mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Take const reference in some window functions
This commit is contained in:
@@ -631,7 +631,7 @@ void window_update_scroll_widgets(rct_window& w)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t window_get_scroll_data_index(rct_window& w, rct_widgetindex widget_index)
|
||||
int32_t window_get_scroll_data_index(const rct_window& w, rct_widgetindex widget_index)
|
||||
{
|
||||
int32_t i, result;
|
||||
|
||||
@@ -953,7 +953,7 @@ void window_rotate_camera(rct_window& w, int32_t direction)
|
||||
}
|
||||
|
||||
void window_viewport_get_map_coords_by_cursor(
|
||||
rct_window& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y)
|
||||
const rct_window& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y)
|
||||
{
|
||||
// Get mouse position to offset against.
|
||||
auto mouseCoords = context_get_cursor_position_scaled();
|
||||
@@ -1953,7 +1953,7 @@ void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t
|
||||
window_set_position(w, newWindowCoords);
|
||||
}
|
||||
|
||||
int32_t window_can_resize(rct_window& w)
|
||||
int32_t window_can_resize(const rct_window& w)
|
||||
{
|
||||
return (w.flags & WF_RESIZABLE) && (w.min_width != w.max_width || w.min_height != w.max_height);
|
||||
}
|
||||
@@ -2178,7 +2178,7 @@ rct_window* window_get_listening()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
rct_windowclass window_get_classification(rct_window& window)
|
||||
rct_windowclass window_get_classification(const rct_window& window)
|
||||
{
|
||||
return window.classification;
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ void widget_invalidate_by_class(rct_windowclass cls, rct_widgetindex widgetIndex
|
||||
void widget_invalidate_by_number(rct_windowclass cls, rct_windownumber number, rct_widgetindex widgetIndex);
|
||||
void WindowInitScrollWidgets(rct_window& w);
|
||||
void window_update_scroll_widgets(rct_window& w);
|
||||
int32_t window_get_scroll_data_index(rct_window& w, rct_widgetindex widget_index);
|
||||
int32_t window_get_scroll_data_index(const rct_window& w, rct_widgetindex widget_index);
|
||||
|
||||
void window_push_others_right(rct_window& w);
|
||||
void window_push_others_below(rct_window& w1);
|
||||
@@ -723,7 +723,7 @@ rct_window* window_get_main();
|
||||
void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords);
|
||||
void window_rotate_camera(rct_window& w, int32_t direction);
|
||||
void window_viewport_get_map_coords_by_cursor(
|
||||
rct_window& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y);
|
||||
const rct_window& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y);
|
||||
void window_viewport_centre_tile_around_cursor(rct_window& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y);
|
||||
void window_check_all_valid_zoom();
|
||||
void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor);
|
||||
@@ -791,7 +791,7 @@ void InvalidateAllWindowsAfterInput();
|
||||
void textinput_cancel();
|
||||
|
||||
void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity);
|
||||
int32_t window_can_resize(rct_window& w);
|
||||
int32_t window_can_resize(const rct_window& w);
|
||||
|
||||
void window_start_textbox(
|
||||
rct_window& call_w, rct_widgetindex call_widget, rct_string_id existing_text, char* existing_args, int32_t maxLength);
|
||||
@@ -840,4 +840,4 @@ money32 place_provisional_track_piece(
|
||||
extern RideConstructionState _rideConstructionState2;
|
||||
|
||||
rct_window* window_get_listening();
|
||||
rct_windowclass window_get_classification(rct_window& window);
|
||||
rct_windowclass window_get_classification(const rct_window& window);
|
||||
|
||||
Reference in New Issue
Block a user