forked from rosebudai/OpenRCT2-Web
Merge pull request #10846 from tupaschoal/const-ref-screencoords
Prefer const ref to send ScreenCoordsXY over
This commit is contained in:
56 files changed
+375
-367
No files matched your search
@@ -246,7 +246,7 @@ public:
|
||||
return cursorPosition;
|
||||
}
|
||||
|
||||
void SetCursorPosition(ScreenCoordsXY cursorPosition) override
|
||||
void SetCursorPosition(const ScreenCoordsXY& cursorPosition) override
|
||||
{
|
||||
SDL_WarpMouseInWindow(nullptr, cursorPosition.x, cursorPosition.y);
|
||||
}
|
||||
|
||||
@@ -63,30 +63,31 @@ int32_t gTooltipCursorY;
|
||||
static int16_t _clickRepeatTicks;
|
||||
|
||||
static int32_t game_get_next_input(ScreenCoordsXY& screenCoords);
|
||||
static void input_widget_over(ScreenCoordsXY screenCoords, rct_window* w, rct_widgetindex widgetIndex);
|
||||
static void input_widget_over(const ScreenCoordsXY& screenCoords, rct_window* w, rct_widgetindex widgetIndex);
|
||||
static void input_widget_over_change_check(
|
||||
rct_windowclass windowClass, rct_windownumber windowNumber, rct_widgetindex widgetIndex);
|
||||
static void input_widget_over_flatbutton_invalidate();
|
||||
void process_mouse_over(ScreenCoordsXY screenCoords);
|
||||
void process_mouse_tool(ScreenCoordsXY screenCoords);
|
||||
void process_mouse_over(const ScreenCoordsXY& screenCoords);
|
||||
void process_mouse_tool(const ScreenCoordsXY& screenCoords);
|
||||
void invalidate_scroll();
|
||||
static rct_mouse_data* get_mouse_input();
|
||||
void tile_element_right_click(int32_t type, TileElement* tileElement, ScreenCoordsXY screenCoords);
|
||||
static void game_handle_input_mouse(ScreenCoordsXY screenCoords, int32_t state);
|
||||
static void input_widget_left(ScreenCoordsXY screenCoords, rct_window* w, rct_widgetindex widgetIndex);
|
||||
void tile_element_right_click(int32_t type, TileElement* tileElement, const ScreenCoordsXY& screenCoords);
|
||||
static void game_handle_input_mouse(const ScreenCoordsXY& screenCoords, int32_t state);
|
||||
static void input_widget_left(const ScreenCoordsXY& screenCoords, rct_window* w, rct_widgetindex widgetIndex);
|
||||
void input_state_widget_pressed(
|
||||
ScreenCoordsXY screenCoords, int32_t state, rct_widgetindex widgetIndex, rct_window* w, rct_widget* widget);
|
||||
const ScreenCoordsXY& screenCoords, int32_t state, rct_widgetindex widgetIndex, rct_window* w, rct_widget* widget);
|
||||
void set_cursor(uint8_t cursor_id);
|
||||
static void input_window_position_continue(rct_window* w, ScreenCoordsXY lastScreenCoords, ScreenCoordsXY newScreenCoords);
|
||||
static void input_window_position_end(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
static void input_window_resize_begin(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void input_window_resize_continue(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
static void input_window_position_continue(
|
||||
rct_window* w, const ScreenCoordsXY& lastScreenCoords, const ScreenCoordsXY& newScreenCoords);
|
||||
static void input_window_position_end(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
static void input_window_resize_begin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void input_window_resize_continue(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
static void input_window_resize_end();
|
||||
static void input_viewport_drag_begin(rct_window* w);
|
||||
static void input_viewport_drag_continue();
|
||||
static void input_viewport_drag_end();
|
||||
static void input_scroll_begin(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void input_scroll_continue(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void input_scroll_begin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void input_scroll_continue(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void input_scroll_end();
|
||||
static void input_scroll_part_update_hthumb(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t scroll_id);
|
||||
static void input_scroll_part_update_hleft(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
@@ -94,7 +95,7 @@ static void input_scroll_part_update_hright(rct_window* w, rct_widgetindex widge
|
||||
static void input_scroll_part_update_vthumb(rct_window* w, rct_widgetindex widgetIndex, int32_t y, int32_t scroll_id);
|
||||
static void input_scroll_part_update_vtop(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
static void input_scroll_part_update_vbottom(rct_window* w, rct_widgetindex widgetIndex, int32_t scroll_id);
|
||||
static void input_update_tooltip(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void input_update_tooltip(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
|
||||
#pragma region Mouse input
|
||||
|
||||
@@ -178,7 +179,7 @@ static rct_mouse_data* get_mouse_input()
|
||||
*
|
||||
* rct2: 0x006E957F
|
||||
*/
|
||||
static void input_scroll_drag_begin(ScreenCoordsXY screenCoords, rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void input_scroll_drag_begin(const ScreenCoordsXY& screenCoords, rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
_inputState = INPUT_STATE_SCROLL_RIGHT;
|
||||
gInputDragLast = screenCoords;
|
||||
@@ -195,7 +196,7 @@ static void input_scroll_drag_begin(ScreenCoordsXY screenCoords, rct_window* w,
|
||||
* Based on (heavily changed)
|
||||
* rct2: 0x006E9E0E, 0x006E9ED0
|
||||
*/
|
||||
static void input_scroll_drag_continue(ScreenCoordsXY screenCoords, rct_window* w)
|
||||
static void input_scroll_drag_continue(const ScreenCoordsXY& screenCoords, rct_window* w)
|
||||
{
|
||||
rct_widgetindex widgetIndex = _dragWidget.widget_index;
|
||||
uint8_t scrollIndex = _dragScrollIndex;
|
||||
@@ -236,7 +237,7 @@ static void input_scroll_drag_continue(ScreenCoordsXY screenCoords, rct_window*
|
||||
*
|
||||
* rct2: 0x006E8ACB
|
||||
*/
|
||||
static void input_scroll_right(ScreenCoordsXY screenCoords, int32_t state)
|
||||
static void input_scroll_right(const ScreenCoordsXY& screenCoords, int32_t state)
|
||||
{
|
||||
rct_window* w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
|
||||
if (w == nullptr)
|
||||
@@ -267,7 +268,7 @@ static void input_scroll_right(ScreenCoordsXY screenCoords, int32_t state)
|
||||
*
|
||||
* rct2: 0x006E8655
|
||||
*/
|
||||
static void game_handle_input_mouse(ScreenCoordsXY screenCoords, int32_t state)
|
||||
static void game_handle_input_mouse(const ScreenCoordsXY& screenCoords, int32_t state)
|
||||
{
|
||||
rct_window* w;
|
||||
rct_widget* widget;
|
||||
@@ -443,7 +444,7 @@ static void game_handle_input_mouse(ScreenCoordsXY screenCoords, int32_t state)
|
||||
|
||||
#pragma region Window positioning / resizing
|
||||
|
||||
void input_window_position_begin(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void input_window_position_begin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
_inputState = INPUT_STATE_POSITIONING_WINDOW;
|
||||
gInputDragLast = screenCoords - ScreenCoordsXY{ w->x, w->y };
|
||||
@@ -452,7 +453,8 @@ void input_window_position_begin(rct_window* w, rct_widgetindex widgetIndex, Scr
|
||||
_dragWidget.widget_index = widgetIndex;
|
||||
}
|
||||
|
||||
static void input_window_position_continue(rct_window* w, ScreenCoordsXY lastScreenCoords, ScreenCoordsXY newScreenCoords)
|
||||
static void input_window_position_continue(
|
||||
rct_window* w, const ScreenCoordsXY& lastScreenCoords, const ScreenCoordsXY& newScreenCoords)
|
||||
{
|
||||
int32_t snapProximity;
|
||||
|
||||
@@ -460,7 +462,7 @@ static void input_window_position_continue(rct_window* w, ScreenCoordsXY lastScr
|
||||
window_move_and_snap(w, newScreenCoords - lastScreenCoords, snapProximity);
|
||||
}
|
||||
|
||||
static void input_window_position_end(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
static void input_window_position_end(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
_inputState = INPUT_STATE_NORMAL;
|
||||
gTooltipTimeout = 0;
|
||||
@@ -468,7 +470,7 @@ static void input_window_position_end(rct_window* w, ScreenCoordsXY screenCoords
|
||||
window_event_moved_call(w, screenCoords);
|
||||
}
|
||||
|
||||
static void input_window_resize_begin(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void input_window_resize_begin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
_inputState = INPUT_STATE_RESIZING;
|
||||
gInputDragLast = screenCoords;
|
||||
@@ -479,7 +481,7 @@ static void input_window_resize_begin(rct_window* w, rct_widgetindex widgetIndex
|
||||
_originalWindowHeight = w->height;
|
||||
}
|
||||
|
||||
static void input_window_resize_continue(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
static void input_window_resize_continue(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (screenCoords.y < (int32_t)context_get_height() - 2)
|
||||
{
|
||||
@@ -588,7 +590,7 @@ static void input_viewport_drag_end()
|
||||
|
||||
#pragma region Scroll bars
|
||||
|
||||
static void input_scroll_begin(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void input_scroll_begin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
rct_widget* widget;
|
||||
|
||||
@@ -661,7 +663,7 @@ static void input_scroll_begin(rct_window* w, rct_widgetindex widgetIndex, Scree
|
||||
window_invalidate_by_number(widgetIndex, w->classification);
|
||||
}
|
||||
|
||||
static void input_scroll_continue(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void input_scroll_continue(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
rct_widget* widget;
|
||||
int32_t scroll_part, scroll_id;
|
||||
@@ -898,7 +900,7 @@ static void input_scroll_part_update_vbottom(rct_window* w, rct_widgetindex widg
|
||||
*
|
||||
* rct2: 0x006E9253
|
||||
*/
|
||||
static void input_widget_over(ScreenCoordsXY screenCoords, rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void input_widget_over(const ScreenCoordsXY& screenCoords, rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
rct_windowclass windowClass = WC_NULL;
|
||||
rct_windownumber windowNumber = 0;
|
||||
@@ -988,7 +990,7 @@ static void input_widget_over_flatbutton_invalidate()
|
||||
*
|
||||
* rct2: 0x006E95F9
|
||||
*/
|
||||
static void input_widget_left(ScreenCoordsXY screenCoords, rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void input_widget_left(const ScreenCoordsXY& screenCoords, rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
rct_windowclass windowClass = WC_NULL;
|
||||
rct_windownumber windowNumber = 0;
|
||||
@@ -1074,7 +1076,7 @@ static void input_widget_left(ScreenCoordsXY screenCoords, rct_window* w, rct_wi
|
||||
*
|
||||
* rct2: 0x006ED833
|
||||
*/
|
||||
void process_mouse_over(ScreenCoordsXY screenCoords)
|
||||
void process_mouse_over(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
@@ -1173,7 +1175,7 @@ void process_mouse_over(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006ED801
|
||||
*/
|
||||
void process_mouse_tool(ScreenCoordsXY screenCoords)
|
||||
void process_mouse_tool(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (_inputFlags & INPUT_FLAG_TOOL_ACTIVE)
|
||||
{
|
||||
@@ -1191,7 +1193,7 @@ void process_mouse_tool(ScreenCoordsXY screenCoords)
|
||||
* rct2: 0x006E8DA7
|
||||
*/
|
||||
void input_state_widget_pressed(
|
||||
ScreenCoordsXY screenCoords, int32_t state, rct_widgetindex widgetIndex, rct_window* w, rct_widget* widget)
|
||||
const ScreenCoordsXY& screenCoords, int32_t state, rct_widgetindex widgetIndex, rct_window* w, rct_widget* widget)
|
||||
{
|
||||
rct_windowclass cursor_w_class;
|
||||
rct_windownumber cursor_w_number;
|
||||
@@ -1439,7 +1441,7 @@ void input_state_widget_pressed(
|
||||
}
|
||||
}
|
||||
|
||||
static void input_update_tooltip(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void input_update_tooltip(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (gTooltipWidget.window_classification == 255)
|
||||
{
|
||||
@@ -1527,7 +1529,7 @@ void invalidate_scroll()
|
||||
/**
|
||||
* rct2: 0x00406C96
|
||||
*/
|
||||
void store_mouse_input(int32_t state, ScreenCoordsXY screenCoords)
|
||||
void store_mouse_input(int32_t state, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
uint32_t writeIndex = _mouseInputQueueWriteIndex;
|
||||
uint32_t nextWriteIndex = (writeIndex + 1) % std::size(_mouseInputQueue);
|
||||
@@ -1583,7 +1585,7 @@ bool input_test_place_object_modifier(PLACE_OBJECT_MODIFIER modifier)
|
||||
return gInputPlaceObjectModifier & modifier;
|
||||
}
|
||||
|
||||
void input_scroll_viewport(ScreenCoordsXY scrollScreenCoords)
|
||||
void input_scroll_viewport(const ScreenCoordsXY& scrollScreenCoords)
|
||||
{
|
||||
rct_window* mainWindow = window_get_main();
|
||||
rct_viewport* viewport = mainWindow->viewport;
|
||||
|
||||
@@ -51,7 +51,7 @@ static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords,
|
||||
*
|
||||
* rct2: 0x006ED9D0
|
||||
*/
|
||||
int32_t viewport_interaction_get_item_left(ScreenCoordsXY screenCoords, viewport_interaction_info* info)
|
||||
int32_t viewport_interaction_get_item_left(const ScreenCoordsXY& screenCoords, viewport_interaction_info* info)
|
||||
{
|
||||
TileElement* tileElement;
|
||||
rct_sprite* sprite;
|
||||
@@ -124,7 +124,7 @@ int32_t viewport_interaction_get_item_left(ScreenCoordsXY screenCoords, viewport
|
||||
return info->type;
|
||||
}
|
||||
|
||||
int32_t viewport_interaction_left_over(ScreenCoordsXY screenCoords)
|
||||
int32_t viewport_interaction_left_over(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
|
||||
@@ -139,7 +139,7 @@ int32_t viewport_interaction_left_over(ScreenCoordsXY screenCoords)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t viewport_interaction_left_click(ScreenCoordsXY screenCoords)
|
||||
int32_t viewport_interaction_left_click(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
|
||||
@@ -200,7 +200,7 @@ int32_t viewport_interaction_left_click(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006EDE88
|
||||
*/
|
||||
int32_t viewport_interaction_get_item_right(ScreenCoordsXY screenCoords, viewport_interaction_info* info)
|
||||
int32_t viewport_interaction_get_item_right(const ScreenCoordsXY& screenCoords, viewport_interaction_info* info)
|
||||
{
|
||||
TileElement* tileElement;
|
||||
rct_scenery_entry* sceneryEntry;
|
||||
@@ -436,7 +436,7 @@ int32_t viewport_interaction_get_item_right(ScreenCoordsXY screenCoords, viewpor
|
||||
return info->type = VIEWPORT_INTERACTION_ITEM_NONE;
|
||||
}
|
||||
|
||||
int32_t viewport_interaction_right_over(ScreenCoordsXY screenCoords)
|
||||
int32_t viewport_interaction_right_over(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
|
||||
@@ -447,7 +447,7 @@ int32_t viewport_interaction_right_over(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006E8A62
|
||||
*/
|
||||
int32_t viewport_interaction_right_click(ScreenCoordsXY screenCoords)
|
||||
int32_t viewport_interaction_right_click(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
CoordsXYE tileElement;
|
||||
viewport_interaction_info info;
|
||||
@@ -656,7 +656,7 @@ static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords,
|
||||
*
|
||||
* rct2: 0x0068A15E
|
||||
*/
|
||||
CoordsXY sub_68A15E(ScreenCoordsXY screenCoords)
|
||||
CoordsXY sub_68A15E(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
CoordsXY mapCoords;
|
||||
CoordsXY initialPos{};
|
||||
|
||||
@@ -869,7 +869,7 @@ bool widget_is_active_tool(rct_window* w, rct_widgetindex widgetIndex)
|
||||
* edi: widget
|
||||
*/
|
||||
void widget_scroll_get_part(
|
||||
rct_window* w, rct_widget* widget, ScreenCoordsXY screenCoords, ScreenCoordsXY& retScreenCoords,
|
||||
rct_window* w, rct_widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords,
|
||||
int32_t* output_scroll_area, int32_t* scroll_id)
|
||||
{
|
||||
*scroll_id = 0;
|
||||
|
||||
@@ -86,8 +86,8 @@ static bool window_fits_on_screen(int32_t x, int32_t y, int32_t width, int32_t h
|
||||
}
|
||||
|
||||
rct_window* window_create(
|
||||
ScreenCoordsXY screenCoords, int32_t width, int32_t height, rct_window_event_list* event_handlers, rct_windowclass cls,
|
||||
uint16_t flags)
|
||||
const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, rct_window_event_list* event_handlers,
|
||||
rct_windowclass cls, uint16_t flags)
|
||||
{
|
||||
// Check if there are any window slots left
|
||||
// include WINDOW_LIMIT_RESERVED for items such as the main viewport and toolbars to not appear to be counted.
|
||||
|
||||
@@ -73,15 +73,15 @@ static void window_editor_inventions_list_mouseup(rct_window *w, rct_widgetindex
|
||||
static void window_editor_inventions_list_resize(rct_window *w);
|
||||
static void window_editor_inventions_list_update(rct_window *w);
|
||||
static void window_editor_inventions_list_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_inventions_list_cursor(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t *cursorId);
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_inventions_list_cursor(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t *cursorId);
|
||||
static void window_editor_inventions_list_invalidate(rct_window *w);
|
||||
static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_editor_inventions_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t *cursorId);
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_inventions_list_drag_cursor(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t *cursorId);
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_inventions_list_drag_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
static rct_string_id window_editor_inventions_list_prepare_name(const ResearchItem * researchItem, bool withGap);
|
||||
@@ -261,7 +261,7 @@ static ResearchItem* window_editor_inventions_list_get_item_from_scroll_y_includ
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static ResearchItem* get_research_item_at(ScreenCoordsXY screenCoords, int32_t* outScrollId)
|
||||
static ResearchItem* get_research_item_at(const ScreenCoordsXY& screenCoords, int32_t* outScrollId)
|
||||
{
|
||||
rct_window* w = window_find_by_class(WC_EDITOR_INVENTION_LIST);
|
||||
if (w != nullptr && w->x <= screenCoords.x && w->y < screenCoords.y && w->x + w->width > screenCoords.x
|
||||
@@ -422,7 +422,8 @@ static void window_editor_inventions_list_scrollgetheight(rct_window* w, int32_t
|
||||
*
|
||||
* rct2: 0x006852D4
|
||||
*/
|
||||
static void window_editor_inventions_list_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_editor_inventions_list_scrollmousedown(
|
||||
rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ResearchItem* researchItem;
|
||||
|
||||
@@ -442,7 +443,8 @@ static void window_editor_inventions_list_scrollmousedown(rct_window* w, int32_t
|
||||
*
|
||||
* rct2: 0x00685275
|
||||
*/
|
||||
static void window_editor_inventions_list_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_editor_inventions_list_scrollmouseover(
|
||||
rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ResearchItem* researchItem;
|
||||
|
||||
@@ -465,7 +467,7 @@ static void window_editor_inventions_list_scrollmouseover(rct_window* w, int32_t
|
||||
* rct2: 0x00685291
|
||||
*/
|
||||
static void window_editor_inventions_list_cursor(
|
||||
rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t* cursorId)
|
||||
rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t* cursorId)
|
||||
{
|
||||
ResearchItem* researchItem;
|
||||
int32_t scrollIndex;
|
||||
@@ -766,7 +768,7 @@ static void window_editor_inventions_list_drag_open(ResearchItem* researchItem)
|
||||
* rct2: 0x0068549C
|
||||
*/
|
||||
static void window_editor_inventions_list_drag_cursor(
|
||||
rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t* cursorId)
|
||||
rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t* cursorId)
|
||||
{
|
||||
rct_window* inventionListWindow = window_find_by_class(WC_EDITOR_INVENTION_LIST);
|
||||
if (inventionListWindow != nullptr)
|
||||
@@ -786,16 +788,17 @@ static void window_editor_inventions_list_drag_cursor(
|
||||
*
|
||||
* rct2: 0x00685412
|
||||
*/
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
static void window_editor_inventions_list_drag_moved(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ResearchItem* researchItem;
|
||||
|
||||
int32_t scrollId;
|
||||
// Skip always researched items, so that the dragged item gets placed underneath them
|
||||
auto newScreenCoords = screenCoords;
|
||||
do
|
||||
{
|
||||
researchItem = get_research_item_at(screenCoords, &scrollId);
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
researchItem = get_research_item_at(newScreenCoords, &scrollId);
|
||||
newScreenCoords.y += LIST_ROW_HEIGHT;
|
||||
} while (researchItem != nullptr && researchItem->IsAlwaysResearched());
|
||||
|
||||
if (scrollId != -1)
|
||||
|
||||
@@ -176,8 +176,8 @@ static void window_editor_object_selection_mousedown(rct_window *w, rct_widgetin
|
||||
static void window_editor_object_selection_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_editor_object_selection_update(rct_window *w);
|
||||
static void window_editor_object_selection_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_object_selection_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_editor_object_selection_invalidate(rct_window *w);
|
||||
static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -680,7 +680,8 @@ static void window_editor_object_selection_scrollgetsize(rct_window* w, int32_t
|
||||
*
|
||||
* rct2: 0x006AB0B6
|
||||
*/
|
||||
static void window_editor_object_selection_scroll_mousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_editor_object_selection_scroll_mousedown(
|
||||
rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
// Used for in-game object selection cheat to prevent crashing the game
|
||||
// when windows attempt to draw objects that don't exist any more
|
||||
@@ -745,7 +746,8 @@ static void window_editor_object_selection_scroll_mousedown(rct_window* w, int32
|
||||
*
|
||||
* rct2: 0x006AB079
|
||||
*/
|
||||
static void window_editor_object_selection_scroll_mouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_editor_object_selection_scroll_mouseover(
|
||||
rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t selectedObject = get_object_from_object_selection(get_selected_object_type(w), screenCoords.y);
|
||||
if (selectedObject != -1)
|
||||
|
||||
@@ -131,8 +131,8 @@ static void window_editor_objective_options_rides_mouseup(rct_window *w, rct_wid
|
||||
static void window_editor_objective_options_rides_resize(rct_window *w);
|
||||
static void window_editor_objective_options_rides_update(rct_window *w);
|
||||
static void window_editor_objective_options_rides_scrollgetheight(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_editor_objective_options_rides_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_objective_options_rides_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_editor_objective_options_rides_invalidate(rct_window *w);
|
||||
static void window_editor_objective_options_rides_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_editor_objective_options_rides_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -1067,7 +1067,7 @@ static void window_editor_objective_options_rides_scrollgetheight(
|
||||
* rct2: 0x006724FC
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollmousedown(
|
||||
rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
auto i = screenCoords.y / 12;
|
||||
if (i < 0 || i >= w->no_list_items)
|
||||
@@ -1086,7 +1086,7 @@ static void window_editor_objective_options_rides_scrollmousedown(
|
||||
* rct2: 0x006724CC
|
||||
*/
|
||||
static void window_editor_objective_options_rides_scrollmouseover(
|
||||
rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
|
||||
@@ -102,10 +102,10 @@ static void window_footpath_mouseup(rct_window * w, rct_widgetindex widgetIndex)
|
||||
static void window_footpath_mousedown(rct_window * w, rct_widgetindex widgetIndex, rct_widget * widget);
|
||||
static void window_footpath_dropdown(rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_footpath_update(rct_window * w);
|
||||
static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_toolupdate(rct_window * w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_invalidate(rct_window * w);
|
||||
static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
|
||||
@@ -176,10 +176,10 @@ static constexpr const uint8_t ConstructionPreviewImages[][4] = {
|
||||
static void window_footpath_mousedown_direction(int32_t direction);
|
||||
static void window_footpath_mousedown_slope(int32_t slope);
|
||||
static void window_footpath_show_footpath_types_dialog(rct_window* w, rct_widget* widget, bool showQueues);
|
||||
static void window_footpath_set_provisional_path_at_point(ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_set_selection_start_bridge_at_point(ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_place_path_at_point(ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_start_bridge_at_point(ScreenCoordsXY screenCoords);
|
||||
static void window_footpath_set_provisional_path_at_point(const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_set_selection_start_bridge_at_point(const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_place_path_at_point(const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_start_bridge_at_point(const ScreenCoordsXY& screenCoords);
|
||||
static void window_footpath_construct();
|
||||
static void window_footpath_remove();
|
||||
static void window_footpath_set_enabled_and_pressed_widgets();
|
||||
@@ -405,7 +405,7 @@ static void window_footpath_dropdown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
*
|
||||
* rct2: 0x006A8032
|
||||
*/
|
||||
static void window_footpath_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
@@ -421,7 +421,7 @@ static void window_footpath_toolupdate(rct_window* w, rct_widgetindex widgetInde
|
||||
*
|
||||
* rct2: 0x006A8047
|
||||
*/
|
||||
static void window_footpath_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
@@ -437,7 +437,7 @@ static void window_footpath_tooldown(rct_window* w, rct_widgetindex widgetIndex,
|
||||
*
|
||||
* rct2: 0x006A8067
|
||||
*/
|
||||
static void window_footpath_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
@@ -449,7 +449,7 @@ static void window_footpath_tooldrag(rct_window* w, rct_widgetindex widgetIndex,
|
||||
*
|
||||
* rct2: 0x006A8066
|
||||
*/
|
||||
static void window_footpath_toolup(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_toolup(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
@@ -708,7 +708,7 @@ static void window_footpath_mousedown_slope(int32_t slope)
|
||||
*
|
||||
* rct2: 0x006A81FB
|
||||
*/
|
||||
static void window_footpath_set_provisional_path_at_point(ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_set_provisional_path_at_point(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
map_invalidate_selection_rect();
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
@@ -786,7 +786,7 @@ static void window_footpath_set_provisional_path_at_point(ScreenCoordsXY screenC
|
||||
*
|
||||
* rct2: 0x006A8388
|
||||
*/
|
||||
static void window_footpath_set_selection_start_bridge_at_point(ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_set_selection_start_bridge_at_point(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t direction;
|
||||
TileElement* tileElement;
|
||||
@@ -830,7 +830,7 @@ static void window_footpath_set_selection_start_bridge_at_point(ScreenCoordsXY s
|
||||
*
|
||||
* rct2: 0x006A82C5
|
||||
*/
|
||||
static void window_footpath_place_path_at_point(ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_place_path_at_point(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t interactionType, currentType, selectedType, z;
|
||||
TileElement* tileElement;
|
||||
@@ -899,7 +899,7 @@ static void window_footpath_place_path_at_point(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006A840F
|
||||
*/
|
||||
static void window_footpath_start_bridge_at_point(ScreenCoordsXY screenCoords)
|
||||
static void window_footpath_start_bridge_at_point(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t z, direction;
|
||||
TileElement* tileElement;
|
||||
|
||||
@@ -72,7 +72,7 @@ static void window_game_bottom_toolbar_tooltip(rct_window* w, rct_widgetindex wi
|
||||
static void window_game_bottom_toolbar_invalidate(rct_window *w);
|
||||
static void window_game_bottom_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_game_bottom_toolbar_update(rct_window* w);
|
||||
static void window_game_bottom_toolbar_cursor(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t *cursorId);
|
||||
static void window_game_bottom_toolbar_cursor(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t *cursorId);
|
||||
static void window_game_bottom_toolbar_unknown05(rct_window *w);
|
||||
|
||||
static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
@@ -708,7 +708,7 @@ static void window_game_bottom_toolbar_update(rct_window* w)
|
||||
* rct2: 0x0066C644
|
||||
*/
|
||||
static void window_game_bottom_toolbar_cursor(
|
||||
rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t* cursorId)
|
||||
rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t* cursorId)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
||||
@@ -151,8 +151,8 @@ static void window_guest_overview_invalidate(rct_window *w);
|
||||
static void window_guest_overview_viewport_rotate(rct_window *w);
|
||||
static void window_guest_overview_update(rct_window* w);
|
||||
static void window_guest_overview_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_guest_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
|
||||
static void window_guest_mouse_up(rct_window *w, rct_widgetindex widgetIndex);
|
||||
@@ -162,8 +162,8 @@ static void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
static void window_guest_rides_update(rct_window *w);
|
||||
static void window_guest_rides_scroll_get_size(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_guest_rides_scroll_mouse_down(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_guest_rides_scroll_mouse_over(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_guest_rides_scroll_mouse_down(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_guest_rides_scroll_mouse_over(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_guest_rides_invalidate(rct_window *w);
|
||||
static void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_guest_rides_scroll_paint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -1221,7 +1221,7 @@ void window_guest_overview_text_input(rct_window* w, rct_widgetindex widgetIndex
|
||||
*
|
||||
* rct2: 0x696A5F
|
||||
*/
|
||||
void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
@@ -1249,10 +1249,8 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
return;
|
||||
|
||||
screenCoords.x--;
|
||||
screenCoords.y += 16;
|
||||
gPickupPeepX = screenCoords.x;
|
||||
gPickupPeepY = screenCoords.y;
|
||||
gPickupPeepX = screenCoords.x - 1;
|
||||
gPickupPeepY = screenCoords.y + 16;
|
||||
w->picked_peep_frame++;
|
||||
if (w->picked_peep_frame >= 48)
|
||||
{
|
||||
@@ -1273,7 +1271,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
||||
*
|
||||
* rct2: 0x696A54
|
||||
*/
|
||||
void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
@@ -1628,7 +1626,7 @@ void window_guest_rides_scroll_get_size(rct_window* w, int32_t scrollIndex, int3
|
||||
*
|
||||
* rct2: 0x006978CC
|
||||
*/
|
||||
void window_guest_rides_scroll_mouse_down(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_guest_rides_scroll_mouse_down(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
@@ -1645,7 +1643,7 @@ void window_guest_rides_scroll_mouse_down(rct_window* w, int32_t scrollIndex, Sc
|
||||
*
|
||||
* rct2: 0x0069789C
|
||||
*/
|
||||
void window_guest_rides_scroll_mouse_over(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_guest_rides_scroll_mouse_over(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
|
||||
@@ -97,8 +97,8 @@ static void window_guest_list_mousedown(rct_window *w, rct_widgetindex widgetInd
|
||||
static void window_guest_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_guest_list_update(rct_window *w);
|
||||
static void window_guest_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_guest_list_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_guest_list_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_guest_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_guest_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_guest_list_invalidate(rct_window *w);
|
||||
static void window_guest_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_guest_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -553,7 +553,7 @@ static void window_guest_list_scrollgetsize(rct_window* w, int32_t scrollIndex,
|
||||
*
|
||||
* rct2: 0x00699D7D
|
||||
*/
|
||||
static void window_guest_list_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_guest_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t i, spriteIndex;
|
||||
Peep* peep;
|
||||
@@ -605,7 +605,7 @@ static void window_guest_list_scrollmousedown(rct_window* w, int32_t scrollIndex
|
||||
*
|
||||
* rct2: 0x00699D3B
|
||||
*/
|
||||
static void window_guest_list_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_guest_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ static void window_land_rights_invalidate(rct_window *w);
|
||||
static void window_land_rights_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_land_rights_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_land_rights_inputsize(rct_window *w);
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_land_rights_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static bool land_rights_tool_is_active();
|
||||
|
||||
@@ -290,7 +290,7 @@ static void window_land_rights_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
}
|
||||
}
|
||||
|
||||
static void window_land_rights_tool_update_land_rights(ScreenCoordsXY screenCoords)
|
||||
static void window_land_rights_tool_update_land_rights(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
map_invalidate_selection_rect();
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
@@ -393,7 +393,7 @@ static void window_land_rights_toolabort(rct_window* w, rct_widgetindex widgetIn
|
||||
*
|
||||
* rct2: 0x006681D1
|
||||
*/
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
window_land_rights_tool_update_land_rights(screenCoords);
|
||||
}
|
||||
@@ -402,7 +402,7 @@ static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetI
|
||||
*
|
||||
* rct2: 0x006681E6
|
||||
*/
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND)
|
||||
{
|
||||
@@ -430,7 +430,7 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd
|
||||
*
|
||||
* rct2: 0x006681FB
|
||||
*/
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND)
|
||||
{
|
||||
|
||||
@@ -84,8 +84,8 @@ static void window_loadsave_close(rct_window *w);
|
||||
static void window_loadsave_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_loadsave_resize(rct_window *w);
|
||||
static void window_loadsave_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_loadsave_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_loadsave_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_loadsave_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_loadsave_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_loadsave_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_loadsave_compute_max_date_width();
|
||||
static void window_loadsave_invalidate(rct_window *w);
|
||||
@@ -527,7 +527,7 @@ static void window_loadsave_scrollgetsize(rct_window* w, int32_t scrollIndex, in
|
||||
*height = w->no_list_items * SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
static void window_loadsave_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_loadsave_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t selectedItem;
|
||||
|
||||
@@ -563,7 +563,7 @@ static void window_loadsave_scrollmousedown(rct_window* w, int32_t scrollIndex,
|
||||
}
|
||||
}
|
||||
|
||||
static void window_loadsave_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_loadsave_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t selectedItem;
|
||||
|
||||
|
||||
@@ -125,12 +125,12 @@ static void window_map_resize(rct_window *w);
|
||||
static void window_map_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_map_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_map_update(rct_window *w);
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_map_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_map_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_map_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_map_invalidate(rct_window *w);
|
||||
static void window_map_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -189,11 +189,11 @@ static void window_map_paint_hud_rectangle(rct_drawpixelinfo* dpi);
|
||||
static void window_map_inputsize_land(rct_window* w);
|
||||
static void window_map_inputsize_map(rct_window* w);
|
||||
|
||||
static void window_map_set_land_rights_tool_update(ScreenCoordsXY screenCoords);
|
||||
static void window_map_place_park_entrance_tool_update(ScreenCoordsXY screenCoords);
|
||||
static void window_map_set_peep_spawn_tool_update(ScreenCoordsXY screenCoords);
|
||||
static void window_map_place_park_entrance_tool_down(ScreenCoordsXY screenCoords);
|
||||
static void window_map_set_peep_spawn_tool_down(ScreenCoordsXY screenCoords);
|
||||
static void window_map_set_land_rights_tool_update(const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_place_park_entrance_tool_update(const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_set_peep_spawn_tool_update(const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_place_park_entrance_tool_down(const ScreenCoordsXY& screenCoords);
|
||||
static void window_map_set_peep_spawn_tool_down(const ScreenCoordsXY& screenCoords);
|
||||
static void map_window_increase_map_size();
|
||||
static void map_window_decrease_map_size();
|
||||
static void map_window_set_pixels(rct_window* w);
|
||||
@@ -464,7 +464,7 @@ static void window_map_update(rct_window* w)
|
||||
*
|
||||
* rct2: 0x0068D093
|
||||
*/
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -484,7 +484,7 @@ static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, Sc
|
||||
*
|
||||
* rct2: 0x0068D074
|
||||
*/
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -501,7 +501,7 @@ static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, Scre
|
||||
*
|
||||
* rct2: 0x0068D088
|
||||
*/
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -563,7 +563,7 @@ static void window_map_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t
|
||||
*
|
||||
* rct2: 0x0068D726
|
||||
*/
|
||||
static void window_map_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_map_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
CoordsXY c = map_window_screen_to_map(screenCoords);
|
||||
int32_t mapX = std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1);
|
||||
@@ -1158,7 +1158,7 @@ static void window_map_paint_hud_rectangle(rct_drawpixelinfo* dpi)
|
||||
*
|
||||
* rct2: 0x0068D24E
|
||||
*/
|
||||
static void window_map_set_land_rights_tool_update(ScreenCoordsXY screenCoords)
|
||||
static void window_map_set_land_rights_tool_update(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
rct_viewport* viewport;
|
||||
|
||||
@@ -1189,7 +1189,7 @@ static void window_map_set_land_rights_tool_update(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x00666EEF
|
||||
*/
|
||||
static CoordsXYZD place_park_entrance_get_map_position(ScreenCoordsXY screenCoords)
|
||||
static CoordsXYZD place_park_entrance_get_map_position(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION };
|
||||
const CoordsXY mapCoords = sub_68A15E(screenCoords);
|
||||
@@ -1225,7 +1225,7 @@ static CoordsXYZD place_park_entrance_get_map_position(ScreenCoordsXY screenCoor
|
||||
*
|
||||
* rct2: 0x00666FD0
|
||||
*/
|
||||
static void window_map_place_park_entrance_tool_update(ScreenCoordsXY screenCoords)
|
||||
static void window_map_place_park_entrance_tool_update(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t sideDirection;
|
||||
|
||||
@@ -1267,7 +1267,7 @@ static void window_map_place_park_entrance_tool_update(ScreenCoordsXY screenCoor
|
||||
*
|
||||
* rct2: 0x0068D4E9
|
||||
*/
|
||||
static void window_map_set_peep_spawn_tool_update(ScreenCoordsXY screenCoords)
|
||||
static void window_map_set_peep_spawn_tool_update(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t mapZ, direction;
|
||||
TileElement* tileElement;
|
||||
@@ -1302,7 +1302,7 @@ static void window_map_set_peep_spawn_tool_update(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006670A4
|
||||
*/
|
||||
static void window_map_place_park_entrance_tool_down(ScreenCoordsXY screenCoords)
|
||||
static void window_map_place_park_entrance_tool_down(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
park_entrance_remove_ghost();
|
||||
|
||||
@@ -1322,7 +1322,7 @@ static void window_map_place_park_entrance_tool_down(ScreenCoordsXY screenCoords
|
||||
*
|
||||
* rct2: 0x0068D573
|
||||
*/
|
||||
static void window_map_set_peep_spawn_tool_down(ScreenCoordsXY screenCoords)
|
||||
static void window_map_set_peep_spawn_tool_down(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
TileElement* tileElement;
|
||||
int32_t mapZ, direction;
|
||||
@@ -1692,19 +1692,18 @@ static CoordsXY map_window_screen_to_map(ScreenCoordsXY screenCoords)
|
||||
{
|
||||
screenCoords.x = ((screenCoords.x + 8) - MAXIMUM_MAP_SIZE_TECHNICAL) / 2;
|
||||
screenCoords.y = ((screenCoords.y + 8)) / 2;
|
||||
int32_t x = (screenCoords.y - screenCoords.x) * 32;
|
||||
int32_t y = (screenCoords.x + screenCoords.y) * 32;
|
||||
auto location = TileCoordsXY(screenCoords.y - screenCoords.x, screenCoords.x + screenCoords.y).ToCoordsXY();
|
||||
|
||||
switch (get_current_rotation())
|
||||
{
|
||||
case 0:
|
||||
return { x, y };
|
||||
return location;
|
||||
case 1:
|
||||
return { MAXIMUM_MAP_SIZE_BIG - 1 - y, x };
|
||||
return { MAXIMUM_MAP_SIZE_BIG - 1 - location.y, location.x };
|
||||
case 2:
|
||||
return { MAXIMUM_MAP_SIZE_BIG - 1 - x, MAXIMUM_MAP_SIZE_BIG - 1 - y };
|
||||
return { MAXIMUM_MAP_SIZE_BIG - 1 - location.x, MAXIMUM_MAP_SIZE_BIG - 1 - location.y };
|
||||
case 3:
|
||||
return { y, MAXIMUM_MAP_SIZE_BIG - 1 - x };
|
||||
return { location.y, MAXIMUM_MAP_SIZE_BIG - 1 - location.x };
|
||||
}
|
||||
|
||||
return { 0, 0 }; // unreachable
|
||||
|
||||
@@ -87,8 +87,8 @@ static void window_maze_construction_mouseup(rct_window *w, rct_widgetindex widg
|
||||
static void window_maze_construction_resize(rct_window *w);
|
||||
static void window_maze_construction_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_maze_construction_update(rct_window *w);
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_maze_construction_invalidate(rct_window *w);
|
||||
static void window_maze_construction_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
@@ -335,7 +335,7 @@ static void window_maze_construction_update(rct_window* w)
|
||||
*
|
||||
* rct2: 0x006CD63E
|
||||
*/
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -353,7 +353,7 @@ static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex w
|
||||
*
|
||||
* rct2: 0x006C825F
|
||||
*/
|
||||
static void window_maze_construction_entrance_tooldown(ScreenCoordsXY screenCoords, rct_window* w)
|
||||
static void window_maze_construction_entrance_tooldown(const ScreenCoordsXY& screenCoords, rct_window* w)
|
||||
{
|
||||
ride_construction_invalidate_current_track();
|
||||
|
||||
@@ -402,7 +402,7 @@ static void window_maze_construction_entrance_tooldown(ScreenCoordsXY screenCoor
|
||||
*
|
||||
* rct2: 0x006CD65D
|
||||
*/
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
||||
@@ -136,8 +136,8 @@ static void window_multiplayer_players_mouseup(rct_window *w, rct_widgetindex wi
|
||||
static void window_multiplayer_players_resize(rct_window *w);
|
||||
static void window_multiplayer_players_update(rct_window *w);
|
||||
static void window_multiplayer_players_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_multiplayer_players_invalidate(rct_window *w);
|
||||
static void window_multiplayer_players_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_multiplayer_players_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -148,8 +148,8 @@ static void window_multiplayer_groups_mousedown(rct_window *w, rct_widgetindex w
|
||||
static void window_multiplayer_groups_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_multiplayer_groups_update(rct_window *w);
|
||||
static void window_multiplayer_groups_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_multiplayer_groups_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_multiplayer_groups_invalidate(rct_window *w);
|
||||
static void window_multiplayer_groups_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -591,7 +591,7 @@ static void window_multiplayer_players_scrollgetsize(rct_window* w, int32_t scro
|
||||
}
|
||||
}
|
||||
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_multiplayer_players_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
@@ -605,7 +605,7 @@ static void window_multiplayer_players_scrollmousedown(rct_window* w, int32_t sc
|
||||
window_player_open(network_get_player_id(index));
|
||||
}
|
||||
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_multiplayer_players_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
@@ -836,7 +836,7 @@ static void window_multiplayer_groups_scrollgetsize(rct_window* w, int32_t scrol
|
||||
}
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_multiplayer_groups_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
@@ -852,7 +852,7 @@ static void window_multiplayer_groups_scrollmousedown(rct_window* w, int32_t scr
|
||||
GameActions::Execute(&networkModifyGroup);
|
||||
}
|
||||
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_multiplayer_groups_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
|
||||
@@ -207,8 +207,8 @@ static void window_new_ride_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_new_ride_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_new_ride_update(rct_window *w);
|
||||
static void window_new_ride_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_new_ride_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_new_ride_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_new_ride_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_new_ride_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_new_ride_invalidate(rct_window *w);
|
||||
static void window_new_ride_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_new_ride_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -264,7 +264,7 @@ static constexpr const int32_t window_new_ride_tab_animation_divisor[] = { 4, 8,
|
||||
|
||||
static void window_new_ride_set_page(rct_window* w, int32_t page);
|
||||
static void window_new_ride_refresh_widget_sizing(rct_window* w);
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
static void window_new_ride_paint_ride_information(
|
||||
rct_window* w, rct_drawpixelinfo* dpi, ride_list_item item, int32_t x, int32_t y, int32_t width);
|
||||
static void window_new_ride_select(rct_window* w);
|
||||
@@ -763,7 +763,7 @@ static void window_new_ride_scrollgetsize(rct_window* w, int32_t scrollIndex, in
|
||||
*
|
||||
* rct2: 0x006B6C89
|
||||
*/
|
||||
static void window_new_ride_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_new_ride_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ride_list_item item;
|
||||
|
||||
@@ -783,7 +783,7 @@ static void window_new_ride_scrollmousedown(rct_window* w, int32_t scrollIndex,
|
||||
*
|
||||
* rct2: 0x006B6C51
|
||||
*/
|
||||
static void window_new_ride_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_new_ride_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ride_list_item item;
|
||||
|
||||
@@ -903,13 +903,13 @@ static void window_new_ride_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
||||
*
|
||||
* rct2: 0x006B6D3C
|
||||
*/
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ride_list_item result;
|
||||
result.type = RIDE_TYPE_NULL;
|
||||
result.entry_index = RIDE_ENTRY_INDEX_NULL;
|
||||
|
||||
if (--screenCoords.x < 0 || --screenCoords.y < 0)
|
||||
if (screenCoords.x <= 0 || screenCoords.y <= 0)
|
||||
return result;
|
||||
|
||||
int32_t column = screenCoords.x / 116;
|
||||
|
||||
@@ -40,7 +40,7 @@ static rct_widget window_news_widgets[] = {
|
||||
static void window_news_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_news_update(rct_window *w);
|
||||
static void window_news_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_news_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_news_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_news_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_news_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
@@ -199,37 +199,39 @@ static void window_news_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_
|
||||
*
|
||||
* rct2: 0x0066EA5C
|
||||
*/
|
||||
static void window_news_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_news_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t itemHeight = window_news_get_item_height();
|
||||
int32_t i, buttonIndex;
|
||||
|
||||
buttonIndex = 0;
|
||||
auto mutableScreenCoords = screenCoords;
|
||||
for (i = 11; i < 61; i++)
|
||||
{
|
||||
if (news_item_is_empty(i))
|
||||
break;
|
||||
|
||||
if (screenCoords.y < itemHeight)
|
||||
if (mutableScreenCoords.y < itemHeight)
|
||||
{
|
||||
NewsItem* const newsItem = news_item_get(i);
|
||||
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON || screenCoords.y < 14 || screenCoords.y >= 38 || screenCoords.x < 328)
|
||||
if (newsItem->Flags & NEWS_FLAG_HAS_BUTTON || mutableScreenCoords.y < 14 || mutableScreenCoords.y >= 38
|
||||
|| mutableScreenCoords.x < 328)
|
||||
{
|
||||
buttonIndex = 0;
|
||||
break;
|
||||
}
|
||||
else if (screenCoords.x < 351 && news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT)
|
||||
else if (mutableScreenCoords.x < 351 && news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT)
|
||||
{
|
||||
buttonIndex = 1;
|
||||
break;
|
||||
}
|
||||
else if (screenCoords.x < 376 && news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_LOCATION)
|
||||
else if (mutableScreenCoords.x < 376 && news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_LOCATION)
|
||||
{
|
||||
buttonIndex = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
screenCoords.y -= itemHeight;
|
||||
mutableScreenCoords.y -= itemHeight;
|
||||
}
|
||||
|
||||
if (buttonIndex != 0)
|
||||
|
||||
@@ -288,8 +288,8 @@ static void window_object_load_error_close(rct_window *w);
|
||||
static void window_object_load_error_update(rct_window *w);
|
||||
static void window_object_load_error_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_object_load_error_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_object_load_error_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_object_load_error_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_object_load_error_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_object_load_error_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_object_load_error_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_object_load_error_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
#ifndef DISABLE_HTTP
|
||||
@@ -516,7 +516,7 @@ static void window_object_load_error_mouseup(rct_window* w, rct_widgetindex widg
|
||||
}
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_object_load_error_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
// Highlight item that the cursor is over, or remove highlighting if none
|
||||
int32_t selected_item;
|
||||
@@ -542,7 +542,7 @@ static void window_object_load_error_select_element_from_list(rct_window* w, int
|
||||
widget_invalidate(w, WIDX_SCROLL);
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_object_load_error_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t selected_item;
|
||||
selected_item = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
|
||||
|
||||
@@ -559,8 +559,8 @@ static void window_ride_colour_resize(rct_window *w);
|
||||
static void window_ride_colour_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_ride_colour_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_ride_colour_update(rct_window *w);
|
||||
static void window_ride_colour_tooldown(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_colour_tooldrag(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_colour_tooldown(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_colour_tooldrag(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_colour_invalidate(rct_window *w);
|
||||
static void window_ride_colour_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_ride_colour_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -579,8 +579,8 @@ static void window_ride_measurements_resize(rct_window *w);
|
||||
static void window_ride_measurements_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_ride_measurements_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_ride_measurements_update(rct_window *w);
|
||||
static void window_ride_measurements_tooldown(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_measurements_tooldrag(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_measurements_tooldown(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_measurements_tooldrag(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_measurements_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_ride_measurements_invalidate(rct_window *w);
|
||||
static void window_ride_measurements_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -4725,7 +4725,7 @@ static void window_ride_colour_update(rct_window* w)
|
||||
*
|
||||
* rct2: 0x006B04EC
|
||||
*/
|
||||
static void window_ride_colour_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_colour_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA)
|
||||
window_ride_set_track_colour_scheme(w, screenCoords.x, screenCoords.y);
|
||||
@@ -4735,7 +4735,7 @@ static void window_ride_colour_tooldown(rct_window* w, rct_widgetindex widgetInd
|
||||
*
|
||||
* rct2: 0x006B04F3
|
||||
*/
|
||||
static void window_ride_colour_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_colour_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA)
|
||||
window_ride_set_track_colour_scheme(w, screenCoords.x, screenCoords.y);
|
||||
@@ -5573,7 +5573,7 @@ static void window_ride_measurements_update(rct_window* w)
|
||||
*
|
||||
* rct2: 0x006D2AE7
|
||||
*/
|
||||
static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
TileElement* tileElement;
|
||||
CoordsXY mapCoords;
|
||||
@@ -5596,7 +5596,7 @@ static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex wid
|
||||
}
|
||||
}
|
||||
|
||||
static void window_ride_measurements_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_measurements_tooldrag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (screenCoords.x == _lastSceneryX && screenCoords.y == _lastSceneryY)
|
||||
return;
|
||||
|
||||
@@ -139,8 +139,8 @@ static void window_ride_construction_resize(rct_window *w);
|
||||
static void window_ride_construction_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_ride_construction_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_ride_construction_update(rct_window *w);
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_construction_invalidate(rct_window *w);
|
||||
static void window_ride_construction_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static bool track_piece_direction_is_diagonal(const uint8_t direction);
|
||||
@@ -479,7 +479,7 @@ static void window_ride_construction_show_special_track_dropdown(rct_window* w,
|
||||
static void ride_selected_track_set_seat_rotation(int32_t seatRotation);
|
||||
static void loc_6C7502(int32_t al);
|
||||
static void ride_construction_set_brakes_speed(int32_t brakesSpeed);
|
||||
static void ride_construction_tooldown_entrance_exit(ScreenCoordsXY screenCoords);
|
||||
static void ride_construction_tooldown_entrance_exit(const ScreenCoordsXY& screenCoords);
|
||||
|
||||
static uint8_t _currentPossibleRideConfigurations[32];
|
||||
|
||||
@@ -2219,7 +2219,7 @@ static std::optional<CoordsXY> ride_get_place_position_from_screen_position(Scre
|
||||
*
|
||||
* rct2: 0x006C8229
|
||||
*/
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -2237,7 +2237,7 @@ static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex w
|
||||
*
|
||||
* rct2: 0x006C8248
|
||||
*/
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -3461,7 +3461,7 @@ static void ride_construction_set_brakes_speed(int32_t brakesSpeed)
|
||||
*
|
||||
* rct2: 0x006CC6A8
|
||||
*/
|
||||
void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords)
|
||||
void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t z;
|
||||
const rct_preview_track* trackBlock;
|
||||
@@ -3663,7 +3663,7 @@ void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006CD354
|
||||
*/
|
||||
void ride_construction_toolupdate_entrance_exit(ScreenCoordsXY screenCoords)
|
||||
void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
uint8_t stationNum;
|
||||
|
||||
@@ -3706,7 +3706,7 @@ void ride_construction_toolupdate_entrance_exit(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006CCA73
|
||||
*/
|
||||
void ride_construction_tooldown_construct(ScreenCoordsXY screenCoords)
|
||||
void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
const CursorState* state = context_get_cursor_state();
|
||||
ride_id_t rideIndex;
|
||||
@@ -3906,7 +3906,7 @@ void ride_construction_tooldown_construct(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006CCA73
|
||||
*/
|
||||
static void ride_construction_tooldown_entrance_exit(ScreenCoordsXY screenCoords)
|
||||
static void ride_construction_tooldown_entrance_exit(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ride_construction_invalidate_current_track();
|
||||
map_invalidate_selection_rect();
|
||||
|
||||
@@ -77,8 +77,8 @@ static void window_ride_list_mousedown(rct_window *w, rct_widgetindex widgetInde
|
||||
static void window_ride_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_ride_list_update(rct_window *w);
|
||||
static void window_ride_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_ride_list_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_list_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_ride_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_ride_list_invalidate(rct_window *w);
|
||||
static void window_ride_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_ride_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -442,7 +442,7 @@ static void window_ride_list_scrollgetsize(rct_window* w, int32_t scrollIndex, i
|
||||
*
|
||||
* rct2: 0x006B361F
|
||||
*/
|
||||
static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
@@ -470,7 +470,7 @@ static void window_ride_list_scrollmousedown(rct_window* w, int32_t scrollIndex,
|
||||
*
|
||||
* rct2: 0x006B35EF
|
||||
*/
|
||||
static void window_ride_list_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_ride_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index;
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ static void window_scenery_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
||||
static void window_scenery_update(rct_window *w);
|
||||
static void window_scenery_periodic_update(rct_window *w);
|
||||
static void window_scenery_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_scenery_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_scenery_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_scenery_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_scenery_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_scenery_tooltip(rct_window* w, rct_widgetindex widgetIndex, rct_string_id *stringId);
|
||||
static void window_scenery_invalidate(rct_window *w);
|
||||
static void window_scenery_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -867,7 +867,7 @@ void window_scenery_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* w
|
||||
*height = window_scenery_rows_height(rows);
|
||||
}
|
||||
|
||||
static uint16_t get_scenery_id_by_cursor_pos(ScreenCoordsXY screenCoords)
|
||||
static uint16_t get_scenery_id_by_cursor_pos(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t tabSceneryIndex = screenCoords.x / SCENERY_BUTTON_WIDTH + (screenCoords.y / SCENERY_BUTTON_HEIGHT) * 9;
|
||||
uint8_t tabIndex = gWindowSceneryActiveTabIndex;
|
||||
@@ -890,7 +890,7 @@ static uint16_t get_scenery_id_by_cursor_pos(ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006E1C4A
|
||||
*/
|
||||
void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
uint16_t sceneryId = get_scenery_id_by_cursor_pos(screenCoords);
|
||||
if (sceneryId == WINDOW_SCENERY_TAB_SELECTION_UNDEFINED)
|
||||
@@ -911,7 +911,7 @@ void window_scenery_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCo
|
||||
*
|
||||
* rct2: 0x006E1BB8
|
||||
*/
|
||||
void window_scenery_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_scenery_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
uint16_t sceneryId = get_scenery_id_by_cursor_pos(screenCoords);
|
||||
if (sceneryId != WINDOW_SCENERY_TAB_SELECTION_UNDEFINED)
|
||||
|
||||
@@ -75,8 +75,8 @@ static void window_server_list_resize(rct_window *w);
|
||||
static void window_server_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_server_list_update(rct_window *w);
|
||||
static void window_server_list_scroll_getsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_server_list_scroll_mousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_server_list_scroll_mouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_server_list_scroll_mousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_server_list_scroll_mouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_server_list_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_server_list_invalidate(rct_window *w);
|
||||
static void window_server_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -264,7 +264,7 @@ static void window_server_list_scroll_getsize(rct_window* w, int32_t scrollIndex
|
||||
*height = w->no_list_items * ITEM_HEIGHT;
|
||||
}
|
||||
|
||||
static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t serverIndex = w->selected_list_item;
|
||||
if (serverIndex >= 0 && serverIndex < (int32_t)_serverList.GetCount())
|
||||
@@ -288,7 +288,7 @@ static void window_server_list_scroll_mousedown(rct_window* w, int32_t scrollInd
|
||||
}
|
||||
}
|
||||
|
||||
static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_server_list_scroll_mouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
// Item
|
||||
int32_t index = screenCoords.y / ITEM_HEIGHT;
|
||||
|
||||
@@ -45,8 +45,8 @@ static void window_shortcut_resize(rct_window *w);
|
||||
static void window_shortcut_invalidate(rct_window *w);
|
||||
static void window_shortcut_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_shortcut_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_shortcut_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_shortcut_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_shortcut_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_shortcut_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_shortcut_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
|
||||
static rct_window_event_list window_shortcut_events = {
|
||||
@@ -252,7 +252,7 @@ static void window_shortcut_scrollgetsize(rct_window* w, int32_t scrollIndex, in
|
||||
*
|
||||
* rct2: 0x006E3A3E
|
||||
*/
|
||||
static void window_shortcut_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_shortcut_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t selected_item = (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT;
|
||||
if (selected_item >= w->no_list_items)
|
||||
@@ -265,7 +265,7 @@ static void window_shortcut_scrollmousedown(rct_window* w, int32_t scrollIndex,
|
||||
*
|
||||
* rct2: 0x006E3A16
|
||||
*/
|
||||
static void window_shortcut_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_shortcut_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t selected_item = (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT;
|
||||
if (selected_item >= w->no_list_items)
|
||||
|
||||
@@ -140,10 +140,10 @@ static void window_staff_overview_update(rct_window* w);
|
||||
static void window_staff_overview_invalidate(rct_window *w);
|
||||
static void window_staff_overview_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
static void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_overview_tool_abort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_staff_overview_text_input(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_staff_overview_viewport_rotate(rct_window *w);
|
||||
@@ -1137,7 +1137,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
*
|
||||
* rct2: 0x006BDFD8
|
||||
*/
|
||||
void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
@@ -1165,10 +1165,8 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
return;
|
||||
|
||||
screenCoords.x--;
|
||||
screenCoords.y += 16;
|
||||
gPickupPeepX = screenCoords.x;
|
||||
gPickupPeepY = screenCoords.y;
|
||||
gPickupPeepX = screenCoords.x - 1;
|
||||
gPickupPeepY = screenCoords.y + 16;
|
||||
w->picked_peep_frame++;
|
||||
if (w->picked_peep_frame >= 48)
|
||||
{
|
||||
@@ -1189,7 +1187,7 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
||||
*
|
||||
* rct2: 0x006BDFC3
|
||||
*/
|
||||
void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_PICKUP)
|
||||
{
|
||||
@@ -1239,7 +1237,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
|
||||
}
|
||||
}
|
||||
|
||||
void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PATROL)
|
||||
return;
|
||||
@@ -1276,7 +1274,7 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex,
|
||||
GameActions::Execute(&staffSetPatrolAreaAction);
|
||||
}
|
||||
|
||||
void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PATROL)
|
||||
return;
|
||||
|
||||
@@ -45,11 +45,11 @@ static void window_staff_list_resize(rct_window *w);
|
||||
static void window_staff_list_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_staff_list_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_staff_list_update(rct_window *w);
|
||||
static void window_staff_list_tooldown(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_list_tooldown(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_list_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_staff_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_staff_list_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_list_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_staff_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_staff_list_invalidate(rct_window *w);
|
||||
static void window_staff_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_staff_list_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -334,7 +334,7 @@ void window_staff_list_update(rct_window* w)
|
||||
*
|
||||
* rct2: 0x006BD990
|
||||
*/
|
||||
static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ void window_staff_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t
|
||||
*
|
||||
* rct2: 0x006BDC9A
|
||||
*/
|
||||
void window_staff_list_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_staff_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t i, spriteIndex;
|
||||
Peep* peep;
|
||||
@@ -487,7 +487,7 @@ void window_staff_list_scrollmousedown(rct_window* w, int32_t scrollIndex, Scree
|
||||
*
|
||||
* rct2: 0x006BDC6B
|
||||
*/
|
||||
void window_staff_list_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_staff_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ static void window_themes_mousedown(rct_window *w, rct_widgetindex widgetIndex,
|
||||
static void window_themes_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_themes_update(rct_window *w);
|
||||
static void window_themes_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_themes_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_themes_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_themes_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_themes_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_themes_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_themes_invalidate(rct_window *w);
|
||||
static void window_themes_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -636,7 +636,7 @@ void window_themes_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* wi
|
||||
*height = scrollHeight;
|
||||
}
|
||||
|
||||
void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (screenCoords.y / _row_height < get_colour_scheme_tab_count())
|
||||
{
|
||||
@@ -702,7 +702,7 @@ void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoo
|
||||
}
|
||||
}
|
||||
|
||||
void window_themes_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_themes_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
// if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS)
|
||||
// return;
|
||||
|
||||
@@ -456,13 +456,13 @@ static void window_tile_inspector_resize(rct_window* w);
|
||||
static void window_tile_inspector_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_tile_inspector_update(rct_window* w);
|
||||
static void window_tile_inspector_dropdown(rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_tile_inspector_update_selected_tile(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_tile_inspector_update_selected_tile(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_tile_inspector_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height);
|
||||
static void window_tile_inspector_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_tile_inspector_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_tile_inspector_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_tile_inspector_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_tile_inspector_invalidate(rct_window* w);
|
||||
static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex);
|
||||
@@ -1213,7 +1213,7 @@ static void window_tile_inspector_dropdown(rct_window* w, rct_widgetindex widget
|
||||
}
|
||||
}
|
||||
|
||||
static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
map_invalidate_selection_rect();
|
||||
|
||||
@@ -1255,7 +1255,7 @@ static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex wid
|
||||
map_invalidate_selection_rect();
|
||||
}
|
||||
|
||||
static void window_tile_inspector_update_selected_tile(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
static void window_tile_inspector_update_selected_tile(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
const bool ctrlIsHeldDown = input_test_place_object_modifier(PLACE_OBJECT_MODIFIER_COPY_Z);
|
||||
|
||||
@@ -1304,12 +1304,12 @@ static void window_tile_inspector_update_selected_tile(rct_window* w, ScreenCoor
|
||||
window_tile_inspector_load_tile(w, clickedElement);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
window_tile_inspector_update_selected_tile(w, screenCoords);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
window_tile_inspector_update_selected_tile(w, screenCoords);
|
||||
}
|
||||
@@ -1344,14 +1344,14 @@ static void window_tile_inspector_set_page(rct_window* w, const TILE_INSPECTOR_P
|
||||
w->pressed_widgets = 0;
|
||||
}
|
||||
|
||||
static void window_tile_inspector_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_tile_inspector_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
// Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements
|
||||
const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1;
|
||||
window_tile_inspector_select_element_from_list(w, index);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_tile_inspector_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1;
|
||||
if (index < 0 || index >= windowTileInspectorElementCount)
|
||||
|
||||
@@ -115,7 +115,7 @@ static void window_title_command_editor_mouseup(rct_window * w, rct_widgetindex
|
||||
static void window_title_command_editor_mousedown(rct_window * w, rct_widgetindex widgetIndex, rct_widget * widget);
|
||||
static void window_title_command_editor_dropdown(rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_title_command_editor_update(rct_window * w);
|
||||
static void window_title_command_editor_tool_down(rct_window * w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_title_command_editor_tool_down(rct_window * w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_title_command_editor_invalidate(rct_window * w);
|
||||
static void window_title_command_editor_paint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
static void window_title_command_editor_textinput(rct_window * w, rct_widgetindex widgetIndex, char * text);
|
||||
@@ -609,7 +609,8 @@ static void window_title_command_editor_update(rct_window* w)
|
||||
}
|
||||
}
|
||||
|
||||
static void window_title_command_editor_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_title_command_editor_tool_down(
|
||||
rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
viewport_interaction_get_item_left(screenCoords, &info);
|
||||
|
||||
@@ -47,8 +47,8 @@ static void window_title_editor_mousedown(rct_window * w, rct_widgetindex widget
|
||||
static void window_title_editor_dropdown(rct_window * w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_title_editor_update(rct_window * w);
|
||||
static void window_title_editor_scrollgetsize(rct_window * w, int32_t scrollIndex, int32_t * width, int32_t * height);
|
||||
static void window_title_editor_scrollmousedown(rct_window * w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_title_editor_scrollmouseover(rct_window * w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_title_editor_scrollmousedown(rct_window * w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_title_editor_scrollmouseover(rct_window * w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_title_editor_textinput(rct_window * w, rct_widgetindex widgetIndex, char * text);
|
||||
static void window_title_editor_invalidate(rct_window * w);
|
||||
static void window_title_editor_paint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
@@ -616,7 +616,7 @@ static void window_title_editor_scrollgetsize(rct_window* w, int32_t scrollIndex
|
||||
*width = SCROLL_WIDTH;
|
||||
}
|
||||
|
||||
static void window_title_editor_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_title_editor_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
|
||||
w->selected_list_item = -1;
|
||||
@@ -639,7 +639,7 @@ static void window_title_editor_scrollmousedown(rct_window* w, int32_t scrollInd
|
||||
}
|
||||
}
|
||||
|
||||
static void window_title_editor_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_title_editor_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
|
||||
switch (w->selected_tab)
|
||||
|
||||
@@ -41,7 +41,7 @@ static rct_widget window_title_menu_widgets[] = {
|
||||
static void window_title_menu_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_title_menu_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_title_menu_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_title_menu_cursor(rct_window *w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t *cursorId);
|
||||
static void window_title_menu_cursor(rct_window *w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t *cursorId);
|
||||
static void window_title_menu_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
static rct_window_event_list window_title_menu_events = {
|
||||
@@ -217,7 +217,8 @@ static void window_title_menu_dropdown(rct_window* w, rct_widgetindex widgetInde
|
||||
}
|
||||
}
|
||||
|
||||
static void window_title_menu_cursor(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords, int32_t* cursorId)
|
||||
static void window_title_menu_cursor(
|
||||
rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords, int32_t* cursorId)
|
||||
{
|
||||
gTooltipTimeout = 2000;
|
||||
}
|
||||
|
||||
@@ -102,8 +102,8 @@ static void window_scenarioselect_close(rct_window *w);
|
||||
static void window_scenarioselect_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_scenarioselect_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_scenarioselect_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_scenarioselect_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_scenarioselect_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_scenarioselect_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_scenarioselect_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_scenarioselect_invalidate(rct_window *w);
|
||||
static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_scenarioselect_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, int32_t scrollIndex);
|
||||
@@ -325,20 +325,21 @@ static void window_scenarioselect_scrollgetsize(rct_window* w, int32_t scrollInd
|
||||
*
|
||||
* rct2: 0x6780FE
|
||||
*/
|
||||
static void window_scenarioselect_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_scenarioselect_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
const int32_t scenarioItemHeight = get_scenario_list_item_size();
|
||||
|
||||
auto mutableScreenCoords = screenCoords;
|
||||
for (const auto& listItem : _listItems)
|
||||
{
|
||||
switch (listItem.type)
|
||||
{
|
||||
case LIST_ITEM_TYPE::HEADING:
|
||||
screenCoords.y -= 18;
|
||||
mutableScreenCoords.y -= 18;
|
||||
break;
|
||||
case LIST_ITEM_TYPE::SCENARIO:
|
||||
screenCoords.y -= scenarioItemHeight;
|
||||
if (screenCoords.y < 0 && !listItem.scenario.is_locked)
|
||||
mutableScreenCoords.y -= scenarioItemHeight;
|
||||
if (mutableScreenCoords.y < 0 && !listItem.scenario.is_locked)
|
||||
{
|
||||
audio_play_sound(SoundId::Click1, 0, w->x + (w->width / 2));
|
||||
gFirstTimeSaving = true;
|
||||
@@ -350,7 +351,7 @@ static void window_scenarioselect_scrollmousedown(rct_window* w, int32_t scrollI
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (screenCoords.y < 0)
|
||||
if (mutableScreenCoords.y < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -361,23 +362,24 @@ static void window_scenarioselect_scrollmousedown(rct_window* w, int32_t scrollI
|
||||
*
|
||||
* rct2: 0x678162
|
||||
*/
|
||||
static void window_scenarioselect_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_scenarioselect_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
const int32_t scenarioItemHeight = get_scenario_list_item_size();
|
||||
|
||||
bool originalShowLockedInformation = _showLockedInformation;
|
||||
_showLockedInformation = false;
|
||||
const scenario_index_entry* selected = nullptr;
|
||||
auto mutableScreenCoords = screenCoords;
|
||||
for (const auto& listItem : _listItems)
|
||||
{
|
||||
switch (listItem.type)
|
||||
{
|
||||
case LIST_ITEM_TYPE::HEADING:
|
||||
screenCoords.y -= 18;
|
||||
mutableScreenCoords.y -= 18;
|
||||
break;
|
||||
case LIST_ITEM_TYPE::SCENARIO:
|
||||
screenCoords.y -= scenarioItemHeight;
|
||||
if (screenCoords.y < 0)
|
||||
mutableScreenCoords.y -= scenarioItemHeight;
|
||||
if (mutableScreenCoords.y < 0)
|
||||
{
|
||||
if (listItem.scenario.is_locked)
|
||||
{
|
||||
@@ -390,7 +392,7 @@ static void window_scenarioselect_scrollmouseover(rct_window* w, int32_t scrollI
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (screenCoords.y < 0)
|
||||
if (mutableScreenCoords.y < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ static rct_window_event_list window_tooltip_events = {
|
||||
static utf8 _tooltipText[sizeof(gCommonStringFormatBuffer)];
|
||||
static int16_t _tooltipNumLines;
|
||||
|
||||
void window_tooltip_reset(ScreenCoordsXY screenCoords)
|
||||
void window_tooltip_reset(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
gTooltipCursorX = screenCoords.x;
|
||||
gTooltipCursorY = screenCoords.y;
|
||||
@@ -130,7 +130,7 @@ void window_tooltip_show(rct_string_id id, ScreenCoordsXY screenCoords)
|
||||
*
|
||||
* rct2: 0x006EA10D
|
||||
*/
|
||||
void window_tooltip_open(rct_window* widgetWindow, rct_widgetindex widgetIndex, ScreenCoordsXY screenCords)
|
||||
void window_tooltip_open(rct_window* widgetWindow, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCords)
|
||||
{
|
||||
rct_widget* widget;
|
||||
|
||||
|
||||
@@ -263,10 +263,10 @@ static rct_widget window_top_toolbar_widgets[] = {
|
||||
static void window_top_toolbar_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_top_toolbar_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget* widget);
|
||||
static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoordsy);
|
||||
static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoordsy);
|
||||
static void window_top_toolbar_tool_abort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_top_toolbar_invalidate(rct_window *w);
|
||||
static void window_top_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -2906,7 +2906,7 @@ static void top_toolbar_tool_update_scenery(int16_t x, int16_t y)
|
||||
*
|
||||
* rct2: 0x0066CB25
|
||||
*/
|
||||
static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -2932,7 +2932,7 @@ static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widget
|
||||
*
|
||||
* rct2: 0x0066CB73
|
||||
*/
|
||||
static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -3135,7 +3135,7 @@ static void window_top_toolbar_water_tool_drag(int16_t x, int16_t y)
|
||||
*
|
||||
* rct2: 0x0066CB4E
|
||||
*/
|
||||
static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -3185,7 +3185,7 @@ static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIn
|
||||
*
|
||||
* rct2: 0x0066CC5B
|
||||
*/
|
||||
static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
||||
@@ -66,8 +66,8 @@ static rct_widget window_track_place_widgets[] = {
|
||||
static void window_track_place_close(rct_window *w);
|
||||
static void window_track_place_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_track_place_update(rct_window *w);
|
||||
static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_track_place_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_track_place_unknown14(rct_window *w);
|
||||
static void window_track_place_invalidate(rct_window *w);
|
||||
@@ -262,7 +262,7 @@ static GameActionResult::Ptr FindValidTrackDesignPlaceHeight(CoordsXYZ& loc, uin
|
||||
*
|
||||
* rct2: 0x006CFF2D
|
||||
*/
|
||||
static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int16_t mapZ;
|
||||
|
||||
@@ -334,7 +334,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI
|
||||
*
|
||||
* rct2: 0x006CFF34
|
||||
*/
|
||||
static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
window_track_place_clear_provisional();
|
||||
map_invalidate_map_selection_tiles();
|
||||
|
||||
@@ -58,8 +58,8 @@ static void window_track_list_close(rct_window *w);
|
||||
static void window_track_list_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_track_list_update(rct_window *w);
|
||||
static void window_track_list_scrollgetsize(rct_window *w, int32_t scrollIndex, int32_t *width, int32_t *height);
|
||||
static void window_track_list_scrollmousedown(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_track_list_scrollmouseover(rct_window *w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_track_list_scrollmousedown(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_track_list_scrollmouseover(rct_window *w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_track_list_textinput(rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void window_track_list_invalidate(rct_window *w);
|
||||
static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
@@ -285,7 +285,7 @@ static void window_track_list_select(rct_window* w, int32_t listIndex)
|
||||
}
|
||||
}
|
||||
|
||||
static int32_t window_track_list_get_list_item_index_from_position(ScreenCoordsXY screenCoords)
|
||||
static int32_t window_track_list_get_list_item_index_from_position(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
size_t maxItems = _filteredTrackIds.size();
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER))
|
||||
@@ -372,7 +372,7 @@ static void window_track_list_scrollgetsize(rct_window* w, int32_t scrollIndex,
|
||||
*
|
||||
* rct2: 0x006CFB39
|
||||
*/
|
||||
static void window_track_list_scrollmousedown(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_track_list_scrollmousedown(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (!w->track_list.track_list_being_updated)
|
||||
{
|
||||
@@ -388,7 +388,7 @@ static void window_track_list_scrollmousedown(rct_window* w, int32_t scrollIndex
|
||||
*
|
||||
* rct2: 0x006CFAD7
|
||||
*/
|
||||
static void window_track_list_scrollmouseover(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_track_list_scrollmouseover(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (!w->track_list.track_list_being_updated)
|
||||
{
|
||||
|
||||
@@ -80,10 +80,10 @@ static void window_view_clipping_close_button(rct_window* w);
|
||||
static void window_view_clipping_mouseup(rct_window* w, rct_widgetindex widgetIndex);
|
||||
static void window_view_clipping_mousedown(rct_window*w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void window_view_clipping_update(rct_window* w);
|
||||
static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
static void window_view_clipping_tool_up(rct_window* w, rct_widgetindex, ScreenCoordsXY);
|
||||
static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
static void window_view_clipping_tool_up(rct_window* w, rct_widgetindex, const ScreenCoordsXY&);
|
||||
static void window_view_clipping_invalidate(rct_window* w);
|
||||
static void window_view_clipping_paint(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
static void window_view_clipping_scrollgetsize(rct_window* w, int scrollIndex, int* width, int* height);
|
||||
@@ -310,7 +310,7 @@ static void window_view_clipping_update(rct_window* w)
|
||||
widget_invalidate(w, WIDX_CLIP_HEIGHT_SLIDER);
|
||||
}
|
||||
|
||||
static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (_dragging)
|
||||
{
|
||||
@@ -329,7 +329,7 @@ static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widg
|
||||
}
|
||||
}
|
||||
|
||||
static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t direction;
|
||||
auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction);
|
||||
@@ -340,7 +340,7 @@ static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widget
|
||||
}
|
||||
}
|
||||
|
||||
static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (!_dragging)
|
||||
{
|
||||
@@ -362,7 +362,7 @@ static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widget
|
||||
}
|
||||
}
|
||||
|
||||
static void window_view_clipping_tool_up(struct rct_window*, rct_widgetindex, ScreenCoordsXY)
|
||||
static void window_view_clipping_tool_up(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&)
|
||||
{
|
||||
gClipSelectionA = TileCoordsXY{ gMapSelectPositionA };
|
||||
gClipSelectionB = TileCoordsXY{ gMapSelectPositionB };
|
||||
|
||||
@@ -180,9 +180,9 @@ void window_tile_inspector_clear_clipboard();
|
||||
|
||||
rct_window* window_editor_object_selection_open();
|
||||
|
||||
void window_tooltip_reset(ScreenCoordsXY screenCoords);
|
||||
void window_tooltip_reset(const ScreenCoordsXY& screenCoords);
|
||||
void window_tooltip_show(rct_string_id id, ScreenCoordsXY screenCoords);
|
||||
void window_tooltip_open(rct_window* widgetWindow, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void window_tooltip_open(rct_window* widgetWindow, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_tooltip_close();
|
||||
|
||||
rct_window* window_scenery_scatter_open();
|
||||
@@ -1188,7 +1188,7 @@ ScreenCoordsXY context_get_cursor_position_scaled()
|
||||
static_cast<int32_t>(std::ceil(cursorCoords.y / gConfigGeneral.window_scale)) };
|
||||
}
|
||||
|
||||
void context_set_cursor_position(ScreenCoordsXY cursorPosition)
|
||||
void context_set_cursor_position(const ScreenCoordsXY& cursorPosition)
|
||||
{
|
||||
GetContext()->GetUiContext()->SetCursorPosition(cursorPosition);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ void context_hide_cursor();
|
||||
void context_show_cursor();
|
||||
ScreenCoordsXY context_get_cursor_position();
|
||||
ScreenCoordsXY context_get_cursor_position_scaled();
|
||||
void context_set_cursor_position(ScreenCoordsXY cursorPosition);
|
||||
void context_set_cursor_position(const ScreenCoordsXY& cursorPosition);
|
||||
const CursorState* context_get_cursor_state();
|
||||
const uint8_t* context_get_keys_state();
|
||||
const uint8_t* context_get_keys_pressed();
|
||||
|
||||
@@ -94,7 +94,7 @@ extern INPUT_STATE _inputState;
|
||||
extern uint8_t _inputFlags;
|
||||
extern uint16_t _tooltipNotShownTicks;
|
||||
|
||||
void input_window_position_begin(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void input_window_position_begin(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
|
||||
void title_handle_keyboard_input();
|
||||
void game_handle_input();
|
||||
@@ -102,7 +102,7 @@ void game_handle_keyboard_input();
|
||||
void game_handle_edge_scroll();
|
||||
int32_t get_next_key();
|
||||
|
||||
void store_mouse_input(int32_t state, ScreenCoordsXY screenCoords);
|
||||
void store_mouse_input(int32_t state, const ScreenCoordsXY& screenCoords);
|
||||
|
||||
void input_set_flag(INPUT_FLAGS flag, bool on);
|
||||
bool input_test_flag(INPUT_FLAGS flag);
|
||||
@@ -117,6 +117,6 @@ void reset_tooltip_not_shown();
|
||||
|
||||
void input_reset_place_obj_modifier();
|
||||
|
||||
void input_scroll_viewport(ScreenCoordsXY screenCoords);
|
||||
void input_scroll_viewport(const ScreenCoordsXY& screenCoords);
|
||||
|
||||
#endif
|
||||
@@ -275,7 +275,7 @@ static void chat_clear_input()
|
||||
|
||||
// This method is the same as gfx_draw_string_left_wrapped.
|
||||
// But this adjusts the initial Y coordinate depending of the number of lines.
|
||||
int32_t chat_history_draw_string(rct_drawpixelinfo* dpi, void* args, ScreenCoordsXY screenCoords, int32_t width)
|
||||
int32_t chat_history_draw_string(rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& screenCoords, int32_t width)
|
||||
{
|
||||
int32_t fontSpriteBase, lineHeight, lineY, numLines;
|
||||
|
||||
|
||||
@@ -42,6 +42,6 @@ void chat_history_add(const char* src);
|
||||
void chat_input(CHAT_INPUT input);
|
||||
|
||||
int32_t chat_string_wrapped_get_height(void* args, int32_t width);
|
||||
int32_t chat_history_draw_string(rct_drawpixelinfo* dpi, void* args, ScreenCoordsXY screenCoords, int32_t width);
|
||||
int32_t chat_history_draw_string(rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& screenCoords, int32_t width);
|
||||
|
||||
#endif
|
||||
@@ -204,7 +204,7 @@ void viewport_create(
|
||||
* edx is assumed to be (and always is) the current rotation, so it is not
|
||||
* needed as parameter.
|
||||
*/
|
||||
CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY startCoords)
|
||||
CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords)
|
||||
{
|
||||
int16_t height = 0;
|
||||
|
||||
@@ -1015,7 +1015,7 @@ static void viewport_paint_weather_gloom(rct_drawpixelinfo* dpi)
|
||||
*
|
||||
* rct2: 0x0068958D
|
||||
*/
|
||||
std::optional<CoordsXY> screen_pos_to_map_pos(ScreenCoordsXY screenCoords, int32_t* direction)
|
||||
std::optional<CoordsXY> screen_pos_to_map_pos(const ScreenCoordsXY& screenCoords, int32_t* direction)
|
||||
{
|
||||
auto mapCoords = screen_get_map_xy(screenCoords, nullptr);
|
||||
if (!mapCoords)
|
||||
@@ -1061,7 +1061,7 @@ std::optional<CoordsXY> screen_pos_to_map_pos(ScreenCoordsXY screenCoords, int32
|
||||
return { mapCoords->ToTileStart() };
|
||||
}
|
||||
|
||||
ScreenCoordsXY screen_coord_to_viewport_coord(rct_viewport* viewport, ScreenCoordsXY screenCoords)
|
||||
ScreenCoordsXY screen_coord_to_viewport_coord(rct_viewport* viewport, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
ScreenCoordsXY ret;
|
||||
ret.x = ((screenCoords.x - viewport->x) << viewport->zoom) + viewport->view_x;
|
||||
@@ -1638,7 +1638,7 @@ InteractionInfo set_interaction_info_from_paint_session(paint_session* session,
|
||||
* viewport: edi
|
||||
*/
|
||||
void get_map_coordinates_from_pos(
|
||||
ScreenCoordsXY screenCoords, int32_t flags, CoordsXY& mapCoords, int32_t* interactionType, TileElement** tileElement,
|
||||
const ScreenCoordsXY& screenCoords, int32_t flags, CoordsXY& mapCoords, int32_t* interactionType, TileElement** tileElement,
|
||||
rct_viewport** viewport)
|
||||
{
|
||||
rct_window* window = window_find_from_point(screenCoords);
|
||||
@@ -1740,7 +1740,7 @@ void viewport_invalidate(rct_viewport* viewport, int32_t left, int32_t top, int3
|
||||
}
|
||||
}
|
||||
|
||||
static rct_viewport* viewport_find_from_point(ScreenCoordsXY screenCoords)
|
||||
static rct_viewport* viewport_find_from_point(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
rct_window* w = window_find_from_point(screenCoords);
|
||||
if (w == nullptr)
|
||||
@@ -1770,7 +1770,7 @@ static rct_viewport* viewport_find_from_point(ScreenCoordsXY screenCoords)
|
||||
* tile_element: edx ?
|
||||
* viewport: edi
|
||||
*/
|
||||
std::optional<CoordsXY> screen_get_map_xy(ScreenCoordsXY screenCoords, rct_viewport** viewport)
|
||||
std::optional<CoordsXY> screen_get_map_xy(const ScreenCoordsXY& screenCoords, rct_viewport** viewport)
|
||||
{
|
||||
int32_t interactionType;
|
||||
rct_viewport* myViewport = nullptr;
|
||||
@@ -1805,7 +1805,7 @@ std::optional<CoordsXY> screen_get_map_xy(ScreenCoordsXY screenCoords, rct_viewp
|
||||
*
|
||||
* rct2: 0x006894D4
|
||||
*/
|
||||
std::optional<CoordsXY> screen_get_map_xy_with_z(ScreenCoordsXY screenCoords, int16_t z)
|
||||
std::optional<CoordsXY> screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int16_t z)
|
||||
{
|
||||
rct_viewport* viewport = viewport_find_from_point(screenCoords);
|
||||
if (viewport == nullptr)
|
||||
@@ -1827,7 +1827,7 @@ std::optional<CoordsXY> screen_get_map_xy_with_z(ScreenCoordsXY screenCoords, in
|
||||
*
|
||||
* rct2: 0x00689604
|
||||
*/
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant(ScreenCoordsXY screenCoords, uint8_t* quadrant)
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant(const ScreenCoordsXY& screenCoords, uint8_t* quadrant)
|
||||
{
|
||||
auto mapCoords = screen_get_map_xy(screenCoords, nullptr);
|
||||
if (!mapCoords)
|
||||
@@ -1841,7 +1841,7 @@ std::optional<CoordsXY> screen_get_map_xy_quadrant(ScreenCoordsXY screenCoords,
|
||||
*
|
||||
* rct2: 0x0068964B
|
||||
*/
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant_with_z(ScreenCoordsXY screenCoords, int16_t z, uint8_t* quadrant)
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* quadrant)
|
||||
{
|
||||
auto mapCoords = screen_get_map_xy_with_z(screenCoords, z);
|
||||
if (!mapCoords)
|
||||
@@ -1855,7 +1855,7 @@ std::optional<CoordsXY> screen_get_map_xy_quadrant_with_z(ScreenCoordsXY screenC
|
||||
*
|
||||
* rct2: 0x00689692
|
||||
*/
|
||||
std::optional<CoordsXY> screen_get_map_xy_side(ScreenCoordsXY screenCoords, uint8_t* side)
|
||||
std::optional<CoordsXY> screen_get_map_xy_side(const ScreenCoordsXY& screenCoords, uint8_t* side)
|
||||
{
|
||||
auto mapCoords = screen_get_map_xy(screenCoords, nullptr);
|
||||
if (!mapCoords)
|
||||
@@ -1869,7 +1869,7 @@ std::optional<CoordsXY> screen_get_map_xy_side(ScreenCoordsXY screenCoords, uint
|
||||
*
|
||||
* rct2: 0x006896DC
|
||||
*/
|
||||
std::optional<CoordsXY> screen_get_map_xy_side_with_z(ScreenCoordsXY screenCoords, int16_t z, uint8_t* side)
|
||||
std::optional<CoordsXY> screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* side)
|
||||
{
|
||||
auto mapCoords = screen_get_map_xy_with_z(screenCoords, z);
|
||||
if (!mapCoords)
|
||||
|
||||
@@ -146,11 +146,11 @@ void viewport_paint(
|
||||
const rct_viewport* viewport, rct_drawpixelinfo* dpi, int16_t left, int16_t top, int16_t right, int16_t bottom,
|
||||
std::vector<paint_session>* sessions = nullptr);
|
||||
|
||||
CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY startCoords);
|
||||
CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords);
|
||||
|
||||
ScreenCoordsXY screen_coord_to_viewport_coord(rct_viewport* viewport, ScreenCoordsXY screenCoords);
|
||||
ScreenCoordsXY screen_coord_to_viewport_coord(rct_viewport* viewport, const ScreenCoordsXY& screenCoords);
|
||||
CoordsXY viewport_coord_to_map_coord(int32_t x, int32_t y, int32_t z);
|
||||
std::optional<CoordsXY> screen_pos_to_map_pos(ScreenCoordsXY screenCoords, int32_t* direction);
|
||||
std::optional<CoordsXY> screen_pos_to_map_pos(const ScreenCoordsXY& screenCoords, int32_t* direction);
|
||||
|
||||
void show_gridlines();
|
||||
void hide_gridlines();
|
||||
@@ -161,31 +161,31 @@ void hide_construction_rights();
|
||||
void viewport_set_visibility(uint8_t mode);
|
||||
|
||||
void get_map_coordinates_from_pos(
|
||||
ScreenCoordsXY screenCoords, int32_t flags, CoordsXY& mapCoords, int32_t* interactionType, TileElement** tileElement,
|
||||
const ScreenCoordsXY& screenCoords, int32_t flags, CoordsXY& mapCoords, int32_t* interactionType, TileElement** tileElement,
|
||||
rct_viewport** viewport);
|
||||
void get_map_coordinates_from_pos_window(
|
||||
rct_window* window, ScreenCoordsXY screenCoords, int32_t flags, CoordsXY& mapCoords, int32_t* interactionType,
|
||||
TileElement** tileElement, rct_viewport** viewport);
|
||||
|
||||
InteractionInfo set_interaction_info_from_paint_session(paint_session* session, uint16_t filter);
|
||||
int32_t viewport_interaction_get_item_left(ScreenCoordsXY screenCoords, viewport_interaction_info* info);
|
||||
int32_t viewport_interaction_left_over(ScreenCoordsXY screenCoords);
|
||||
int32_t viewport_interaction_left_click(ScreenCoordsXY screenCoords);
|
||||
int32_t viewport_interaction_get_item_right(ScreenCoordsXY screenCoords, viewport_interaction_info* info);
|
||||
int32_t viewport_interaction_right_over(ScreenCoordsXY screenCoords);
|
||||
int32_t viewport_interaction_right_click(ScreenCoordsXY screenCoords);
|
||||
int32_t viewport_interaction_get_item_left(const ScreenCoordsXY& screenCoords, viewport_interaction_info* info);
|
||||
int32_t viewport_interaction_left_over(const ScreenCoordsXY& screenCoords);
|
||||
int32_t viewport_interaction_left_click(const ScreenCoordsXY& screenCoords);
|
||||
int32_t viewport_interaction_get_item_right(const ScreenCoordsXY& screenCoords, viewport_interaction_info* info);
|
||||
int32_t viewport_interaction_right_over(const ScreenCoordsXY& screenCoords);
|
||||
int32_t viewport_interaction_right_click(const ScreenCoordsXY& screenCoords);
|
||||
|
||||
CoordsXY sub_68A15E(ScreenCoordsXY screenCoords);
|
||||
CoordsXY sub_68A15E(const ScreenCoordsXY& screenCoords);
|
||||
void sub_68B2B7(paint_session* session, const CoordsXY& mapCoords);
|
||||
|
||||
void viewport_invalidate(rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom);
|
||||
|
||||
std::optional<CoordsXY> screen_get_map_xy(ScreenCoordsXY screenCoords, rct_viewport** viewport);
|
||||
std::optional<CoordsXY> screen_get_map_xy_with_z(ScreenCoordsXY screenCoords, int16_t z);
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant(ScreenCoordsXY screenCoords, uint8_t* quadrant);
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant_with_z(ScreenCoordsXY screenCoords, int16_t z, uint8_t* quadrant);
|
||||
std::optional<CoordsXY> screen_get_map_xy_side(ScreenCoordsXY screenCoords, uint8_t* side);
|
||||
std::optional<CoordsXY> screen_get_map_xy_side_with_z(ScreenCoordsXY screenCoords, int16_t z, uint8_t* side);
|
||||
std::optional<CoordsXY> screen_get_map_xy(const ScreenCoordsXY& screenCoords, rct_viewport** viewport);
|
||||
std::optional<CoordsXY> screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoords, int16_t z);
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant(const ScreenCoordsXY& screenCoords, uint8_t* quadrant);
|
||||
std::optional<CoordsXY> screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* quadrant);
|
||||
std::optional<CoordsXY> screen_get_map_xy_side(const ScreenCoordsXY& screenCoords, uint8_t* side);
|
||||
std::optional<CoordsXY> screen_get_map_xy_side_with_z(const ScreenCoordsXY& screenCoords, int16_t z, uint8_t* side);
|
||||
|
||||
uint8_t get_current_rotation();
|
||||
int16_t get_height_marker_offset();
|
||||
|
||||
@@ -67,7 +67,7 @@ bool widget_is_pressed(rct_window* w, rct_widgetindex widgetIndex);
|
||||
bool widget_is_highlighted(rct_window* w, rct_widgetindex widgetIndex);
|
||||
bool widget_is_active_tool(rct_window* w, rct_widgetindex widgetIndex);
|
||||
void widget_scroll_get_part(
|
||||
rct_window* w, rct_widget* widget, ScreenCoordsXY screenCoords, ScreenCoordsXY& retScreenCoords,
|
||||
rct_window* w, rct_widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords,
|
||||
int32_t* output_scroll_area, int32_t* scroll_id);
|
||||
|
||||
void widget_set_enabled(rct_window* w, rct_widgetindex widgetIndex, bool enabled);
|
||||
|
||||
@@ -396,7 +396,7 @@ void window_close_all_except_flags(uint16_t flags)
|
||||
*
|
||||
* rct2: 0x006EA845
|
||||
*/
|
||||
rct_window* window_find_from_point(ScreenCoordsXY screenCoords)
|
||||
rct_window* window_find_from_point(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++)
|
||||
{
|
||||
@@ -426,7 +426,7 @@ rct_window* window_find_from_point(ScreenCoordsXY screenCoords)
|
||||
* returns widget_index (edx)
|
||||
* EDI NEEDS TO BE SET TO w->widgets[widget_index] AFTER
|
||||
*/
|
||||
rct_widgetindex window_find_widget_from_point(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
// Invalidate the window
|
||||
window_event_invalidate_call(w);
|
||||
@@ -1256,12 +1256,12 @@ void window_draw_viewport(rct_drawpixelinfo* dpi, rct_window* w)
|
||||
viewport_render(dpi, w->viewport, dpi->x, dpi->y, dpi->x + dpi->width, dpi->y + dpi->height);
|
||||
}
|
||||
|
||||
void window_set_position(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
void window_set_position(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
window_move_position(w, ScreenCoordsXY(screenCoords.x - w->x, screenCoords.y - w->y));
|
||||
}
|
||||
|
||||
void window_move_position(rct_window* w, ScreenCoordsXY deltaCoords)
|
||||
void window_move_position(rct_window* w, const ScreenCoordsXY& deltaCoords)
|
||||
{
|
||||
if (deltaCoords.x == 0 && deltaCoords.y == 0)
|
||||
return;
|
||||
@@ -1448,25 +1448,25 @@ void window_event_unknown_08_call(rct_window* w)
|
||||
w->event_handlers->unknown_08(w);
|
||||
}
|
||||
|
||||
void window_event_tool_update_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_tool_update_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_update != nullptr)
|
||||
w->event_handlers->tool_update(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_down != nullptr)
|
||||
w->event_handlers->tool_down(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_drag_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_tool_drag_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_drag != nullptr)
|
||||
w->event_handlers->tool_drag(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_up_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_tool_up_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_up != nullptr)
|
||||
w->event_handlers->tool_up(w, widgetIndex, screenCoords);
|
||||
@@ -1492,19 +1492,19 @@ void window_get_scroll_size(rct_window* w, int32_t scrollIndex, int32_t* width,
|
||||
}
|
||||
}
|
||||
|
||||
void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->scroll_mousedown != nullptr)
|
||||
w->event_handlers->scroll_mousedown(w, scrollIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->scroll_mousedrag != nullptr)
|
||||
w->event_handlers->scroll_mousedrag(w, scrollIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords)
|
||||
void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->scroll_mouseover != nullptr)
|
||||
w->event_handlers->scroll_mouseover(w, scrollIndex, screenCoords);
|
||||
@@ -1536,7 +1536,7 @@ rct_string_id window_event_tooltip_call(rct_window* w, rct_widgetindex widgetInd
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
int32_t window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int32_t cursorId = CURSOR_ARROW;
|
||||
if (w->event_handlers->cursor != nullptr)
|
||||
@@ -1544,7 +1544,7 @@ int32_t window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, Scr
|
||||
return cursorId;
|
||||
}
|
||||
|
||||
void window_event_moved_call(rct_window* w, ScreenCoordsXY screenCoords)
|
||||
void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
if (w->event_handlers->moved != nullptr)
|
||||
w->event_handlers->moved(w, screenCoords);
|
||||
|
||||
@@ -180,22 +180,22 @@ struct rct_window_event_list
|
||||
void (*update)(struct rct_window*);
|
||||
void (*periodic_update)(struct rct_window*);
|
||||
void (*unknown_08)(struct rct_window*);
|
||||
void (*tool_update)(struct rct_window*, rct_widgetindex, ScreenCoordsXY);
|
||||
void (*tool_down)(struct rct_window*, rct_widgetindex, ScreenCoordsXY);
|
||||
void (*tool_drag)(struct rct_window*, rct_widgetindex, ScreenCoordsXY);
|
||||
void (*tool_up)(struct rct_window*, rct_widgetindex, ScreenCoordsXY);
|
||||
void (*tool_update)(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&);
|
||||
void (*tool_down)(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&);
|
||||
void (*tool_drag)(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&);
|
||||
void (*tool_up)(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&);
|
||||
void (*tool_abort)(struct rct_window*, rct_widgetindex);
|
||||
void (*unknown_0E)(struct rct_window*);
|
||||
void (*get_scroll_size)(struct rct_window*, int32_t, int32_t*, int32_t*);
|
||||
void (*scroll_mousedown)(struct rct_window*, int32_t, ScreenCoordsXY);
|
||||
void (*scroll_mousedrag)(struct rct_window*, int32_t, ScreenCoordsXY);
|
||||
void (*scroll_mouseover)(struct rct_window*, int32_t, ScreenCoordsXY);
|
||||
void (*scroll_mousedown)(struct rct_window*, int32_t, const ScreenCoordsXY&);
|
||||
void (*scroll_mousedrag)(struct rct_window*, int32_t, const ScreenCoordsXY&);
|
||||
void (*scroll_mouseover)(struct rct_window*, int32_t, const ScreenCoordsXY&);
|
||||
void (*text_input)(struct rct_window*, rct_widgetindex, char*);
|
||||
void (*viewport_rotate)(struct rct_window*);
|
||||
void (*unknown_15)(struct rct_window*, int32_t, int32_t);
|
||||
void (*tooltip)(struct rct_window*, rct_widgetindex, rct_string_id*);
|
||||
void (*cursor)(struct rct_window*, rct_widgetindex, ScreenCoordsXY, int32_t*);
|
||||
void (*moved)(struct rct_window*, ScreenCoordsXY);
|
||||
void (*cursor)(struct rct_window*, rct_widgetindex, const ScreenCoordsXY&, int32_t*);
|
||||
void (*moved)(struct rct_window*, const ScreenCoordsXY&);
|
||||
void (*invalidate)(struct rct_window*);
|
||||
void (*paint)(struct rct_window*, rct_drawpixelinfo*);
|
||||
void (*scroll_paint)(struct rct_window*, rct_drawpixelinfo*, int32_t);
|
||||
@@ -633,8 +633,8 @@ void window_update_all();
|
||||
void window_set_window_limit(int32_t value);
|
||||
|
||||
rct_window* window_create(
|
||||
ScreenCoordsXY screenCoords, int32_t width, int32_t height, rct_window_event_list* event_handlers, rct_windowclass cls,
|
||||
uint16_t flags);
|
||||
const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, rct_window_event_list* event_handlers,
|
||||
rct_windowclass cls, uint16_t flags);
|
||||
rct_window* window_create_auto_pos(
|
||||
int32_t width, int32_t height, rct_window_event_list* event_handlers, rct_windowclass cls, uint16_t flags);
|
||||
rct_window* window_create_centred(
|
||||
@@ -648,8 +648,8 @@ void window_close_all_except_class(rct_windowclass cls);
|
||||
void window_close_all_except_flags(uint16_t flags);
|
||||
rct_window* window_find_by_class(rct_windowclass cls);
|
||||
rct_window* window_find_by_number(rct_windowclass cls, rct_windownumber number);
|
||||
rct_window* window_find_from_point(ScreenCoordsXY screenCoords);
|
||||
rct_widgetindex window_find_widget_from_point(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
rct_window* window_find_from_point(const ScreenCoordsXY& screenCoords);
|
||||
rct_widgetindex window_find_widget_from_point(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
void window_invalidate_by_class(rct_windowclass cls);
|
||||
void window_invalidate_by_number(rct_windowclass cls, rct_windownumber number);
|
||||
void window_invalidate_all();
|
||||
@@ -687,8 +687,8 @@ void window_draw(rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t to
|
||||
void window_draw_widgets(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
void window_draw_viewport(rct_drawpixelinfo* dpi, rct_window* w);
|
||||
|
||||
void window_set_position(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
void window_move_position(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
void window_set_position(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
void window_move_position(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
void window_resize(rct_window* w, int32_t dw, int32_t dh);
|
||||
void window_set_resize(rct_window* w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight);
|
||||
|
||||
@@ -706,9 +706,9 @@ void window_relocate_windows(int32_t width, int32_t height);
|
||||
void window_resize_gui(int32_t width, int32_t height);
|
||||
void window_resize_gui_scenario_editor(int32_t width, int32_t height);
|
||||
void window_ride_construct(rct_window* w);
|
||||
void ride_construction_toolupdate_entrance_exit(ScreenCoordsXY screenCoords);
|
||||
void ride_construction_toolupdate_construct(ScreenCoordsXY screenCoords);
|
||||
void ride_construction_tooldown_construct(ScreenCoordsXY screenCoords);
|
||||
void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords);
|
||||
void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords);
|
||||
void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords);
|
||||
|
||||
void window_bubble_list_item(rct_window* w, int32_t item_position);
|
||||
|
||||
@@ -725,22 +725,22 @@ void window_event_unknown_05_call(rct_window* w);
|
||||
void window_event_update_call(rct_window* w);
|
||||
void window_event_periodic_update_call(rct_window* w);
|
||||
void window_event_unknown_08_call(rct_window* w);
|
||||
void window_event_tool_update_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_tool_drag_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_tool_up_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_tool_update_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_tool_drag_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_tool_up_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_tool_abort_call(rct_window* w, rct_widgetindex widgetIndex);
|
||||
void window_event_unknown_0E_call(rct_window* w);
|
||||
void window_get_scroll_size(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height);
|
||||
void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_scroll_mousedown_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_textinput_call(rct_window* w, rct_widgetindex widgetIndex, char* text);
|
||||
void window_event_viewport_rotate_call(rct_window* w);
|
||||
void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType);
|
||||
rct_string_id window_event_tooltip_call(rct_window* w, rct_widgetindex widgetIndex);
|
||||
int32_t window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords);
|
||||
void window_event_moved_call(rct_window* w, ScreenCoordsXY screenCoords);
|
||||
int32_t window_event_cursor_call(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords);
|
||||
void window_event_invalidate_call(rct_window* w);
|
||||
void window_event_paint_call(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
void window_event_scroll_paint_call(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex);
|
||||
|
||||
@@ -6140,7 +6140,7 @@ static int32_t loc_6CD18E(
|
||||
*
|
||||
* rct2: 0x006CCF70
|
||||
*/
|
||||
CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(ScreenCoordsXY screenCoords)
|
||||
CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenCoordsXY& screenCoords)
|
||||
{
|
||||
int16_t entranceMinX, entranceMinY, entranceMaxX, entranceMaxY, word_F4418C, word_F4418E;
|
||||
int32_t interactionType, stationDirection;
|
||||
|
||||
@@ -1222,7 +1222,7 @@ void window_ride_construction_update_active_elements();
|
||||
void ride_construction_remove_ghosts();
|
||||
money32 ride_entrance_exit_place_ghost(
|
||||
Ride* ride, const CoordsXY& entranceExitCoords, int32_t direction, int32_t placeType, int32_t stationNum);
|
||||
CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(ScreenCoordsXY screenCoords);
|
||||
CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenCoordsXY& screenCoords);
|
||||
|
||||
bool ride_select_backwards_from_front();
|
||||
bool ride_select_forwards_from_back();
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace OpenRCT2::Ui
|
||||
{
|
||||
return {};
|
||||
}
|
||||
void SetCursorPosition(ScreenCoordsXY /*cursorPosition*/) override
|
||||
void SetCursorPosition(const ScreenCoordsXY& /*cursorPosition*/) override
|
||||
{
|
||||
}
|
||||
void SetCursorTrap(bool /*value*/) override
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace OpenRCT2
|
||||
virtual void SetCursorScale(uint8_t scale) abstract;
|
||||
virtual void SetCursorVisible(bool value) abstract;
|
||||
virtual ScreenCoordsXY GetCursorPosition() abstract;
|
||||
virtual void SetCursorPosition(ScreenCoordsXY cursorPosition) abstract;
|
||||
virtual void SetCursorPosition(const ScreenCoordsXY& cursorPosition) abstract;
|
||||
virtual void SetCursorTrap(bool value) abstract;
|
||||
virtual const uint8_t* GetKeysState() abstract;
|
||||
virtual const uint8_t* GetKeysPressed() abstract;
|
||||
|
||||
@@ -244,7 +244,7 @@ void footpath_provisional_update()
|
||||
* direction: ecx
|
||||
* tileElement: edx
|
||||
*/
|
||||
CoordsXY footpath_get_coordinates_from_pos(ScreenCoordsXY screenCoords, int32_t* direction, TileElement** tileElement)
|
||||
CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement)
|
||||
{
|
||||
int32_t z = 0, interactionType;
|
||||
TileElement* myTileElement;
|
||||
@@ -339,7 +339,7 @@ CoordsXY footpath_get_coordinates_from_pos(ScreenCoordsXY screenCoords, int32_t*
|
||||
* direction: cl
|
||||
* tileElement: edx
|
||||
*/
|
||||
CoordsXY footpath_bridge_get_info_from_pos(ScreenCoordsXY screenCoords, int32_t* direction, TileElement** tileElement)
|
||||
CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement)
|
||||
{
|
||||
// First check if we point at an entrance or exit. In that case, we would want the path coming from the entrance/exit.
|
||||
int32_t interactionType;
|
||||
|
||||
@@ -183,8 +183,8 @@ money32 footpath_remove(CoordsXYZ footpathLoc, int32_t flags);
|
||||
money32 footpath_provisional_set(int32_t type, CoordsXYZ footpathLoc, int32_t slope);
|
||||
void footpath_provisional_remove();
|
||||
void footpath_provisional_update();
|
||||
CoordsXY footpath_get_coordinates_from_pos(ScreenCoordsXY screenCoords, int32_t* direction, TileElement** tileElement);
|
||||
CoordsXY footpath_bridge_get_info_from_pos(ScreenCoordsXY screenCoords, int32_t* direction, TileElement** tileElement);
|
||||
CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement);
|
||||
CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement);
|
||||
void footpath_remove_litter(const CoordsXYZ& footpathPos);
|
||||
void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags);
|
||||
void footpath_update_queue_chains();
|
||||
|
||||
Reference in new issue
Block a user