mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use ScreenCoordsXY for tool_* functions
This commit is contained in:
parent
e9bcad193a
commit
afc14183e7
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_footpath_tooldown(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_footpath_tooldrag(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_footpath_toolup(rct_window * w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_invalidate(rct_window * w);
|
||||
static void window_footpath_paint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
|
||||
|
@ -405,15 +405,15 @@ static void window_footpath_dropdown(rct_window* w, rct_widgetindex widgetIndex,
|
|||
*
|
||||
* rct2: 0x006A8032
|
||||
*/
|
||||
static void window_footpath_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_footpath_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
window_footpath_set_provisional_path_at_point(x, y);
|
||||
window_footpath_set_provisional_path_at_point(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL)
|
||||
{
|
||||
window_footpath_set_selection_start_bridge_at_point(x, y);
|
||||
window_footpath_set_selection_start_bridge_at_point(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,15 +421,15 @@ static void window_footpath_toolupdate(rct_window* w, rct_widgetindex widgetInde
|
|||
*
|
||||
* rct2: 0x006A8047
|
||||
*/
|
||||
static void window_footpath_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_footpath_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
window_footpath_place_path_at_point(x, y);
|
||||
window_footpath_place_path_at_point(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL)
|
||||
{
|
||||
window_footpath_start_bridge_at_point(x, y);
|
||||
window_footpath_start_bridge_at_point(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -437,11 +437,11 @@ static void window_footpath_tooldown(rct_window* w, rct_widgetindex widgetIndex,
|
|||
*
|
||||
* rct2: 0x006A8067
|
||||
*/
|
||||
static void window_footpath_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_footpath_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
window_footpath_place_path_at_point(x, y);
|
||||
window_footpath_place_path_at_point(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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, int32_t x, int32_t y)
|
||||
static void window_footpath_toolup(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_CONSTRUCT_ON_LAND)
|
||||
{
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_abort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
|
||||
static void window_guest_mouse_up(rct_window *w, rct_widgetindex widgetIndex);
|
||||
|
@ -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, int32_t x, int32_t y)
|
||||
void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
|
@ -1231,7 +1231,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
|
||||
int32_t map_x, map_y;
|
||||
footpath_get_coordinates_from_pos(x, y + 16, &map_x, &map_y, nullptr, nullptr);
|
||||
footpath_get_coordinates_from_pos(screenCoords.x, screenCoords.y + 16, &map_x, &map_y, nullptr, nullptr);
|
||||
if (map_x != LOCATION_NULL)
|
||||
{
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
||||
|
@ -1246,14 +1246,15 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
gPickupPeepImage = UINT32_MAX;
|
||||
|
||||
int32_t interactionType;
|
||||
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_NONE, nullptr, nullptr, &interactionType, nullptr, nullptr);
|
||||
get_map_coordinates_from_pos(
|
||||
screenCoords.x, screenCoords.y, VIEWPORT_INTERACTION_MASK_NONE, nullptr, nullptr, &interactionType, nullptr, nullptr);
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
return;
|
||||
|
||||
x--;
|
||||
y += 16;
|
||||
gPickupPeepX = x;
|
||||
gPickupPeepY = y;
|
||||
screenCoords.x--;
|
||||
screenCoords.y += 16;
|
||||
gPickupPeepX = screenCoords.x;
|
||||
gPickupPeepY = screenCoords.y;
|
||||
w->picked_peep_frame++;
|
||||
if (w->picked_peep_frame >= 48)
|
||||
{
|
||||
|
@ -1274,14 +1275,14 @@ 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, int32_t x, int32_t y)
|
||||
void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
|
||||
int32_t dest_x, dest_y;
|
||||
TileElement* tileElement;
|
||||
footpath_get_coordinates_from_pos(x, y + 16, &dest_x, &dest_y, nullptr, &tileElement);
|
||||
footpath_get_coordinates_from_pos(screenCoords.x, screenCoords.y + 16, &dest_x, &dest_y, nullptr, &tileElement);
|
||||
|
||||
if (dest_x == LOCATION_NULL)
|
||||
return;
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_toolabort(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static bool land_rights_tool_is_active();
|
||||
|
||||
|
@ -395,20 +395,20 @@ 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, int32_t x, int32_t y)
|
||||
static void window_land_rights_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
window_land_rights_tool_update_land_rights(x, y);
|
||||
window_land_rights_tool_update_land_rights(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006681E6
|
||||
*/
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND)
|
||||
{
|
||||
if (x != LOCATION_NULL)
|
||||
if (screenCoords.x != LOCATION_NULL)
|
||||
{
|
||||
auto landBuyRightsAction = LandBuyRightsAction(
|
||||
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
|
||||
|
@ -418,7 +418,7 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd
|
|||
}
|
||||
else
|
||||
{
|
||||
if (x != LOCATION_NULL)
|
||||
if (screenCoords.x != LOCATION_NULL)
|
||||
{
|
||||
auto landBuyRightsAction = LandBuyRightsAction(
|
||||
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
|
||||
|
@ -432,11 +432,11 @@ 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, int32_t x, int32_t y)
|
||||
static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND)
|
||||
{
|
||||
if (x != LOCATION_NULL)
|
||||
if (screenCoords.x != LOCATION_NULL)
|
||||
{
|
||||
auto landBuyRightsAction = LandBuyRightsAction(
|
||||
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
|
||||
|
@ -446,7 +446,7 @@ static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetInd
|
|||
}
|
||||
else
|
||||
{
|
||||
if (x != LOCATION_NULL)
|
||||
if (screenCoords.x != LOCATION_NULL)
|
||||
{
|
||||
auto landBuyRightsAction = LandBuyRightsAction(
|
||||
{ gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y },
|
||||
|
|
|
@ -123,9 +123,9 @@ 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, int32_t x, int32_t y);
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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, int32_t x, int32_t y);
|
||||
|
@ -462,18 +462,18 @@ static void window_map_update(rct_window* w)
|
|||
*
|
||||
* rct2: 0x0068D093
|
||||
*/
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_SET_LAND_RIGHTS:
|
||||
window_map_set_land_rights_tool_update(x, y);
|
||||
window_map_set_land_rights_tool_update(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_BUILD_PARK_ENTRANCE:
|
||||
window_map_place_park_entrance_tool_update(x, y);
|
||||
window_map_place_park_entrance_tool_update(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_PEOPLE_STARTING_POSITION:
|
||||
window_map_set_peep_spawn_tool_update(x, y);
|
||||
window_map_set_peep_spawn_tool_update(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -482,15 +482,15 @@ static void window_map_toolupdate(rct_window* w, rct_widgetindex widgetIndex, in
|
|||
*
|
||||
* rct2: 0x0068D074
|
||||
*/
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_BUILD_PARK_ENTRANCE:
|
||||
window_map_place_park_entrance_tool_down(x, y);
|
||||
window_map_place_park_entrance_tool_down(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_PEOPLE_STARTING_POSITION:
|
||||
window_map_set_peep_spawn_tool_down(x, y);
|
||||
window_map_set_peep_spawn_tool_down(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ static void window_map_tooldown(rct_window* w, rct_widgetindex widgetIndex, int3
|
|||
*
|
||||
* rct2: 0x0068D088
|
||||
*/
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_map_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_invalidate(rct_window *w);
|
||||
static void window_maze_construction_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
|
@ -335,16 +335,16 @@ static void window_maze_construction_update(rct_window* w)
|
|||
*
|
||||
* rct2: 0x006CD63E
|
||||
*/
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_maze_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_MAZE_DIRECTION_GROUPBOX:
|
||||
ride_construction_toolupdate_construct(ScreenCoordsXY(x, y));
|
||||
ride_construction_toolupdate_construct(screenCoords);
|
||||
break;
|
||||
case WIDX_MAZE_ENTRANCE:
|
||||
case WIDX_MAZE_EXIT:
|
||||
ride_construction_toolupdate_entrance_exit(ScreenCoordsXY(x, y));
|
||||
ride_construction_toolupdate_entrance_exit(screenCoords);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -401,16 +401,16 @@ static void window_maze_construction_entrance_tooldown(int32_t x, int32_t y, rct
|
|||
*
|
||||
* rct2: 0x006CD65D
|
||||
*/
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_maze_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_MAZE_DIRECTION_GROUPBOX:
|
||||
ride_construction_tooldown_construct(ScreenCoordsXY(x, y));
|
||||
ride_construction_tooldown_construct(screenCoords);
|
||||
break;
|
||||
case WIDX_MAZE_ENTRANCE:
|
||||
case WIDX_MAZE_EXIT:
|
||||
window_maze_construction_entrance_tooldown(x, y, w);
|
||||
window_maze_construction_entrance_tooldown(screenCoords.x, screenCoords.y, w);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_ride_colour_tooldrag(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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, int32_t x, int32_t y);
|
||||
static void window_ride_measurements_tooldrag(rct_window *w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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);
|
||||
|
@ -4722,20 +4722,20 @@ static void window_ride_colour_update(rct_window* w)
|
|||
*
|
||||
* rct2: 0x006B04EC
|
||||
*/
|
||||
static void window_ride_colour_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_ride_colour_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA)
|
||||
window_ride_set_track_colour_scheme(w, x, y);
|
||||
window_ride_set_track_colour_scheme(w, screenCoords.x, screenCoords.y);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B04F3
|
||||
*/
|
||||
static void window_ride_colour_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_ride_colour_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA)
|
||||
window_ride_set_track_colour_scheme(w, x, y);
|
||||
window_ride_set_track_colour_scheme(w, screenCoords.x, screenCoords.y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5570,17 +5570,17 @@ static void window_ride_measurements_update(rct_window* w)
|
|||
*
|
||||
* rct2: 0x006D2AE7
|
||||
*/
|
||||
static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
TileElement* tileElement;
|
||||
int16_t mapX, mapY;
|
||||
int32_t interactionType;
|
||||
|
||||
_lastSceneryX = x;
|
||||
_lastSceneryY = y;
|
||||
_lastSceneryX = screenCoords.x;
|
||||
_lastSceneryY = screenCoords.y;
|
||||
_collectTrackDesignScenery = true; // Default to true in case user does not select anything valid
|
||||
|
||||
get_map_coordinates_from_pos(x, y, 0xFCCF, &mapX, &mapY, &interactionType, &tileElement, nullptr);
|
||||
get_map_coordinates_from_pos(screenCoords.x, screenCoords.y, 0xFCCF, &mapX, &mapY, &interactionType, &tileElement, nullptr);
|
||||
switch (interactionType)
|
||||
{
|
||||
case VIEWPORT_INTERACTION_ITEM_SCENERY:
|
||||
|
@ -5593,18 +5593,18 @@ static void window_ride_measurements_tooldown(rct_window* w, rct_widgetindex wid
|
|||
}
|
||||
}
|
||||
|
||||
static void window_ride_measurements_tooldrag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_ride_measurements_tooldrag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (x == _lastSceneryX && y == _lastSceneryY)
|
||||
if (screenCoords.x == _lastSceneryX && screenCoords.y == _lastSceneryY)
|
||||
return;
|
||||
_lastSceneryX = x;
|
||||
_lastSceneryY = y;
|
||||
_lastSceneryX = screenCoords.x;
|
||||
_lastSceneryY = screenCoords.y;
|
||||
|
||||
TileElement* tileElement;
|
||||
int16_t mapX, mapY;
|
||||
int32_t interactionType;
|
||||
|
||||
get_map_coordinates_from_pos(x, y, 0xFCCF, &mapX, &mapY, &interactionType, &tileElement, nullptr);
|
||||
get_map_coordinates_from_pos(screenCoords.x, screenCoords.y, 0xFCCF, &mapX, &mapY, &interactionType, &tileElement, nullptr);
|
||||
switch (interactionType)
|
||||
{
|
||||
case VIEWPORT_INTERACTION_ITEM_SCENERY:
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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);
|
||||
|
@ -2211,16 +2211,16 @@ static bool ride_get_place_position_from_screen_position(int32_t screenX, int32_
|
|||
*
|
||||
* rct2: 0x006C8229
|
||||
*/
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_ride_construction_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_CONSTRUCT:
|
||||
ride_construction_toolupdate_construct(ScreenCoordsXY(x, y));
|
||||
ride_construction_toolupdate_construct(screenCoords);
|
||||
break;
|
||||
case WIDX_ENTRANCE:
|
||||
case WIDX_EXIT:
|
||||
ride_construction_toolupdate_entrance_exit(ScreenCoordsXY(x, y));
|
||||
ride_construction_toolupdate_entrance_exit(screenCoords);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2229,16 +2229,16 @@ 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, int32_t x, int32_t y)
|
||||
static void window_ride_construction_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_CONSTRUCT:
|
||||
ride_construction_tooldown_construct(ScreenCoordsXY(x, y));
|
||||
ride_construction_tooldown_construct(screenCoords);
|
||||
break;
|
||||
case WIDX_ENTRANCE:
|
||||
case WIDX_EXIT:
|
||||
ride_construction_tooldown_entrance_exit(ScreenCoordsXY(x, y));
|
||||
ride_construction_tooldown_entrance_exit(screenCoords);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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, int32_t x, int32_t y)
|
||||
void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PICKUP)
|
||||
return;
|
||||
|
@ -1147,7 +1147,7 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
|
||||
|
||||
int32_t map_x, map_y;
|
||||
footpath_get_coordinates_from_pos(x, y + 16, &map_x, &map_y, nullptr, nullptr);
|
||||
footpath_get_coordinates_from_pos(screenCoords.x, screenCoords.y + 16, &map_x, &map_y, nullptr, nullptr);
|
||||
if (map_x != LOCATION_NULL)
|
||||
{
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
||||
|
@ -1162,14 +1162,15 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
|
|||
gPickupPeepImage = UINT32_MAX;
|
||||
|
||||
int32_t interactionType;
|
||||
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_NONE, nullptr, nullptr, &interactionType, nullptr, nullptr);
|
||||
get_map_coordinates_from_pos(
|
||||
screenCoords.x, screenCoords.y, VIEWPORT_INTERACTION_MASK_NONE, nullptr, nullptr, &interactionType, nullptr, nullptr);
|
||||
if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE)
|
||||
return;
|
||||
|
||||
x--;
|
||||
y += 16;
|
||||
gPickupPeepX = x;
|
||||
gPickupPeepY = y;
|
||||
screenCoords.x--;
|
||||
screenCoords.y += 16;
|
||||
gPickupPeepX = screenCoords.x;
|
||||
gPickupPeepY = screenCoords.y;
|
||||
w->picked_peep_frame++;
|
||||
if (w->picked_peep_frame >= 48)
|
||||
{
|
||||
|
@ -1190,13 +1191,13 @@ 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, int32_t x, int32_t y)
|
||||
void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_PICKUP)
|
||||
{
|
||||
int32_t dest_x, dest_y;
|
||||
TileElement* tileElement;
|
||||
footpath_get_coordinates_from_pos(x, y + 16, &dest_x, &dest_y, nullptr, &tileElement);
|
||||
footpath_get_coordinates_from_pos(screenCoords.x, screenCoords.y + 16, &dest_x, &dest_y, nullptr, &tileElement);
|
||||
|
||||
if (dest_x == LOCATION_NULL)
|
||||
return;
|
||||
|
@ -1215,7 +1216,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
|
|||
else if (widgetIndex == WIDX_PATROL)
|
||||
{
|
||||
int32_t dest_x, dest_y;
|
||||
footpath_get_coordinates_from_pos(x, y, &dest_x, &dest_y, nullptr, nullptr);
|
||||
footpath_get_coordinates_from_pos(screenCoords.x, screenCoords.y, &dest_x, &dest_y, nullptr, nullptr);
|
||||
|
||||
if (dest_x == LOCATION_NULL)
|
||||
return;
|
||||
|
@ -1241,7 +1242,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, int32_t x, int32_t y)
|
||||
void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PATROL)
|
||||
return;
|
||||
|
@ -1256,7 +1257,7 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex,
|
|||
return; // Do nothing if we do not have a paintvalue(this should never happen)
|
||||
|
||||
int32_t dest_x, dest_y;
|
||||
footpath_get_coordinates_from_pos(x, y, &dest_x, &dest_y, nullptr, nullptr);
|
||||
footpath_get_coordinates_from_pos(screenCoords.x, screenCoords.y, &dest_x, &dest_y, nullptr, nullptr);
|
||||
|
||||
if (dest_x == LOCATION_NULL)
|
||||
return;
|
||||
|
@ -1279,7 +1280,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, int32_t x, int32_t y)
|
||||
void window_staff_overview_tool_up(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex != WIDX_PATROL)
|
||||
return;
|
||||
|
|
|
@ -45,7 +45,7 @@ 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, int32_t x, int32_t y);
|
||||
static void window_staff_list_tooldown(rct_window *w, rct_widgetindex widgetIndex, 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, int32_t x, int32_t y);
|
||||
|
@ -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, int32_t x, int32_t y)
|
||||
static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON)
|
||||
{
|
||||
|
@ -342,11 +342,13 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde
|
|||
|
||||
int32_t direction;
|
||||
TileElement* tileElement;
|
||||
footpath_get_coordinates_from_pos(x, y, &x, &y, &direction, &tileElement);
|
||||
if (x == LOCATION_NULL)
|
||||
CoordsXY footpathCoords;
|
||||
footpath_get_coordinates_from_pos(
|
||||
screenCoords.x, screenCoords.y, &footpathCoords.x, &footpathCoords.y, &direction, &tileElement);
|
||||
if (footpathCoords.x == LOCATION_NULL)
|
||||
return;
|
||||
|
||||
bool isPatrolAreaSet = staff_is_patrol_area_set(200 + selectedPeepType, x, y);
|
||||
bool isPatrolAreaSet = staff_is_patrol_area_set(200 + selectedPeepType, footpathCoords.x, footpathCoords.y);
|
||||
|
||||
uint16_t spriteIndex;
|
||||
Peep *peep, *closestPeep = nullptr;
|
||||
|
@ -362,7 +364,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde
|
|||
{
|
||||
continue;
|
||||
}
|
||||
if (!staff_is_location_in_patrol(peep, x, y))
|
||||
if (!staff_is_location_in_patrol(peep, footpathCoords.x, footpathCoords.y))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -373,7 +375,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde
|
|||
continue;
|
||||
}
|
||||
|
||||
int32_t distance = abs(x - peep->x) + abs(y - peep->y);
|
||||
int32_t distance = abs(footpathCoords.x - peep->x) + abs(footpathCoords.y - peep->y);
|
||||
if (distance < closestPeepDistance)
|
||||
{
|
||||
closestPeepDistance = distance;
|
||||
|
|
|
@ -456,10 +456,10 @@ 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, int32_t x, int32_t y);
|
||||
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, int32_t x, int32_t y);
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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, int32_t x, int32_t y);
|
||||
static void window_tile_inspector_scrollmouseover(rct_window* w, int32_t scrollIndex, int32_t x, int32_t y);
|
||||
|
@ -1216,18 +1216,19 @@ 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, int32_t x, int32_t y)
|
||||
static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
map_invalidate_selection_rect();
|
||||
|
||||
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE;
|
||||
|
||||
int16_t mapX = x;
|
||||
int16_t mapY = y;
|
||||
int16_t mapX = screenCoords.x;
|
||||
int16_t mapY = screenCoords.y;
|
||||
TileElement* clickedElement = nullptr;
|
||||
if (input_test_place_object_modifier(PLACE_OBJECT_MODIFIER_COPY_Z))
|
||||
{
|
||||
get_map_coordinates_from_pos(x, y, ViewportInteractionFlags, &mapX, &mapY, nullptr, &clickedElement, nullptr);
|
||||
get_map_coordinates_from_pos(
|
||||
screenCoords.x, screenCoords.y, ViewportInteractionFlags, &mapX, &mapY, nullptr, &clickedElement, nullptr);
|
||||
}
|
||||
|
||||
// Even if Ctrl was pressed, fall back to normal selection when there was nothing under the cursor
|
||||
|
@ -1304,14 +1305,14 @@ static void window_tile_inspector_update_selected_tile(rct_window* w, int32_t x,
|
|||
window_tile_inspector_load_tile(w, clickedElement);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_tile_inspector_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
window_tile_inspector_update_selected_tile(w, x, y);
|
||||
window_tile_inspector_update_selected_tile(w, screenCoords.x, screenCoords.y);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_tile_inspector_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
window_tile_inspector_update_selected_tile(w, x, y);
|
||||
window_tile_inspector_update_selected_tile(w, screenCoords.x, screenCoords.y);
|
||||
}
|
||||
|
||||
static void window_tile_inspector_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_title_command_editor_tool_down(rct_window * w, rct_widgetindex widgetIndex, 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);
|
||||
|
@ -610,10 +610,10 @@ static void window_title_command_editor_update(rct_window* w)
|
|||
}
|
||||
}
|
||||
|
||||
static void window_title_command_editor_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_title_command_editor_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
viewport_interaction_info info;
|
||||
viewport_interaction_get_item_left(x, y, &info);
|
||||
viewport_interaction_get_item_left(screenCoords.x, screenCoords.y, &info);
|
||||
|
||||
if (info.type == VIEWPORT_INTERACTION_ITEM_SPRITE)
|
||||
{
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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);
|
||||
|
@ -2862,24 +2862,24 @@ 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, int32_t x, int32_t y)
|
||||
static void window_top_toolbar_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_CLEAR_SCENERY:
|
||||
top_toolbar_tool_update_scenery_clear(x, y);
|
||||
top_toolbar_tool_update_scenery_clear(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_LAND:
|
||||
if (gLandPaintMode)
|
||||
top_toolbar_tool_update_land_paint(x, y);
|
||||
top_toolbar_tool_update_land_paint(screenCoords.x, screenCoords.y);
|
||||
else
|
||||
top_toolbar_tool_update_land(x, y);
|
||||
top_toolbar_tool_update_land(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_WATER:
|
||||
top_toolbar_tool_update_water(x, y);
|
||||
top_toolbar_tool_update_water(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_SCENERY:
|
||||
top_toolbar_tool_update_scenery(x, y);
|
||||
top_toolbar_tool_update_scenery(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2888,7 +2888,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, int32_t x, int32_t y)
|
||||
static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
@ -2919,7 +2919,7 @@ static void window_top_toolbar_tool_down(rct_window* w, rct_widgetindex widgetIn
|
|||
}
|
||||
break;
|
||||
case WIDX_SCENERY:
|
||||
window_top_toolbar_scenery_tool_down(x, y, w, widgetIndex);
|
||||
window_top_toolbar_scenery_tool_down(screenCoords.x, screenCoords.y, w, widgetIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3091,7 +3091,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, int32_t x, int32_t y)
|
||||
static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
@ -3122,17 +3122,17 @@ static void window_top_toolbar_tool_drag(rct_window* w, rct_widgetindex widgetIn
|
|||
}
|
||||
else
|
||||
{
|
||||
window_top_toolbar_land_tool_drag(x, y);
|
||||
window_top_toolbar_land_tool_drag(screenCoords.x, screenCoords.y);
|
||||
}
|
||||
break;
|
||||
case WIDX_WATER:
|
||||
window_top_toolbar_water_tool_drag(x, y);
|
||||
window_top_toolbar_water_tool_drag(screenCoords.x, screenCoords.y);
|
||||
break;
|
||||
case WIDX_SCENERY:
|
||||
if (gWindowSceneryPaintEnabled & 1)
|
||||
window_top_toolbar_scenery_tool_down(x, y, w, widgetIndex);
|
||||
window_top_toolbar_scenery_tool_down(screenCoords.x, screenCoords.y, w, widgetIndex);
|
||||
if (gWindowSceneryEyedropperEnabled)
|
||||
window_top_toolbar_scenery_tool_down(x, y, w, widgetIndex);
|
||||
window_top_toolbar_scenery_tool_down(screenCoords.x, screenCoords.y, w, widgetIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3141,7 +3141,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, int32_t x, int32_t y)
|
||||
static void window_top_toolbar_tool_up(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
|
|
|
@ -65,8 +65,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, int32_t x, int32_t y);
|
||||
static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
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_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);
|
||||
|
@ -244,7 +244,7 @@ static void window_track_place_update(rct_window* w)
|
|||
*
|
||||
* rct2: 0x006CFF2D
|
||||
*/
|
||||
static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y)
|
||||
static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
int16_t mapX, mapY, mapZ;
|
||||
|
||||
|
@ -254,7 +254,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
// Get the tool map position
|
||||
sub_68A15E(x, y, &mapX, &mapY);
|
||||
sub_68A15E(screenCoords.x, screenCoords.y, &mapX, &mapY);
|
||||
if (mapX == LOCATION_NULL)
|
||||
{
|
||||
window_track_place_clear_provisional();
|
||||
|
@ -310,7 +310,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, int32_t x, int32_t y)
|
||||
static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
window_track_place_clear_provisional();
|
||||
map_invalidate_map_selection_tiles();
|
||||
|
@ -319,7 +319,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
int16_t mapX, mapY;
|
||||
sub_68A15E(x, y, &mapX, &mapY);
|
||||
sub_68A15E(screenCoords.x, screenCoords.y, &mapX, &mapY);
|
||||
if (mapX == LOCATION_NULL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -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, int32_t x, int32_t y);
|
||||
static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y);
|
||||
static void window_view_clipping_tool_up(rct_window* w, rct_widgetindex, int32_t, int32_t);
|
||||
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_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,15 +310,15 @@ 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, int32_t x, int32_t y)
|
||||
static void window_view_clipping_tool_update(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (_dragging)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int16_t mapX = x;
|
||||
int16_t mapY = y;
|
||||
int16_t mapX = screenCoords.x;
|
||||
int16_t mapY = screenCoords.y;
|
||||
int32_t direction;
|
||||
screen_pos_to_map_pos(&mapX, &mapY, &direction);
|
||||
if (mapX != LOCATION_NULL)
|
||||
|
@ -332,10 +332,10 @@ 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, int32_t x, int32_t y)
|
||||
static void window_view_clipping_tool_down(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
int16_t mapX = x;
|
||||
int16_t mapY = y;
|
||||
int16_t mapX = screenCoords.x;
|
||||
int16_t mapY = screenCoords.y;
|
||||
int32_t direction;
|
||||
screen_pos_to_map_pos(&mapX, &mapY, &direction);
|
||||
if (mapX != LOCATION_NULL)
|
||||
|
@ -345,15 +345,15 @@ 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, int32_t x, int32_t y)
|
||||
static void window_view_clipping_tool_drag(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (!_dragging)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int16_t mapX = x;
|
||||
int16_t mapY = y;
|
||||
int16_t mapX = screenCoords.x;
|
||||
int16_t mapY = screenCoords.y;
|
||||
int32_t direction;
|
||||
screen_pos_to_map_pos(&mapX, &mapY, &direction);
|
||||
if (mapX != LOCATION_NULL)
|
||||
|
@ -369,7 +369,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, int32_t, int32_t)
|
||||
static void window_view_clipping_tool_up(struct rct_window*, rct_widgetindex, ScreenCoordsXY)
|
||||
{
|
||||
gClipSelectionA = { uint8_t(gMapSelectPositionA.x / 32), uint8_t(gMapSelectPositionA.y / 32) };
|
||||
gClipSelectionB = { uint8_t(gMapSelectPositionB.x / 32), uint8_t(gMapSelectPositionB.y / 32) };
|
||||
|
|
|
@ -1436,25 +1436,25 @@ void window_event_unknown_08_call(rct_window* w)
|
|||
void window_event_tool_update_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_update != nullptr)
|
||||
w->event_handlers->tool_update(w, widgetIndex, screenCoords.x, screenCoords.y);
|
||||
w->event_handlers->tool_update(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_down_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_down != nullptr)
|
||||
w->event_handlers->tool_down(w, widgetIndex, screenCoords.x, screenCoords.y);
|
||||
w->event_handlers->tool_down(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_drag_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_drag != nullptr)
|
||||
w->event_handlers->tool_drag(w, widgetIndex, screenCoords.x, screenCoords.y);
|
||||
w->event_handlers->tool_drag(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_up_call(rct_window* w, rct_widgetindex widgetIndex, ScreenCoordsXY screenCoords)
|
||||
{
|
||||
if (w->event_handlers->tool_up != nullptr)
|
||||
w->event_handlers->tool_up(w, widgetIndex, screenCoords.x, screenCoords.y);
|
||||
w->event_handlers->tool_up(w, widgetIndex, screenCoords);
|
||||
}
|
||||
|
||||
void window_event_tool_abort_call(rct_window* w, rct_widgetindex widgetIndex)
|
||||
|
|
|
@ -180,10 +180,10 @@ 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, int32_t, int32_t);
|
||||
void (*tool_down)(struct rct_window*, rct_widgetindex, int32_t, int32_t);
|
||||
void (*tool_drag)(struct rct_window*, rct_widgetindex, int32_t, int32_t);
|
||||
void (*tool_up)(struct rct_window*, rct_widgetindex, int32_t, int32_t);
|
||||
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_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*);
|
||||
|
|
Loading…
Reference in New Issue