From 7f9c25a7a93ea153b36adf01738f444bbdd2a648 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 13 Oct 2017 22:23:07 +0200 Subject: [PATCH] Use constant for LOCATION_NULL, split off location stuff to Location.h --- src/openrct2-ui/windows/Footpath.cpp | 8 +- src/openrct2-ui/windows/Guest.cpp | 8 +- src/openrct2-ui/windows/LandRights.cpp | 12 +- src/openrct2-ui/windows/Map.cpp | 22 +-- src/openrct2-ui/windows/MapGen.cpp | 4 +- src/openrct2-ui/windows/Multiplayer.cpp | 6 +- src/openrct2-ui/windows/News.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 2 +- src/openrct2-ui/windows/Player.cpp | 4 +- src/openrct2-ui/windows/Staff.cpp | 6 +- src/openrct2-ui/windows/StaffList.cpp | 4 +- .../windows/TitleCommandEditor.cpp | 10 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 34 ++--- src/openrct2/Editor.cpp | 4 +- src/openrct2/actions/GameAction.h | 2 +- .../actions/PlaceParkEntranceAction.hpp | 8 +- src/openrct2/actions/RideCreateAction.hpp | 2 +- src/openrct2/audio/Audio.cpp | 8 +- src/openrct2/drawing/lightfx.c | 8 +- src/openrct2/drawing/lightfx.h | 2 +- src/openrct2/interface/console.c | 2 +- src/openrct2/interface/viewport.c | 40 +++--- src/openrct2/interface/viewport.h | 4 +- src/openrct2/interface/viewport_interaction.c | 12 +- src/openrct2/interface/window.c | 8 +- src/openrct2/management/NewsItem.cpp | 12 +- src/openrct2/network/Network.cpp | 10 +- src/openrct2/network/NetworkPlayer.h | 4 +- src/openrct2/network/network.h | 4 +- src/openrct2/paint/Paint.cpp | 68 ++++----- src/openrct2/paint/map_element/banner.c | 2 +- src/openrct2/paint/map_element/fence.c | 96 ++++++------- src/openrct2/paint/map_element/map_element.c | 2 +- src/openrct2/paint/map_element/map_element.h | 2 +- src/openrct2/paint/map_element/path.c | 10 +- src/openrct2/paint/map_element/scenery.c | 8 +- .../paint/map_element/scenery_multiple.c | 8 +- src/openrct2/paint/map_element/surface.c | 72 +++++----- src/openrct2/paint/paint.h | 14 +- src/openrct2/paint/supports.c | 6 +- src/openrct2/peep/Peep.cpp | 116 +++++++-------- src/openrct2/peep/Peep.h | 6 +- src/openrct2/peep/Staff.cpp | 32 ++--- src/openrct2/rct1.h | 20 +-- src/openrct2/rct1/S4Importer.cpp | 8 +- src/openrct2/rct2.h | 14 +- src/openrct2/ride/TrackDesign.cpp | 30 ++-- src/openrct2/ride/TrackDesign.h | 6 +- src/openrct2/ride/cable_lift.c | 4 +- .../ride/coaster/JuniorRollerCoaster.cpp | 102 +++++++------- .../coaster/MultiDimensionRollerCoaster.cpp | 2 +- .../ride/coaster/WoodenRollerCoaster.cpp | 6 +- src/openrct2/ride/gentle/CarRide.cpp | 6 +- src/openrct2/ride/gentle/CircusShow.cpp | 2 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 2 +- src/openrct2/ride/gentle/Dodgems.cpp | 2 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 2 +- src/openrct2/ride/gentle/FlyingSaucers.cpp | 2 +- src/openrct2/ride/gentle/GhostTrain.cpp | 10 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 2 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 2 +- src/openrct2/ride/gentle/MiniGolf.cpp | 10 +- src/openrct2/ride/gentle/MiniHelicopters.cpp | 8 +- src/openrct2/ride/gentle/ObservationTower.cpp | 2 +- src/openrct2/ride/gentle/SpaceRings.cpp | 2 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 6 +- src/openrct2/ride/ride.c | 54 +++---- src/openrct2/ride/ride.h | 18 +-- src/openrct2/ride/ride_ratings.c | 2 +- src/openrct2/ride/thrill/3dCinema.cpp | 2 +- src/openrct2/ride/thrill/Enterprise.cpp | 2 +- src/openrct2/ride/thrill/GoKarts.cpp | 2 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 2 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 10 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 2 +- src/openrct2/ride/thrill/PirateShip.cpp | 2 +- src/openrct2/ride/thrill/RotoDrop.cpp | 2 +- src/openrct2/ride/thrill/TopSpin.cpp | 4 +- src/openrct2/ride/thrill/Twist.cpp | 2 +- src/openrct2/ride/track.c | 4 +- src/openrct2/ride/track_design_save.c | 12 +- src/openrct2/ride/track_paint.c | 132 +++++++++--------- src/openrct2/ride/track_paint.h | 52 +++---- src/openrct2/ride/transport/Chairlift.cpp | 16 +-- src/openrct2/ride/transport/Lift.cpp | 2 +- .../ride/transport/MiniatureRailway.cpp | 108 +++++++------- src/openrct2/ride/transport/Monorail.cpp | 40 +++--- src/openrct2/ride/vehicle.c | 40 +++--- src/openrct2/ride/vehicle.h | 4 +- src/openrct2/ride/water/BoatRide.cpp | 2 +- src/openrct2/ride/water/SubmarineRide.cpp | 4 +- src/openrct2/scenario/scenario.c | 2 +- src/openrct2/title/TitleSequencePlayer.cpp | 2 +- src/openrct2/windows/GameBottomToolbar.cpp | 4 +- src/openrct2/windows/Ride.cpp | 4 +- src/openrct2/windows/RideConstruction.cpp | 12 +- src/openrct2/windows/TileInspector.cpp | 4 +- src/openrct2/windows/TopToolbar.cpp | 60 ++++---- src/openrct2/world/Banner.cpp | 8 +- src/openrct2/world/Duck.cpp | 2 +- src/openrct2/world/Entrance.cpp | 16 +-- src/openrct2/world/Fountain.cpp | 4 +- src/openrct2/world/Location.h | 71 ++++++++++ src/openrct2/world/SmallScenery.cpp | 4 +- src/openrct2/world/Wall.cpp | 6 +- src/openrct2/world/entrance.h | 10 +- src/openrct2/world/footpath.c | 24 ++-- src/openrct2/world/footpath.h | 6 +- src/openrct2/world/map.c | 52 +++---- src/openrct2/world/map.h | 65 ++------- src/openrct2/world/money_effect.c | 8 +- src/openrct2/world/scenery.c | 4 +- src/openrct2/world/scenery.h | 6 +- src/openrct2/world/sprite.c | 28 ++-- src/openrct2/world/sprite.h | 1 - test/testpaint/FunctionCall.hpp | 6 +- test/testpaint/PaintIntercept.cpp | 2 +- test/testpaint/compat.c | 10 +- 118 files changed, 954 insertions(+), 931 deletions(-) create mode 100644 src/openrct2/world/Location.h diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index f0dda23ee7..08b3fedc86 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -796,7 +796,7 @@ static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y) sint32 interactionType; rct_map_element * mapElement; - rct_xy16 mapCoord = {0}; + LocationXY16 mapCoord = {0}; get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x, &mapCoord.y, &interactionType, &mapElement, nullptr); x = mapCoord.x; @@ -857,7 +857,7 @@ static void window_footpath_set_selection_start_bridge_at_point(sint32 screenX, gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; footpath_bridge_get_info_from_pos(screenX, screenY, &x, &y, &direction, &mapElement); - if (x == MAP_LOCATION_NULL) + if (x == LOCATION_NULL) { return; } @@ -908,7 +908,7 @@ static void window_footpath_place_path_at_point(sint32 x, sint32 y) footpath_provisional_update(); - rct_xy16 mapCoord = {0}; + LocationXY16 mapCoord = {0}; get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x, &mapCoord.y, &interactionType, &mapElement, nullptr); x = mapCoord.x; @@ -955,7 +955,7 @@ static void window_footpath_start_bridge_at_point(sint32 screenX, sint32 screenY rct_map_element * mapElement; footpath_bridge_get_info_from_pos(screenX, screenY, &x, &y, &direction, &mapElement); - if (x == MAP_LOCATION_NULL) + if (x == LOCATION_NULL) { return; } diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 3a34efac18..59141cccd3 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -702,7 +702,7 @@ void window_guest_viewport_init(rct_window* w){ uint8 final_check = 1; if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE - || (peep->state == PEEP_STATE_LEAVING_RIDE && peep->x == SPRITE_LOCATION_NULL)){ + || (peep->state == PEEP_STATE_LEAVING_RIDE && peep->x == LOCATION_NULL)){ Ride *ride = get_ride(peep->current_ride); if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK){ @@ -717,7 +717,7 @@ void window_guest_viewport_init(rct_window* w){ final_check = 0; } } - if (peep->x == SPRITE_LOCATION_NULL && final_check){ + if (peep->x == LOCATION_NULL && final_check){ Ride *ride = get_ride(peep->current_ride); sint32 x = ride->overall_view.x * 32 + 16; sint32 y = ride->overall_view.y * 32 + 16; @@ -1150,7 +1150,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde sint32 map_x, map_y; footpath_get_coordinates_from_pos(x, y + 16, &map_x, &map_y, nullptr, nullptr); - if (map_x != MAP_LOCATION_NULL) { + if (map_x != LOCATION_NULL) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA.x = map_x; @@ -1199,7 +1199,7 @@ void window_guest_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, rct_map_element* mapElement; footpath_get_coordinates_from_pos(x, y + 16, &dest_x, &dest_y, nullptr, &mapElement); - if (dest_x == MAP_LOCATION_NULL) + if (dest_x == LOCATION_NULL) return; game_command_callback = game_command_callback_pickup_guest; diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 57940ba367..8e355ab0b1 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -287,10 +287,10 @@ static void window_land_rights_tool_update_land_rights(sint16 x, sint16 y) map_invalidate_selection_rect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - rct_xy16 mapTile = { 0 }; + LocationXY16 mapTile = { 0 }; screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr); - if (mapTile.x == MAP_LOCATION_NULL) { + if (mapTile.x == LOCATION_NULL) { if (_landRightsCost != MONEY32_UNDEFINED) { _landRightsCost = MONEY32_UNDEFINED; window_invalidate_by_class(WC_CLEAR_SCENERY); @@ -393,7 +393,7 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd { if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) { - if (x != MAP_LOCATION_NULL) + if (x != LOCATION_NULL) { gGameCommandErrorTitle = STR_CANT_BUY_LAND; game_do_command( @@ -408,7 +408,7 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd } else { - if (x != MAP_LOCATION_NULL) + if (x != LOCATION_NULL) { gGameCommandErrorTitle = STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE; game_do_command( @@ -430,7 +430,7 @@ static void window_land_rights_tooldown(rct_window* w, rct_widgetindex widgetInd static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetIndex, sint32 x, sint32 y) { if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) { - if (x != MAP_LOCATION_NULL) + if (x != LOCATION_NULL) { gGameCommandErrorTitle = STR_CANT_BUY_LAND; game_do_command( @@ -445,7 +445,7 @@ static void window_land_rights_tooldrag(rct_window* w, rct_widgetindex widgetInd } else { - if (x != MAP_LOCATION_NULL) + if (x != LOCATION_NULL) { gGameCommandErrorTitle = STR_CANT_BUY_CONSTRUCTION_RIGHTS_HERE; game_do_command( diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index ae5d046bb8..72e74e85da 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -100,7 +100,7 @@ static rct_widget window_map_widgets[] = { // used in transforming viewport view coordinates to minimap coordinates // rct2: 0x00981BBC -const rct_xy16 MiniMapOffsets[] = { +const LocationXY16 MiniMapOffsets[] = { { 256 - 8, 0 }, { 512 - 8, 256 }, { 256 - 8, 512 }, @@ -934,7 +934,7 @@ static void window_map_centre_on_view_point() if (w_map == nullptr) return; - rct_xy16 offset = MiniMapOffsets[get_current_rotation()]; + LocationXY16 offset = MiniMapOffsets[get_current_rotation()]; // calculate centre view point of viewport and transform it to minimap coordinates @@ -1072,7 +1072,7 @@ static void window_map_paint_peep_overlay(rct_drawpixelinfo *dpi) left = peep->x; top = peep->y; - if (left == SPRITE_LOCATION_NULL) + if (left == LOCATION_NULL) continue; window_map_transform_to_map_coords(&left, &top); @@ -1122,7 +1122,7 @@ static void window_map_paint_train_overlay(rct_drawpixelinfo *dpi) left = vehicle->x; top = vehicle->y; - if (left == SPRITE_LOCATION_NULL) + if (left == LOCATION_NULL) continue; window_map_transform_to_map_coords(&left, &top); @@ -1151,7 +1151,7 @@ static void window_map_paint_hud_rectangle(rct_drawpixelinfo *dpi) if (viewport == nullptr) return; - rct_xy16 offset = MiniMapOffsets[get_current_rotation()]; + LocationXY16 offset = MiniMapOffsets[get_current_rotation()]; sint16 left = (viewport->view_x >> 5) + offset.x; sint16 right = ((viewport->view_x + viewport->view_width) >> 5) + offset.x; sint16 top = (viewport->view_y >> 4) + offset.y; @@ -1186,7 +1186,7 @@ static void window_map_set_land_rights_tool_update(sint32 x, sint32 y) map_invalidate_selection_rect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; screen_get_map_xy(x, y, &mapX, &mapY, &viewport); - if (mapX == MAP_LOCATION_NULL) + if (mapX == LOCATION_NULL) return; gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; @@ -1216,7 +1216,7 @@ static void place_park_entrance_get_map_position(sint32 x, sint32 y, sint16 *map rct_map_element *mapElement; sub_68A15E(x, y, mapX, mapY, direction, &mapElement); - if (*mapX == MAP_LOCATION_NULL) + if (*mapX == LOCATION_NULL) return; mapElement = map_get_surface_element_at(*mapX >> 5, *mapY >> 5); @@ -1290,7 +1290,7 @@ static void window_map_set_peep_spawn_tool_update(sint32 x, sint32 y) gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; footpath_bridge_get_info_from_pos(x, y, &mapX, &mapY, &direction, &mapElement); - if ((mapX & 0xFFFF) == 0x8000) + if ((mapX & 0xFFFF) == LOCATION_NULL) return; mapZ = mapElement->base_height * 8; @@ -1326,7 +1326,7 @@ static void window_map_place_park_entrance_tool_down(sint32 x, sint32 y) sint16 mapX, mapY, mapZ; sint32 direction; place_park_entrance_get_map_position(x, y, &mapX, &mapY, &mapZ, &direction); - if (mapX != MAP_LOCATION_NULL) { + if (mapX != LOCATION_NULL) { gGameCommandErrorTitle = STR_CANT_BUILD_PARK_ENTRANCE_HERE; money32 price = place_park_entrance(mapX, mapY, mapZ, direction); if (price != MONEY32_UNDEFINED) { @@ -1350,7 +1350,7 @@ static void window_map_set_peep_spawn_tool_down(sint32 x, sint32 y) sint32 mapX, mapY, mapZ, direction; footpath_get_coordinates_from_pos(x, y, &mapX, &mapY, &direction, &mapElement); - if (mapX == 0x8000) + if (mapX == LOCATION_NULL) return; surfaceMapElement = map_get_surface_element_at(mapX >> 5, mapY >> 5); @@ -1648,7 +1648,7 @@ static void map_window_set_pixels(rct_window *w) sint32 x = 0, y = 0, dx = 0, dy = 0; sint32 pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1; - rct_xy16 destinationPosition = MakeXY16(pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE); + LocationXY16 destinationPosition = MakeXY16(pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE); destination = &(*_mapImageData)[destinationPosition.y][destinationPosition.x]; switch (get_current_rotation()) { case 0: diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 4678212436..aedbe32918 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -805,7 +805,7 @@ static void window_mapgen_base_paint(rct_window *w, rct_drawpixelinfo *dpi) gfx_draw_string_left(dpi, STR_TERRAIN_LABEL, nullptr, textColour, w->x + 4, w->y + w->widgets[WIDX_FLOOR_TEXTURE].top + 1); // The practical map size is 2 lower than the technical map size - rct_xy16 mapSizeArgs = MakeXY16(_mapSize - 2, _mapSize -2); + LocationXY16 mapSizeArgs = MakeXY16(_mapSize - 2, _mapSize -2); gfx_draw_string_left(dpi, STR_RESOLUTION_X_BY_Y, &mapSizeArgs, w->colours[1], w->x + w->widgets[WIDX_MAP_SIZE].left + 1, w->y + w->widgets[WIDX_MAP_SIZE].top + 1); arg = (_baseHeight - 12) / 2; @@ -1091,7 +1091,7 @@ static void window_mapgen_simplex_paint(rct_window *w, rct_drawpixelinfo *dpi) gfx_draw_string_left(dpi, STR_MAPGEN_OPTION_PLACE_TREES, NULL, textColour, w->x + 5, w->y + w->widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1); // The practical map size is 2 lower than the technical map size - rct_xy16 mapSizeArgs = MakeXY16(_mapSize - 2, _mapSize - 2); + LocationXY16 mapSizeArgs = MakeXY16(_mapSize - 2, _mapSize - 2); gfx_draw_string_left(dpi, STR_RESOLUTION_X_BY_Y, &mapSizeArgs, textColour, w->x + w->widgets[WIDX_SIMPLEX_MAP_SIZE].left + 1, w->y + w->widgets[WIDX_SIMPLEX_MAP_SIZE].top + 1); arg = (_waterLevel - 12) / 2; diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 101f45e46b..0b553d2761 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -288,7 +288,7 @@ static void window_multiplayer_draw_tab_images(rct_window *w, rct_drawpixelinfo static void window_multiplayer_set_page(rct_window* w, sint32 page); static bool _windowInformationSizeDirty; -static rct_xy16 _windowInformationSize; +static LocationXY16 _windowInformationSize; rct_window * window_multiplayer_open() { @@ -393,7 +393,7 @@ static void window_multiplayer_information_mouseup(rct_window *w, rct_widgetinde } } -static rct_xy16 window_multiplayer_information_get_size() +static LocationXY16 window_multiplayer_information_get_size() { if (!_windowInformationSizeDirty) { return _windowInformationSize; @@ -418,7 +418,7 @@ static rct_xy16 window_multiplayer_information_get_size() static void window_multiplayer_information_resize(rct_window *w) { - rct_xy16 size = window_multiplayer_information_get_size(); + LocationXY16 size = window_multiplayer_information_get_size(); window_set_resize(w, size.x, size.y, size.x, size.y); } diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 86627cef29..342da6e35c 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -167,7 +167,7 @@ static void window_news_update(rct_window *w) } else if (w->news.var_482 > 1) { news_item_get_subject_location(newsItem->Type, newsItem->Assoc, &x, &y, &z); - if (x != SPRITE_LOCATION_NULL) + if (x != LOCATION_NULL) if ((w = window_get_main()) != nullptr) window_scroll_to_location(w, x, y, z); return; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index aad311d64e..cfad0f9693 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -874,7 +874,7 @@ static void window_park_init_viewport(rct_window *w) return; for (i = 0; i < MAX_PARK_ENTRANCES; i++) { - if (gParkEntrances[i].x != SPRITE_LOCATION_NULL) { + if (gParkEntrances[i].x != LOCATION_NULL) { x = gParkEntrances[i].x + 16; y = gParkEntrances[i].y + 16; z = gParkEntrances[i].z + 32; diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 32a025cf18..a56d78928d 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -278,7 +278,7 @@ void window_player_overview_mouse_up(rct_window *w, rct_widgetindex widgetIndex) if (player == -1) { return; } - rct_xyz16 coord = network_get_player_last_action_coord(player); + LocationXYZ16 coord = network_get_player_last_action_coord(player); if (coord.x || coord.y || coord.z) { window_scroll_to_location(mainWindow, coord.x, coord.y, coord.z); } @@ -603,7 +603,7 @@ static void window_player_update_viewport(rct_window *w, bool scroll) rct_viewport *viewport = w->viewport; if (viewport != nullptr) { - rct_xyz16 coord = network_get_player_last_action_coord(playerIndex); + LocationXYZ16 coord = network_get_player_last_action_coord(playerIndex); if (coord.x != 0 || coord.y != 0 || coord.z != 0) { sint32 viewX, viewY; centre_2d_coordinates(coord.x, coord.y, coord.z, &viewX, &viewY, viewport); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index ee6bc96683..dc8f04e246 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1088,7 +1088,7 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde sint32 map_x, map_y; footpath_get_coordinates_from_pos(x, y + 16, &map_x, &map_y, nullptr, nullptr); - if (map_x != MAP_LOCATION_NULL) { + if (map_x != LOCATION_NULL) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA.x = map_x; @@ -1135,7 +1135,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, rct_map_element* mapElement; footpath_get_coordinates_from_pos(x, y + 16, &dest_x, &dest_y, nullptr, &mapElement); - if (dest_x == MAP_LOCATION_NULL) + if (dest_x == LOCATION_NULL) return; game_command_callback = game_command_callback_pickup_staff; @@ -1145,7 +1145,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, sint32 dest_x, dest_y; footpath_get_coordinates_from_pos(x, y, &dest_x, &dest_y, nullptr, nullptr); - if (dest_x == MAP_LOCATION_NULL) return; + if (dest_x == LOCATION_NULL) return; game_do_command(dest_x, 1, dest_y, w->number, GAME_COMMAND_SET_STAFF_PATROL, 0, 0); } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 799ae7142c..c4703b2458 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -337,7 +337,7 @@ static void window_staff_list_tooldown(rct_window *w, rct_widgetindex widgetInde sint32 direction; rct_map_element *mapElement; footpath_get_coordinates_from_pos(x, y, &x, &y, &direction, &mapElement); - if (x == 0x8000) + if (x == LOCATION_NULL) return; bool isPatrolAreaSet = staff_is_patrol_area_set(200 + selectedPeepType, x, y); @@ -358,7 +358,7 @@ static void window_staff_list_tooldown(rct_window *w, rct_widgetindex widgetInde } } - if (peep->x == MAP_LOCATION_NULL) { + if (peep->x == LOCATION_NULL) { continue; } diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index 3c1583db42..d61a5e69b3 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -111,7 +111,7 @@ static void window_title_command_editor_textinput(rct_window *w, rct_widgetindex static void window_title_command_editor_inputsize(rct_window *w); static sint32 get_command_info_index(sint32 index); static TITLE_COMMAND_ORDER get_command_info(sint32 index); -static rct_xy16 get_location(); +static LocationXY16 get_location(); static uint8 get_zoom(); static rct_window_event_list window_title_command_editor_events = { @@ -163,9 +163,9 @@ static TITLE_COMMAND_ORDER get_command_info(sint32 index) return _window_title_command_editor_orders[0]; } -static rct_xy16 get_location() +static LocationXY16 get_location() { - rct_xy16 mapCoord = { 0 }; + LocationXY16 mapCoord = { 0 }; rct_window *w = window_get_main(); if (w != nullptr) { sint32 interactionType; @@ -274,7 +274,7 @@ static void window_title_command_editor_mouseup(rct_window *w, rct_widgetindex w break; case WIDX_GET: if (command.Type == TITLE_SCRIPT_LOCATION) { - rct_xy16 mapCoord = get_location(); + LocationXY16 mapCoord = get_location(); command.X = (uint8)mapCoord.x; command.Y = (uint8)mapCoord.y; snprintf(textbox1Buffer, BUF_SIZE, "%d", command.X); @@ -391,7 +391,7 @@ static void window_title_command_editor_dropdown(rct_window *w, rct_widgetindex switch (command.Type) { case TITLE_SCRIPT_LOCATION: { - rct_xy16 mapCoord = get_location(); + LocationXY16 mapCoord = get_location(); command.X = (uint8)mapCoord.x; command.Y = (uint8)mapCoord.y; snprintf(textbox1Buffer, BUF_SIZE, "%d", command.X); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index d512884f4f..d46e4659c0 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -121,11 +121,11 @@ static void window_track_place_attempt_placement(rct_track_td6 *td6, sint32 x, s static void window_track_place_clear_mini_preview(); static void window_track_place_draw_mini_preview(rct_track_td6 *td6); -static void window_track_place_draw_mini_preview_track(rct_track_td6 *td6, sint32 pass, rct_xy16 origin, rct_xy16 *min, rct_xy16 *max); -static void window_track_place_draw_mini_preview_maze(rct_track_td6 *td6, sint32 pass, rct_xy16 origin, rct_xy16 *min, rct_xy16 *max); -static rct_xy16 draw_mini_preview_get_pixel_position(sint16 x, sint16 y); -static bool draw_mini_preview_is_pixel_in_bounds(rct_xy16 pixel); -static uint8 *draw_mini_preview_get_pixel_ptr(rct_xy16 pixel); +static void window_track_place_draw_mini_preview_track(rct_track_td6 *td6, sint32 pass, LocationXY16 origin, LocationXY16 *min, LocationXY16 *max); +static void window_track_place_draw_mini_preview_maze(rct_track_td6 *td6, sint32 pass, LocationXY16 origin, LocationXY16 *min, LocationXY16 *max); +static LocationXY16 draw_mini_preview_get_pixel_position(sint16 x, sint16 y); +static bool draw_mini_preview_is_pixel_in_bounds(LocationXY16 pixel); +static uint8 *draw_mini_preview_get_pixel_ptr(LocationXY16 pixel); /** * @@ -258,7 +258,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI // Get the tool map position sub_68A15E(x, y, &mapX, &mapY, nullptr, nullptr); - if (mapX == MAP_LOCATION_NULL) { + if (mapX == LOCATION_NULL) { window_track_place_clear_provisional(); return; } @@ -320,7 +320,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; sub_68A15E(x, y, &mapX, &mapY, nullptr, nullptr); - if (mapX == MAP_LOCATION_NULL) + if (mapX == LOCATION_NULL) return; // Try increasing Z until a feasible placement is found @@ -486,10 +486,10 @@ static void window_track_place_draw_mini_preview(rct_track_td6 *td6) window_track_place_clear_mini_preview(); // First pass is used to determine the width and height of the image so it can centre it - rct_xy16 min = { 0, 0 }; - rct_xy16 max = { 0, 0 }; + LocationXY16 min = { 0, 0 }; + LocationXY16 max = { 0, 0 }; for (sint32 pass = 0; pass < 2; pass++) { - rct_xy16 origin = { 0, 0 }; + LocationXY16 origin = { 0, 0 }; if (pass == 1) { origin.x -= ((max.x + min.x) >> 6) * 32; origin.y -= ((max.y + min.y) >> 6) * 32; @@ -503,7 +503,7 @@ static void window_track_place_draw_mini_preview(rct_track_td6 *td6) } } -static void window_track_place_draw_mini_preview_track(rct_track_td6 *td6, sint32 pass, rct_xy16 origin, rct_xy16 *min, rct_xy16 *max) +static void window_track_place_draw_mini_preview_track(rct_track_td6 *td6, sint32 pass, LocationXY16 origin, LocationXY16 *min, LocationXY16 *max) { uint8 rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3; rct_td6_track_element *trackElement = td6->track_elements; @@ -526,7 +526,7 @@ static void window_track_place_draw_mini_preview_track(rct_track_td6 *td6, sint3 min->y = Math::Min(min->y, y); max->y = Math::Max(max->y, y); } else { - rct_xy16 pixelPosition = draw_mini_preview_get_pixel_position(x, y); + LocationXY16 pixelPosition = draw_mini_preview_get_pixel_position(x, y); if (draw_mini_preview_is_pixel_in_bounds(pixelPosition)) { uint8 *pixel = draw_mini_preview_get_pixel_ptr(pixelPosition); @@ -566,7 +566,7 @@ static void window_track_place_draw_mini_preview_track(rct_track_td6 *td6, sint3 } } -static void window_track_place_draw_mini_preview_maze(rct_track_td6 *td6, sint32 pass, rct_xy16 origin, rct_xy16 *min, rct_xy16 *max) +static void window_track_place_draw_mini_preview_maze(rct_track_td6 *td6, sint32 pass, LocationXY16 origin, LocationXY16 *min, LocationXY16 *max) { uint8 rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3; rct_td6_maze_element *mazeElement = td6->maze_elements; @@ -584,7 +584,7 @@ static void window_track_place_draw_mini_preview_maze(rct_track_td6 *td6, sint32 min->y = Math::Min(min->y, y); max->y = Math::Max(max->y, y); } else { - rct_xy16 pixelPosition = draw_mini_preview_get_pixel_position(x, y); + LocationXY16 pixelPosition = draw_mini_preview_get_pixel_position(x, y); if (draw_mini_preview_is_pixel_in_bounds(pixelPosition)) { uint8 *pixel = draw_mini_preview_get_pixel_ptr(pixelPosition); @@ -603,7 +603,7 @@ static void window_track_place_draw_mini_preview_maze(rct_track_td6 *td6, sint32 } } -static rct_xy16 draw_mini_preview_get_pixel_position(sint16 x, sint16 y) +static LocationXY16 draw_mini_preview_get_pixel_position(sint16 x, sint16 y) { return { (sint16)(80 + ((y / 32) - (x / 32)) * 4), @@ -611,12 +611,12 @@ static rct_xy16 draw_mini_preview_get_pixel_position(sint16 x, sint16 y) }; } -static bool draw_mini_preview_is_pixel_in_bounds(rct_xy16 pixel) +static bool draw_mini_preview_is_pixel_in_bounds(LocationXY16 pixel) { return pixel.x >= 0 && pixel.y >= 0 && pixel.x <= 160 && pixel.y <= 75; } -static uint8 *draw_mini_preview_get_pixel_ptr(rct_xy16 pixel) +static uint8 *draw_mini_preview_get_pixel_ptr(LocationXY16 pixel) { return &_window_track_place_mini_preview[pixel.y * TRACK_MINI_PREVIEW_WIDTH + pixel.x]; } diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 5ebce78d0a..00e5c7c17a 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -535,7 +535,7 @@ namespace Editor for (sint32 i = 0; i < MAX_PARK_ENTRANCES; i++) { - if (gParkEntrances[i].x != MAP_LOCATION_NULL) + if (gParkEntrances[i].x != LOCATION_NULL) { break; } @@ -549,7 +549,7 @@ namespace Editor for (sint32 i = 0; i < MAX_PARK_ENTRANCES; i++) { - if (gParkEntrances[i].x == MAP_LOCATION_NULL) + if (gParkEntrances[i].x == LOCATION_NULL) { continue; } diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 439b019c18..e873897ab1 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -74,7 +74,7 @@ public: rct_string_id ErrorTitle = (rct_string_id)-1; rct_string_id ErrorMessage = (rct_string_id)-1; uint8 ErrorMessageArgs[12] = { 0 }; - rct_xyz32 Position = { 0 }; + LocationXYZ32 Position = { 0 }; money32 Cost = 0; uint16 ExpenditureType = 0; diff --git a/src/openrct2/actions/PlaceParkEntranceAction.hpp b/src/openrct2/actions/PlaceParkEntranceAction.hpp index 2cca42bbab..fc9504946e 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.hpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.hpp @@ -92,7 +92,7 @@ public: sint8 entranceNum = -1; for (uint8 i = 0; i < MAX_PARK_ENTRANCES; ++i) { - if (gParkEntrances[i].x == MAP_LOCATION_NULL) + if (gParkEntrances[i].x == LOCATION_NULL) { entranceNum = i; break; @@ -106,7 +106,7 @@ public: sint8 zLow = _z * 2; sint8 zHigh = zLow + 12; - rct_xy16 entranceLoc = { _x, _y }; + LocationXY16 entranceLoc = { _x, _y }; for (uint8 index = 0; index < 3; index++) { if (index == 1) @@ -152,7 +152,7 @@ public: sint8 entranceNum = -1; for (uint8 i = 0; i < MAX_PARK_ENTRANCES; ++i) { - if (gParkEntrances[i].x == MAP_LOCATION_NULL) + if (gParkEntrances[i].x == LOCATION_NULL) { entranceNum = i; break; @@ -168,7 +168,7 @@ public: sint8 zLow = _z * 2; sint8 zHigh = zLow + 12; - rct_xy16 entranceLoc = { _x, _y }; + LocationXY16 entranceLoc = { _x, _y }; for (uint8 index = 0; index < 3; index++) { if (index == 1) diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index 5b9e5c1458..5b687078de 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -304,7 +304,7 @@ public: window_invalidate_by_class(WC_RIDE_LIST); res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; - res->Position.x = (uint16)0x8000; + res->Position.x = LOCATION_NULL; return std::move(res); } diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 4f7aeda530..c2db89fddd 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -129,7 +129,7 @@ static sint32 SoundVolumeAdjust[SOUND_MAXID] = -700 // SOUND_62 }; -AudioParams audio_get_params_from_location(sint32 soundId, const rct_xyz16 *location); +AudioParams audio_get_params_from_location(sint32 soundId, const LocationXYZ16 *location); void audio_init() { @@ -189,7 +189,7 @@ sint32 audio_play_sound_at_location(sint32 soundId, sint16 x, sint16 y, sint16 z if (gGameSoundsOff) return 0; - rct_xyz16 location; + LocationXYZ16 location; location.x = x; location.y = y; location.z = z; @@ -208,7 +208,7 @@ sint32 audio_play_sound_at_location(sint32 soundId, sint16 x, sint16 y, sint16 z * @param location The location at which the sound effect is to be played. * @return The audio parameters to be used when playing this sound effect. */ -AudioParams audio_get_params_from_location(sint32 soundId, const rct_xyz16 *location) +AudioParams audio_get_params_from_location(sint32 soundId, const LocationXYZ16 *location) { sint32 volumeDown = 0; AudioParams params; @@ -223,7 +223,7 @@ AudioParams audio_get_params_from_location(sint32 soundId, const rct_xyz16 *loca } uint8 rotation = get_current_rotation(); - rct_xy16 pos2 = coordinate_3d_to_2d(location, rotation); + LocationXY16 pos2 = coordinate_3d_to_2d(location, rotation); rct_window * window = gWindowNextSlot; while (true) { diff --git a/src/openrct2/drawing/lightfx.c b/src/openrct2/drawing/lightfx.c index 21ab2d4417..82142afb06 100644 --- a/src/openrct2/drawing/lightfx.c +++ b/src/openrct2/drawing/lightfx.c @@ -180,13 +180,13 @@ void lightfx_prepare_light_list() continue; } - rct_xyz16 coord_3d = { + LocationXYZ16 coord_3d = { .x = entry->x, .y = entry->y, .z = entry->z }; - rct_xy16 coord_2d = coordinate_3d_to_2d(&coord_3d, _current_view_rotation_front); + LocationXY16 coord_2d = coordinate_3d_to_2d(&coord_3d, _current_view_rotation_front); entry->x = coord_2d.x;// - (_current_view_x_front); entry->y = coord_2d.y;// - (_current_view_y_front); @@ -276,7 +276,7 @@ void lightfx_prepare_light_list() } for (sint32 pat = startSamplePoint; pat < totalSamplePoints; pat++) { - rct_xy16 mapCoord = { 0 }; + LocationXY16 mapCoord = { 0 }; rct_map_element *mapElement = 0; @@ -666,7 +666,7 @@ void lightfx_add_3d_light(uint32 lightID, uint16 lightIDqualifier, sint16 x, sin // log_warning("new 3d light"); } -void lightfx_add_3d_light_magic_from_drawing_tile(rct_xy16 mapPosition, sint16 offsetX, sint16 offsetY, sint16 offsetZ, uint8 lightType) +void lightfx_add_3d_light_magic_from_drawing_tile(LocationXY16 mapPosition, sint16 offsetX, sint16 offsetY, sint16 offsetZ, uint8 lightType) { sint16 x = mapPosition.x + offsetX; sint16 y = mapPosition.y + offsetY; diff --git a/src/openrct2/drawing/lightfx.h b/src/openrct2/drawing/lightfx.h index 4cc741e9d0..d8810eb256 100644 --- a/src/openrct2/drawing/lightfx.h +++ b/src/openrct2/drawing/lightfx.h @@ -66,7 +66,7 @@ const rct_palette * lightfx_get_palette(); void lightfx_add_3d_light(uint32 lightID, uint16 lightIDqualifier, sint16 x, sint16 y, uint16 z, uint8 lightType); -void lightfx_add_3d_light_magic_from_drawing_tile(rct_xy16 mapPosition, sint16 offsetX, sint16 offsetY, sint16 offsetZ, uint8 lightType); +void lightfx_add_3d_light_magic_from_drawing_tile(LocationXY16 mapPosition, sint16 offsetX, sint16 offsetY, sint16 offsetZ, uint8 lightType); void lightfx_add_lights_magic_vehicles(); diff --git a/src/openrct2/interface/console.c b/src/openrct2/interface/console.c index 9ce5084682..c5b749f5ca 100644 --- a/src/openrct2/interface/console.c +++ b/src/openrct2/interface/console.c @@ -801,7 +801,7 @@ static sint32 cc_get(const utf8 **argv, sint32 argc) if (w != NULL) { sint32 interactionType; rct_map_element *mapElement; - rct_xy16 mapCoord = { 0 }; + LocationXY16 mapCoord = { 0 }; get_map_coordinates_from_pos(w->viewport->view_width / 2, w->viewport->view_height / 2, VIEWPORT_INTERACTION_MASK_TERRAIN, &mapCoord.x, &mapCoord.y, &interactionType, &mapElement, NULL); mapCoord.x -= 16; mapCoord.x /= 32; diff --git a/src/openrct2/interface/viewport.c b/src/openrct2/interface/viewport.c index c20fc9f7ba..d3438ea8cb 100644 --- a/src/openrct2/interface/viewport.c +++ b/src/openrct2/interface/viewport.c @@ -111,20 +111,20 @@ void viewport_init_all() void centre_2d_coordinates(sint32 x, sint32 y, sint32 z, sint32 * out_x, sint32 * out_y, rct_viewport * viewport){ sint32 start_x = x; - rct_xyz16 coord_3d = { + LocationXYZ16 coord_3d = { .x = x, .y = y, .z = z }; - rct_xy16 coord_2d = coordinate_3d_to_2d(&coord_3d, get_current_rotation()); + LocationXY16 coord_2d = coordinate_3d_to_2d(&coord_3d, get_current_rotation()); // If the start location was invalid // propagate the invalid location to the output. // This fixes a bug that caused the game to enter an infinite loop. - if (start_x == ((sint16)(uint16)0x8000)) + if (start_x == LOCATION_NULL) { - *out_x = ((sint16)(uint16)0x8000); + *out_x = LOCATION_NULL; *out_y = 0; return; } @@ -226,7 +226,7 @@ void viewport_adjust_for_map_height(sint16* x, sint16* y, sint16 *z) sint16 height = 0; uint32 rotation = get_current_rotation(); - rct_xy16 pos; + LocationXY16 pos; for (sint32 i = 0; i < 6; i++) { pos = viewport_coord_to_map_coord(start_x, start_y, height); height = map_element_height((0xFFFF) & pos.x, (0xFFFF) & pos.y); @@ -784,7 +784,7 @@ static void viewport_paint_weather_gloom(rct_drawpixelinfo * dpi) void screen_pos_to_map_pos(sint16 *x, sint16 *y, sint32 *direction) { screen_get_map_xy(*x, *y, x, y, NULL); - if (*x == MAP_LOCATION_NULL) + if (*x == LOCATION_NULL) return; sint32 my_direction; @@ -816,17 +816,17 @@ void screen_pos_to_map_pos(sint16 *x, sint16 *y, sint32 *direction) if (direction != NULL) *direction = my_direction; } -rct_xy16 screen_coord_to_viewport_coord(rct_viewport *viewport, uint16 x, uint16 y) +LocationXY16 screen_coord_to_viewport_coord(rct_viewport *viewport, uint16 x, uint16 y) { - rct_xy16 ret; + LocationXY16 ret; ret.x = ((x - viewport->x) << viewport->zoom) + viewport->view_x; ret.y = ((y - viewport->y) << viewport->zoom) + viewport->view_y; return ret; } -rct_xy16 viewport_coord_to_map_coord(sint32 x, sint32 y, sint32 z) +LocationXY16 viewport_coord_to_map_coord(sint32 x, sint32 y, sint32 z) { - rct_xy16 ret = { 0 }; + LocationXY16 ret = { 0 }; switch (get_current_rotation()) { case 0: ret.x = -x / 2 + y + z; @@ -1474,12 +1474,12 @@ void screen_get_map_xy(sint32 screenX, sint32 screenY, sint16 *x, sint16 *y, rct rct_viewport *myViewport = NULL; get_map_coordinates_from_pos(screenX, screenY, VIEWPORT_INTERACTION_MASK_TERRAIN, &my_x, &my_y, &interactionType, NULL, &myViewport); if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE) { - *x = 0x8000; + *x = LOCATION_NULL; return; } - rct_xy16 start_vp_pos = screen_coord_to_viewport_coord(myViewport, screenX, screenY); - rct_xy16 map_pos = { my_x + 16, my_y + 16 }; + LocationXY16 start_vp_pos = screen_coord_to_viewport_coord(myViewport, screenX, screenY); + LocationXY16 map_pos = { my_x + 16, my_y + 16 }; for (sint32 i = 0; i < 5; i++) { sint32 z = map_element_height(map_pos.x, map_pos.y); @@ -1502,16 +1502,16 @@ void screen_get_map_xy_with_z(sint16 screenX, sint16 screenY, sint16 z, sint16 * { rct_viewport *viewport = viewport_find_from_point(screenX, screenY); if (viewport == NULL) { - *mapX = 0x8000; + *mapX = LOCATION_NULL; return; } screenX = viewport->view_x + ((screenX - viewport->x) << viewport->zoom); screenY = viewport->view_y + ((screenY - viewport->y) << viewport->zoom); - rct_xy16 mapPosition = viewport_coord_to_map_coord(screenX, screenY + z, 0); + LocationXY16 mapPosition = viewport_coord_to_map_coord(screenX, screenY + z, 0); if (mapPosition.x < 0 || mapPosition.x >= (256 * 32) || mapPosition.y < 0 || mapPosition.y >(256 * 32)) { - *mapX = 0x8000; + *mapX = LOCATION_NULL; return; } @@ -1526,7 +1526,7 @@ void screen_get_map_xy_with_z(sint16 screenX, sint16 screenY, sint16 z, sint16 * void screen_get_map_xy_quadrant(sint16 screenX, sint16 screenY, sint16 *mapX, sint16 *mapY, uint8 *quadrant) { screen_get_map_xy(screenX, screenY, mapX, mapY, NULL); - if (*mapX == MAP_LOCATION_NULL) + if (*mapX == LOCATION_NULL) return; *quadrant = map_get_tile_quadrant(*mapX, *mapY); @@ -1541,7 +1541,7 @@ void screen_get_map_xy_quadrant(sint16 screenX, sint16 screenY, sint16 *mapX, si void screen_get_map_xy_quadrant_with_z(sint16 screenX, sint16 screenY, sint16 z, sint16 *mapX, sint16 *mapY, uint8 *quadrant) { screen_get_map_xy_with_z(screenX, screenY, z, mapX, mapY); - if (*mapX == MAP_LOCATION_NULL) + if (*mapX == LOCATION_NULL) return; *quadrant = map_get_tile_quadrant(*mapX, *mapY); @@ -1556,7 +1556,7 @@ void screen_get_map_xy_quadrant_with_z(sint16 screenX, sint16 screenY, sint16 z, void screen_get_map_xy_side(sint16 screenX, sint16 screenY, sint16 *mapX, sint16 *mapY, uint8 *side) { screen_get_map_xy(screenX, screenY, mapX, mapY, NULL); - if (*mapX == MAP_LOCATION_NULL) + if (*mapX == LOCATION_NULL) return; *side = map_get_tile_side(*mapX, *mapY); @@ -1571,7 +1571,7 @@ void screen_get_map_xy_side(sint16 screenX, sint16 screenY, sint16 *mapX, sint16 void screen_get_map_xy_side_with_z(sint16 screenX, sint16 screenY, sint16 z, sint16 *mapX, sint16 *mapY, uint8 *side) { screen_get_map_xy_with_z(screenX, screenY, z, mapX, mapY); - if (*mapX == MAP_LOCATION_NULL) + if (*mapX == LOCATION_NULL) return; *side = map_get_tile_side(*mapX, *mapY); diff --git a/src/openrct2/interface/viewport.h b/src/openrct2/interface/viewport.h index 8d6aee2f80..f4eaafd667 100644 --- a/src/openrct2/interface/viewport.h +++ b/src/openrct2/interface/viewport.h @@ -130,8 +130,8 @@ void viewport_paint(rct_viewport* viewport, rct_drawpixelinfo* dpi, sint16 left, void viewport_adjust_for_map_height(sint16* x, sint16* y, sint16 *z); -rct_xy16 screen_coord_to_viewport_coord(rct_viewport *viewport, uint16 x, uint16 y); -rct_xy16 viewport_coord_to_map_coord(sint32 x, sint32 y, sint32 z); +LocationXY16 screen_coord_to_viewport_coord(rct_viewport *viewport, uint16 x, uint16 y); +LocationXY16 viewport_coord_to_map_coord(sint32 x, sint32 y, sint32 z); void screen_pos_to_map_pos(sint16 *x, sint16 *y, sint32 *direction); void show_gridlines(); diff --git a/src/openrct2/interface/viewport_interaction.c b/src/openrct2/interface/viewport_interaction.c index accb5ac7e4..a18b8453ec 100644 --- a/src/openrct2/interface/viewport_interaction.c +++ b/src/openrct2/interface/viewport_interaction.c @@ -57,7 +57,7 @@ sint32 viewport_interaction_get_item_left(sint32 x, sint32 y, viewport_interacti if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER) return info->type = VIEWPORT_INTERACTION_ITEM_NONE; - rct_xy16 mapCoord = { 0 }; + LocationXY16 mapCoord = { 0 }; get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_SPRITE & VIEWPORT_INTERACTION_MASK_RIDE & VIEWPORT_INTERACTION_MASK_PARK, &mapCoord.x, &mapCoord.y, &info->type, &info->mapElement, NULL); info->x = mapCoord.x; info->y = mapCoord.y; @@ -183,7 +183,7 @@ sint32 viewport_interaction_get_item_right(sint32 x, sint32 y, viewport_interact if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && gS6Info.editor_step != EDITOR_STEP_ROLLERCOASTER_DESIGNER) return info->type = VIEWPORT_INTERACTION_ITEM_NONE; - rct_xy16 mapCoord = { 0 }; + LocationXY16 mapCoord = { 0 }; get_map_coordinates_from_pos(x, y, ~(VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER), &mapCoord.x, &mapCoord.y, &info->type, &info->mapElement, NULL); info->x = mapCoord.x; info->y = mapCoord.y; @@ -563,7 +563,7 @@ static rct_peep *viewport_interaction_get_closest_peep(sint32 x, sint32 y, sint3 closestPeep = NULL; closestDistance = 0xFFFF; FOR_ALL_PEEPS(spriteIndex, peep) { - if (peep->sprite_left == (sint16)(uint16)0x8000) + if (peep->sprite_left == LOCATION_NULL) continue; distance = @@ -594,7 +594,7 @@ void sub_68A15E(sint32 screenX, sint32 screenY, sint16 *x, sint16 *y, sint32 *di get_map_coordinates_from_pos(screenX, screenY, VIEWPORT_INTERACTION_MASK_TERRAIN & VIEWPORT_INTERACTION_MASK_WATER, &my_x, &my_y, &interactionType, &myMapElement, &viewport); if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE) { - *x = 0x8000; + *x = LOCATION_NULL; return; } @@ -603,8 +603,8 @@ void sub_68A15E(sint32 screenX, sint32 screenY, sint16 *x, sint16 *y, sint32 *di originalZ = map_get_water_height(myMapElement) << 4; } - rct_xy16 start_vp_pos = screen_coord_to_viewport_coord(viewport, screenX, screenY); - rct_xy16 map_pos = { my_x + 16, my_y + 16 }; + LocationXY16 start_vp_pos = screen_coord_to_viewport_coord(viewport, screenX, screenY); + LocationXY16 map_pos = { my_x + 16, my_y + 16 }; for (sint32 i = 0; i < 5; i++) { sint16 z = originalZ; diff --git a/src/openrct2/interface/window.c b/src/openrct2/interface/window.c index 3d5e337379..c705f42433 100644 --- a/src/openrct2/interface/window.c +++ b/src/openrct2/interface/window.c @@ -1339,7 +1339,7 @@ void window_set_location(rct_window *w, sint32 x, sint32 y, sint32 z) */ void window_scroll_to_location(rct_window *w, sint32 x, sint32 y, sint32 z) { - rct_xyz16 location_3d = { + LocationXYZ16 location_3d = { .x = x, .y = y, .z = z @@ -1360,7 +1360,7 @@ void window_scroll_to_location(rct_window *w, sint32 x, sint32 y, sint32 z) } } - rct_xy16 map_coordinate = coordinate_3d_to_2d(&location_3d, get_current_rotation()); + LocationXY16 map_coordinate = coordinate_3d_to_2d(&location_3d, get_current_rotation()); sint32 i = 0; if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { @@ -1437,8 +1437,8 @@ void window_rotate_camera(rct_window *w, sint32 direction) screen_get_map_xy(x, y, &x, &y, &other); // other != viewport probably triggers on viewports in ride or guest window? - // x is 0x8000 if middle of viewport is obstructed by another window? - if (x == SPRITE_LOCATION_NULL || other != viewport) { + // x is LOCATION_NULL if middle of viewport is obstructed by another window? + if (x == LOCATION_NULL || other != viewport) { x = (viewport->view_width >> 1) + viewport->view_x; y = (viewport->view_height >> 1) + viewport->view_y; diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 82b21df121..d9b74bcb79 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -214,7 +214,7 @@ static sint32 news_item_get_new_history_slot() /** * Get the (x,y,z) coordinates of the subject of a news item. - * If the new item is no longer valid, return SPRITE_LOCATION_NULL in the x-coordinate + * If the new item is no longer valid, return LOCATION_NULL in the x-coordinate * * rct2: 0x0066BA74 */ @@ -230,7 +230,7 @@ void news_item_get_subject_location(sint32 type, sint32 subject, sint32 * x, sin ride = get_ride(subject); if (ride->overall_view.xy == RCT_XY8_UNDEFINED) { - *x = SPRITE_LOCATION_NULL; + *x = LOCATION_NULL; break; } *x = ride->overall_view.x * 32 + 16; @@ -242,12 +242,12 @@ void news_item_get_subject_location(sint32 type, sint32 subject, sint32 * x, sin *x = peep->x; *y = peep->y; *z = peep->z; - if (*x != SPRITE_LOCATION_NULL) + if (*x != LOCATION_NULL) break; if (peep->state != 3 && peep->state != 7) { - *x = SPRITE_LOCATION_NULL; + *x = LOCATION_NULL; break; } @@ -255,7 +255,7 @@ void news_item_get_subject_location(sint32 type, sint32 subject, sint32 * x, sin ride = get_ride(peep->current_ride); if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { - *x = SPRITE_LOCATION_NULL; + *x = LOCATION_NULL; break; } @@ -282,7 +282,7 @@ void news_item_get_subject_location(sint32 type, sint32 subject, sint32 * x, sin *z = map_element_height(*x, *y); break; default: - *x = SPRITE_LOCATION_NULL; + *x = LOCATION_NULL; break; } } diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index d8518f34cb..433222bb0c 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -30,7 +30,7 @@ #define ACTION_COOLDOWN_TIME_DEMOLISH_RIDE 1000 static rct_peep* _pickup_peep = 0; -static sint32 _pickup_peep_old_x = SPRITE_LOCATION_NULL; +static sint32 _pickup_peep_old_x = LOCATION_NULL; #ifndef DISABLE_NETWORK @@ -2594,12 +2594,12 @@ void network_set_player_last_action(uint32 index, sint32 command) gNetwork.player_list[index]->LastActionTime = platform_get_ticks(); } -rct_xyz16 network_get_player_last_action_coord(uint32 index) +LocationXYZ16 network_get_player_last_action_coord(uint32 index) { return gNetwork.player_list[index]->LastActionCoord; } -void network_set_player_last_action_coord(uint32 index, rct_xyz16 coord) +void network_set_player_last_action_coord(uint32 index, LocationXYZ16 coord) { if (index < gNetwork.player_list.size()) { gNetwork.player_list[index]->LastActionCoord = coord; @@ -3207,8 +3207,8 @@ money32 network_get_player_money_spent(uint32 index) { return MONEY(0, 0); } void network_add_player_money_spent(uint32 index, money32 cost) { } sint32 network_get_player_last_action(uint32 index, sint32 time) { return -999; } void network_set_player_last_action(uint32 index, sint32 command) { } -rct_xyz16 network_get_player_last_action_coord(uint32 index) { return {0, 0, 0}; } -void network_set_player_last_action_coord(uint32 index, rct_xyz16 coord) { } +LocationXYZ16 network_get_player_last_action_coord(uint32 index) { return {0, 0, 0}; } +void network_set_player_last_action_coord(uint32 index, LocationXYZ16 coord) { } uint32 network_get_player_commands_ran(uint32 index) { return 0; } sint32 network_get_player_index(uint8 id) { return -1; } uint8 network_get_player_group(uint32 index) { return 0; } diff --git a/src/openrct2/network/NetworkPlayer.h b/src/openrct2/network/NetworkPlayer.h index 8766a187d9..5740e191e6 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -39,9 +39,9 @@ public: uint32 CommandsRan = 0; sint32 LastAction = -999; uint32 LastActionTime = 0; - rct_xyz16 LastActionCoord = { 0 }; + LocationXYZ16 LastActionCoord = { 0 }; rct_peep* PickupPeep = 0; - sint32 PickupPeepOldX = SPRITE_LOCATION_NULL; + sint32 PickupPeepOldX = LOCATION_NULL; std::string KeyHash; uint32 LastDemolishRideTime = 0; uint32 LastPlaceSceneryTime = 0; diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 78d47831e1..4b3e1cbc0c 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -327,8 +327,8 @@ money32 network_get_player_money_spent(uint32 index); void network_add_player_money_spent(uint32 index, money32 cost); sint32 network_get_player_last_action(uint32 index, sint32 time); void network_set_player_last_action(uint32 index, sint32 command); -rct_xyz16 network_get_player_last_action_coord(uint32 index); -void network_set_player_last_action_coord(uint32 index, rct_xyz16 coord); +LocationXYZ16 network_get_player_last_action_coord(uint32 index); +void network_set_player_last_action_coord(uint32 index, LocationXYZ16 coord); uint32 network_get_player_commands_ran(uint32 index); sint32 network_get_player_index(uint8 id); uint8 network_get_player_group(uint32 index); diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 8556d1231c..ad85992811 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -104,7 +104,7 @@ static void paint_session_add_ps_to_quadrant(paint_session * session, paint_stru /** * Extracted from 0x0098196c, 0x0098197c, 0x0098198c, 0x0098199c */ -static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, rct_xyz16 offset, rct_xyz16 boundBoxSize, rct_xyz16 boundBoxOffset, uint8 rotation) +static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, LocationXYZ16 offset, LocationXYZ16 boundBoxSize, LocationXYZ16 boundBoxOffset, uint8 rotation) { if (session->NextFreePaintStruct >= session->EndOfPaintStructArray) return NULL; paint_struct * ps = &session->NextFreePaintStruct->basic; @@ -132,7 +132,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, rct_x offset.x += session->SpritePosition.x; offset.y += session->SpritePosition.y; - rct_xy16 map = coordinate_3d_to_2d(&offset, rotation); + LocationXY16 map = coordinate_3d_to_2d(&offset, rotation); ps->x = map.x; ps->y = map.y; @@ -201,7 +201,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, rct_x void paint_session_generate(paint_session * session) { rct_drawpixelinfo * dpi = session->Unk140E9A8; - rct_xy16 mapTile = + LocationXY16 mapTile = { (sint16)(dpi->x & 0xFFE0), (sint16)((dpi->y - 16) & 0xFFE0) @@ -545,69 +545,69 @@ static void paint_ps_image_with_bounding_boxes(rct_drawpixelinfo * dpi, paint_st const uint8 colour = BoundBoxDebugColours[ps->sprite_type]; const uint8 rotation = get_current_rotation(); - const rct_xyz16 frontTop = + const LocationXYZ16 frontTop = { (sint16)ps->bound_box_x_end, (sint16)ps->bound_box_y_end, (sint16)ps->bound_box_z_end }; - const rct_xy16 screenCoordFrontTop = coordinate_3d_to_2d(&frontTop, rotation); + const LocationXY16 screenCoordFrontTop = coordinate_3d_to_2d(&frontTop, rotation); - const rct_xyz16 frontBottom = + const LocationXYZ16 frontBottom = { (sint16)ps->bound_box_x_end, (sint16)ps->bound_box_y_end, (sint16)ps->bound_box_z }; - const rct_xy16 screenCoordFrontBottom = coordinate_3d_to_2d(&frontBottom, rotation); + const LocationXY16 screenCoordFrontBottom = coordinate_3d_to_2d(&frontBottom, rotation); - const rct_xyz16 leftTop = + const LocationXYZ16 leftTop = { (sint16)ps->bound_box_x, (sint16)ps->bound_box_y_end, (sint16)ps->bound_box_z_end }; - const rct_xy16 screenCoordLeftTop = coordinate_3d_to_2d(&leftTop, rotation); + const LocationXY16 screenCoordLeftTop = coordinate_3d_to_2d(&leftTop, rotation); - const rct_xyz16 leftBottom = + const LocationXYZ16 leftBottom = { (sint16)ps->bound_box_x, (sint16)ps->bound_box_y_end, (sint16)ps->bound_box_z }; - const rct_xy16 screenCoordLeftBottom = coordinate_3d_to_2d(&leftBottom, rotation); + const LocationXY16 screenCoordLeftBottom = coordinate_3d_to_2d(&leftBottom, rotation); - const rct_xyz16 rightTop = + const LocationXYZ16 rightTop = { (sint16)ps->bound_box_x_end, (sint16)ps->bound_box_y, (sint16)ps->bound_box_z_end }; - const rct_xy16 screenCoordRightTop = coordinate_3d_to_2d(&rightTop, rotation); + const LocationXY16 screenCoordRightTop = coordinate_3d_to_2d(&rightTop, rotation); - const rct_xyz16 rightBottom = + const LocationXYZ16 rightBottom = { (sint16)ps->bound_box_x_end, (sint16)ps->bound_box_y, (sint16)ps->bound_box_z }; - const rct_xy16 screenCoordRightBottom = coordinate_3d_to_2d(&rightBottom, rotation); + const LocationXY16 screenCoordRightBottom = coordinate_3d_to_2d(&rightBottom, rotation); - const rct_xyz16 backTop = + const LocationXYZ16 backTop = { (sint16)ps->bound_box_x, (sint16)ps->bound_box_y, (sint16)ps->bound_box_z_end }; - const rct_xy16 screenCoordBackTop = coordinate_3d_to_2d(&backTop, rotation); + const LocationXY16 screenCoordBackTop = coordinate_3d_to_2d(&backTop, rotation); - const rct_xyz16 backBottom = + const LocationXYZ16 backBottom = { (sint16)ps->bound_box_x, (sint16)ps->bound_box_y, (sint16)ps->bound_box_z }; - const rct_xy16 screenCoordBackBottom = coordinate_3d_to_2d(&backBottom, rotation); + const LocationXY16 screenCoordBackBottom = coordinate_3d_to_2d(&backBottom, rotation); // bottom square gfx_draw_line(dpi, screenCoordFrontBottom.x, screenCoordFrontBottom.y, screenCoordLeftBottom.x, screenCoordLeftBottom.y, colour); @@ -767,14 +767,14 @@ extern "C" uint32 image_element = image_id & 0x7FFFF; rct_g1_element *g1Element = gfx_get_g1_element(image_element); - rct_xyz16 coord_3d = + LocationXYZ16 coord_3d = { x_offset, // ax y_offset, // cx z_offset }; - rct_xyz16 boundBox = + LocationXYZ16 boundBox = { bound_box_length_x, // di bound_box_length_y, // si @@ -821,7 +821,7 @@ extern "C" ps->bound_box_z = coord_3d.z; ps->bound_box_z_end = (boundBox.z + coord_3d.z); - rct_xy16 map = coordinate_3d_to_2d(&coord_3d, rotation); + LocationXY16 map = coordinate_3d_to_2d(&coord_3d, rotation); ps->x = map.x; ps->y = map.y; @@ -903,9 +903,9 @@ extern "C" session->UnkF1AD28 = 0; session->UnkF1AD2C = NULL; - rct_xyz16 offset = { x_offset, y_offset, z_offset }; - rct_xyz16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; - rct_xyz16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; + LocationXYZ16 offset = { x_offset, y_offset, z_offset }; + LocationXYZ16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; + LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset, rotation); if (ps == NULL) { @@ -914,7 +914,7 @@ extern "C" session->UnkF1AD28 = ps; - rct_xy16 attach = + LocationXY16 attach = { (sint16)ps->bound_box_x, (sint16)ps->bound_box_y @@ -973,9 +973,9 @@ extern "C" session->UnkF1AD28 = 0; session->UnkF1AD2C = NULL; - rct_xyz16 offset = { x_offset, y_offset, z_offset }; - rct_xyz16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; - rct_xyz16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; + LocationXYZ16 offset = { x_offset, y_offset, z_offset }; + LocationXYZ16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; + LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset, rotation); if (ps == NULL) { @@ -1028,9 +1028,9 @@ extern "C" ); } - rct_xyz16 offset = { x_offset, y_offset, z_offset }; - rct_xyz16 boundBox = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; - rct_xyz16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; + LocationXYZ16 offset = { x_offset, y_offset, z_offset }; + LocationXYZ16 boundBox = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; + LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; paint_struct * ps = sub_9819_c(session, image_id, offset, boundBox, boundBoxOffset, rotation); if (ps == NULL) @@ -1148,13 +1148,13 @@ extern "C" ps->args[3] = 0; ps->y_offsets = (uint8 *)y_offsets; - const rct_xyz16 position = + const LocationXYZ16 position = { session->SpritePosition.x, session->SpritePosition.y, z }; - const rct_xy16 coord = coordinate_3d_to_2d(&position, rotation); + const LocationXY16 coord = coordinate_3d_to_2d(&position, rotation); ps->x = coord.x + offset_x; ps->y = coord.y; diff --git a/src/openrct2/paint/map_element/banner.c b/src/openrct2/paint/map_element/banner.c index 22ef66aa05..2cd3560c65 100644 --- a/src/openrct2/paint/map_element/banner.c +++ b/src/openrct2/paint/map_element/banner.c @@ -24,7 +24,7 @@ #include "../../world/scenery.h" /** rct2: 0x0098D884 */ -const rct_xy16 BannerBoundBoxes[][2] = { +const LocationXY16 BannerBoundBoxes[][2] = { {{ 1, 2}, { 1, 29}}, {{ 2, 32}, {29, 32}}, {{32, 2}, {32, 29}}, diff --git a/src/openrct2/paint/map_element/fence.c b/src/openrct2/paint/map_element/fence.c index 0dddb90e0d..5382ff49e8 100644 --- a/src/openrct2/paint/map_element/fence.c +++ b/src/openrct2/paint/map_element/fence.c @@ -50,10 +50,10 @@ static const uint8 byte_9A40CC[] = { static void fence_paint_door(paint_session * session, uint32 imageId, rct_scenery_entry * sceneryEntry, uint32 imageColourFlags, uint32 tertiaryColour, uint32 dword_141F710, - rct_xyz16 offset, - rct_xyz16 boundsR1, rct_xyz16 boundsR1_, - rct_xyz16 boundsR2, rct_xyz16 boundsR2_, - rct_xyz16 boundsL1, rct_xyz16 boundsL1_) + LocationXYZ16 offset, + LocationXYZ16 boundsR1, LocationXYZ16 boundsR1_, + LocationXYZ16 boundsR2, LocationXYZ16 boundsR2_, + LocationXYZ16 boundsL1, LocationXYZ16 boundsL1_) { if (sceneryEntry->wall.flags & WALL_SCENERY_HAS_PRIMARY_COLOUR) { imageId |= imageColourFlags; @@ -90,7 +90,7 @@ static void fence_paint_door(paint_session * session, uint32 imageId, } } -static void fence_paint_wall(paint_session * session, uint32 frameNum, const rct_scenery_entry * sceneryEntry, uint32 dword_141F710, uint32 imageColourFlags, uint32 dword_141F718, uint32 tertiaryColour, uint32 imageOffset, rct_xyz16 offset, rct_xyz16 bounds, rct_xyz16 boundsOffset) +static void fence_paint_wall(paint_session * session, uint32 frameNum, const rct_scenery_entry * sceneryEntry, uint32 dword_141F710, uint32 imageColourFlags, uint32 dword_141F718, uint32 tertiaryColour, uint32 imageOffset, LocationXYZ16 offset, LocationXYZ16 bounds, LocationXYZ16 boundsOffset) { uint32 baseImageId = sceneryEntry->image + imageOffset + frameNum; uint32 imageId = baseImageId; @@ -181,8 +181,8 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma if (sceneryEntry->wall.flags & WALL_SCENERY_IS_DOOR) { - rct_xyz16 offset; - rct_xyz16 boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_; + LocationXYZ16 offset; + LocationXYZ16 boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_; uint8 animationFrame = wall_element_get_animation_frame(map_element); // Add the direction as well animationFrame |= (map_element->properties.wall.animation & WALL_ANIMATION_FLAG_DIRECTION_BACKWARD) >> 3; @@ -191,15 +191,15 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma case 0: imageId = sceneryEntry->image + byte_9A406C[animationFrame]; - boundsR1 = (rct_xyz16) {1, 3, ah - 5}; - boundsR1_ = (rct_xyz16) {1, 1, height + 1}; - boundsR2 = (rct_xyz16) {1, 28, 3}; - boundsR2_ = (rct_xyz16) {1, 1, height + ah - 9}; + boundsR1 = (LocationXYZ16) {1, 3, ah - 5}; + boundsR1_ = (LocationXYZ16) {1, 1, height + 1}; + boundsR2 = (LocationXYZ16) {1, 28, 3}; + boundsR2_ = (LocationXYZ16) {1, 1, height + ah - 9}; - boundsL1 = (rct_xyz16) {1, 28, ah}; - boundsL1_ = (rct_xyz16) {1, 1, height + 1}; + boundsL1 = (LocationXYZ16) {1, 28, ah}; + boundsL1_ = (LocationXYZ16) {1, 1, height + 1}; - offset = (rct_xyz16) {0, 0, height}; + offset = (LocationXYZ16) {0, 0, height}; fence_paint_door(session, imageId, sceneryEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -207,15 +207,15 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma case 1: imageId = sceneryEntry->image + byte_9A408C[animationFrame]; - boundsR1 = (rct_xyz16) {3, 3, ah - 5}; - boundsR1_ = (rct_xyz16) {1, 30, height + 1}; - boundsR2 = (rct_xyz16) {29, 3, 2}; - boundsR2_ = (rct_xyz16) {1, 30, height + ah - 8}; + boundsR1 = (LocationXYZ16) {3, 3, ah - 5}; + boundsR1_ = (LocationXYZ16) {1, 30, height + 1}; + boundsR2 = (LocationXYZ16) {29, 3, 2}; + boundsR2_ = (LocationXYZ16) {1, 30, height + ah - 8}; - boundsL1 = (rct_xyz16) {29, 1, ah}; - boundsL1_ = (rct_xyz16) {2, 30, height + 1}; + boundsL1 = (LocationXYZ16) {29, 1, ah}; + boundsL1_ = (LocationXYZ16) {2, 30, height + 1}; - offset = (rct_xyz16) {1, 31, height}; + offset = (LocationXYZ16) {1, 31, height}; fence_paint_door(session, imageId, sceneryEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -223,15 +223,15 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma case 2: imageId = sceneryEntry->image + byte_9A40AC[animationFrame]; - boundsR1 = (rct_xyz16) {3, 3, ah - 5}; - boundsR1_ = (rct_xyz16) {30, 1, height + 1}; - boundsR2 = (rct_xyz16) {3, 29, 2}; - boundsR2_ = (rct_xyz16) {30, 1, height + ah - 8}; + boundsR1 = (LocationXYZ16) {3, 3, ah - 5}; + boundsR1_ = (LocationXYZ16) {30, 1, height + 1}; + boundsR2 = (LocationXYZ16) {3, 29, 2}; + boundsR2_ = (LocationXYZ16) {30, 1, height + ah - 8}; - boundsL1 = (rct_xyz16) {1, 29, ah}; - boundsL1_ = (rct_xyz16) {30, 2, height + 1}; + boundsL1 = (LocationXYZ16) {1, 29, ah}; + boundsL1_ = (LocationXYZ16) {30, 2, height + 1}; - offset = (rct_xyz16) {31, 0, height}; + offset = (LocationXYZ16) {31, 0, height}; fence_paint_door(session, imageId, sceneryEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -239,15 +239,15 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma case 3: imageId = sceneryEntry->image + byte_9A40CC[animationFrame]; - boundsR1 = (rct_xyz16) {3, 1, ah - 5}; - boundsR1_ = (rct_xyz16) {1, 1, height + 1}; - boundsR2 = (rct_xyz16) {28, 1, 3}; - boundsR2_ = (rct_xyz16) {1, 1, height + ah - 9}; + boundsR1 = (LocationXYZ16) {3, 1, ah - 5}; + boundsR1_ = (LocationXYZ16) {1, 1, height + 1}; + boundsR2 = (LocationXYZ16) {28, 1, 3}; + boundsR2_ = (LocationXYZ16) {1, 1, height + ah - 9}; - boundsL1 = (rct_xyz16) {28, 1, ah}; - boundsL1_ = (rct_xyz16) {1, 1, height + 1}; + boundsL1 = (LocationXYZ16) {28, 1, ah}; + boundsL1_ = (LocationXYZ16) {1, 1, height + 1}; - offset = (rct_xyz16) {2, 1, height}; + offset = (LocationXYZ16) {2, 1, height}; fence_paint_door(session, imageId, sceneryEntry, imageColourFlags, tertiaryColour, dword_141F710, offset, boundsR1, boundsR1_, boundsR2, boundsR2_, boundsL1, boundsL1_); break; @@ -258,7 +258,7 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma uint32 imageOffset = 0; - rct_xyz16 offset = { 0, 0, 0 }, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 }; + LocationXYZ16 offset = { 0, 0, 0 }, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 }; switch (direction) { case 0: @@ -270,9 +270,9 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma imageOffset = 1; } - offset = (rct_xyz16){0, 0, height}; - bounds = (rct_xyz16){1, 28, ah}; - boundsOffset = (rct_xyz16){1, 1, height + 1}; + offset = (LocationXYZ16){0, 0, height}; + bounds = (LocationXYZ16){1, 28, ah}; + boundsOffset = (LocationXYZ16){1, 1, height + 1}; break; case 1: @@ -294,9 +294,9 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma } } - offset = (rct_xyz16){1, 31, height}; - bounds = (rct_xyz16){29, 1, ah}; - boundsOffset = (rct_xyz16){2, 30, height + 1}; + offset = (LocationXYZ16){1, 31, height}; + bounds = (LocationXYZ16){29, 1, ah}; + boundsOffset = (LocationXYZ16){2, 30, height + 1}; break; case 2: @@ -312,9 +312,9 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma imageOffset += 6; } - offset = (rct_xyz16){31, 0, height}; - bounds = (rct_xyz16){1, 29, ah}; - boundsOffset = (rct_xyz16){30, 2, height + 1}; + offset = (LocationXYZ16){31, 0, height}; + bounds = (LocationXYZ16){1, 29, ah}; + boundsOffset = (LocationXYZ16){30, 2, height + 1}; break; case 3: @@ -326,9 +326,9 @@ void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_ma imageOffset = 0; } - offset = (rct_xyz16){2, 1, height}; - bounds = (rct_xyz16){28, 1, ah}; - boundsOffset = (rct_xyz16){1, 1, height + 1}; + offset = (LocationXYZ16){2, 1, height}; + bounds = (LocationXYZ16){28, 1, ah}; + boundsOffset = (LocationXYZ16){1, 1, height + 1}; break; } diff --git a/src/openrct2/paint/map_element/map_element.c b/src/openrct2/paint/map_element/map_element.c index 94342ac124..82dbedc247 100644 --- a/src/openrct2/paint/map_element/map_element.c +++ b/src/openrct2/paint/map_element/map_element.c @@ -241,7 +241,7 @@ static void sub_68B3FB(paint_session * session, sint32 x, sint32 y) sint32 direction = map_element_get_direction_with_offset(map_element, rotation); sint32 height = map_element->base_height * 8; - rct_xy16 dword_9DE574 = session->MapPosition; + LocationXY16 dword_9DE574 = session->MapPosition; session->CurrentlyDrawnItem = map_element; // Setup the painting of for example: the underground, signs, rides, scenery, etc. switch (map_element_get_type(map_element)) diff --git a/src/openrct2/paint/map_element/map_element.h b/src/openrct2/paint/map_element/map_element.h index a6057eef66..e966cfd416 100644 --- a/src/openrct2/paint/map_element/map_element.h +++ b/src/openrct2/paint/map_element/map_element.h @@ -87,7 +87,7 @@ extern const uint16 segment_offsets[9]; extern bool gShowSupportSegmentHeights; -extern const rct_xy16 BannerBoundBoxes[][2]; +extern const LocationXY16 BannerBoundBoxes[][2]; extern const uint8 byte_98D800[4]; diff --git a/src/openrct2/paint/map_element/path.c b/src/openrct2/paint/map_element/path.c index 9328bdb627..3d01f7bcca 100644 --- a/src/openrct2/paint/map_element/path.c +++ b/src/openrct2/paint/map_element/path.c @@ -368,7 +368,7 @@ static void sub_6A4101(paint_session * session, rct_map_element * map_element, u direction += get_current_rotation(); direction &= 3; - rct_xyz16 boundBoxOffsets = { + LocationXYZ16 boundBoxOffsets = { .x = BannerBoundBoxes[direction][0].x, .y = BannerBoundBoxes[direction][0].y, .z = height + 2 @@ -803,8 +803,8 @@ void path_paint_pole_support(paint_session * session, rct_map_element * mapEleme (((mapElement->properties.path.edges >> 4) << get_current_rotation()) >> 4); - rct_xy16 boundBoxOffset = {.x =stru_98D804[edges][0], .y = stru_98D804[edges][1]}; - rct_xy16 boundBoxSize = {.x =stru_98D804[edges][2], .y = stru_98D804[edges][3]}; + LocationXY16 boundBoxOffset = {.x =stru_98D804[edges][0], .y = stru_98D804[edges][1]}; + LocationXY16 boundBoxSize = {.x =stru_98D804[edges][2], .y = stru_98D804[edges][3]}; uint16 edi = edges | (corners << 4); @@ -904,12 +904,12 @@ void path_paint_box_support(paint_session * session, rct_map_element* mapElement uint8 edges = ((mapElement->properties.path.edges << get_current_rotation()) & 0xF) | (((mapElement->properties.path.edges & 0xF) << get_current_rotation()) >> 4); - rct_xy16 boundBoxOffset = { + LocationXY16 boundBoxOffset = { .x = stru_98D804[edges][0], .y = stru_98D804[edges][1] }; - rct_xy16 boundBoxSize = { + LocationXY16 boundBoxSize = { .x = stru_98D804[edges][2], .y = stru_98D804[edges][3] }; diff --git a/src/openrct2/paint/map_element/scenery.c b/src/openrct2/paint/map_element/scenery.c index 0c512da0ec..2e5d9eb42c 100644 --- a/src/openrct2/paint/map_element/scenery.c +++ b/src/openrct2/paint/map_element/scenery.c @@ -24,14 +24,14 @@ #include "../../world/map.h" #include "../../world/scenery.h" -static const rct_xy16 offsets[] = { +static const LocationXY16 offsets[] = { { 3, 3 }, { 3, 17 }, { 17, 3 }, { 3, 3 } }; -static const rct_xy16 lengths[] = { +static const LocationXY16 lengths[] = { { 12, 26 }, { 26, 12 }, { 12, 26 }, @@ -45,8 +45,8 @@ static const rct_xy16 lengths[] = { void scenery_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element* mapElement) { //RCT2_CALLPROC_X(0x6DFF47, 0, 0, direction, height, (sint32)mapElement, 0, 0); return; session->InteractionType = VIEWPORT_INTERACTION_ITEM_SCENERY; - rct_xyz16 boxlength; - rct_xyz16 boxoffset; + LocationXYZ16 boxlength; + LocationXYZ16 boxoffset; boxoffset.x = 0; boxoffset.y = 0; boxoffset.z = height; diff --git a/src/openrct2/paint/map_element/scenery_multiple.c b/src/openrct2/paint/map_element/scenery_multiple.c index 172faea410..48ca329c0c 100644 --- a/src/openrct2/paint/map_element/scenery_multiple.c +++ b/src/openrct2/paint/map_element/scenery_multiple.c @@ -155,8 +155,8 @@ static void scenery_multiple_sign_paint_line(paint_session * session, const utf8 } typedef struct boundbox { - rct_xy16 offset; - rct_xy16 length; + LocationXY16 offset; + LocationXY16 length; } boundbox; static const boundbox s98E3C4[] = { @@ -195,8 +195,8 @@ void scenery_multiple_paint(paint_session * session, uint8 direction, uint16 hei rct_large_scenery_tile *tile = &entry->large_scenery.tiles[ebp]; uint32 dword_F4387C = 0; image_id |= ((mapElement->properties.scenerymultiple.colour[0] & 0x1F) << 19) | ((mapElement->properties.scenerymultiple.colour[1] & 0x1F) << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; - rct_xyz16 boxlength; - rct_xyz16 boxoffset; + LocationXYZ16 boxlength; + LocationXYZ16 boxoffset; if (gTrackDesignSaveMode) { if (!track_design_save_contains_map_element(mapElement)) { ebp = 0x21700000; diff --git a/src/openrct2/paint/map_element/surface.c b/src/openrct2/paint/map_element/surface.c index fb72701aaa..8d72f0ea54 100644 --- a/src/openrct2/paint/map_element/surface.c +++ b/src/openrct2/paint/map_element/surface.c @@ -31,7 +31,7 @@ static const uint8 byte_97B444[] = { }; // rct2: 0x97B464, 0x97B474, 0x97B484, 0x97B494 -static const rct_xy16 viewport_surface_paint_data[][4] = { +static const LocationXY16 viewport_surface_paint_data[][4] = { { {32, 0}, {-32, 32}, @@ -460,8 +460,8 @@ static void viewport_surface_draw_land_side_top(paint_session * session, enum ed { registers regs; - rct_xy8 offset = {0, 0}; - rct_xy8 bounds = {0, 0}; + LocationXY8 offset = {0, 0}; + LocationXY8 bounds = {0, 0}; switch (edge) { case EDGE_TOPLEFT: regs.al = self.corner_heights.top; @@ -558,10 +558,10 @@ static void viewport_surface_draw_land_side_bottom(paint_session * session, enum { registers regs; - rct_xy8 offset = {0, 0}; - rct_xy8 bounds = {0, 0}; - rct_xy16 tunnelBounds = {1, 1}; - rct_xy16 tunnelTopBoundBoxOffset = {0, 0}; + LocationXY8 offset = {0, 0}; + LocationXY8 bounds = {0, 0}; + LocationXY16 tunnelBounds = {1, 1}; + LocationXY16 tunnelTopBoundBoxOffset = {0, 0}; tunnel_entry * tunnelArray; switch (edge) { @@ -718,8 +718,8 @@ static void viewport_surface_draw_water_side_top(paint_session * session, enum e { registers regs; - rct_xy8 offset = {0, 0}; - rct_xy8 bounds = {0, 0}; + LocationXY8 offset = {0, 0}; + LocationXY8 bounds = {0, 0}; switch (edge) { case EDGE_TOPLEFT: regs.al = self.corner_heights.top; @@ -820,10 +820,10 @@ static void viewport_surface_draw_water_side_bottom(paint_session * session, enu { registers regs; - rct_xy8 offset = {0, 0}; - rct_xy8 bounds = {0, 0}; - rct_xy16 tunnelBounds = {1, 1}; - rct_xy16 tunnelTopBoundBoxOffset = {0, 0}; + LocationXY8 offset = {0, 0}; + LocationXY8 bounds = {0, 0}; + LocationXY16 tunnelBounds = {1, 1}; + LocationXY16 tunnelTopBoundBoxOffset = {0, 0}; tunnel_entry * tunnelArray; switch (edge) { @@ -1001,7 +1001,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ uint32 terrain_type = map_element_get_terrain(mapElement); uint32 surfaceShape = viewport_surface_paint_setup_get_relative_slope(mapElement, rotation); - rct_xy16 base = { + LocationXY16 base = { .x = session->SpritePosition.x, .y = session->SpritePosition.y }; @@ -1023,8 +1023,8 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ tileDescriptors[0] = selfDescriptor; for (sint32 i = 0; i < 4; i++) { - rct_xy16 offset = viewport_surface_paint_data[i][rotation]; - rct_xy16 position = {.x = base.x + offset.x, .y = base.y + offset.y}; + LocationXY16 offset = viewport_surface_paint_data[i][rotation]; + LocationXY16 position = {.x = base.x + offset.x, .y = base.y + offset.y}; tileDescriptors[i + 1].map_element = NULL; if (position.x > 0x2000 || position.y > 0x2000) { @@ -1173,7 +1173,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && gCurrentViewportFlags & VIEWPORT_FLAG_LAND_OWNERSHIP ) { - rct_xy16 pos = session->MapPosition; + LocationXY16 pos = session->MapPosition; for (sint32 i = 0; i < MAX_PEEP_SPAWNS; ++i) { rct2_peep_spawn * spawn = &gPeepSpawns[i]; @@ -1193,7 +1193,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ assert(surfaceShape < countof(byte_97B444)); paint_attach_to_previous_ps(session, SPR_TERRAIN_SELECTION_SQUARE + byte_97B444[surfaceShape], 0, 0); } else if (mapElement->properties.surface.ownership & OWNERSHIP_AVAILABLE) { - rct_xy16 pos = session->MapPosition; + LocationXY16 pos = session->MapPosition; paint_struct * backup = session->UnkF1AD28; sint32 height2 = (map_element_height(pos.x + 16, pos.y + 16) & 0xFFFF) + 3; sub_98196C(session, SPR_LAND_OWNERSHIP_AVAILABLE, 16, 16, 1, 1, 0, height2, rotation); @@ -1208,7 +1208,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ paint_attach_to_previous_ps(session, SPR_TERRAIN_SELECTION_DOTTED + byte_97B444[surfaceShape], 0, 0); } else if (mapElement->properties.surface.ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) { paint_struct * backup = session->UnkF1AD28; - rct_xy16 pos = session->MapPosition; + LocationXY16 pos = session->MapPosition; sint32 height2 = map_element_height(pos.x + 16, pos.y + 16) & 0xFFFF; sub_98196C(session, SPR_LAND_CONSTRUCTION_RIGHTS_AVAILABLE, 16, 16, 1, 1, 0, height2 + 3, rotation); session->UnkF1AD28 = backup; @@ -1221,7 +1221,7 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) { // loc_660FB8: - rct_xy16 pos = session->MapPosition; + LocationXY16 pos = session->MapPosition; if (pos.x >= gMapSelectPositionA.x && pos.x <= gMapSelectPositionB.x && pos.y >= gMapSelectPositionA.y && @@ -1284,9 +1284,9 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ } if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) { - rct_xy16 pos = session->MapPosition; + LocationXY16 pos = session->MapPosition; - rct_xy16 * tile; + LocationXY16 * tile; for (tile = gMapSelectionTiles; tile->x != -1; tile++) { if (tile->x != pos.x || tile->y != pos.y) { continue; @@ -1412,8 +1412,8 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ sint32 bit_1, bit_8, bit_4, bit_2; - rct_xy8 offset; - rct_xy16 box_offset, box_size; + LocationXY8 offset; + LocationXY16 box_offset, box_size; uint32 image_1, image_2, image_3; switch (i) { default: @@ -1426,9 +1426,9 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ image_1 = 22872; image_2 = 22876; image_3 = 22874; - offset = (rct_xy8) {1, 31}; - box_size = (struct rct_xy16) {.x=30, .y=1}; - box_offset = (struct rct_xy16) {.x=1, .y=31}; + offset = (LocationXY8) {1, 31}; + box_size = (struct LocationXY16) {.x=30, .y=1}; + box_offset = (struct LocationXY16) {.x=1, .y=31}; break; case 1: @@ -1440,9 +1440,9 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ image_1 = 22873; image_2 = 22877; image_3 = 22875; - offset = (rct_xy8) {31, 0}; - box_size = (struct rct_xy16) {.x=1, .y=30}; - box_offset = (struct rct_xy16) {.x=31, .y=1}; + offset = (LocationXY8) {31, 0}; + box_size = (struct LocationXY16) {.x=1, .y=30}; + box_offset = (struct LocationXY16) {.x=31, .y=1}; break; case 2: @@ -1454,9 +1454,9 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ image_1 = 22872; image_2 = 22874; image_3 = 22876; - offset = (rct_xy8) {1, 0}; - box_size = (struct rct_xy16) {30, 1}; - box_offset = (struct rct_xy16) {1, 1}; + offset = (LocationXY8) {1, 0}; + box_size = (struct LocationXY16) {30, 1}; + box_offset = (struct LocationXY16) {1, 1}; // TODO: Fences on top tile get clipped after a while break; @@ -1469,9 +1469,9 @@ void surface_paint(paint_session * session, uint8 direction, uint16 height, rct_ image_1 = 22873; image_2 = 22875; image_3 = 22877; - offset = (rct_xy8) {1, 1}; - box_size = (struct rct_xy16) {1, 30}; - box_offset = (struct rct_xy16) {1, 1}; + offset = (LocationXY8) {1, 1}; + box_size = (struct LocationXY16) {1, 30}; + box_offset = (struct LocationXY16) {1, 1}; break; } diff --git a/src/openrct2/paint/paint.h b/src/openrct2/paint/paint.h index 51e4236323..364283d51b 100644 --- a/src/openrct2/paint/paint.h +++ b/src/openrct2/paint/paint.h @@ -112,9 +112,9 @@ union paint_entry { typedef struct sprite_bb { uint32 sprite_id; - rct_xyz16 offset; - rct_xyz16 bb_offset; - rct_xyz16 bb_size; + LocationXYZ16 offset; + LocationXYZ16 bb_offset; + LocationXYZ16 bb_size; } sprite_bb; typedef struct paint_struct_bound_box { @@ -154,7 +154,7 @@ typedef struct paint_session void * CurrentlyDrawnItem; paint_entry * EndOfPaintStructArray; paint_entry * NextFreePaintStruct; - rct_xy16 SpritePosition; + LocationXY16 SpritePosition; paint_struct UnkF1A4CC; paint_struct * UnkF1AD28; attached_paint_struct * UnkF1AD2C; @@ -164,7 +164,7 @@ typedef struct paint_session paint_string_struct * PSStringHead; paint_string_struct * LastPSString; paint_struct * WoodenSupportsPrependTo; - rct_xy16 MapPosition; + LocationXY16 MapPosition; tunnel_entry LeftTunnels[TUNNEL_MAX_COUNT]; uint8 LeftTunnelCount; tunnel_entry RightTunnels[TUNNEL_MAX_COUNT]; @@ -183,12 +183,12 @@ extern paint_session gPaintSession; #define gPaintStructs RCT2_ADDRESS(0x00EE788C, paint_entry) #define g_currently_drawn_item RCT2_GLOBAL(0x009DE578, void*) #define gEndOfPaintStructArray RCT2_GLOBAL(0x00EE7880, paint_entry *) -#define gPaintSpritePosition RCT2_GLOBAL(0x009DE568, rct_xy16) +#define gPaintSpritePosition RCT2_GLOBAL(0x009DE568, LocationXY16) #define gPaintInteractionType RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) #define gSupportSegments RCT2_ADDRESS(RCT2_ADDRESS_CURRENT_SUPPORT_SEGMENTS, support_height) #define gSupport RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, support_height) #define gWoodenSupportsPrependTo RCT2_GLOBAL(0x009DEA58, paint_struct *) -#define gPaintMapPosition RCT2_GLOBAL(0x009DE574, rct_xy16) +#define gPaintMapPosition RCT2_GLOBAL(0x009DE574, LocationXY16) #define gLeftTunnels RCT2_ADDRESS(0x009E3138, tunnel_entry) #define gLeftTunnelCount RCT2_GLOBAL(0x0141F56A, uint8) #define gRightTunnels RCT2_ADDRESS(0x009E30B6, tunnel_entry) diff --git a/src/openrct2/paint/supports.c b/src/openrct2/paint/supports.c index c2d9419083..30f80c3011 100644 --- a/src/openrct2/paint/supports.c +++ b/src/openrct2/paint/supports.c @@ -20,7 +20,7 @@ #include "map_element/map_element.h" /** rct2: 0x0097AF20, 0x0097AF21 */ -static const rct_xy8 loc_97AF20[] = { +static const LocationXY8 loc_97AF20[] = { {4, 4}, {28, 4}, {4, 28}, @@ -76,7 +76,7 @@ static const uint8 _97AF32[] = { }; /** rct2: 0x0097B052, 0x0097B053 */ -static const rct_xy16 loc_97B052[] = { +static const LocationXY16 loc_97B052[] = { {-15, -1}, {0, -2}, {-2, -1}, @@ -88,7 +88,7 @@ static const rct_xy16 loc_97B052[] = { }; /** rct2: 0x0097B062, 0x0097B063 */ -static const rct_xy8 _97B062[] = { +static const LocationXY8 _97B062[] = { { 18, 3 }, { 3, 18 }, { 18, 3 }, diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 0896c484df..82ac92c099 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -65,7 +65,7 @@ uint32 gNextGuestNumber; uint8 gPeepWarningThrottle[16]; -rct_xyz16 gPeepPathFindGoalPosition; +LocationXYZ16 gPeepPathFindGoalPosition; bool gPeepPathFindIgnoreForeignQueues; uint8 gPeepPathFindQueueRideIndex; // uint32 gPeepPathFindAltStationNum; @@ -81,7 +81,7 @@ static uint8 _peepPathFindFewestNumSteps; * be declared properly. */ static struct { - rct_xyz8 location; + LocationXYZ8 location; uint8 direction; } _peepPathFindHistory[16]; @@ -450,7 +450,7 @@ static const ride_rating NauseaMaximumThresholds[] = { // Locations of the spiral slide platform that a peep walks from the entrance of the ride to the // entrance of the slide. Up to 4 locations for each 4 sides that an ride entrance can be located // and 4 different rotations of the ride. 4 * 4 * 4 = 64 locations. -static const rct_xy16 SpiralSlideWalkingPath[64] = { +static const LocationXY16 SpiralSlideWalkingPath[64] = { { 56, 8 }, { 8, 8 }, { 8, 32 }, @@ -982,7 +982,7 @@ static void sub_68F41A(rct_peep * peep, sint32 index) } } - if (peep->peep_flags & PEEP_FLAGS_EXPLODE && peep->x != MAP_LOCATION_NULL) + if (peep->peep_flags & PEEP_FLAGS_EXPLODE && peep->x != LOCATION_NULL) { audio_play_sound_at_location(SOUND_CRASH, peep->x, peep->y, peep->z); @@ -1026,7 +1026,7 @@ static void sub_68F41A(rct_peep * peep, sint32 index) if (peep->var_F2 >= 18) { peep->var_F2 = 0; - if (peep->x != MAP_LOCATION_NULL) + if (peep->x != LOCATION_NULL) { uint8 thought_type = peep_assess_surroundings(peep->x & 0xFFE0, peep->y & 0xFFE0, peep->z); @@ -1660,7 +1660,7 @@ static void peep_check_cant_find_exit(rct_peep * peep) } /** rct2: 0x00981D7C, 0x00981D7E */ -static const rct_xy16 word_981D7C[4] = { { -2, 0 }, { 0, 2 }, { 2, 0 }, { 0, -2 } }; +static const LocationXY16 word_981D7C[4] = { { -2, 0 }, { 0, 2 }, { 2, 0 }, { 0, -2 } }; /** * @@ -1882,7 +1882,7 @@ void peep_update_sprite_type(rct_peep * peep) if (peep->sprite_type == PEEP_SPRITE_TYPE_BALLOON && (peep_rand() & 0xFFFF) <= 327) { bool isBalloonPopped = false; - if (peep->x != SPRITE_LOCATION_NULL) + if (peep->x != LOCATION_NULL) { if ((peep_rand() & 0xFFFF) <= 13107) { @@ -1895,7 +1895,7 @@ void peep_update_sprite_type(rct_peep * peep) peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; } - if (gClimateCurrentRainLevel != 0 && (peep->item_standard_flags & PEEP_ITEM_UMBRELLA) && peep->x != SPRITE_LOCATION_NULL) + if (gClimateCurrentRainLevel != 0 && (peep->item_standard_flags & PEEP_ITEM_UMBRELLA) && peep->x != LOCATION_NULL) { sint32 x = peep->x & 0xFFE0; sint32 y = peep->y & 0xFFE0; @@ -2012,7 +2012,7 @@ void peep_pickup(rct_peep * peep) remove_peep_from_ride(peep); invalidate_sprite_2((rct_sprite *)peep); - sprite_move(SPRITE_LOCATION_NULL, peep->y, peep->z, (rct_sprite *)peep); + sprite_move(LOCATION_NULL, peep->y, peep->z, (rct_sprite *)peep); peep_decrement_num_riders(peep); peep->state = PEEP_STATE_PICKED; peep->sub_state = 0; @@ -2030,7 +2030,7 @@ void peep_pickup_abort(rct_peep * peep, sint32 old_x) sprite_move(old_x, peep->y, peep->z + 8, (rct_sprite *)peep); invalidate_sprite_2((rct_sprite *)peep); - if (peep->x != (sint16)SPRITE_LOCATION_NULL) + if (peep->x != (sint16)LOCATION_NULL) { peep_decrement_num_riders(peep); peep->state = PEEP_STATE_FALLING; @@ -2400,7 +2400,7 @@ static void peep_try_get_up_from_sitting(rct_peep * peep) } /** rct2: 0x00981F2C, 0x00981F2E */ -static const rct_xy16 _981F2C[] = { +static const LocationXY16 _981F2C[] = { { 7, 12 }, { 12, 25 }, { 25, 20 }, { 20, 7 }, { 7, 20 }, { 20, 25 }, { 25, 12 }, { 12, 7 }, }; @@ -2848,7 +2848,7 @@ static void peep_update_ride_sub_state_0(rct_peep * peep) } /** rct2: 0x00981FD4, 0x00981FD6 */ -static const rct_xy16 _981FD4[] = { +static const LocationXY16 _981FD4[] = { { 8, 8 }, { 8, 24 }, { 24, 24 }, @@ -2956,7 +2956,7 @@ static void peep_update_ride_sub_state_1(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const rct_xy16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const LocationXY16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -3357,7 +3357,7 @@ static void peep_update_ride_sub_state_5(rct_peep * peep) vehicle->friction += seated_peep->var_41; invalidate_sprite_2((rct_sprite *)seated_peep); - sprite_move(0x2000, 0, 0, (rct_sprite *)seated_peep); + sprite_move(LOCATION_NULL, 0, 0, (rct_sprite *)seated_peep); peep_decrement_num_riders(seated_peep); seated_peep->state = PEEP_STATE_ON_RIDE; @@ -3374,7 +3374,7 @@ static void peep_update_ride_sub_state_5(rct_peep * peep) invalidate_sprite_2((rct_sprite *)vehicle); invalidate_sprite_2((rct_sprite *)peep); - sprite_move(0x2000, 0, 0, (rct_sprite *)peep); + sprite_move(LOCATION_NULL, 0, 0, (rct_sprite *)peep); peep_decrement_num_riders(peep); peep->state = PEEP_STATE_ON_RIDE; @@ -3911,7 +3911,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) peep->destination_x = 0; peep->destination_y = 0; peep->var_37 = (peep->var_37 / 4) & 0xC; - sprite_move(0x2000, y, peep->z, (rct_sprite *)peep); + sprite_move(LOCATION_NULL, y, peep->z, (rct_sprite *)peep); return; } else if ((peep->var_37 & 3) == 2) @@ -3944,7 +3944,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) x *= 32; y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const rct_xy16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const LocationXY16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -3964,7 +3964,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const rct_xy16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const LocationXY16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -3974,7 +3974,7 @@ static void peep_update_ride_sub_state_14(rct_peep * peep) } /** rct2: 0x00981F0C, 0x00981F0E */ -static const rct_xy16 _981F0C[] = { +static const LocationXY16 _981F0C[] = { { 25, 56 }, { 56, 7 }, { 7, -24 }, @@ -3982,7 +3982,7 @@ static const rct_xy16 _981F0C[] = { }; /** rct2: 0x00981F1C, 0x00981F1E */ -static const rct_xy16 _981F1C[] = { +static const LocationXY16 _981F1C[] = { { 8, 56 }, { 56, 24 }, { 24, -24 }, @@ -4072,7 +4072,7 @@ static void peep_update_ride_sub_state_15(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const rct_xy16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const LocationXY16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -4116,7 +4116,7 @@ static void peep_update_ride_sub_state_16(rct_peep * peep) y *= 32; assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); - const rct_xy16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; + const LocationXY16 slidePlatformDestination = SpiralSlideWalkingPath[peep->var_37]; x += slidePlatformDestination.x; y += slidePlatformDestination.y; @@ -4759,7 +4759,7 @@ static bool peep_update_fixing_sub_state_1(bool firstRun, rct_peep * peep, Ride vehicle = GET_VEHICLE(vehicle->prev_vehicle_on_ride); } - rct_xy16 offset = word_981D6C[peep->direction]; + LocationXY16 offset = word_981D6C[peep->direction]; peep->destination_x = (offset.x * -12) + vehicle->x; peep->destination_y = (offset.y * -12) + vehicle->y; peep->destination_tolerence = 2; @@ -4859,7 +4859,7 @@ static bool peep_update_fixing_sub_state_6(bool firstRun, rct_peep * peep, Ride } /** rct2: 0x00992A3C */ -static const rct_xy16 _992A3C[] = { +static const LocationXY16 _992A3C[] = { { -12, 0 }, { 0, 12 }, { 12, 0 }, @@ -4880,7 +4880,7 @@ static bool peep_update_fixing_sub_state_7(bool firstRun, rct_peep * peep, Ride return true; } - rct_xy8 stationPosition = ride->station_starts[peep->current_ride_station]; + LocationXY8 stationPosition = ride->station_starts[peep->current_ride_station]; if (stationPosition.xy == RCT_XY8_UNDEFINED) { return true; @@ -4898,7 +4898,7 @@ static bool peep_update_fixing_sub_state_7(bool firstRun, rct_peep * peep, Ride } sint32 direction = map_element_get_direction(mapElement); - rct_xy16 offset = _992A3C[direction]; + LocationXY16 offset = _992A3C[direction]; stationX += 16 + offset.x; if (offset.x == 0) @@ -4971,7 +4971,7 @@ static bool peep_update_fixing_sub_state_9(bool firstRun, rct_peep * peep, Ride return true; } - rct_xy8 stationPosition = ride->station_starts[peep->current_ride_station]; + LocationXY8 stationPosition = ride->station_starts[peep->current_ride_station]; if (stationPosition.xy == RCT_XY8_UNDEFINED) { return true; @@ -5011,7 +5011,7 @@ static bool peep_update_fixing_sub_state_9(bool firstRun, rct_peep * peep, Ride uint16 destinationX = input.x + 16; uint16 destinationY = input.y + 16; - rct_xy16 offset = _992A3C[direction]; + LocationXY16 offset = _992A3C[direction]; destinationX -= offset.x; if (offset.x == 0) @@ -5126,7 +5126,7 @@ static bool peep_update_fixing_sub_state_12(bool firstRun, rct_peep * peep, Ride if (!firstRun) { - rct_xy8 stationPosition = ride->exits[peep->current_ride_station]; + LocationXY8 stationPosition = ride->exits[peep->current_ride_station]; if (stationPosition.xy == RCT_XY8_UNDEFINED) { stationPosition = ride->entrances[peep->current_ride_station]; @@ -5143,7 +5143,7 @@ static bool peep_update_fixing_sub_state_12(bool firstRun, rct_peep * peep, Ride stationX += 16; stationY += 16; - rct_xy16 direction = word_981D6C[peep->direction]; + LocationXY16 direction = word_981D6C[peep->direction]; stationX += direction.x * 20; stationY += direction.y * 20; @@ -5218,7 +5218,7 @@ static bool peep_update_fixing_sub_state_14(bool firstRun, rct_peep * peep, Ride if (!firstRun) { - rct_xy8 exitPosition = ride->exits[peep->current_ride_station]; + LocationXY8 exitPosition = ride->exits[peep->current_ride_station]; if (exitPosition.xy == RCT_XY8_UNDEFINED) { exitPosition = ride->entrances[peep->current_ride_station]; @@ -5238,7 +5238,7 @@ static bool peep_update_fixing_sub_state_14(bool firstRun, rct_peep * peep, Ride exitX += 16; exitY += 16; - rct_xy16 ebx_direction = word_981D6C[peep->direction]; + LocationXY16 ebx_direction = word_981D6C[peep->direction]; exitX -= ebx_direction.x * 19; exitY -= ebx_direction.y * 19; @@ -5414,7 +5414,7 @@ static void peep_update_queuing(rct_peep * peep) } /** rct2: 0x009929C8 */ -static const rct_xy16 _9929C8[] = { +static const LocationXY16 _9929C8[] = { { 28, 28 }, { 28, 4 }, { 20, 4 }, { 20, 28 }, { 12, 28 }, { 12, 4 }, { 4, 4 }, { 4, 28 }, }; @@ -5972,7 +5972,7 @@ static sint32 peep_update_walking_find_bench(rct_peep * peep) } /** rct2: 0x00992A4C */ -static const rct_xy16 _992A4C[] = { +static const LocationXY16 _992A4C[] = { { 11, 16 }, { 16, 21 }, { 21, 16 }, @@ -6144,7 +6144,7 @@ static void peep_update_walking_break_scenery(rct_peep * peep) if (inner_peep->staff_type != STAFF_TYPE_SECURITY) continue; - if (inner_peep->x == SPRITE_LOCATION_NULL) + if (inner_peep->x == LOCATION_NULL) continue; sint32 x_diff = abs(inner_peep->x - peep->x); @@ -6740,7 +6740,7 @@ static void peep_update_answering(rct_peep * peep) } /** rct2: 0x00992A5C */ -static const rct_xy16 _992A5C[] = { +static const LocationXY16 _992A5C[] = { { 3, 16 }, { 16, 29 }, { 29, 16 }, { 16, 3 }, { 3, 29 }, { 29, 29 }, { 29, 3 }, { 3, 3 }, }; @@ -7010,7 +7010,7 @@ static void peep_update_patrolling(rct_peep * peep) // clang-format off /** rct2: 0x00981F4C, 0x00981F4E */ -static const rct_xy16 _981F4C[] = { +static const LocationXY16 _981F4C[] = { { 7, 5 }, { 5, 25 }, { 25, 5 }, @@ -7705,7 +7705,7 @@ void peep_update_crowd_noise() FOR_ALL_GUESTS(spriteIndex, peep) { - if (peep->sprite_left == (sint16)(uint16)0x8000) + if (peep->sprite_left == LOCATION_NULL) continue; if (viewport->view_x > peep->sprite_right) continue; @@ -9938,8 +9938,8 @@ static bool path_is_thin_junction(rct_map_element * path, sint16 x, sint16 y, ui */ static void peep_pathfind_heuristic_search(sint16 x, sint16 y, uint8 z, rct_peep * peep, rct_map_element * currentMapElement, bool inPatrolArea, uint8 counter, uint16 * endScore, sint32 test_edge, - uint8 * endJunctions, rct_xyz8 junctionList[16], uint8 directionList[16], - rct_xyz8 * endXYZ, uint8 * endSteps) + uint8 * endJunctions, LocationXYZ8 junctionList[16], uint8 directionList[16], + LocationXYZ8 * endXYZ, uint8 * endSteps) { uint8 searchResult = PATH_SEARCH_FAILED; @@ -10529,7 +10529,7 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe // Used to allow walking through no entry banners _peepPathFindIsStaff = (peep->type == PEEP_TYPE_STAFF); - rct_xyz8 goal = { (uint8)(gPeepPathFindGoalPosition.x >> 5), + LocationXYZ8 goal = { (uint8)(gPeepPathFindGoalPosition.x >> 5), (uint8)(gPeepPathFindGoalPosition.y >> 5), (uint8)(gPeepPathFindGoalPosition.z) }; @@ -10693,9 +10693,9 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 uint8 bestJunctions = 0; - rct_xyz8 bestJunctionList[16] = { 0 }; + LocationXYZ8 bestJunctionList[16] = { 0 }; uint8 bestDirectionList[16] = { 0 }; - rct_xyz8 bestXYZ = { 0, 0, 0 }; + LocationXYZ8 bestXYZ = { 0, 0, 0 }; if (gPathFindDebug) { @@ -10740,7 +10740,7 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe uint16 score = 0xFFFF; /* Variable endXYZ contains the end location of the * search path. */ - rct_xyz8 endXYZ; + LocationXYZ8 endXYZ; endXYZ.x = 0; endXYZ.y = 0; endXYZ.z = 0; @@ -10755,7 +10755,7 @@ sint32 peep_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep * pe * In the future these could be used to visualise the * pathfinding on the map. */ uint8 endJunctions = 0; - rct_xyz8 endJunctionList[16] = { 0 }; + LocationXYZ8 endJunctionList[16] = { 0 }; uint8 endDirectionList[16] = { 0 }; bool inPatrolArea = false; @@ -10900,7 +10900,7 @@ static uint8 get_nearest_park_entrance_index(uint16 x, uint16 y) uint16 nearestDist = 0xFFFF; for (uint8 i = 0; i < MAX_PARK_ENTRANCES; i++) { - if (gParkEntrances[i].x == MAP_LOCATION_NULL) + if (gParkEntrances[i].x == LOCATION_NULL) continue; uint16 dist = abs(gParkEntrances[i].x - x) + abs(gParkEntrances[i].y - y); @@ -11014,7 +11014,7 @@ static sint32 guest_path_find_park_entrance(rct_peep * peep, rct_map_element * m // Resolves already-corrupt guests (e.g. loaded from save) if (peep->peep_flags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN && - (peep->current_ride >= 4 || gParkEntrances[peep->current_ride].x == MAP_LOCATION_NULL)) + (peep->current_ride >= 4 || gParkEntrances[peep->current_ride].x == LOCATION_NULL)) { peep->peep_flags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN); } @@ -11025,7 +11025,7 @@ static sint32 guest_path_find_park_entrance(rct_peep * peep, rct_map_element * m uint16 nearestDist = 0xFFFF; for (entranceNum = 0; entranceNum < MAX_PARK_ENTRANCES; ++entranceNum) { - if (gParkEntrances[entranceNum].x == MAP_LOCATION_NULL) + if (gParkEntrances[entranceNum].x == LOCATION_NULL) continue; uint16 dist = abs(gParkEntrances[entranceNum].x - peep->next_x) + abs(gParkEntrances[entranceNum].y - peep->next_y); @@ -11079,7 +11079,7 @@ static sint32 guest_path_find_park_entrance(rct_peep * peep, rct_map_element * m */ static void get_ride_queue_end(sint16 * x, sint16 * y, sint16 * z) { - rct_xy16 result = { 0, 0 }; + LocationXY16 result = { 0, 0 }; rct_map_element * mapElement = map_get_first_element_at(*x / 32, *y / 32); if (mapElement == NULL) @@ -11479,7 +11479,7 @@ static sint32 guest_path_finding(rct_peep * peep) closestStationNum = bitscanforward(entranceStations); } - rct_xy8 entranceXY; + LocationXY8 entranceXY; if (numEntranceStations == 0) entranceXY = ride->station_starts[closestStationNum]; // closestStationNum is always 0 here. else @@ -12401,7 +12401,7 @@ void peep_reset_pathfind_goal(rct_peep * peep) static bool peep_has_valid_xy(rct_peep * peep) { - if (peep->x != MAP_LOCATION_NULL) + if (peep->x != LOCATION_NULL) { if (peep->x < (256 * 32) && peep->y < (256 * 32)) { @@ -12985,7 +12985,7 @@ bool loc_690FD0(rct_peep * peep, uint8 * rideToView, uint8 * rideSeatToView, rct */ static sint32 peep_get_height_on_slope(rct_peep * peep, sint32 x, sint32 y) { - if (x == MAP_LOCATION_NULL) + if (x == LOCATION_NULL) return 0; if (peep->next_var_29 & 0x18) @@ -13457,7 +13457,7 @@ static void peep_pick_ride_to_go_on(rct_peep * peep) return; if (peep_has_food(peep)) return; - if (peep->x == MAP_LOCATION_NULL) + if (peep->x == LOCATION_NULL) return; for (uint32 i = 0; i < Util::CountOf(_peepRideConsideration); i++) @@ -13590,7 +13590,7 @@ static void peep_head_for_nearest_ride_type(rct_peep * peep, sint32 rideType) } if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK) return; - if (peep->x == MAP_LOCATION_NULL) + if (peep->x == LOCATION_NULL) return; if (peep->guest_heading_to_ride_id != 255) { @@ -13716,7 +13716,7 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep * peep, sint32 rideTy } if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK) return; - if (peep->x == MAP_LOCATION_NULL) + if (peep->x == LOCATION_NULL) return; if (peep->guest_heading_to_ride_id != 255) { @@ -14293,7 +14293,7 @@ void peep_autoposition(rct_peep * newPeep) uint8 i; for (i = 0; i < MAX_PARK_ENTRANCES; ++i) { - if (gParkEntrances[i].x != SPRITE_LOCATION_NULL) + if (gParkEntrances[i].x != LOCATION_NULL) ++count; } @@ -14302,7 +14302,7 @@ void peep_autoposition(rct_peep * newPeep) uint32 rand = scenario_rand_max(count); for (i = 0; i < MAX_PARK_ENTRANCES; ++i) { - if (gParkEntrances[i].x != SPRITE_LOCATION_NULL) + if (gParkEntrances[i].x != LOCATION_NULL) { if (rand == 0) break; @@ -14385,7 +14385,7 @@ static void peep_release_balloon(rct_peep * peep, sint16 spawn_height) { peep->item_standard_flags &= ~PEEP_ITEM_BALLOON; - if (peep->sprite_type == PEEP_SPRITE_TYPE_BALLOON && peep->x != MAP_LOCATION_NULL) + if (peep->sprite_type == PEEP_SPRITE_TYPE_BALLOON && peep->x != LOCATION_NULL) { create_balloon(peep->x, peep->y, spawn_height, peep->balloon_colour, false); peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index c045e5f193..58464753db 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -601,8 +601,8 @@ typedef struct rct_peep }; uint8 photo1_ride_ref; // 0xC7 uint32 peep_flags; // 0xC8 - rct_xyzd8 pathfind_goal; // 0xCC - rct_xyzd8 pathfind_history[4]; // 0xD0 + LocationXYZD8 pathfind_goal; // 0xCC + LocationXYZD8 pathfind_history[4]; // 0xD0 uint8 no_action_frame_no; // 0xE0 // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc uint8 litter_count; // 0xE1 @@ -739,7 +739,7 @@ extern uint32 gNextGuestNumber; extern uint8 gPeepWarningThrottle[16]; -extern rct_xyz16 gPeepPathFindGoalPosition; +extern LocationXYZ16 gPeepPathFindGoalPosition; extern bool gPeepPathFindIgnoreForeignQueues; extern uint8 gPeepPathFindQueueRideIndex; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index eec663c50a..efb56866af 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -156,7 +156,7 @@ static inline void staff_autoposition_new_staff_member(rct_peep * newPeep) uint8 i; for (i = 0; i < MAX_PARK_ENTRANCES; ++i) { - if (gParkEntrances[i].x != SPRITE_LOCATION_NULL) + if (gParkEntrances[i].x != LOCATION_NULL) ++count; } @@ -165,7 +165,7 @@ static inline void staff_autoposition_new_staff_member(rct_peep * newPeep) uint32 rand = scenario_rand_max(count); for (i = 0; i < MAX_PARK_ENTRANCES; ++i) { - if (gParkEntrances[i].x != SPRITE_LOCATION_NULL) + if (gParkEntrances[i].x != LOCATION_NULL) { if (rand == 0) break; @@ -578,7 +578,7 @@ uint16 hire_new_staff_member(uint8 staffType) sint32 command_x, ebx, command_y, command_z, esi, new_sprite_index, ebp; command_y = command_z = esi = new_sprite_index = ebp = 0; - command_x = 0x8000; + command_x = LOCATION_NULL; sint32 autoposition = gConfigGeneral.auto_staff_placement; if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) @@ -931,7 +931,7 @@ static uint8 staff_handyman_direction_to_nearest_litter(rct_peep * peep) return 0xFF; } - rct_xy16 litterTile = { static_cast(nearestLitter->x & 0xFFE0), static_cast(nearestLitter->y & 0xFFE0) }; + LocationXY16 litterTile = { static_cast(nearestLitter->x & 0xFFE0), static_cast(nearestLitter->y & 0xFFE0) }; if (!staff_is_location_in_patrol(peep, litterTile.x, litterTile.y)) { @@ -955,7 +955,7 @@ static uint8 staff_handyman_direction_to_nearest_litter(rct_peep * peep) nextDirection = x_diff < 0 ? 0 : 2; } - rct_xy16 nextTile = { static_cast((nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x), + LocationXY16 nextTile = { static_cast((nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x), static_cast((nearestLitter->y & 0xFFE0) - TileDirectionDelta[nextDirection].y) }; sint16 nextZ = ((peep->z + 8) & 0xFFF0) / 8; @@ -1026,7 +1026,7 @@ static uint8 staff_handyman_direction_to_uncut_grass(rct_peep * peep, uint8 vali continue; } - rct_xy16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[chosenDirection].x), + LocationXY16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[chosenDirection].x), static_cast(peep->next_y + TileDirectionDelta[chosenDirection].y) }; if (chosenTile.x > 0x1FFF || chosenTile.y > 0x1FFF) @@ -1061,7 +1061,7 @@ static sint32 staff_handyman_direction_rand_surface(rct_peep * peep, uint8 valid if (!(validDirections & (1 << direction))) continue; - rct_xy16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), + LocationXY16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), static_cast(peep->next_y + TileDirectionDelta[direction].y) }; if (map_surface_is_blocked(chosenTile.x, chosenTile.y)) @@ -1150,7 +1150,7 @@ static sint32 staff_path_finding_handyman(rct_peep * peep) // countof(TileDirectionDelta) assert(direction < 8); - rct_xy16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), + LocationXY16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), static_cast(peep->next_y + TileDirectionDelta[direction].y) }; while (chosenTile.x > 0x1FFF || chosenTile.y > 0x1FFF) @@ -1199,7 +1199,7 @@ static uint8 staff_direction_surface(rct_peep * peep, uint8 initialDirection) if (fence_in_the_way(peep->next_x, peep->next_y, peep->next_z, peep->next_z + 4, direction ^ (1 << 1)) == true) continue; - rct_xy16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), + LocationXY16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), static_cast(peep->next_y + TileDirectionDelta[direction].y) }; if (map_surface_is_blocked(chosenTile.x, chosenTile.y) == false) @@ -1223,13 +1223,13 @@ static uint8 staff_mechanic_direction_surface(rct_peep * peep) Ride * ride = get_ride(peep->current_ride); - rct_xy8 location = ride->exits[peep->current_ride_station]; + LocationXY8 location = ride->exits[peep->current_ride_station]; if (location.xy == RCT_XY8_UNDEFINED) { location = ride->entrances[peep->current_ride_station]; } - rct_xy16 chosenTile = { static_cast(location.x * 32), static_cast(location.y * 32) }; + LocationXY16 chosenTile = { static_cast(location.x * 32), static_cast(location.y * 32) }; sint16 x_diff = chosenTile.x - peep->x; sint16 y_diff = chosenTile.y - peep->y; @@ -1321,13 +1321,13 @@ static uint8 staff_mechanic_direction_path(rct_peep * peep, uint8 validDirection /* Find location of the exit for the target ride station * or if the ride has no exit, the entrance. */ - rct_xy8 location = ride->exits[peep->current_ride_station]; + LocationXY8 location = ride->exits[peep->current_ride_station]; if (location.xy == RCT_XY8_UNDEFINED) { location = ride->entrances[peep->current_ride_station]; } - rct_xy16 chosenTile = { static_cast(location.x * 32), static_cast(location.y * 32) }; + LocationXY16 chosenTile = { static_cast(location.x * 32), static_cast(location.y * 32) }; gPeepPathFindGoalPosition.x = chosenTile.x; gPeepPathFindGoalPosition.y = chosenTile.y; @@ -1410,7 +1410,7 @@ static sint32 staff_path_finding_mechanic(rct_peep * peep) // countof(TileDirectionDelta) assert(direction < 8); - rct_xy16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), + LocationXY16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), static_cast(peep->next_y + TileDirectionDelta[direction].y) }; while (chosenTile.x > 0x1FFF || chosenTile.y > 0x1FFF) @@ -1495,7 +1495,7 @@ static sint32 staff_path_finding_misc(rct_peep * peep) direction = staff_direction_path(peep, validDirections, pathElement); } - rct_xy16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), + LocationXY16 chosenTile = { static_cast(peep->next_x + TileDirectionDelta[direction].x), static_cast(peep->next_y + TileDirectionDelta[direction].y) }; while (chosenTile.x > 0x1FFF || chosenTile.y > 0x1FFF) @@ -1524,7 +1524,7 @@ static void staff_entertainer_update_nearby_peeps(rct_peep * peep) FOR_ALL_GUESTS(spriteIndex, guest) { - if (guest->x == SPRITE_LOCATION_NULL) + if (guest->x == LOCATION_NULL) continue; sint16 z_dist = abs(peep->z - guest->z); diff --git a/src/openrct2/rct1.h b/src/openrct2/rct1.h index e7a8b53570..5c44ef8627 100644 --- a/src/openrct2/rct1.h +++ b/src/openrct2/rct1.h @@ -68,14 +68,14 @@ typedef struct rct1_ride { uint16 name; // 0x022 uint16 name_argument_ride; // 0x024 uint16 name_argument_number; // 0x026 - rct_xy8 overall_view; // 0x028 - rct_xy8 station_starts[RCT12_MAX_STATIONS_PER_RIDE]; // 0x02A + LocationXY8 overall_view; // 0x028 + LocationXY8 station_starts[RCT12_MAX_STATIONS_PER_RIDE]; // 0x02A uint8 station_height[RCT12_MAX_STATIONS_PER_RIDE]; // 0x032 uint8 station_length[RCT12_MAX_STATIONS_PER_RIDE]; // 0x036 uint8 station_light[RCT12_MAX_STATIONS_PER_RIDE]; // 0x03A uint8 station_depart[RCT12_MAX_STATIONS_PER_RIDE]; // 0x03E - rct_xy8 entrance[RCT12_MAX_STATIONS_PER_RIDE]; // 0x042 - rct_xy8 exit[RCT12_MAX_STATIONS_PER_RIDE]; // 0x04A + LocationXY8 entrance[RCT12_MAX_STATIONS_PER_RIDE]; // 0x042 + LocationXY8 exit[RCT12_MAX_STATIONS_PER_RIDE]; // 0x04A uint16 last_peep_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x052 uint8 num_peeps_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x05A uint16 vehicles[RCT1_MAX_TRAINS_PER_RIDE]; // 0x05E @@ -91,7 +91,7 @@ typedef struct rct1_ride { uint8 max_waiting_time; // 0x07F uint8 operation_option; // 0x080 uint8 boat_hire_return_direction; // 0x081 - rct_xy8 boat_hire_return_position; // 0x082 + LocationXY8 boat_hire_return_position; // 0x082 uint8 data_logging_index; // 0x084 uint8 special_track_elements; // 0x085 uint16 unk_86; // 0x086 @@ -111,7 +111,7 @@ typedef struct rct1_ride { uint32 testing_flags; // 0x0B8 // x y map location of the current track piece during a test // this is to prevent counting special tracks multiple times - rct_xy8 cur_test_track_location; // 0x0BC + LocationXY8 cur_test_track_location; // 0x0BC // Next 3 variables are related (XXXX XYYY ZZZa aaaa) uint16 turn_count_default; // 0x0BE X = current turn count uint16 turn_count_banked; // 0x0C0 @@ -141,7 +141,7 @@ typedef struct rct1_ride { sint16 unk_E4; // 0x0E4 sint16 unk_E6; // 0x0E6 money16 price; // 0x0E8 - rct_xy8 chairlift_bullwheel_location[2]; // 0x0EA + LocationXY8 chairlift_bullwheel_location[2]; // 0x0EA uint8 chairlift_bullwheel_z[2]; // 0x0EE union { rating_tuple ratings; @@ -289,7 +289,7 @@ typedef struct rct1_vehicle { union { sint16 track_direction; // 0x36 (0000 0000 0000 0011) sint16 track_type; // 0x36 (0000 0011 1111 1100) - rct_xy8 boat_location; // 0x36 + LocationXY8 boat_location; // 0x36 }; uint16 track_x; // 0x38 uint16 track_y; // 0x3A @@ -485,8 +485,8 @@ typedef struct rct1_peep { }; uint8 photo1_ride_ref; // 0xC7 uint32 peep_flags; // 0xC8 - rct_xyzd8 pathfind_goal; // 0xCC - rct_xyzd8 pathfind_history[4]; // 0xD0 + LocationXYZD8 pathfind_goal; // 0xCC + LocationXYZD8 pathfind_history[4]; // 0xD0 uint8 no_action_frame_no; // 0xE0 // 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc uint8 litter_count; // 0xE1 diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index da497159c7..9d675231f2 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1073,7 +1073,7 @@ private: if (_s4.sprites[i].unknown.sprite_identifier == SPRITE_IDENTIFIER_VEHICLE) { rct1_vehicle * srcVehicle = &_s4.sprites[i].vehicle; - if (srcVehicle->x != SPRITE_LOCATION_NULL) + if (srcVehicle->x != LOCATION_NULL) { rct_vehicle * vehicle = (rct_vehicle *)create_sprite(SPRITE_IDENTIFIER_VEHICLE); spriteIndexMap[i] = vehicle->sprite_index; @@ -2543,7 +2543,7 @@ private: { for (size_t i = 0; i < Util::CountOf(gParkEntrances); i++) { - gParkEntrances[i].x = MAP_LOCATION_NULL; + gParkEntrances[i].x = LOCATION_NULL; } uint8 entranceIndex = 0; @@ -2656,11 +2656,11 @@ private: } } - void FixLandOwnershipTiles(std::initializer_list tiles) + void FixLandOwnershipTiles(std::initializer_list tiles) { rct_map_element * currentElement; - for (const rct_xy8 * tile = tiles.begin(); tile != tiles.end(); ++tile) + for (const LocationXY8 * tile = tiles.begin(); tile != tiles.end(); ++tile) { currentElement = map_get_surface_element_at((*tile).x, (*tile).y); currentElement->properties.surface.ownership |= OWNERSHIP_AVAILABLE; diff --git a/src/openrct2/rct2.h b/src/openrct2/rct2.h index 7af9ab7a2d..6dc248f5b7 100644 --- a/src/openrct2/rct2.h +++ b/src/openrct2/rct2.h @@ -73,16 +73,16 @@ typedef struct rct2_ride { uint16 name_arguments_number; // 0x04E }; }; - rct_xy8 overall_view; // 0x050 - rct_xy8 station_starts[RCT12_MAX_STATIONS_PER_RIDE]; // 0x052 + LocationXY8 overall_view; // 0x050 + LocationXY8 station_starts[RCT12_MAX_STATIONS_PER_RIDE]; // 0x052 uint8 station_heights[RCT12_MAX_STATIONS_PER_RIDE]; // 0x05A uint8 station_length[RCT12_MAX_STATIONS_PER_RIDE]; // 0x05E uint8 station_depart[RCT12_MAX_STATIONS_PER_RIDE]; // 0x062 // ride->vehicle index for current train waiting for passengers // at station uint8 train_at_station[RCT12_MAX_STATIONS_PER_RIDE]; // 0x066 - rct_xy8 entrances[RCT12_MAX_STATIONS_PER_RIDE]; // 0x06A - rct_xy8 exits[RCT12_MAX_STATIONS_PER_RIDE]; // 0x072 + LocationXY8 entrances[RCT12_MAX_STATIONS_PER_RIDE]; // 0x06A + LocationXY8 exits[RCT12_MAX_STATIONS_PER_RIDE]; // 0x072 uint16 last_peep_in_queue[RCT12_MAX_STATIONS_PER_RIDE]; // 0x07A uint8 pad_082[RCT12_MAX_STATIONS_PER_RIDE]; // 0x082, Used to be number of peeps in queue in RCT1, but this has moved. uint16 vehicles[RCT2_MAX_VEHICLES_PER_RIDE]; // 0x086, Points to the first car in the train @@ -108,7 +108,7 @@ typedef struct rct2_ride { }; uint8 boat_hire_return_direction; // 0x0D1 - rct_xy8 boat_hire_return_position; // 0x0D2 + LocationXY8 boat_hire_return_position; // 0x0D2 uint8 measurement_index; // 0x0D4 // bits 0 through 4 are the number of helix sections // bit 5: spinning tunnel, water splash, or rapids @@ -134,7 +134,7 @@ typedef struct rct2_ride { uint32 testing_flags; // 0x108 // x y map location of the current track piece during a test // this is to prevent counting special tracks multiple times - rct_xy8 cur_test_track_location; // 0x10C + LocationXY8 cur_test_track_location; // 0x10C // Next 3 variables are related (XXXX XYYY ZZZa aaaa) uint16 turn_count_default; // 0x10E X = current turn count uint16 turn_count_banked; // 0x110 @@ -163,7 +163,7 @@ typedef struct rct2_ride { // Customer count in the last 10 * 960 game ticks (sliding window) uint16 num_customers[RCT2_CUSTOMER_HISTORY_SIZE]; // 0x124 money16 price; // 0x138 - rct_xy8 chairlift_bullwheel_location[2]; // 0x13A + LocationXY8 chairlift_bullwheel_location[2]; // 0x13A uint8 chairlift_bullwheel_z[2]; // 0x13E union { rating_tuple ratings; // 0x140 diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index d63149c7df..b254f18561 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -53,9 +53,9 @@ typedef struct map_backup rct_track_td6 * gActiveTrackDesign; bool gTrackDesignSceneryToggle; -rct_xyz16 gTrackPreviewMin; -rct_xyz16 gTrackPreviewMax; -rct_xyz16 gTrackPreviewOrigin; +LocationXYZ16 gTrackPreviewMin; +LocationXYZ16 gTrackPreviewMax; +LocationXYZ16 gTrackPreviewOrigin; bool byte_9D8150; static uint8 _trackDesignPlaceOperation; @@ -644,7 +644,7 @@ void track_design_mirror(rct_track_td6 * td6) static void track_design_add_selection_tile(sint16 x, sint16 y) { - rct_xy16 * selectionTile = gMapSelectionTiles; + LocationXY16 * selectionTile = gMapSelectionTiles; for (; selectionTile->x != -1; selectionTile++) { if (selectionTile->x == x && selectionTile->y == y) @@ -695,7 +695,7 @@ track_design_place_scenery(rct_td6_scenery_element * scenery_start, uint8 rideIn for (rct_td6_scenery_element * scenery = scenery_start; scenery->scenery_object.end_flag != 0xFF; scenery++) { uint8 rotation = _currentTrackPieceDirection; - rct_xy8 tile = {(uint8) (originX / 32), (uint8) (originY / 32)}; + LocationXY8 tile = {(uint8) (originX / 32), (uint8) (originY / 32)}; switch (rotation & 3) { case MAP_ELEMENT_DIRECTION_WEST: @@ -716,13 +716,13 @@ track_design_place_scenery(rct_td6_scenery_element * scenery_start, uint8 rideIn break; } - rct_xy16 mapCoord = {(sint16) (tile.x * 32), (sint16) (tile.y * 32)}; + LocationXY16 mapCoord = {(sint16) (tile.x * 32), (sint16) (tile.y * 32)}; track_design_update_max_min_coordinates(mapCoord.x, mapCoord.y, originZ); if (_trackDesignPlaceOperation == PTD_OPERATION_DRAW_OUTLINES && mode == 0) { uint8 new_tile = 1; - rct_xy16 * selectionTile = gMapSelectionTiles; + LocationXY16 * selectionTile = gMapSelectionTiles; for (; selectionTile->x != -1; selectionTile++) { if (selectionTile->x == tile.x && selectionTile->y == tile.y) @@ -1173,7 +1173,7 @@ static sint32 track_design_place_maze(rct_track_td6 * td6, sint16 x, sint16 y, s for (; maze_element->all != 0; maze_element++) { uint8 rotation = _currentTrackPieceDirection & 3; - rct_xy16 mapCoord = {(sint16) (maze_element->x * 32), (sint16) (maze_element->y * 32)}; + LocationXY16 mapCoord = {(sint16) (maze_element->x * 32), (sint16) (maze_element->y * 32)}; rotate_map_coordinates(&mapCoord.x, &mapCoord.y, rotation); mapCoord.x += x; mapCoord.y += y; @@ -1391,7 +1391,7 @@ static bool track_design_place_ride(rct_track_td6 * td6, sint16 x, sint16 y, sin case PTD_OPERATION_DRAW_OUTLINES: for (const rct_preview_track * trackBlock = TrackBlocks[trackType]; trackBlock->index != 0xFF; trackBlock++) { - rct_xy16 tile = {x, y}; + LocationXY16 tile = {x, y}; map_offset_with_rotation(&tile.x, &tile.y, trackBlock->x, trackBlock->y, rotation); track_design_update_max_min_coordinates(tile.x, tile.y, z); track_design_add_selection_tile(tile.x, tile.y); @@ -1471,7 +1471,7 @@ static bool track_design_place_ride(rct_track_td6 * td6, sint16 x, sint16 y, sin sint32 tempZ = z - TrackCoordinates[trackType].z_begin; for (const rct_preview_track * trackBlock = TrackBlocks[trackType]; trackBlock->index != 0xFF; trackBlock++) { - rct_xy16 tile = {x, y}; + LocationXY16 tile = {x, y}; map_offset_with_rotation(&tile.x, &tile.y, trackBlock->x, trackBlock->y, rotation); if (tile.x < 0 || tile.y < 0 || tile.x >= (256 * 32) || tile.y >= (256 * 32)) { @@ -1558,7 +1558,7 @@ static bool track_design_place_ride(rct_track_td6 * td6, sint16 x, sint16 y, sin if (_trackDesignPlaceOperation != PTD_OPERATION_1) { - rct_xy16 tile = { + LocationXY16 tile = { (sint16) (x + TileDirectionDelta[rotation].x), (sint16) (y + TileDirectionDelta[rotation].y) }; @@ -2098,7 +2098,7 @@ static money32 place_maze_design(uint8 flags, uint8 rideIndex, uint16 mazeEntry, { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 8; coord.y = y + 8; coord.z = z; @@ -2201,7 +2201,7 @@ void track_design_draw_preview(rct_track_td6 * td6, uint8 * pixels) td6->cost = cost; td6->track_flags = flags & 7; - rct_xyz32 centre; + LocationXYZ32 centre; centre.x = (gTrackPreviewMin.x + gTrackPreviewMax.x) / 2 + 16; centre.y = (gTrackPreviewMin.y + gTrackPreviewMax.y) / 2 + 16; centre.z = (gTrackPreviewMin.z + gTrackPreviewMax.z) / 2; @@ -2249,12 +2249,12 @@ void track_design_draw_preview(rct_track_td6 * td6, uint8 * pixels) dpi.pitch = 0; dpi.bits = pixels; - rct_xy32 offset = {size_x / 2, size_y / 2}; + LocationXY32 offset = {size_x / 2, size_y / 2}; for (sint32 i = 0; i < 4; i++) { gCurrentRotation = i; - rct_xy32 pos2d = translate_3d_to_2d_with_z(i, centre); + LocationXY32 pos2d = translate_3d_to_2d_with_z(i, centre); pos2d.x -= offset.x; pos2d.y -= offset.y; diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 9c00fd2263..10af1599a2 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -203,9 +203,9 @@ extern "C" { extern rct_track_td6 *gActiveTrackDesign; extern bool gTrackDesignSceneryToggle; -extern rct_xyz16 gTrackPreviewMin; -extern rct_xyz16 gTrackPreviewMax; -extern rct_xyz16 gTrackPreviewOrigin; +extern LocationXYZ16 gTrackPreviewMin; +extern LocationXYZ16 gTrackPreviewMax; +extern LocationXYZ16 gTrackPreviewOrigin; extern bool byte_9D8150; diff --git a/src/openrct2/ride/cable_lift.c b/src/openrct2/ride/cable_lift.c index 195745130a..e3a58ee9c0 100644 --- a/src/openrct2/ride/cable_lift.c +++ b/src/openrct2/ride/cable_lift.c @@ -268,7 +268,7 @@ static bool sub_6DF01A_loop(rct_vehicle* vehicle) { vehicle->track_progress = trackProgress; moveInfo = vehicle_get_move_info(vehicle->var_CD, vehicle->track_type, trackProgress); - rct_xyz16 unk = { + LocationXYZ16 unk = { moveInfo->x, moveInfo->y, moveInfo->z @@ -352,7 +352,7 @@ static bool sub_6DF21B_loop(rct_vehicle* vehicle) { vehicle->track_progress = trackProgress; moveInfo = vehicle_get_move_info(vehicle->var_CD, vehicle->track_type, trackProgress); - rct_xyz16 unk = { + LocationXYZ16 unk = { moveInfo->x, moveInfo->y, moveInfo->z diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 03abafc897..3113f2b1a4 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -873,7 +873,7 @@ static const uint32 junior_rc_track_pieces_left_quarter_turn_5_tiles_25_deg_up[2 } } }; -const rct_xy16 junior_rc_left_quarter_turn_5_tiles_25_deg_up_offsets[4][5] = { { +const LocationXY16 junior_rc_left_quarter_turn_5_tiles_25_deg_up_offsets[4][5] = { { { 0, 6 }, { 0, 0 }, { 0, 16 }, @@ -1910,7 +1910,7 @@ static void junior_rc_flat_to_left_bank_paint_setup(paint_session * session, uin } } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -1958,7 +1958,7 @@ static void junior_rc_flat_to_right_bank_paint_setup(paint_session * session, ui } } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -1982,7 +1982,7 @@ static void junior_rc_right_bank_to_flat_paint_setup(paint_session * session, ui junior_rc_flat_to_left_bank_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); } -const rct_xy16 junior_rc_banked_right_quarter_turn_5_tiles_bound_lengths[4][5] = { { +const LocationXY16 junior_rc_banked_right_quarter_turn_5_tiles_bound_lengths[4][5] = { { { 32, 20 }, { 32, 16 }, { 16, 16 }, @@ -2011,7 +2011,7 @@ const rct_xy16 junior_rc_banked_right_quarter_turn_5_tiles_bound_lengths[4][5] = { 32, 20 }, } }; -const rct_xyz16 junior_rc_banked_right_quarter_turn_5_tiles_bound_offsets[4][5] = { { +const LocationXYZ16 junior_rc_banked_right_quarter_turn_5_tiles_bound_offsets[4][5] = { { { 0, 6 }, { 0, 16 }, { 0, 0 }, @@ -2172,7 +2172,7 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup(paint_session * session } } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -2232,7 +2232,7 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup(paint_session * sessio } } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -2309,7 +2309,7 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup(paint_session * session } } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -2370,7 +2370,7 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup(paint_session * sessio } } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -2418,14 +2418,14 @@ static void junior_rc_25_deg_down_to_right_bank_paint_setup(paint_session * sess junior_rc_left_bank_to_25_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); } -static const rct_xyz16 junior_rc_left_bank_bound_lengths[4] = { +static const LocationXYZ16 junior_rc_left_bank_bound_lengths[4] = { { 32, 1, 26 }, { 1, 32, 26 }, { 32, 20, 1 }, { 20, 32, 1 }, }; -static const rct_xy16 junior_rc_left_bank_bound_offsets[4] = { +static const LocationXY16 junior_rc_left_bank_bound_offsets[4] = { { 0, 27 }, { 27, 0 }, { 0, 6 }, @@ -2455,7 +2455,7 @@ static void junior_rc_left_bank_paint_setup(paint_session * session, uint8 rideI paint_util_push_tunnel_left(session, height, 0); } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -2681,14 +2681,14 @@ static void junior_rc_s_bend_left_paint_setup(paint_session * session, uint8 rid trackSequence = 3 - trackSequence; } - const rct_xy16 offsetList[] = { + const LocationXY16 offsetList[] = { { 0, 6 }, { 0, 0 }, { 0, 6 }, { 0, 6 }, }; - const rct_xy16 boundsList[] = { + const LocationXY16 boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -2696,8 +2696,8 @@ static void junior_rc_s_bend_left_paint_setup(paint_session * session, uint8 rid }; uint32 imageId = junior_rc_track_pieces_s_bend_left[(direction & 1)][trackSequence] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = offsetList[trackSequence]; - rct_xy16 bounds = boundsList[trackSequence]; + LocationXY16 offset = offsetList[trackSequence]; + LocationXY16 bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { sub_98196C(session, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 1, height, get_current_rotation()); @@ -2781,14 +2781,14 @@ static void junior_rc_s_bend_right_paint_setup(paint_session * session, uint8 ri trackSequence = 3 - trackSequence; } - const rct_xy16 offsetList[] = { + const LocationXY16 offsetList[] = { { 0, 6 }, { 0, 6 }, { 0, 0 }, { 0, 6 }, }; - const rct_xy16 boundsList[] = { + const LocationXY16 boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -2796,8 +2796,8 @@ static void junior_rc_s_bend_right_paint_setup(paint_session * session, uint8 ri }; uint32 imageId = junior_rc_track_pieces_s_bend_right[direction & 1][trackSequence] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = offsetList[trackSequence]; - rct_xy16 bounds = boundsList[trackSequence]; + LocationXY16 offset = offsetList[trackSequence]; + LocationXY16 bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { sub_98196C(session, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 1, height, get_current_rotation()); @@ -2919,7 +2919,7 @@ static void junior_rc_left_quarter_turn_3_tiles_paint_setup(paint_session * sess mapElement); } -const rct_xy16 junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths[4][3] = { { +const LocationXY16 junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths[4][3] = { { { 32, 20 }, { 16, 16 }, { 20, 32 }, @@ -2940,7 +2940,7 @@ const rct_xy16 junior_rc_right_quarter_turn_3_tiles_bank_bound_lengths[4][3] = { { 32, 20 }, } }; -const rct_xyz16 junior_rc_right_quarter_turn_3_tiles_bank_offsets[4][3] = { { +const LocationXYZ16 junior_rc_right_quarter_turn_3_tiles_bank_offsets[4][3] = { { { 0, 6 }, { 16, 16 }, { 6, 0 }, @@ -3017,9 +3017,9 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up(paint_session * JUNIOR_RC_CHAINTYPE chainType) { uint32 imageId = 0; - rct_xy16 offset = { 0 }; - rct_xy16 boundsLength = { 0 }; - rct_xy16 boundsOffset = { 0 }; + LocationXY16 offset = { 0 }; + LocationXY16 boundsLength = { 0 }; + LocationXY16 boundsOffset = { 0 }; switch (trackSequence) { @@ -3095,9 +3095,9 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down(paint_session JUNIOR_RC_CHAINTYPE chainType) { uint32 imageId = 0; - rct_xy16 offset = { 0 }; - rct_xy16 boundsLength = { 0 }; - rct_xy16 boundsOffset = { 0 }; + LocationXY16 offset = { 0 }; + LocationXY16 boundsLength = { 0 }; + LocationXY16 boundsOffset = { 0 }; switch (trackSequence) { @@ -3601,7 +3601,7 @@ static void junior_rc_brake_paint_setup(paint_session * session, uint8 rideIndex paint_util_push_tunnel_left(session, height, TUNNEL_0); } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -3637,7 +3637,7 @@ static void junior_rc_block_brake_paint_setup(paint_session * session, uint8 rid paint_util_push_tunnel_left(session, height, TUNNEL_0); } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { sint32 edi = (direction & 1) ? 2 : 1; @@ -3791,7 +3791,7 @@ static void junior_rc_right_eighth_to_orthogonal_paint_setup(paint_session * ses junior_rc_left_eighth_to_diag_paint_setup(session, rideIndex, trackSequence, (direction + 3) % 4, height, mapElement); } -static const rct_xy16 junior_rc_left_eighth_to_diag_bank_bound_lengths[4][4] = { +static const LocationXY16 junior_rc_left_eighth_to_diag_bank_bound_lengths[4][4] = { { { 32, 1 }, { 32, 16 }, @@ -3818,7 +3818,7 @@ static const rct_xy16 junior_rc_left_eighth_to_diag_bank_bound_lengths[4][4] = { }, }; -static const rct_xyz16 junior_rc_left_eighth_to_diag_bank_bound_offsets[4][4] = { +static const LocationXYZ16 junior_rc_left_eighth_to_diag_bank_bound_offsets[4][4] = { { { 0, 27 }, { 0, 0 }, @@ -3935,7 +3935,7 @@ static void junior_rc_left_eighth_to_diag_bank_paint_setup(paint_session * sessi paint_util_set_general_support_height(session, height + 32, 0x20); } -static const rct_xy16 junior_rc_right_eighth_to_diag_bank_bound_lengths[4][4] = { +static const LocationXY16 junior_rc_right_eighth_to_diag_bank_bound_lengths[4][4] = { { { 32, 20 }, { 16, 16 }, @@ -3962,7 +3962,7 @@ static const rct_xy16 junior_rc_right_eighth_to_diag_bank_bound_lengths[4][4] = }, }; -static const rct_xyz16 junior_rc_right_eighth_to_diag_bank_bound_offsets[4][4] = { +static const LocationXYZ16 junior_rc_right_eighth_to_diag_bank_bound_offsets[4][4] = { { { 0, 6 }, { 0, 0 }, @@ -4723,14 +4723,14 @@ static void junior_rc_diag_25_deg_down_to_right_bank_paint_setup(paint_session * paint_util_set_general_support_height(session, height + 48, 0x20); } -const rct_xyz16 junior_rc_diag_left_bank_bound_offsets[4] = { +const LocationXYZ16 junior_rc_diag_left_bank_bound_offsets[4] = { { -16, -16, 27 }, { -16, -16 }, { -16, -16 }, { -16, -16 }, }; -const rct_xyz16 junior_rc_diag_right_bank_bound_offsets[4] = { +const LocationXYZ16 junior_rc_diag_right_bank_bound_offsets[4] = { { -16, -16 }, { -16, -16 }, { -16, -16, 27 }, @@ -4779,14 +4779,14 @@ static void junior_rc_diag_right_bank_paint_setup(paint_session * session, uint8 paint_util_set_general_support_height(session, height + 32, 0x20); } -static const rct_xy16 junior_rc_60_deg_up_bound_offsets[4] = { +static const LocationXY16 junior_rc_60_deg_up_bound_offsets[4] = { { 0, 6 }, { 10, 29 }, { 29, 10 }, { 6, 0 }, }; -static const rct_xy16 junior_rc_60_deg_up_tile_offsets[4] = { +static const LocationXY16 junior_rc_60_deg_up_tile_offsets[4] = { { 0, 6 }, { 6, 0 }, { 0, 6 }, @@ -4795,7 +4795,7 @@ static const rct_xy16 junior_rc_60_deg_up_tile_offsets[4] = { static const sint8 junior_rc_60_deg_up_bound_thickness[4] = { 1, 75, 75, 1 }; -static const rct_xy16 junior_rc_60_deg_up_bound_lengths[4] = { +static const LocationXY16 junior_rc_60_deg_up_bound_lengths[4] = { { 32, 20 }, { 10, 1 }, { 1, 10 }, @@ -4831,7 +4831,7 @@ void junior_rc_paint_track_60_deg_up(paint_session * session, uint8 rideIndex, u break; } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; sint8 support[4] = { 35, 29, 25, 32 }; if (track_paint_util_should_paint_supports(pos)) @@ -4859,7 +4859,7 @@ static void junior_rc_60_deg_down_paint_setup(paint_session * session, uint8 rid junior_rc_60_deg_up_paint_setup(session, rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); } -static const rct_xy16 junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4][2] = { +static const LocationXY16 junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4][2] = { { { 32, 20 }, { 0 } }, { { 10, 32 }, { 2, 32 } }, { { 32, 10 }, { 32, 2 } }, @@ -4868,7 +4868,7 @@ static const rct_xy16 junior_rc_25_deg_up_to_60_deg_up_bound_lengths[4][2] = { static const sint8 junior_rc_25_deg_up_to_60_deg_up_bound_thickness[4] = { 1, 43, 43, 1 }; -static const rct_xy16 junior_rc_25_deg_up_to_60_deg_up_bound_offsets[4][2] = { +static const LocationXY16 junior_rc_25_deg_up_to_60_deg_up_bound_offsets[4][2] = { { { 0, 6 }, { 0 } }, { { 10, 0 }, { 4, 0 } }, { { 0, 10 }, { 0, 4 } }, @@ -4922,7 +4922,7 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up(paint_session * session, uint8 break; } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; sint8 support[4] = { 12, 12, 12, 14 }; if (track_paint_util_should_paint_supports(pos)) @@ -4997,7 +4997,7 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up(paint_session * session, uint8 break; } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { @@ -5204,7 +5204,7 @@ static void junior_rc_diag_60_deg_down_to_25_deg_down_paint_setup(paint_session isChained ? JUNIOR_RC_CHAIN_FRICTION_WHEELS : JUNIOR_RC_CHAIN_NONE); } -static const rct_xy16 junior_rc_flat_to_60_deg_up_bound_lengths[4][2] = { +static const LocationXY16 junior_rc_flat_to_60_deg_up_bound_lengths[4][2] = { { { 32, 24 }, { 0 } }, { { 10, 1 }, { 2, 32 } }, { { 1, 10 }, { 32, 2 } }, @@ -5213,18 +5213,18 @@ static const rct_xy16 junior_rc_flat_to_60_deg_up_bound_lengths[4][2] = { static const sint8 junior_rc_flat_to_60_deg_up_bound_thickness[4] = { 1, 43, 43, 1 }; -static const rct_xy16 junior_rc_flat_to_60_deg_up_bound_offsets[4][2] = { +static const LocationXY16 junior_rc_flat_to_60_deg_up_bound_offsets[4][2] = { { { 0, 4 }, { 0 } }, { { 10, 0 }, { 4, 0 } }, { { 0, 10 }, { 0, 4 } }, { { 4, 0 }, { 0 } }, }; -static const rct_xy16 junior_rc_flat_to_60_deg_up_tile_offsets[4][2] = { +static const LocationXY16 junior_rc_flat_to_60_deg_up_tile_offsets[4][2] = { { { 12, -10 }, { 0 } }, { { 22, 9 }, { 12, -11 } }, { { 30, 7 }, { 5, 0 } }, { { 12, -12 }, { 0 } } }; -static const rct_xy16 junior_rc_60_deg_up_to_flat_tile_offsets[4][2] = { +static const LocationXY16 junior_rc_60_deg_up_to_flat_tile_offsets[4][2] = { { { 13, -9 }, { 0 } }, { { 32, 9 }, { -7, -11 } }, { { 22, 18 }, { 2, -19 } }, { { 13, -9 }, { 0 } } }; @@ -5276,7 +5276,7 @@ static void junior_rc_flat_to_60_deg_up_paint_setup(paint_session * session, uin break; } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; sint8 support[4] = { 12, 12, 12, 14 }; if (track_paint_util_should_paint_supports(pos)) @@ -5345,7 +5345,7 @@ static void junior_rc_60_deg_up_to_flat_paint_setup(paint_session * session, uin break; } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { @@ -5454,7 +5454,7 @@ static void junior_rc_booster_paint_setup(paint_session * session, uint8 rideInd paint_util_push_tunnel_left(session, height, TUNNEL_0); } - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; if (track_paint_util_should_paint_supports(pos)) { uint8 supportType = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index 1daa22a8f9..76cdb98cac 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -118,7 +118,7 @@ static void multi_dimension_rc_track_station(paint_session * session, uint8 ride { 15811, 15813, SPR_STATION_INVERTED_BAR_A_NW_SE }, }; - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; if (mapElement->properties.track.type == TRACK_ELEM_END_STATION) { diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 3be07e9a64..6ba0835ca3 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -30,9 +30,9 @@ typedef struct sprite_bb_2 { uint32 sprite_id_a; uint32 sprite_id_b; - rct_xyz16 offset; - rct_xyz16 bb_offset; - rct_xyz16 bb_size; + LocationXYZ16 offset; + LocationXYZ16 bb_offset; + LocationXYZ16 bb_size; } sprite_bb_2; enum diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 6f2cbb2df6..f84c3b2057 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -482,7 +482,7 @@ static void paint_car_ride_track_spinning_tunnel(paint_session * session, uint8 static void paint_car_ride_track_60_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = car_ride_track_pieces_60_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -532,7 +532,7 @@ static void paint_car_ride_track_60_deg_up(paint_session * session, uint8 rideIn static void paint_car_ride_track_25_deg_up_to_60_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = car_ride_track_pieces_25_deg_up_to_60_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; @@ -589,7 +589,7 @@ static void paint_car_ride_track_25_deg_up_to_60_deg_up(paint_session * session, static void paint_car_ride_track_60_deg_up_to_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = car_ride_track_pieces_60_deg_up_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/CircusShow.cpp b/src/openrct2/ride/gentle/CircusShow.cpp index da01efc7d3..d197d0be86 100644 --- a/src/openrct2/ride/gentle/CircusShow.cpp +++ b/src/openrct2/ride/gentle/CircusShow.cpp @@ -61,7 +61,7 @@ static void paint_circus_show(paint_session * session, uint8 rideIndex, uint8 tr sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 6a78987c03..95002e671f 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -75,7 +75,7 @@ static void paint_crooked_house(paint_session * session, uint8 rideIndex, uint8 sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index d2aa82dfca..662f3042d3 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -50,7 +50,7 @@ static void paint_dodgems(paint_session * session, uint8 rideIndex, uint8 trackS sint32 edges = edges_4x4[relativeTrackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index e7937c3840..fbd9599d76 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -153,7 +153,7 @@ static void paint_ferris_wheel(paint_session * session, uint8 rideIndex, uint8 t } Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index f75a7d4526..e1c363db3a 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -46,7 +46,7 @@ static void paint_flying_saucers(paint_session * session, uint8 rideIndex, uint8 sint32 edges = edges_4x4[relativeTrackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index 947d2da9fc..859cb54652 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -138,7 +138,7 @@ static const uint32 ghost_train_track_pieces_brakes[4] = { static void paint_ghost_train_track_flat(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = ghost_train_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -174,7 +174,7 @@ static void paint_ghost_train_track_flat(paint_session * session, uint8 rideInde static void paint_ghost_train_track_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = ghost_train_track_pieces_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) @@ -226,7 +226,7 @@ static void paint_ghost_train_track_25_deg_up(paint_session * session, uint8 rid static void paint_ghost_train_track_flat_to_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = ghost_train_track_pieces_flat_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) @@ -277,7 +277,7 @@ static void paint_ghost_train_track_flat_to_25_deg_up(paint_session * session, u static void paint_ghost_train_track_25_deg_up_to_flat_shared(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][0] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) @@ -525,7 +525,7 @@ static void paint_ghost_train_track_spinning_tunnel(paint_session * session, uin static void paint_ghost_train_track_brakes(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = ghost_train_track_pieces_brakes[direction] | session->TrackColours[SCHEME_TRACK]; diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 7df027407d..1e93f58810 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -97,7 +97,7 @@ static void paint_haunted_house(paint_session * session, uint8 rideIndex, uint8 sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index bab1b06ca2..cea259ab6b 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -115,7 +115,7 @@ static void paint_merry_go_round(paint_session * session, uint8 rideIndex, uint8 sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 9056b0f12e..b11ab7bcc0 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -597,7 +597,7 @@ static void paint_mini_golf_track_25_deg_down_to_flat(paint_session * session, u static void paint_mini_golf_station(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; Ride * ride = get_ride(rideIndex); const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; uint32 imageId; @@ -746,7 +746,7 @@ static void paint_mini_golf_hole_ab(paint_session * session, uint8 trackSequence const uint32 sprites[4][2][2]) { uint32 imageId; - rct_xy16 boundBox, boundBoxOffset; + LocationXY16 boundBox, boundBoxOffset; bool drewSupports = wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], NULL); @@ -815,7 +815,7 @@ static void paint_mini_golf_hole_c(paint_session * session, uint8 rideIndex, uin sint32 height, rct_map_element * mapElement) { uint32 imageId; - rct_xy16 boundBox, boundBoxOffset; + LocationXY16 boundBox, boundBoxOffset; bool drewSupports = wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], NULL); @@ -884,7 +884,7 @@ static void paint_mini_golf_hole_d(paint_session * session, uint8 rideIndex, uin sint32 height, rct_map_element * mapElement) { uint32 imageId; - rct_xy16 boundBox, boundBoxOffset; + LocationXY16 boundBox, boundBoxOffset; sint32 supportType = (direction & 1); if (trackSequence == 2) @@ -976,7 +976,7 @@ static void paint_mini_golf_hole_e(paint_session * session, uint8 rideIndex, uin sint32 height, rct_map_element * mapElement) { uint32 imageId; - rct_xy16 boundBox, boundBoxOffset; + LocationXY16 boundBox, boundBoxOffset; sint32 supportType = (direction & 1); if (trackSequence == 2) diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 34529517f3..3d0ff30648 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -64,7 +64,7 @@ static void paint_mini_helicopters_track_station(paint_session * session, uint8 static void paint_mini_helicopters_track_flat(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; if (direction & 1) @@ -95,7 +95,7 @@ static void paint_mini_helicopters_track_flat(paint_session * session, uint8 rid static void paint_mini_helicopters_track_flat_to_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; switch (direction) @@ -136,7 +136,7 @@ static void paint_mini_helicopters_track_flat_to_25_deg_up(paint_session * sessi static void paint_mini_helicopters_track_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; switch (direction) @@ -177,7 +177,7 @@ static void paint_mini_helicopters_track_25_deg_up(paint_session * session, uint static void paint_mini_helicopters_track_25_deg_up_to_flat(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; switch (direction) diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index e3b391b018..93a7483fdb 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -87,7 +87,7 @@ static void paint_observation_tower_base(paint_session * session, uint8 rideInde sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 65f73ef718..ebe0554eca 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -96,7 +96,7 @@ static void paint_space_rings(paint_session * session, uint8 rideIndex, uint8 tr sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index e321eb745e..9b9e4a927b 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -143,8 +143,8 @@ static void spiral_slide_paint_tile_front(paint_session * session, uint8 rideInd { sint32 offset = SPIRAL_SLIDE_PEEP + 46 * direction; - rct_xyz8 boundingBox = { 0, 0, 108 }; - rct_xyz16 boundingBoxOffset = { 0, 0, static_cast(height + 3) }; + LocationXYZ8 boundingBox = { 0, 0, 108 }; + LocationXYZ16 boundingBoxOffset = { 0, 0, static_cast(height + 3) }; if (direction == 0) { @@ -200,7 +200,7 @@ static void paint_spiral_slide(paint_session * session, uint8 rideIndex, uint8 t sint32 edges = edges_2x2[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/ride.c b/src/openrct2/ride/ride.c index aa52866737..6b7fe49eda 100644 --- a/src/openrct2/ride/ride.c +++ b/src/openrct2/ride/ride.c @@ -184,10 +184,10 @@ uint16 _previousTrackPieceZ; uint8 _currentBrakeSpeed2; uint8 _currentSeatRotationAngle; -rct_xyz16 _unkF44188; +LocationXYZ16 _unkF44188; -rct_xyzd16 _unkF440C5; +LocationXYZD16 _unkF440C5; uint8 gRideEntranceExitPlaceType; uint8 gRideEntranceExitPlaceRideIndex; @@ -543,7 +543,7 @@ bool track_block_get_next_from_zero(sint16 x, sint16 y, sint16 z_start, uint8 ri rct_map_element* mapElement = map_get_first_element_at(x / 32, y / 32); if (mapElement == NULL){ output->element = NULL; - output->x = MAP_LOCATION_NULL; + output->x = LOCATION_NULL; return 0; } @@ -1131,7 +1131,7 @@ void ride_remove_peeps(sint32 rideIndex) sint32 exitZ = 0; sint32 exitDirection = 255; if (stationIndex != -1) { - rct_xy8 location = ride->exits[stationIndex]; + LocationXY8 location = ride->exits[stationIndex]; if (location.xy != RCT_XY8_UNDEFINED) { exitX = location.x; exitY = location.y; @@ -2126,7 +2126,7 @@ void ride_update_popularity(Ride* ride, uint8 pop_amount){ } /** rct2: 0x0098DDB8, 0x0098DDBA */ -static const rct_xy16 ride_spiral_slide_main_tile_offset[][4] = { +static const LocationXY16 ride_spiral_slide_main_tile_offset[][4] = { { { 32, 32 }, { 0, 32 }, @@ -2633,7 +2633,7 @@ static void ride_call_closest_mechanic(sint32 rideIndex) rct_peep *ride_find_closest_mechanic(Ride *ride, sint32 forInspection) { sint32 x, y, z, stationIndex; - rct_xy8 location; + LocationXY8 location; rct_map_element *mapElement; // Get either exit position or entrance position if there is no exit @@ -2698,7 +2698,7 @@ rct_peep *find_closest_mechanic(sint32 x, sint32 y, sint32 forInspection) if (!staff_is_location_in_patrol(peep, x & 0xFFE0, y & 0xFFE0)) continue; - if (peep->x == MAP_LOCATION_NULL) + if (peep->x == LOCATION_NULL) continue; // Manhattan distance @@ -3199,7 +3199,7 @@ void ride_check_all_reachable() * rct2: 0x006B7C59 * @return 1 if the coordinate is reachable or has no entrance, 0 otherwise */ -static sint32 ride_entrance_exit_is_reachable(rct_xy8 coordinates, Ride* ride, sint32 index) +static sint32 ride_entrance_exit_is_reachable(LocationXY8 coordinates, Ride* ride, sint32 index) { sint32 x, y, z; rct_map_element *mapElement; @@ -3233,7 +3233,7 @@ static sint32 ride_entrance_exit_is_reachable(rct_xy8 coordinates, Ride* ride, s static void ride_entrance_exit_connected(Ride* ride, sint32 ride_idx) { for (sint32 i = 0; i < MAX_STATIONS; ++i) { - rct_xy8 station_start = ride->station_starts[i], + LocationXY8 station_start = ride->station_starts[i], entrance = ride->entrances[i], exit = ride->exits[i]; @@ -3267,7 +3267,7 @@ static void ride_shop_connected(Ride* ride, sint32 ride_idx) sint32 x, y, count; rct_map_element *mapElement; - rct_xy8 coordinates = ride->station_starts[0]; + LocationXY8 coordinates = ride->station_starts[0]; if (coordinates.xy == RCT_XY8_UNDEFINED) return; @@ -3458,7 +3458,7 @@ void ride_set_map_tooltip(rct_map_element *mapElement) sint32 ride_music_params_update(sint16 x, sint16 y, sint16 z, uint8 rideIndex, uint16 sampleRate, uint32 position, uint8 *tuneId) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gGameSoundsOff && g_music_tracking_viewport != NULL) { - rct_xy16 rotatedCoords = { 0, 0 }; + LocationXY16 rotatedCoords = { 0, 0 }; switch (get_current_rotation()) { case 0: @@ -3966,7 +3966,7 @@ static money32 ride_set_setting(uint8 rideIndex, uint8 setting, uint8 value, uin if (flags & GAME_COMMAND_FLAG_APPLY) { if (ride->overall_view.xy != RCT_XY8_UNDEFINED) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = ride->overall_view.x * 32 + 16; coord.y = ride->overall_view.y * 32 + 16; coord.z = map_element_height(coord.x, coord.y); @@ -4107,7 +4107,7 @@ static void sub_6B5952(sint32 rideIndex) Ride *ride = get_ride(rideIndex); for (sint32 i = 0; i < MAX_STATIONS; i++) { - rct_xy8 location = ride->entrances[i]; + LocationXY8 location = ride->entrances[i]; if (location.xy == RCT_XY8_UNDEFINED) continue; @@ -4460,14 +4460,14 @@ static sint32 count_free_misc_sprite_slots() return max(0, miscSpriteCount + remainingSpriteCount - 300); } -static const rct_xy16 word_9A3AB4[4] = { +static const LocationXY16 word_9A3AB4[4] = { { 0, 0 }, { 0, -96 }, { -96, -96 }, { -96, 0 }, }; -static const rct_xy16 word_9A2A60[] = { +static const LocationXY16 word_9A2A60[] = { { 0, 16 }, { 16, 31 }, { 31, 16 }, @@ -4567,7 +4567,7 @@ static rct_vehicle *vehicle_create_car( vehicle->sub_state = 0; vehicle->update_flags = 0; - rct_xy16 chosenLoc; + LocationXY16 chosenLoc; // loc_6DDD26: do { vehicle->sprite_direction = scenario_rand() & 0x1E; @@ -4938,7 +4938,7 @@ void loc_6DDF9C(Ride *ride, rct_map_element *mapElement) */ static bool ride_initialise_cable_lift_track(Ride *ride, bool isApplying) { - rct_xy8 location; + LocationXY8 location; sint32 stationIndex; for (stationIndex = 0; stationIndex < MAX_STATIONS; stationIndex++) { location = ride->station_starts[stationIndex]; @@ -5943,7 +5943,7 @@ void game_command_set_ride_appearance(sint32 *eax, sint32 *ebx, sint32 *ecx, sin if (apply && gGameCommandNestLevel == 1) { if (ride->overall_view.xy != RCT_XY8_UNDEFINED) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = ride->overall_view.x * 32 + 16; coord.y = ride->overall_view.y * 32 + 16; coord.z = map_element_height(coord.x, coord.y); @@ -6087,7 +6087,7 @@ void game_command_set_ride_price(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 * uint32 shop_item; if (ride->overall_view.xy != RCT_XY8_UNDEFINED) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = ride->overall_view.x * 32 + 16; coord.y = ride->overall_view.y * 32 + 16; coord.z = map_element_height(coord.x, coord.y); @@ -6568,7 +6568,7 @@ void ride_get_entrance_or_exit_position_from_screen_position(sint32 screenX, sin stationHeight = ride->station_heights[gRideEntranceExitPlaceStationIndex]; screen_get_map_xy_with_z(screenX, screenY, stationHeight * 8, &mapX, &mapY); - if (mapX == MAP_LOCATION_NULL) { + if (mapX == LOCATION_NULL) { *outX = 0x8000; return; } @@ -6583,7 +6583,7 @@ void ride_get_entrance_or_exit_position_from_screen_position(sint32 screenX, sin if (ride->type == RIDE_TYPE_NULL) return; - rct_xy8 stationStart = ride->station_starts[gRideEntranceExitPlaceStationIndex]; + LocationXY8 stationStart = ride->station_starts[gRideEntranceExitPlaceStationIndex]; if (stationStart.xy == RCT_XY8_UNDEFINED) return; @@ -6955,7 +6955,7 @@ static sint32 ride_get_track_length(Ride *ride) sint32 x, y, z, trackType, rideIndex, result; for (sint32 i = 0; i < MAX_STATIONS; i++) { - rct_xy8 location = ride->station_starts[i]; + LocationXY8 location = ride->station_starts[i]; if (location.xy == RCT_XY8_UNDEFINED) continue; @@ -7308,7 +7308,7 @@ static money32 ride_set_vehicles(uint8 rideIndex, uint8 setting, uint8 value, ui ride_update_max_vehicles(rideIndex); if (ride->overall_view.xy != RCT_XY8_UNDEFINED) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = ride->overall_view.x * 32 + 16; coord.y = ride->overall_view.y * 32 + 16; coord.z = map_element_height(coord.x, coord.y); @@ -7353,7 +7353,7 @@ void sub_6CB945(sint32 rideIndex) if (ride->station_starts[stationId].xy == RCT_XY8_UNDEFINED) continue; - rct_xyz16 location = { + LocationXYZ16 location = { .x = ride->station_starts[stationId].x * 32, .y = ride->station_starts[stationId].y * 32, .z = ride->station_heights[stationId] @@ -7401,7 +7401,7 @@ void sub_6CB945(sint32 rideIndex) const rct_preview_track *trackBlock = get_track_def_from_ride(ride, mapElement->properties.track.type); while ((++trackBlock)->index != 0xFF) { - rct_xyz16 blockLocation = location; + LocationXYZ16 blockLocation = location; map_offset_with_rotation(&blockLocation.x, &blockLocation.y, trackBlock->x, trackBlock->y, direction); bool trackFound = false; @@ -7457,7 +7457,7 @@ void sub_6CB945(sint32 rideIndex) continue; } - rct_xy16 location = { + LocationXY16 location = { .x = (*locationList & 0xFF) * 32, .y = ((*locationList >> 8) & 0xFF) * 32 }; @@ -7468,7 +7468,7 @@ void sub_6CB945(sint32 rideIndex) if (mapElement->properties.entrance.ride_index != rideIndex) continue; if (mapElement->properties.entrance.type > ENTRANCE_TYPE_RIDE_EXIT) continue; - rct_xy16 nextLocation = location; + LocationXY16 nextLocation = location; nextLocation.x += TileDirectionDelta[map_element_get_direction(mapElement)].x; nextLocation.y += TileDirectionDelta[map_element_get_direction(mapElement)].y; diff --git a/src/openrct2/ride/ride.h b/src/openrct2/ride/ride.h index 825f19beb8..905a81cbcc 100644 --- a/src/openrct2/ride/ride.h +++ b/src/openrct2/ride/ride.h @@ -157,16 +157,16 @@ typedef struct Ride { uint16 name_arguments_number; // 0x04E }; }; - rct_xy8 overall_view; // 0x050 - rct_xy8 station_starts[MAX_STATIONS]; // 0x052 + LocationXY8 overall_view; // 0x050 + LocationXY8 station_starts[MAX_STATIONS]; // 0x052 uint8 station_heights[MAX_STATIONS]; // 0x05A uint8 station_length[MAX_STATIONS]; // 0x05E uint8 station_depart[MAX_STATIONS]; // 0x062 // ride->vehicle index for current train waiting for passengers // at station uint8 train_at_station[MAX_STATIONS]; // 0x066 - rct_xy8 entrances[MAX_STATIONS]; // 0x06A - rct_xy8 exits[MAX_STATIONS]; // 0x072 + LocationXY8 entrances[MAX_STATIONS]; // 0x06A + LocationXY8 exits[MAX_STATIONS]; // 0x072 uint16 last_peep_in_queue[MAX_STATIONS]; // 0x07A uint8 pad_082[MAX_STATIONS]; // 0x082, Used to be number of peeps in queue in RCT1, but this has moved. uint16 vehicles[MAX_VEHICLES_PER_RIDE]; // 0x086, Points to the first car in the train @@ -192,7 +192,7 @@ typedef struct Ride { }; uint8 boat_hire_return_direction; // 0x0D1 - rct_xy8 boat_hire_return_position; // 0x0D2 + LocationXY8 boat_hire_return_position; // 0x0D2 uint8 measurement_index; // 0x0D4 // bits 0 through 4 are the number of helix sections // bit 5: spinning tunnel, water splash, or rapids @@ -218,7 +218,7 @@ typedef struct Ride { uint32 testing_flags; // 0x108 // x y map location of the current track piece during a test // this is to prevent counting special tracks multiple times - rct_xy8 cur_test_track_location; // 0x10C + LocationXY8 cur_test_track_location; // 0x10C // Next 3 variables are related (XXXX XYYY ZZZa aaaa) uint16 turn_count_default; // 0x10E X = current turn count uint16 turn_count_banked; // 0x110 @@ -247,7 +247,7 @@ typedef struct Ride { // Customer count in the last 10 * 960 game ticks (sliding window) uint16 num_customers[CUSTOMER_HISTORY_SIZE]; // 0x124 money16 price; // 0x138 - rct_xy8 chairlift_bullwheel_location[2]; // 0x13A + LocationXY8 chairlift_bullwheel_location[2]; // 0x13A uint8 chairlift_bullwheel_z[2]; // 0x13E union { rating_tuple ratings; // 0x140 @@ -1002,9 +1002,9 @@ extern uint16 _previousTrackPieceZ; extern uint8 _currentBrakeSpeed2; extern uint8 _currentSeatRotationAngle; -extern rct_xyz16 _unkF44188; +extern LocationXYZ16 _unkF44188; -extern rct_xyzd16 _unkF440C5; +extern LocationXYZD16 _unkF440C5; extern uint8 gRideEntranceExitPlaceType; extern uint8 gRideEntranceExitPlaceRideIndex; diff --git a/src/openrct2/ride/ride_ratings.c b/src/openrct2/ride/ride_ratings.c index 9964dcb81b..75d7cc8bc3 100644 --- a/src/openrct2/ride/ride_ratings.c +++ b/src/openrct2/ride/ride_ratings.c @@ -1251,7 +1251,7 @@ static rating_tuple ride_ratings_get_drop_ratings(Ride *ride) static sint32 ride_ratings_get_scenery_score(Ride *ride) { sint8 i = ride_get_first_valid_station_start(ride); - rct_xy8 location; + LocationXY8 location; if (i == -1) { diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index e2f52a71d9..e3d2d267b1 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -62,7 +62,7 @@ static void paint_3d_cinema(paint_session * session, uint8 rideIndex, uint8 trac sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index 12dc68ac27..558c1f569f 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -86,7 +86,7 @@ static void paint_enterprise(paint_session * session, uint8 rideIndex, uint8 tra sint32 edges = edges_4x4[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 3b4200af78..8117eca18a 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -346,7 +346,7 @@ static void paint_go_karts_track_25_deg_down_to_flat(paint_session * session, ui static void paint_go_karts_station(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; Ride * ride = get_ride(rideIndex); const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index f040840d9c..ca4b71c235 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -98,7 +98,7 @@ static void paint_launched_freefall_base(paint_session * session, uint8 rideInde sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 31a2d2d8a8..44ade20854 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -70,8 +70,8 @@ static rct_vehicle * get_first_vehicle(Ride * ride) return NULL; } -static void paint_magic_carpet_frame(paint_session * session, uint8 plane, uint8 direction, rct_xyz16 offset, - rct_xyz16 bbOffset, rct_xyz16 bbSize) +static void paint_magic_carpet_frame(paint_session * session, uint8 plane, uint8 direction, LocationXYZ16 offset, + LocationXYZ16 bbOffset, LocationXYZ16 bbSize) { uint32 imageId; if (direction & 1) @@ -96,7 +96,7 @@ static void paint_magic_carpet_frame(paint_session * session, uint8 plane, uint8 } static void paint_magic_carpet_pendulum(paint_session * session, uint8 plane, uint32 swingImageId, uint8 direction, - rct_xyz16 offset, rct_xyz16 bbOffset, rct_xyz16 bbSize) + LocationXYZ16 offset, LocationXYZ16 bbOffset, LocationXYZ16 bbSize) { uint32 imageId = swingImageId; if (direction & 2) @@ -117,7 +117,7 @@ static void paint_magic_carpet_pendulum(paint_session * session, uint8 plane, ui } static void paint_magic_carpet_vehicle(paint_session * session, Ride * ride, uint8 direction, uint32 swingImageId, - rct_xyz16 offset, rct_xyz16 bbOffset, rct_xyz16 bbSize) + LocationXYZ16 offset, LocationXYZ16 bbOffset, LocationXYZ16 bbSize) { rct_ride_entry * rideEntry = get_ride_entry_by_ride(ride); uint32 vehicleImageId = rideEntry->vehicles[0].base_image_id + direction; @@ -186,7 +186,7 @@ static void paint_magic_carpet_structure(paint_session * session, Ride * ride, u } bound_box bb = MagicCarpetBounds[direction]; - rct_xyz16 offset, bbOffset, bbSize; + LocationXYZ16 offset, bbOffset, bbSize; offset.x = (direction & 1) ? 0 : axisOffset; offset.y = (direction & 1) ? axisOffset : 0; offset.z = height + 7; diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 8be7988274..225a7b4fc6 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -140,7 +140,7 @@ static void paint_motionsimulator(paint_session * session, uint8 rideIndex, uint sint32 edges = edges_2x2[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = { session->MapPosition.x, session->MapPosition.y }; + LocationXY16 position = { session->MapPosition.x, session->MapPosition.y }; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); track_paint_util_paint_floor(session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, diff --git a/src/openrct2/ride/thrill/PirateShip.cpp b/src/openrct2/ride/thrill/PirateShip.cpp index f71ecf6116..2b13939d52 100644 --- a/src/openrct2/ride/thrill/PirateShip.cpp +++ b/src/openrct2/ride/thrill/PirateShip.cpp @@ -172,7 +172,7 @@ static void paint_pirate_ship(paint_session * session, uint8 rideIndex, uint8 tr { uint8 relativeTrackSequence = track_map_1x5[direction][trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; bool hasFence; diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 01bb2d3758..46ddcdf220 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -98,7 +98,7 @@ static void paint_roto_drop_base(paint_session * session, uint8 rideIndex, uint8 sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 2d70c476d2..6e99dee1a8 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -146,7 +146,7 @@ static void top_spin_paint_vehicle(paint_session * session, sint8 al, sint8 cl, } image_id += seatImageId; - rct_xyz16 seatCoords = { al, cl, static_cast(height) }; + LocationXYZ16 seatCoords = { al, cl, static_cast(height) }; seatCoords.z += TopSpinSeatHeightOffset[armRotation]; @@ -250,7 +250,7 @@ static void paint_top_spin(paint_session * session, uint8 rideIndex, uint8 track sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_MISC], NULL); diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 2260e777b4..7e78f30f7d 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -89,7 +89,7 @@ static void paint_twist(paint_session * session, uint8 rideIndex, uint8 trackSeq const uint8 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId; diff --git a/src/openrct2/ride/track.c b/src/openrct2/ride/track.c index 8aa5e58548..72ad5a35de 100644 --- a/src/openrct2/ride/track.c +++ b/src/openrct2/ride/track.c @@ -1393,7 +1393,7 @@ static money32 track_place(sint32 rideIndex, sint32 type, sint32 originX, sint32 } if (gGameCommandNestLevel == 1) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = originX + 16; coord.y = originY + 16; coord.z = trackpieceZ; @@ -1693,7 +1693,7 @@ static money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 o price *= -10; if (gGameCommandNestLevel == 1) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = originX + 16; coord.y = originY + 16; coord.z = trackpieceZ; diff --git a/src/openrct2/ride/track_design_save.c b/src/openrct2/ride/track_design_save.c index 9d0847fd94..f9373c3dca 100644 --- a/src/openrct2/ride/track_design_save.c +++ b/src/openrct2/ride/track_design_save.c @@ -833,7 +833,7 @@ static bool track_design_save_to_td6_for_maze(uint8 rideIndex, rct_track_td6 *td return false; } - gTrackPreviewOrigin = (rct_xyz16) { startX, startY, mapElement->base_height * 8 }; + gTrackPreviewOrigin = (LocationXYZ16) { startX, startY, mapElement->base_height * 8 }; size_t numMazeElements = 0; td6->maze_elements = calloc(8192, sizeof(rct_td6_maze_element)); @@ -867,7 +867,7 @@ static bool track_design_save_to_td6_for_maze(uint8 rideIndex, rct_track_td6 *td } Ride *ride = get_ride(rideIndex); - rct_xy8 location = ride->entrances[0]; + LocationXY8 location = ride->entrances[0]; if (location.xy == RCT_XY8_UNDEFINED) { gGameCommandErrorText = STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; @@ -932,7 +932,7 @@ static bool track_design_save_to_td6_for_maze(uint8 rideIndex, rct_track_td6 *td // Save global vars as they are still used by scenery sint16 startZ = gTrackPreviewOrigin.z; place_virtual_track(td6, PTD_OPERATION_DRAW_OUTLINES, true, 0, 4096, 4096, 0); - gTrackPreviewOrigin = (rct_xyz16) { startX, startY, startZ }; + gTrackPreviewOrigin = (LocationXYZ16) { startX, startY, startZ }; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -996,7 +996,7 @@ static bool track_design_save_to_td6_for_tracked_ride(uint8 rideIndex, rct_track sint16 start_x = trackElement.x; sint16 start_y = trackElement.y; sint16 start_z = z + trackCoordinates->z_begin; - gTrackPreviewOrigin = (rct_xyz16) { start_x, start_y, start_z }; + gTrackPreviewOrigin = (LocationXYZ16) { start_x, start_y, start_z }; size_t numTrackElements = 0; td6->track_elements = calloc(8192, sizeof(rct_td6_track_element)); @@ -1058,7 +1058,7 @@ static bool track_design_save_to_td6_for_tracked_ride(uint8 rideIndex, rct_track for (sint32 station_index = 0; station_index < RCT12_MAX_STATIONS_PER_RIDE; station_index++) { z = ride->station_heights[station_index]; - rct_xy8 location; + LocationXY8 location; if (i == 0) { location = ride->entrances[station_index]; } else { @@ -1121,7 +1121,7 @@ static bool track_design_save_to_td6_for_tracked_ride(uint8 rideIndex, rct_track place_virtual_track(td6, PTD_OPERATION_DRAW_OUTLINES, true, 0, 4096, 4096, 0); // Resave global vars for scenery reasons. - gTrackPreviewOrigin = (rct_xyz16) { start_x, start_y, start_z }; + gTrackPreviewOrigin = (LocationXYZ16) { start_x, start_y, start_z }; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; diff --git a/src/openrct2/ride/track_paint.c b/src/openrct2/ride/track_paint.c index 28d87abff3..d4724c99d6 100644 --- a/src/openrct2/ride/track_paint.c +++ b/src/openrct2/ride/track_paint.c @@ -30,7 +30,7 @@ #include "../paint/map_element/map_element.h" /* rct2: 0x007667AC */ -static rct_xy16 loc_7667AC[] = { +static LocationXY16 loc_7667AC[] = { {.x = -1, .y = 0}, {.x = 0, .y = -1}, {.x = 1, .y = 0}, @@ -38,7 +38,7 @@ static rct_xy16 loc_7667AC[] = { }; /* rct2: 0x007667AE */ -static rct_xy16 loc_7667AE[] = { +static LocationXY16 loc_7667AE[] = { {.x = 0, .y = -1}, {.x = 1, .y = 0}, {.x = 0, .y = 1}, @@ -203,9 +203,9 @@ enum bool gUseOriginalRidePaint = false; -bool track_paint_util_has_fence(enum edge_t edge, rct_xy16 position, rct_map_element * mapElement, Ride * ride, uint8 rotation) +bool track_paint_util_has_fence(enum edge_t edge, LocationXY16 position, rct_map_element * mapElement, Ride * ride, uint8 rotation) { - rct_xy16 offset = { 0, 0 }; + LocationXY16 offset = { 0, 0 }; switch (edge) { case EDGE_NE: offset = loc_7667AC[rotation]; @@ -247,7 +247,7 @@ void track_paint_util_paint_floor(paint_session * session, uint8 edges, uint32 c sub_98197C(session, imageId | colourFlags, 0, 0, 32, 32, 1, height, 0, 0, height, rotation); } -void track_paint_util_paint_fences(paint_session * session, uint8 edges, rct_xy16 position, rct_map_element * mapElement, Ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation) +void track_paint_util_paint_fences(paint_session * session, uint8 edges, LocationXY16 position, rct_map_element * mapElement, Ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation) { uint32 imageId; @@ -270,7 +270,7 @@ void track_paint_util_paint_fences(paint_session * session, uint8 edges, rct_xy1 } /* Supports are only placed every 2 tiles for flat pieces*/ -bool track_paint_util_should_paint_supports(rct_xy16 position) +bool track_paint_util_should_paint_supports(LocationXY16 position) { if ((position.x & (1 << 5)) == (position.y & (1 << 5))) return true; @@ -300,7 +300,7 @@ void track_paint_util_draw_station_3(paint_session * session, uint8 rideIndex, u void track_paint_util_draw_station_impl(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, uint16 coverHeight, rct_map_element * mapElement, sint32 fenceOffsetA, sint32 fenceOffsetB) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; Ride * ride = get_ride(rideIndex); const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; const bool hasGreenLight = map_element_get_green_light(mapElement); @@ -434,7 +434,7 @@ void track_paint_util_draw_station_impl(paint_session * session, uint8 rideIndex void track_paint_util_draw_station_inverted(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement, uint8 stationVariant) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; Ride * ride = get_ride(rideIndex); const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; const bool hasGreenLight = map_element_get_green_light(mapElement); @@ -586,28 +586,28 @@ bool track_paint_util_draw_station_covers_2(paint_session * session, enum edge_t uint32 imageId; uint32 baseImageId = entranceStyle->base_image_id; sint32 imageOffset = 0; - rct_xyz16 offset, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 }; + LocationXYZ16 offset, bounds = { 0, 0, 0 }, boundsOffset = { 0, 0, 0 }; - offset = (rct_xyz16) {0, 0, height}; + offset = (LocationXYZ16) {0, 0, height}; switch (edge) { case EDGE_NE: - bounds = (rct_xyz16) {1, 30, heights[stationVariant][0]}; - boundsOffset = (rct_xyz16) {0, 1, height + 1}; + bounds = (LocationXYZ16) {1, 30, heights[stationVariant][0]}; + boundsOffset = (LocationXYZ16) {0, 1, height + 1}; imageOffset = hasFence ? SPR_STATION_COVER_OFFSET_SE_NW_BACK_1 : SPR_STATION_COVER_OFFSET_SE_NW_BACK_0; break; case EDGE_SE: - bounds = (rct_xyz16) {32, 32, 0}; - boundsOffset = (rct_xyz16) {0, 0, height + 1 + heights[stationVariant][0]}; + bounds = (LocationXYZ16) {32, 32, 0}; + boundsOffset = (LocationXYZ16) {0, 0, height + 1 + heights[stationVariant][0]}; imageOffset = SPR_STATION_COVER_OFFSET_NE_SW_FRONT; break; case EDGE_SW: - bounds = (rct_xyz16) {32, 32, 0}; - boundsOffset = (rct_xyz16) {0, 0, height + 1 + heights[stationVariant][0]}; + bounds = (LocationXYZ16) {32, 32, 0}; + boundsOffset = (LocationXYZ16) {0, 0, height + 1 + heights[stationVariant][0]}; imageOffset = SPR_STATION_COVER_OFFSET_SE_NW_FRONT; break; case EDGE_NW: - bounds = (rct_xyz16) {30, 1, heights[stationVariant][0]}; - boundsOffset = (rct_xyz16) {1, 0, height + 1}; + bounds = (LocationXYZ16) {30, 1, heights[stationVariant][0]}; + boundsOffset = (LocationXYZ16) {1, 0, height + 1}; imageOffset = hasFence ? SPR_STATION_COVER_OFFSET_NE_SW_BACK_1 : SPR_STATION_COVER_OFFSET_NE_SW_BACK_0; break; } @@ -643,7 +643,7 @@ bool track_paint_util_draw_station_covers_2(paint_session * session, enum edge_t void track_paint_util_draw_station_platform(paint_session * session, Ride *ride, uint8 direction, sint32 height, sint32 zOffset, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; if (direction & 1) { bool hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation()); @@ -678,7 +678,7 @@ void track_paint_util_draw_station_platform(paint_session * session, Ride *ride, } } -void track_paint_util_draw_pier(paint_session * session, Ride * ride, const rct_ride_entrance_definition * entranceStyle, rct_xy16 position, uint8 direction, sint32 height, rct_map_element * mapElement, uint8 rotation) +void track_paint_util_draw_pier(paint_session * session, Ride * ride, const rct_ride_entrance_definition * entranceStyle, LocationXY16 position, uint8 direction, sint32 height, rct_map_element * mapElement, uint8 rotation) { bool hasFence; uint32 imageId; @@ -732,7 +732,7 @@ void track_paint_util_draw_station_metal_supports_2(paint_session * session, uin } } -const rct_xy16 defaultRightHelixUpSmallQuarterBoundLengths[4][3][2] = { +const LocationXY16 defaultRightHelixUpSmallQuarterBoundLengths[4][3][2] = { { {32, 20}, {16, 16}, @@ -755,7 +755,7 @@ const rct_xy16 defaultRightHelixUpSmallQuarterBoundLengths[4][3][2] = { } }; -const rct_xyz16 defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { +const LocationXYZ16 defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { { {0, 6}, {16, 16}, @@ -780,7 +780,7 @@ const rct_xyz16 defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { static const sint8 right_helix_up_small_quarter_tiles_sprite_map[] = {0, -1, 1, 2}; -void track_paint_util_right_helix_up_small_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3][2], const rct_xy16 offsets[4][3][2], const rct_xy16 boundsLengths[4][3][2], const rct_xyz16 boundsOffsets[4][3][2], uint8 rotation) +void track_paint_util_right_helix_up_small_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3][2], const LocationXY16 offsets[4][3][2], const LocationXY16 boundsLengths[4][3][2], const LocationXYZ16 boundsOffsets[4][3][2], uint8 rotation) { sint32 index = right_helix_up_small_quarter_tiles_sprite_map[trackSequence]; if (index < 0) { @@ -789,23 +789,23 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint(paint_session * s if (sprites[direction][index][0] != 0) { uint32 imageId = sprites[direction][index][0] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16) { 0, 0 } : offsets[direction][index][0]); - rct_xy16 boundsLength = boundsLengths[direction][index][0]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index][0]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16) { 0, 0 } : offsets[direction][index][0]); + LocationXY16 boundsLength = boundsLengths[direction][index][0]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index][0]); sub_98197C(session, imageId, (sint8)offset.x, (sint8)offset.y, boundsLength.x, boundsLength.y, thickness[0], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } if (sprites[direction][index][1] != 0) { uint32 imageId = sprites[direction][index][1] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16){0, 0} : offsets[direction][index][1]); - rct_xy16 boundsLength = boundsLengths[direction][index][1]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16){.x = offset.x, .y = offset.y, .z = 0} : boundsOffsets[direction][index][1]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16){0, 0} : offsets[direction][index][1]); + LocationXY16 boundsLength = boundsLengths[direction][index][1]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16){.x = offset.x, .y = offset.y, .z = 0} : boundsOffsets[direction][index][1]); sub_98197C(session, imageId, (sint8) offset.x, (sint8) offset.y, boundsLength.x, boundsLength.y, thickness[1], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } } -const rct_xyz16 defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2] = { +const LocationXYZ16 defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2] = { { {0, 6}, {0, 16}, @@ -836,7 +836,7 @@ const rct_xyz16 defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2] = { } }; -const rct_xy16 defaultRightHelixUpLargeQuarterBoundLengths[4][5][2] = { +const LocationXY16 defaultRightHelixUpLargeQuarterBoundLengths[4][5][2] = { { {32, 20}, {32, 16}, @@ -868,7 +868,7 @@ const rct_xy16 defaultRightHelixUpLargeQuarterBoundLengths[4][5][2] = { }; static const sint8 right_helix_up_large_quarter_sprite_map[] = {0, -1, 1, 2, -1, 3, 4}; -void track_paint_util_right_helix_up_large_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5][2], const rct_xy16 offsets[4][5][2], const rct_xy16 boundsLengths[4][5][2], const rct_xyz16 boundsOffsets[4][5][2], uint8 rotation) +void track_paint_util_right_helix_up_large_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5][2], const LocationXY16 offsets[4][5][2], const LocationXY16 boundsLengths[4][5][2], const LocationXYZ16 boundsOffsets[4][5][2], uint8 rotation) { sint32 index = right_helix_up_large_quarter_sprite_map[trackSequence]; if (index < 0) { @@ -877,23 +877,23 @@ void track_paint_util_right_helix_up_large_quarter_tiles_paint(paint_session * s if (sprites[direction][index][0] != 0) { uint32 imageId = sprites[direction][index][0] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16) { 0, 0 } : offsets[direction][index][0]); - rct_xy16 boundsLength = boundsLengths[direction][index][0]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index][0]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16) { 0, 0 } : offsets[direction][index][0]); + LocationXY16 boundsLength = boundsLengths[direction][index][0]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index][0]); sub_98197C(session, imageId, (sint8)offset.x, (sint8)offset.y, boundsLength.x, boundsLength.y, thickness[0], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } if (sprites[direction][index][1] != 0) { uint32 imageId = sprites[direction][index][1] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16){0, 0} : offsets[direction][index][1]); - rct_xy16 boundsLength = boundsLengths[direction][index][1]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16){.x = offset.x, .y = offset.y, .z = 0} : boundsOffsets[direction][index][1]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16){0, 0} : offsets[direction][index][1]); + LocationXY16 boundsLength = boundsLengths[direction][index][1]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16){.x = offset.x, .y = offset.y, .z = 0} : boundsOffsets[direction][index][1]); sub_98197C(session, imageId, (sint8) offset.x, (sint8) offset.y, boundsLength.x, boundsLength.y, thickness[1], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } } -const rct_xy16 defaultLeftEighthToDiagBoundLengths[4][4] = { +const LocationXY16 defaultLeftEighthToDiagBoundLengths[4][4] = { { {32, 20}, {32, 16}, @@ -920,7 +920,7 @@ const rct_xy16 defaultLeftEighthToDiagBoundLengths[4][4] = { }, }; -const rct_xyz16 defaultLeftEighthToDiagBoundOffsets[4][4] = { +const LocationXYZ16 defaultLeftEighthToDiagBoundOffsets[4][4] = { { {0, 6}, {0, 0}, @@ -947,7 +947,7 @@ const rct_xyz16 defaultLeftEighthToDiagBoundOffsets[4][4] = { }, }; -const rct_xy16 defaultRightEighthToDiagBoundLengths[4][4] = { +const LocationXY16 defaultRightEighthToDiagBoundLengths[4][4] = { { {32, 20}, {32, 16}, @@ -974,7 +974,7 @@ const rct_xy16 defaultRightEighthToDiagBoundLengths[4][4] = { }, }; -const rct_xyz16 defaultRightEighthToDiagBoundOffsets[4][4] = { +const LocationXYZ16 defaultRightEighthToDiagBoundOffsets[4][4] = { { {0, 6}, {0, 16}, @@ -1031,7 +1031,7 @@ const sint8 defaultEighthToDiagThickness[4][4] = { const uint8 mapLeftEighthTurnToOrthogonal[] = { 4, 2, 3, 1, 0 }; static const sint8 eighth_to_diag_sprite_map[] = {0, 1, 2, -1, 3}; -void track_paint_util_eighth_to_diag_tiles_paint(paint_session * session, const sint8 thickness[4][4], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const rct_xy16 offsets[4][4], const rct_xy16 boundsLengths[4][4], const rct_xyz16 boundsOffsets[4][4], uint8 rotation) +void track_paint_util_eighth_to_diag_tiles_paint(paint_session * session, const sint8 thickness[4][4], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const LocationXY16 offsets[4][4], const LocationXY16 boundsLengths[4][4], const LocationXYZ16 boundsOffsets[4][4], uint8 rotation) { sint32 index = eighth_to_diag_sprite_map[trackSequence]; if (index < 0) { @@ -1039,21 +1039,21 @@ void track_paint_util_eighth_to_diag_tiles_paint(paint_session * session, const } uint32 imageId = sprites[direction][index] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16) { 0, 0 } : offsets[direction][index]); - rct_xy16 boundsLength = boundsLengths[direction][index]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16) { 0, 0 } : offsets[direction][index]); + LocationXY16 boundsLength = boundsLengths[direction][index]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index]); sub_98197C(session, imageId, (sint8)offset.x, (sint8)offset.y, boundsLength.x, boundsLength.y, thickness[direction][index], height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } -const rct_xy16 defaultDiagTileOffsets[4] = { +const LocationXY16 defaultDiagTileOffsets[4] = { {-16, -16}, {-16, -16}, {-16, -16}, {-16, -16}, }; -const rct_xy16 defaultDiagBoundLengths[4] = { +const LocationXY16 defaultDiagBoundLengths[4] = { {32, 32}, {32, 32}, {32, 32}, @@ -1067,7 +1067,7 @@ static const sint8 diag_sprite_map[4][4] = { {0, -1, -1, -1}, }; -void track_paint_util_diag_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4], const rct_xy16 offsets[4], const rct_xy16 boundsLengths[4], const rct_xyz16 boundsOffsets[4], uint8 rotation) +void track_paint_util_diag_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4], const LocationXY16 offsets[4], const LocationXY16 boundsLengths[4], const LocationXYZ16 boundsOffsets[4], uint8 rotation) { sint32 index = diag_sprite_map[direction][trackSequence]; if (index < 0) { @@ -1075,16 +1075,16 @@ void track_paint_util_diag_tiles_paint(paint_session * session, sint8 thickness, } uint32 imageId = sprites[direction] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16) { 0, 0 } : offsets[direction]); - rct_xy16 boundsLength = boundsLengths[direction]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16) { 0, 0 } : offsets[direction]); + LocationXY16 boundsLength = boundsLengths[direction]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction]); sub_98197C(session, imageId, (sint8)offset.x, (sint8)offset.y, boundsLength.x, boundsLength.y, thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } const uint8 mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = {6, 4, 5, 3, 1, 2, 0}; -const rct_xy16 defaultRightQuarterTurn5TilesOffsets[4][5] = { +const LocationXY16 defaultRightQuarterTurn5TilesOffsets[4][5] = { { {0, 6}, {0, 16}, @@ -1115,7 +1115,7 @@ const rct_xy16 defaultRightQuarterTurn5TilesOffsets[4][5] = { } }; -const rct_xyz16 defaultRightQuarterTurn5TilesBoundOffsets[4][5] = { +const LocationXYZ16 defaultRightQuarterTurn5TilesBoundOffsets[4][5] = { { {0, 6}, {0, 16}, @@ -1146,7 +1146,7 @@ const rct_xyz16 defaultRightQuarterTurn5TilesBoundOffsets[4][5] = { } }; -const rct_xy16 defaultRightQuarterTurn5TilesBoundLengths[4][5] = { +const LocationXY16 defaultRightQuarterTurn5TilesBoundLengths[4][5] = { { {32, 20}, {32, 16}, @@ -1178,7 +1178,7 @@ const rct_xy16 defaultRightQuarterTurn5TilesBoundLengths[4][5] = { }; static const sint8 right_quarter_turn_5_tiles_sprite_map[] = {0, -1, 1, 2, -1, 3, 4}; -void track_paint_util_right_quarter_turn_5_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const rct_xy16 offsets[4][5], const rct_xy16 boundsLengths[4][5], const rct_xyz16 boundsOffsets[4][5], uint8 rotation) +void track_paint_util_right_quarter_turn_5_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const LocationXY16 offsets[4][5], const LocationXY16 boundsLengths[4][5], const LocationXYZ16 boundsOffsets[4][5], uint8 rotation) { sint32 index = right_quarter_turn_5_tiles_sprite_map[trackSequence]; if (index < 0) { @@ -1186,9 +1186,9 @@ void track_paint_util_right_quarter_turn_5_tiles_paint(paint_session * session, } uint32 imageId = sprites[direction][index] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16){0, 0} : offsets[direction][index]); - rct_xy16 boundsLength = boundsLengths[direction][index]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16){0, 0} : offsets[direction][index]); + LocationXY16 boundsLength = boundsLengths[direction][index]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index]); sub_98197C(session, imageId, (sint8) offset.x, (sint8) offset.y, boundsLength.x, boundsLength.y, thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } @@ -1258,7 +1258,7 @@ void track_paint_util_right_quarter_turn_5_tiles_wooden_supports(paint_session * const uint8 mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[] = {3, 1, 2, 0}; -const rct_xy16 defaultRightQuarterTurn3TilesOffsets[4][3] = { +const LocationXY16 defaultRightQuarterTurn3TilesOffsets[4][3] = { { {0, 6}, {16, 16}, @@ -1281,7 +1281,7 @@ const rct_xy16 defaultRightQuarterTurn3TilesOffsets[4][3] = { } }; -const rct_xyz16 defaultRightQuarterTurn3TilesBoundOffsets[4][3] = { +const LocationXYZ16 defaultRightQuarterTurn3TilesBoundOffsets[4][3] = { { {0, 6}, {16, 16}, @@ -1304,7 +1304,7 @@ const rct_xyz16 defaultRightQuarterTurn3TilesBoundOffsets[4][3] = { } }; -const rct_xy16 defaultRightQuarterTurn3TilesBoundLengths[4][3] = { +const LocationXY16 defaultRightQuarterTurn3TilesBoundLengths[4][3] = { { {32, 20}, {16, 16}, @@ -1328,7 +1328,7 @@ const rct_xy16 defaultRightQuarterTurn3TilesBoundLengths[4][3] = { }; static const sint8 right_quarter_turn_3_tiles_sprite_map[] = {0, -1, 1, 2}; -void track_paint_util_right_quarter_turn_3_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const rct_xy16 offsets[4][3], const rct_xy16 boundsLengths[4][3], const rct_xyz16 boundsOffsets[4][3], uint8 rotation) +void track_paint_util_right_quarter_turn_3_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const LocationXY16 offsets[4][3], const LocationXY16 boundsLengths[4][3], const LocationXYZ16 boundsOffsets[4][3], uint8 rotation) { sint32 index = right_quarter_turn_3_tiles_sprite_map[trackSequence]; if (index < 0) { @@ -1336,9 +1336,9 @@ void track_paint_util_right_quarter_turn_3_tiles_paint(paint_session * session, } uint32 imageId = sprites[direction][index] | colourFlags; - rct_xy16 offset = (offsets == NULL ? (rct_xy16){0, 0} : offsets[direction][index]); - rct_xy16 boundsLength = boundsLengths[direction][index]; - rct_xyz16 boundsOffset = (boundsOffsets == NULL ? (rct_xyz16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index]); + LocationXY16 offset = (offsets == NULL ? (LocationXY16){0, 0} : offsets[direction][index]); + LocationXY16 boundsLength = boundsLengths[direction][index]; + LocationXYZ16 boundsOffset = (boundsOffsets == NULL ? (LocationXYZ16) { .x = offset.x, .y = offset.y, .z = 0 } : boundsOffsets[direction][index]); sub_98197C(session, imageId, (sint8) offset.x, (sint8) offset.y, boundsLength.x, boundsLength.y, thickness, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, rotation); } diff --git a/src/openrct2/ride/track_paint.h b/src/openrct2/ride/track_paint.h index 6f651ce1e1..0a7db2b2c9 100644 --- a/src/openrct2/ride/track_paint.h +++ b/src/openrct2/ride/track_paint.h @@ -237,29 +237,29 @@ extern const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4] extern const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile[4]; extern const uint8 mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[]; -extern const rct_xy16 defaultRightQuarterTurn5TilesOffsets[4][5]; -extern const rct_xyz16 defaultRightQuarterTurn5TilesBoundOffsets[4][5]; -extern const rct_xy16 defaultRightQuarterTurn5TilesBoundLengths[4][5]; +extern const LocationXY16 defaultRightQuarterTurn5TilesOffsets[4][5]; +extern const LocationXYZ16 defaultRightQuarterTurn5TilesBoundOffsets[4][5]; +extern const LocationXY16 defaultRightQuarterTurn5TilesBoundLengths[4][5]; extern const uint8 mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[]; -extern const rct_xy16 defaultRightQuarterTurn3TilesOffsets[4][3]; -extern const rct_xyz16 defaultRightQuarterTurn3TilesBoundOffsets[4][3]; -extern const rct_xy16 defaultRightQuarterTurn3TilesBoundLengths[4][3]; +extern const LocationXY16 defaultRightQuarterTurn3TilesOffsets[4][3]; +extern const LocationXYZ16 defaultRightQuarterTurn3TilesBoundOffsets[4][3]; +extern const LocationXY16 defaultRightQuarterTurn3TilesBoundLengths[4][3]; -extern const rct_xy16 defaultRightHelixUpSmallQuarterBoundLengths[4][3][2]; -extern const rct_xyz16 defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2]; +extern const LocationXY16 defaultRightHelixUpSmallQuarterBoundLengths[4][3][2]; +extern const LocationXYZ16 defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2]; -extern const rct_xy16 defaultRightHelixUpLargeQuarterBoundLengths[4][5][2]; -extern const rct_xyz16 defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2]; +extern const LocationXY16 defaultRightHelixUpLargeQuarterBoundLengths[4][5][2]; +extern const LocationXYZ16 defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2]; -extern const rct_xyz16 defaultLeftEighthToDiagBoundOffsets[4][4]; -extern const rct_xy16 defaultLeftEighthToDiagBoundLengths[4][4]; -extern const rct_xyz16 defaultRightEighthToDiagBoundOffsets[4][4]; -extern const rct_xy16 defaultRightEighthToDiagBoundLengths[4][4]; +extern const LocationXYZ16 defaultLeftEighthToDiagBoundOffsets[4][4]; +extern const LocationXY16 defaultLeftEighthToDiagBoundLengths[4][4]; +extern const LocationXYZ16 defaultRightEighthToDiagBoundOffsets[4][4]; +extern const LocationXY16 defaultRightEighthToDiagBoundLengths[4][4]; extern const sint8 defaultEighthToDiagThickness[4][4]; -extern const rct_xy16 defaultDiagBoundLengths[4]; -extern const rct_xy16 defaultDiagTileOffsets[4]; +extern const LocationXY16 defaultDiagBoundLengths[4]; +extern const LocationXY16 defaultDiagTileOffsets[4]; extern const uint8 mapLeftEighthTurnToOrthogonal[5]; @@ -267,9 +267,9 @@ extern bool gUseOriginalRidePaint; extern const size_t mini_golf_peep_animation_lengths[]; -bool track_paint_util_has_fence(enum edge_t edge, rct_xy16 position, rct_map_element * mapElement, Ride * ride, uint8 rotation); +bool track_paint_util_has_fence(enum edge_t edge, LocationXY16 position, rct_map_element * mapElement, Ride * ride, uint8 rotation); void track_paint_util_paint_floor(paint_session * session, uint8 edges, uint32 colourFlags, uint16 height, const uint32 floorSprites[4], uint8 rotation); -void track_paint_util_paint_fences(paint_session * session, uint8 edges, rct_xy16 position, rct_map_element * mapElement, Ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation); +void track_paint_util_paint_fences(paint_session * session, uint8 edges, LocationXY16 position, rct_map_element * mapElement, Ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation); bool track_paint_util_draw_station_covers(paint_session * session, enum edge_t edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height); bool track_paint_util_draw_station_covers_2(paint_session * session, enum edge_t edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height, uint8 stationVariant); void track_paint_util_draw_station_platform(paint_session * session, Ride *ride, uint8 direction, sint32 height, sint32 zOffset, rct_map_element * mapElement); @@ -277,19 +277,19 @@ void track_paint_util_draw_station(paint_session * session, uint8 rideIndex, uin void track_paint_util_draw_station_2(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, rct_map_element * mapElement, sint32 fenceOffsetA, sint32 fenceOffsetB); void track_paint_util_draw_station_3(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, uint16 coverHeight, rct_map_element * mapElement); void track_paint_util_draw_station_inverted(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement, uint8 stationVariant); -bool track_paint_util_should_paint_supports(rct_xy16 position); -void track_paint_util_draw_pier(paint_session * session, Ride * ride, const rct_ride_entrance_definition * entranceStyle, rct_xy16 position, uint8 direction, sint32 height, rct_map_element * mapElement, uint8 rotation); +bool track_paint_util_should_paint_supports(LocationXY16 position); +void track_paint_util_draw_pier(paint_session * session, Ride * ride, const rct_ride_entrance_definition * entranceStyle, LocationXY16 position, uint8 direction, sint32 height, rct_map_element * mapElement, uint8 rotation); void track_paint_util_draw_station_metal_supports(paint_session * session, uint8 direction, uint16 height, uint32 colour); void track_paint_util_draw_station_metal_supports_2(paint_session * session, uint8 direction, uint16 height, uint32 colour, uint8 type); -void track_paint_util_right_quarter_turn_5_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const rct_xy16 offsets[4][5], const rct_xy16 boundsLengths[4][5], const rct_xyz16 boundsOffsets[4][5], uint8 rotation); +void track_paint_util_right_quarter_turn_5_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const LocationXY16 offsets[4][5], const LocationXY16 boundsLengths[4][5], const LocationXYZ16 boundsOffsets[4][5], uint8 rotation); void track_paint_util_right_quarter_turn_5_tiles_paint_2(paint_session * session, sint16 height, sint32 direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5]); void track_paint_util_right_quarter_turn_5_tiles_paint_3(paint_session * session, sint16 height, sint32 direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5]); void track_paint_util_right_quarter_turn_5_tiles_tunnel(paint_session * session, sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType); void track_paint_util_right_quarter_turn_5_tiles_wooden_supports(paint_session * session, sint16 height, uint8 direction, uint8 trackSequence); void track_paint_util_right_quarter_turn_3_tiles_25_deg_up_tunnel(paint_session * session, sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType0, uint8 tunnelType3); void track_paint_util_right_quarter_turn_3_tiles_25_deg_down_tunnel(paint_session * session, sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType0, uint8 tunnelType3); -void track_paint_util_right_quarter_turn_3_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const rct_xy16 offsets[4][3], const rct_xy16 boundsLengths[4][3], const rct_xyz16 boundsOffsets[4][3], uint8 rotation); +void track_paint_util_right_quarter_turn_3_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const LocationXY16 offsets[4][3], const LocationXY16 boundsLengths[4][3], const LocationXYZ16 boundsOffsets[4][3], uint8 rotation); void track_paint_util_right_quarter_turn_3_tiles_paint_2(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation); void track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation, sint32 heightOffset); void track_paint_util_right_quarter_turn_3_tiles_paint_3(paint_session * session, sint16 height, sint32 direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[4][3]); @@ -302,10 +302,10 @@ void track_paint_util_left_quarter_turn_1_tile_paint(paint_session * session, si void track_paint_util_spinning_tunnel_paint(paint_session * session, sint8 thickness, sint16 height, uint8 direction, uint8 rotation); void track_paint_util_onride_photo_small_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element *mapElement); void track_paint_util_onride_photo_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element *mapElement); -void track_paint_util_right_helix_up_small_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3][2], const rct_xy16 offsets[4][3][2], const rct_xy16 boundsLengths[4][3][2], const rct_xyz16 boundsOffsets[4][3][2], uint8 rotation); -void track_paint_util_right_helix_up_large_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5][2], const rct_xy16 offsets[4][5][2], const rct_xy16 boundsLengths[4][5][2], const rct_xyz16 boundsOffsets[4][5][2], uint8 rotation); -void track_paint_util_eighth_to_diag_tiles_paint(paint_session * session, const sint8 thickness[4][4], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const rct_xy16 offsets[4][4], const rct_xy16 boundsLengths[4][4], const rct_xyz16 boundsOffsets[4][4], uint8 rotation); -void track_paint_util_diag_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4], const rct_xy16 offsets[4], const rct_xy16 boundsLengths[4], const rct_xyz16 boundsOffsets[4], uint8 rotation); +void track_paint_util_right_helix_up_small_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3][2], const LocationXY16 offsets[4][3][2], const LocationXY16 boundsLengths[4][3][2], const LocationXYZ16 boundsOffsets[4][3][2], uint8 rotation); +void track_paint_util_right_helix_up_large_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5][2], const LocationXY16 offsets[4][5][2], const LocationXY16 boundsLengths[4][5][2], const LocationXYZ16 boundsOffsets[4][5][2], uint8 rotation); +void track_paint_util_eighth_to_diag_tiles_paint(paint_session * session, const sint8 thickness[4][4], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const LocationXY16 offsets[4][4], const LocationXY16 boundsLengths[4][4], const LocationXYZ16 boundsOffsets[4][4], uint8 rotation); +void track_paint_util_diag_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4], const LocationXY16 offsets[4], const LocationXY16 boundsLengths[4], const LocationXYZ16 boundsOffsets[4], uint8 rotation); void track_paint_util_left_quarter_turn_1_tile_tunnel(paint_session * session, uint8 direction, uint16 baseHeight, sint8 startOffset, uint8 startTunnel, sint8 endOffset, uint8 endTunnel); void track_paint_util_right_quarter_turn_1_tile_tunnel(paint_session * session, uint8 direction, uint16 baseHeight, sint8 startOffset, uint8 startTunnel, sint8 endOffset, uint8 endTunnel); diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index f4d546dcc5..5be880bad3 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -138,7 +138,7 @@ static rct_map_element * chairlift_paint_util_map_get_track_element_at_from_ride return NULL; }; -static bool chairlift_paint_util_is_first_track(uint8 rideIndex, const rct_map_element * mapElement, rct_xy16 pos, +static bool chairlift_paint_util_is_first_track(uint8 rideIndex, const rct_map_element * mapElement, LocationXY16 pos, uint8 trackType) { if (mapElement->properties.track.type != TRACK_ELEM_BEGIN_STATION) @@ -146,8 +146,8 @@ static bool chairlift_paint_util_is_first_track(uint8 rideIndex, const rct_map_e return false; } - rct_xy16 delta = TileDirectionDelta[map_element_get_direction(mapElement)]; - rct_xy16 newPos = { + LocationXY16 delta = TileDirectionDelta[map_element_get_direction(mapElement)]; + LocationXY16 newPos = { static_cast(pos.x - delta.x), static_cast(pos.y - delta.y), }; @@ -158,7 +158,7 @@ static bool chairlift_paint_util_is_first_track(uint8 rideIndex, const rct_map_e return nextTrack == NULL; } -static bool chairlift_paint_util_is_last_track(uint8 rideIndex, const rct_map_element * mapElement, rct_xy16 pos, +static bool chairlift_paint_util_is_last_track(uint8 rideIndex, const rct_map_element * mapElement, LocationXY16 pos, uint8 trackType) { if (mapElement->properties.track.type != TRACK_ELEM_END_STATION) @@ -166,8 +166,8 @@ static bool chairlift_paint_util_is_last_track(uint8 rideIndex, const rct_map_el return false; } - rct_xy16 delta = TileDirectionDelta[map_element_get_direction(mapElement)]; - rct_xy16 newPos = { + LocationXY16 delta = TileDirectionDelta[map_element_get_direction(mapElement)]; + LocationXY16 newPos = { static_cast(pos.x + delta.x), static_cast(pos.y + delta.y), }; @@ -181,7 +181,7 @@ static bool chairlift_paint_util_is_last_track(uint8 rideIndex, const rct_map_el static void chairlift_paint_station_ne_sw(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; uint8 trackType = mapElement->properties.track.type; Ride * ride = get_ride(rideIndex); uint32 imageId; @@ -272,7 +272,7 @@ static void chairlift_paint_station_ne_sw(paint_session * session, uint8 rideInd static void chairlift_paint_station_se_nw(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - const rct_xy16 pos = session->MapPosition; + const LocationXY16 pos = session->MapPosition; uint8 trackType = mapElement->properties.track.type; Ride * ride = get_ride(rideIndex); uint32 imageId; diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index 8dfb1bf133..5df4f6b9a5 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -80,7 +80,7 @@ static void paint_lift_base(paint_session * session, uint8 rideIndex, uint8 trac sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; sub_98197C(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index f9e3c60c8a..ba5983f98b 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -276,7 +276,7 @@ static const uint32 miniature_railway_track_pieces_right_eight_to_diag[4][4] = { }, }; -static const rct_xyz16 miniature_railway_track_pieces_right_eight_to_diag_bounds[4][4] = { +static const LocationXYZ16 miniature_railway_track_pieces_right_eight_to_diag_bounds[4][4] = { { { 32, 32, 2 }, { 32, 16, 2 }, @@ -303,7 +303,7 @@ static const rct_xyz16 miniature_railway_track_pieces_right_eight_to_diag_bounds }, }; -static const rct_xy16 miniature_railway_track_pieces_right_eight_to_diag_offset[4][4] = { +static const LocationXY16 miniature_railway_track_pieces_right_eight_to_diag_offset[4][4] = { { { 0, 0 }, { 0, 16 }, @@ -357,7 +357,7 @@ static const uint32 miniature_railway_track_pieces_left_eight_to_diag[4][4] = { }, }; -static const rct_xyz16 miniature_railway_track_pieces_left_eight_to_diag_bounds[4][4] = { +static const LocationXYZ16 miniature_railway_track_pieces_left_eight_to_diag_bounds[4][4] = { { { 32, 32, 2 }, { 32, 16, 2 }, @@ -384,7 +384,7 @@ static const rct_xyz16 miniature_railway_track_pieces_left_eight_to_diag_bounds[ }, }; -static const rct_xy16 miniature_railway_track_pieces_left_eight_to_diag_offset[4][4] = { +static const LocationXY16 miniature_railway_track_pieces_left_eight_to_diag_offset[4][4] = { { { 0, 0 }, { 0, 0 }, @@ -411,7 +411,7 @@ static const rct_xy16 miniature_railway_track_pieces_left_eight_to_diag_offset[4 }, }; -static const rct_xyz16 miniature_railway_track_pieces_right_eight_to_orthog_bounds[4][4] = { +static const LocationXYZ16 miniature_railway_track_pieces_right_eight_to_orthog_bounds[4][4] = { { { 32, 32, 2 }, { 32, 16, 2 }, @@ -438,7 +438,7 @@ static const rct_xyz16 miniature_railway_track_pieces_right_eight_to_orthog_boun }, }; -static const rct_xy16 miniature_railway_track_pieces_right_eight_to_orthog_offset[4][4] = { +static const LocationXY16 miniature_railway_track_pieces_right_eight_to_orthog_offset[4][4] = { { { 0, 0 }, { 0, 0 }, @@ -465,7 +465,7 @@ static const rct_xy16 miniature_railway_track_pieces_right_eight_to_orthog_offse }, }; -static const rct_xyz16 miniature_railway_track_pieces_left_eight_to_orthog_bounds[4][4] = { +static const LocationXYZ16 miniature_railway_track_pieces_left_eight_to_orthog_bounds[4][4] = { { { 32, 32, 2 }, { 32, 16, 2 }, @@ -492,7 +492,7 @@ static const rct_xyz16 miniature_railway_track_pieces_left_eight_to_orthog_bound }, }; -static const rct_xy16 miniature_railway_track_pieces_left_eight_to_orthog_offset[4][4] = { +static const LocationXY16 miniature_railway_track_pieces_left_eight_to_orthog_offset[4][4] = { { { 0, 0 }, { 0, 16 }, @@ -713,7 +713,7 @@ static void paint_miniature_railway_track_25_deg_down_to_flat(paint_session * se paint_miniature_railway_track_flat_to_25_deg_up(session, rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); } -const rct_xy16 miniature_railway_right_quarter_turn_5_tiles_offsets[4][5] = { { +const LocationXY16 miniature_railway_right_quarter_turn_5_tiles_offsets[4][5] = { { { 0, 2 }, { 0, 16 }, { 0, 0 }, @@ -742,7 +742,7 @@ const rct_xy16 miniature_railway_right_quarter_turn_5_tiles_offsets[4][5] = { { { 0, 2 }, } }; -const rct_xyz16 miniature_railway_right_quarter_turn_5_tiles_bound_offsets[4][5] = { { +const LocationXYZ16 miniature_railway_right_quarter_turn_5_tiles_bound_offsets[4][5] = { { { 0, 2, 0 }, { 0, 16, 0 }, { 0, 0, 0 }, @@ -771,7 +771,7 @@ const rct_xyz16 miniature_railway_right_quarter_turn_5_tiles_bound_offsets[4][5] { 0, 2, 0 }, } }; -const rct_xy16 miniature_railway_right_quarter_turn_5_tiles_bound_lengths[4][5] = { { +const LocationXY16 miniature_railway_right_quarter_turn_5_tiles_bound_lengths[4][5] = { { { 32, 32 }, { 32, 16 }, { 16, 16 }, @@ -846,9 +846,9 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles(paint_sessi sint32 index = miniature_railway_right_quarter_turn_5_tiles_sprite_map[trackSequence]; uint32 imageId = miniature_railway_track_pieces_flat_quarter_turn_5_tiles[direction][index] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = miniature_railway_right_quarter_turn_5_tiles_offsets[direction][index]; - rct_xy16 boundsLength = miniature_railway_right_quarter_turn_5_tiles_bound_lengths[direction][index]; - rct_xyz16 boundsOffset = { offset.x, offset.y, 0 }; + LocationXY16 offset = miniature_railway_right_quarter_turn_5_tiles_offsets[direction][index]; + LocationXY16 boundsLength = miniature_railway_right_quarter_turn_5_tiles_bound_lengths[direction][index]; + LocationXYZ16 boundsOffset = { offset.x, offset.y, 0 }; sub_98199C(session, imageId, (sint8)offset.x, (sint8)offset.y, boundsLength.x, boundsLength.y, 2, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, get_current_rotation()); @@ -938,14 +938,14 @@ static void paint_miniature_railway_track_s_bend_left(paint_session * session, u bool isSupported = wooden_a_supports_paint_setup(session, s_bend_left_supports_type[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], NULL); - const rct_xy16 offsetList[] = { + const LocationXY16 offsetList[] = { { 0, 2 }, { 0, 0 }, { 0, 6 }, { 0, 2 }, }; - const rct_xy16 boundsList[] = { + const LocationXY16 boundsList[] = { { 32, 27 }, { 32, 26 }, { 32, 26 }, @@ -954,8 +954,8 @@ static void paint_miniature_railway_track_s_bend_left(paint_session * session, u uint32 imageId = miniature_railway_track_pieces_s_bend_left[direction & 1][trackSequence] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = offsetList[trackSequence]; - rct_xy16 bounds = boundsList[trackSequence]; + LocationXY16 offset = offsetList[trackSequence]; + LocationXY16 bounds = boundsList[trackSequence]; if (isSupported == false) { @@ -1032,14 +1032,14 @@ static void paint_miniature_railway_track_s_bend_right(paint_session * session, bool isSupported = wooden_a_supports_paint_setup(session, s_bend_right_supports_type[direction][trackSequence], 0, height, session->TrackColours[SCHEME_SUPPORTS], NULL); - const rct_xy16 offsetList[] = { + const LocationXY16 offsetList[] = { { 0, 2 }, { 0, 6 }, { 0, 0 }, { 0, 2 }, }; - const rct_xy16 boundsList[] = { + const LocationXY16 boundsList[] = { { 32, 27 }, { 32, 26 }, { 32, 26 }, @@ -1048,8 +1048,8 @@ static void paint_miniature_railway_track_s_bend_right(paint_session * session, uint32 imageId = miniature_railway_track_pieces_s_bend_right[direction & 1][trackSequence] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = offsetList[trackSequence]; - rct_xy16 bounds = boundsList[trackSequence]; + LocationXY16 offset = offsetList[trackSequence]; + LocationXY16 bounds = boundsList[trackSequence]; if (isSupported == false) { sub_98197C_rotated(session, direction, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 2, height, @@ -1124,7 +1124,7 @@ static const uint32 miniature_railway_right_quarter_turn_3_tile_track_floor[4][3 SPR_FLOOR_PLANKS_E_SEGMENT, } }; -const rct_xyz16 miniature_railway_right_quarter_turn_3_tile_bound_offsets[4][3] = { { +const LocationXYZ16 miniature_railway_right_quarter_turn_3_tile_bound_offsets[4][3] = { { { 0, 6, 0 }, { 16, 16, 0 }, { 6, 0, 0 }, @@ -1177,9 +1177,9 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles(paint_sessi uint32 imageId = miniature_railway_track_pieces_flat_quarter_turn_3_tiles[direction][index] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = defaultRightQuarterTurn3TilesOffsets[direction][index]; - rct_xy16 boundsLength = defaultRightQuarterTurn3TilesBoundLengths[direction][index]; - rct_xyz16 boundsOffset = { offset.x, offset.y, 0 }; + LocationXY16 offset = defaultRightQuarterTurn3TilesOffsets[direction][index]; + LocationXY16 boundsLength = defaultRightQuarterTurn3TilesBoundLengths[direction][index]; + LocationXYZ16 boundsOffset = { offset.x, offset.y, 0 }; sub_98199C(session, imageId, (sint8)offset.x, (sint8)offset.y, boundsLength.x, boundsLength.y, 3, height, boundsOffset.x, boundsOffset.y, height + boundsOffset.z, get_current_rotation()); @@ -1225,7 +1225,7 @@ static const uint32 miniature_railway_floor_track_pieces_left_eight_to_diag[4][5 SPR_FLOOR_PLANKS }, }; -static const rct_xyz16 miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[4][5] = { +static const LocationXYZ16 miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[4][5] = { { { 32, 32, 2 }, { 32, 16, 2 }, @@ -1256,7 +1256,7 @@ static const rct_xyz16 miniature_railway_track_floor_pieces_left_eight_to_diag_b }, }; -static const rct_xy16 miniature_railway_track_floor_pieces_left_eight_to_diag_offset[4][5] = { +static const LocationXY16 miniature_railway_track_floor_pieces_left_eight_to_diag_offset[4][5] = { { { 0, 0 }, { 0, 0 }, @@ -1309,8 +1309,8 @@ static void paint_miniature_railway_track_left_eighth_to_diag(paint_session * se if (index >= 0) { imageId = miniature_railway_track_pieces_left_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = miniature_railway_track_pieces_left_eight_to_diag_offset[direction][index]; - rct_xyz16 bounds = miniature_railway_track_pieces_left_eight_to_diag_bounds[direction][index]; + LocationXY16 offset = miniature_railway_track_pieces_left_eight_to_diag_offset[direction][index]; + LocationXYZ16 bounds = miniature_railway_track_pieces_left_eight_to_diag_bounds[direction][index]; if (isRightEighthToOrthog) { bounds = miniature_railway_track_pieces_right_eight_to_orthog_bounds[direction][index]; @@ -1324,8 +1324,8 @@ static void paint_miniature_railway_track_left_eighth_to_diag(paint_session * se { imageId = miniature_railway_floor_track_pieces_left_eight_to_diag[direction][trackSequence] | session->TrackColours[SCHEME_SUPPORTS]; - rct_xy16 offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; - rct_xyz16 bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; + LocationXY16 offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; + LocationXYZ16 bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; sub_98197C(session, imageId, 0, 0, bounds.x, bounds.y, (sint8)bounds.z, height, offset.x, offset.y, height, get_current_rotation()); @@ -1363,7 +1363,7 @@ static const uint32 miniature_railway_floor_track_pieces_right_eight_to_diag[4][ SPR_FLOOR_PLANKS }, }; -static const rct_xyz16 miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[4][5] = { +static const LocationXYZ16 miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[4][5] = { { { 32, 32, 2 }, { 32, 16, 2 }, @@ -1394,7 +1394,7 @@ static const rct_xyz16 miniature_railway_track_floor_pieces_right_eight_to_diag_ }, }; -static const rct_xy16 miniature_railway_track_floor_pieces_right_eight_to_diag_offset[4][5] = { +static const LocationXY16 miniature_railway_track_floor_pieces_right_eight_to_diag_offset[4][5] = { { { 0, 0 }, { 0, 16 }, @@ -1449,8 +1449,8 @@ static void paint_miniature_railway_track_right_eighth_to_diag(paint_session * s { imageId = miniature_railway_track_pieces_right_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = miniature_railway_track_pieces_right_eight_to_diag_offset[direction][index]; - rct_xyz16 bounds = miniature_railway_track_pieces_right_eight_to_diag_bounds[direction][index]; + LocationXY16 offset = miniature_railway_track_pieces_right_eight_to_diag_offset[direction][index]; + LocationXYZ16 bounds = miniature_railway_track_pieces_right_eight_to_diag_bounds[direction][index]; if (isLeftEighthToOrthog) { bounds = miniature_railway_track_pieces_left_eight_to_orthog_bounds[direction][index]; @@ -1464,8 +1464,8 @@ static void paint_miniature_railway_track_right_eighth_to_diag(paint_session * s { imageId = miniature_railway_floor_track_pieces_right_eight_to_diag[direction][trackSequence] | session->TrackColours[SCHEME_SUPPORTS]; - rct_xy16 offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; - rct_xyz16 bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; + LocationXY16 offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; + LocationXYZ16 bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; sub_98197C(session, imageId, 0, 0, bounds.x, bounds.y, (sint8)bounds.z, height, offset.x, offset.y, height, get_current_rotation()); @@ -1541,8 +1541,8 @@ static const sint16 monorail_diag_support_types[][4] = { typedef struct floor_desc { uint32 image_id; - rct_xy16 bound_size; - rct_xy16 bound_offset; + LocationXY16 bound_size; + LocationXY16 bound_offset; } floor_desc; static const floor_desc floors[] = { @@ -1562,8 +1562,8 @@ static void miniature_railway_track_diag_flat(paint_session * session, uint8 rid sint16 supportType = monorail_diag_support_types[direction][trackSequence]; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; if (supportType != -1) { @@ -1646,8 +1646,8 @@ static void miniature_railway_track_diag_25_deg_up(paint_session * session, uint bool hasSupports = false; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; if (supportType != -1) { @@ -1702,8 +1702,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_up(paint_session * sessi bool hasSupports = false; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; if (supportType != -1) @@ -1764,8 +1764,8 @@ static void miniature_railway_track_diag_25_deg_up_to_flat(paint_session * sessi sint16 supportType = monorail_diag_support_types[direction][trackSequence]; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; if (supportType != -1) { @@ -1835,8 +1835,8 @@ static void miniature_railway_track_diag_25_deg_down(paint_session * session, ui bool hasSupports = false; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; if (supportType != -1) @@ -1905,8 +1905,8 @@ static void miniature_railway_track_diag_flat_to_25_deg_down(paint_session * ses bool hasSupports = false; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; if (supportType != -1) @@ -1961,8 +1961,8 @@ static void miniature_railway_track_diag_25_deg_down_to_flat(paint_session * ses { bool hasSupports = false; uint32 floorImage = 0; - rct_xy16 floorBoundSize = { 0 }; - rct_xy16 floorBoundOffset = { 0 }; + LocationXY16 floorBoundSize = { 0 }; + LocationXY16 floorBoundOffset = { 0 }; sint16 supportType = monorail_diag_support_types[direction][trackSequence]; if (supportType != -1) diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index b6a1441ff0..52dbb28f56 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -261,7 +261,7 @@ static const uint32 ghost_train_track_pieces_right_eight_to_diag[4][4] = { }, }; -static const rct_xy16 ghost_train_track_pieces_right_eight_to_diag_bounds[4][4] = { +static const LocationXY16 ghost_train_track_pieces_right_eight_to_diag_bounds[4][4] = { { { 32, 20 }, { 32, 16 }, @@ -288,7 +288,7 @@ static const rct_xy16 ghost_train_track_pieces_right_eight_to_diag_bounds[4][4] }, }; -static const rct_xy16 ghost_train_track_pieces_right_eight_to_diag_offset[4][4] = { +static const LocationXY16 ghost_train_track_pieces_right_eight_to_diag_offset[4][4] = { { { 0, 6 }, { 0, 16 }, @@ -342,7 +342,7 @@ static const uint32 ghost_train_track_pieces_left_eight_to_diag[4][4] = { }, }; -static const rct_xy16 ghost_train_track_pieces_left_eight_to_diag_bounds[4][4] = { +static const LocationXY16 ghost_train_track_pieces_left_eight_to_diag_bounds[4][4] = { { { 32, 20 }, { 32, 16 }, @@ -369,7 +369,7 @@ static const rct_xy16 ghost_train_track_pieces_left_eight_to_diag_bounds[4][4] = }, }; -static const rct_xy16 ghost_train_track_pieces_left_eight_to_diag_offset[4][4] = { +static const LocationXY16 ghost_train_track_pieces_left_eight_to_diag_offset[4][4] = { { { 0, 6 }, { 0, 0 }, @@ -428,7 +428,7 @@ static const uint32 monorail_track_pieces_diag_25_deg_up[4] = { static void paint_monorail_track_flat(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = monorail_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -517,7 +517,7 @@ static void paint_monorail_station(paint_session * session, uint8 rideIndex, uin static void paint_monorail_track_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = monorail_track_pieces_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -560,7 +560,7 @@ static void paint_monorail_track_25_deg_up(paint_session * session, uint8 rideIn static void paint_monorail_track_flat_to_25_deg_up(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = monorail_track_pieces_flat_to_25_deg_up[direction] | session->TrackColours[SCHEME_TRACK]; @@ -603,7 +603,7 @@ static void paint_monorail_track_flat_to_25_deg_up(paint_session * session, uint static void paint_monorail_track_25_deg_up_to_flat(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; uint32 imageId = monorail_track_pieces_25_deg_up_to_flat[direction] | session->TrackColours[SCHEME_TRACK]; @@ -742,14 +742,14 @@ static void paint_monorail_track_s_bend_left(paint_session * session, uint8 ride trackSequence = 3 - trackSequence; } - const rct_xy16 offsetList[] = { + const LocationXY16 offsetList[] = { { 0, 6 }, { 0, 0 }, { 0, 6 }, { 0, 6 }, }; - const rct_xy16 boundsList[] = { + const LocationXY16 boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -757,8 +757,8 @@ static void paint_monorail_track_s_bend_left(paint_session * session, uint8 ride }; uint32 imageId = monorail_track_pieces_s_bend_left[direction & 1][trackSequence] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = offsetList[trackSequence]; - rct_xy16 bounds = boundsList[trackSequence]; + LocationXY16 offset = offsetList[trackSequence]; + LocationXY16 bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { sub_98196C(session, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 3, height, get_current_rotation()); @@ -839,14 +839,14 @@ static void paint_monorail_track_s_bend_right(paint_session * session, uint8 rid trackSequence = 3 - trackSequence; } - const rct_xy16 offsetList[] = { + const LocationXY16 offsetList[] = { { 0, 6 }, { 0, 6 }, { 0, 0 }, { 0, 6 }, }; - const rct_xy16 boundsList[] = { + const LocationXY16 boundsList[] = { { 32, 20 }, { 32, 26 }, { 32, 26 }, @@ -854,8 +854,8 @@ static void paint_monorail_track_s_bend_right(paint_session * session, uint8 rid }; uint32 imageId = monorail_track_pieces_s_bend_right[direction & 1][trackSequence] | session->TrackColours[SCHEME_TRACK]; - rct_xy16 offset = offsetList[trackSequence]; - rct_xy16 bounds = boundsList[trackSequence]; + LocationXY16 offset = offsetList[trackSequence]; + LocationXY16 bounds = boundsList[trackSequence]; if (direction == 0 || direction == 2) { sub_98196C(session, imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, 3, height, get_current_rotation()); @@ -981,8 +981,8 @@ static void paint_monorail_track_left_eighth_to_diag(paint_session * session, ui if (index >= 0) { uint32 imageId = ghost_train_track_pieces_left_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; - const rct_xy16 offset = ghost_train_track_pieces_left_eight_to_diag_offset[direction][index]; - const rct_xy16 bounds = ghost_train_track_pieces_left_eight_to_diag_bounds[direction][index]; + const LocationXY16 offset = ghost_train_track_pieces_left_eight_to_diag_offset[direction][index]; + const LocationXY16 bounds = ghost_train_track_pieces_left_eight_to_diag_bounds[direction][index]; sub_98197C(session, imageId, 0, 0, bounds.x, bounds.y, 2, height, offset.x, offset.y, height, get_current_rotation()); } @@ -1044,8 +1044,8 @@ static void paint_monorail_track_right_eighth_to_diag(paint_session * session, u if (index >= 0) { uint32 imageId = ghost_train_track_pieces_right_eight_to_diag[direction][index] | session->TrackColours[SCHEME_TRACK]; - const rct_xy16 offset = ghost_train_track_pieces_right_eight_to_diag_offset[direction][index]; - const rct_xy16 bounds = ghost_train_track_pieces_right_eight_to_diag_bounds[direction][index]; + const LocationXY16 offset = ghost_train_track_pieces_right_eight_to_diag_offset[direction][index]; + const LocationXY16 bounds = ghost_train_track_pieces_right_eight_to_diag_bounds[direction][index]; sub_98197C(session, imageId, 0, 0, bounds.x, bounds.y, 2, height, offset.x, offset.y, height, get_current_rotation()); } diff --git a/src/openrct2/ride/vehicle.c b/src/openrct2/ride/vehicle.c index 1ed5bdb7bc..5c9700021a 100644 --- a/src/openrct2/ride/vehicle.c +++ b/src/openrct2/ride/vehicle.c @@ -96,7 +96,7 @@ uint8 _vehicleVAngleEndF64E36; uint8 _vehicleBankEndF64E37; uint8 _vehicleF64E2C; rct_vehicle * _vehicleFrontVehicle; -rct_xyz16 unk_F64E20; +LocationXYZ16 unk_F64E20; static const uint8 byte_9A3A14[] = { SOUND_SCREAM_8, SOUND_SCREAM_1 }; static const uint8 byte_9A3A16[] = { SOUND_SCREAM_1, SOUND_SCREAM_6 }; @@ -375,7 +375,7 @@ static const unk_9a36c4 Unk9A36C4[] = { }; /** rct2: 0x009A37C4 */ -static const rct_xy16 Unk9A37C4[] = { +static const LocationXY16 Unk9A37C4[] = { { 0, 0}, { 0, +1}, {+1, 0}, @@ -539,7 +539,7 @@ static const sint32 Unk9A39C4[] = { 1946281152, }; -static const rct_xy16 AvoidCollisionMoveOffset[] = { +static const LocationXY16 AvoidCollisionMoveOffset[] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, @@ -679,7 +679,7 @@ static void vehicle_update_sound_params(rct_vehicle* vehicle) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && (!(gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) || gS6Info.editor_step == EDITOR_STEP_ROLLERCOASTER_DESIGNER)) { if (vehicle->sound1_id != RCT12_SOUND_ID_NULL || vehicle->sound2_id != RCT12_SOUND_ID_NULL) { - if (vehicle->sprite_left != (sint16)(uint16)0x8000) { + if (vehicle->sprite_left != LOCATION_NULL) { sint16 x = g_music_tracking_viewport->view_x; sint16 y = g_music_tracking_viewport->view_y; sint16 w = g_music_tracking_viewport->view_width / 4; @@ -753,7 +753,7 @@ static void vehicle_update_sound_params(rct_vehicle* vehicle) i->frequency = (uint16)v; i->id = vehicle->sprite_index; i->volume = 0; - if (vehicle->x != MAP_LOCATION_NULL) { + if (vehicle->x != LOCATION_NULL) { rct_map_element* map_element = map_get_surface_element_at(vehicle->x >> 5, vehicle->y >> 5); if (map_element != NULL && map_element->base_height * 8 > vehicle->z) { // vehicle underground i->volume = 0x30; @@ -1507,7 +1507,7 @@ static void vehicle_update_measurements(rct_vehicle *vehicle) x = vehicle->x; y = vehicle->y; - if (x == SPRITE_LOCATION_NULL){ + if (x == LOCATION_NULL){ ride->testing_flags &= ~RIDE_TESTING_SHELTERED; return; } @@ -2437,7 +2437,7 @@ static bool vehicle_can_depart_synchronised(rct_vehicle *vehicle) { Ride * ride = get_ride(vehicle->ride); sint32 station = vehicle->current_station; - rct_xy8 location = ride->station_starts[station]; + LocationXY8 location = ride->station_starts[station]; sint32 x = location.x * 32; sint32 y = location.y * 32; sint32 z = ride->station_heights[station]; @@ -2755,7 +2755,7 @@ static void vehicle_update_travelling_boat_hire_setup(rct_vehicle* vehicle) { vehicle->track_x = vehicle->x & 0xFFE0; vehicle->track_y = vehicle->y & 0xFFE0; - rct_xy8 location = { + LocationXY8 location = { .x = (vehicle->track_x + TileDirectionDelta[vehicle->sprite_direction >> 3].x) / 32, .y = (vehicle->track_y + TileDirectionDelta[vehicle->sprite_direction >> 3].y) / 32 }; @@ -3173,7 +3173,7 @@ static void vehicle_update_collision_setup(rct_vehicle* vehicle) { } /** rct2: 0x009A3AC4, 0x009A3AC6 */ -static const rct_xy16 stru_9A3AC4[] = { +static const LocationXY16 stru_9A3AC4[] = { { -256, 0 }, { -236, 98 }, { -181, 181 }, @@ -4097,10 +4097,10 @@ static void vehicle_update_motion_boat_hire(rct_vehicle *vehicle) static void vehicle_update_boat_location(rct_vehicle *vehicle) { Ride *ride = get_ride(vehicle->ride); - rct_xy8 returnPosition = ride->boat_hire_return_position; + LocationXY8 returnPosition = ride->boat_hire_return_position; uint8 returnDirection = ride->boat_hire_return_direction & 3; - rct_xy8 location = { + LocationXY8 location = { .x = (vehicle->x + TileDirectionDelta[returnDirection].x) / 32, .y = (vehicle->y + TileDirectionDelta[returnDirection].y) / 32 }; @@ -4118,7 +4118,7 @@ static void vehicle_update_boat_location(rct_vehicle *vehicle) rct_ride_entry *rideEntry = get_ride_entry(vehicle->ride_subtype); if (!(rideEntry->flags & RIDE_ENTRY_FLAG_7) || vehicle->lost_time_out > 1920) { if (scenario_rand() & 1) { - rct_xy16 destLocation = { + LocationXY16 destLocation = { .x = returnPosition.x * 32 - TileDirectionDelta[returnDirection].x + 16, .y = returnPosition.y * 32 - TileDirectionDelta[returnDirection].y + 16 }; @@ -4879,7 +4879,7 @@ static void vehicle_update_crash(rct_vehicle *vehicle){ invalidate_sprite_2((rct_sprite*)curVehicle); - rct_xyz16 curPosition = { + LocationXYZ16 curPosition = { .x = curVehicle->x, .y = curVehicle->y, .z = curVehicle->z @@ -5726,7 +5726,7 @@ static sint32 vehicle_update_motion_dodgems(rct_vehicle* vehicle) { uint8 oldC4 = vehicle->var_C4 & 0x1E; vehicle->var_C4 = 0; - rct_xyz16 location = { + LocationXYZ16 location = { .x = vehicle->x, .y = vehicle->y, .z = vehicle->z @@ -5764,7 +5764,7 @@ static sint32 vehicle_update_motion_dodgems(rct_vehicle* vehicle) { uint8 direction = vehicle->sprite_direction; direction |= vehicle->var_35 & 1; - rct_xyz16 location = unk_F64E20; + LocationXYZ16 location = unk_F64E20; location.x += Unk9A36C4[direction].x; location.y += Unk9A36C4[direction].y; @@ -5867,7 +5867,7 @@ bool vehicle_update_dodgems_collision(rct_vehicle *vehicle, sint16 x, sint16 y, return true; } - rct_xy8 location = {.x = (x / 32), .y = (y / 32)}; + LocationXY8 location = {.x = (x / 32), .y = (y / 32)}; uint8 rideIndex = vehicle->ride; @@ -7128,7 +7128,7 @@ static void vehicle_update_reverser_car_bogies(rct_vehicle *vehicle) sprite_move(x, y, z, (rct_sprite*)vehicle); } -extern const rct_xy16 DuckMoveOffset[4]; +extern const LocationXY16 DuckMoveOffset[4]; /** * Collision Detection @@ -7178,7 +7178,7 @@ static bool vehicle_update_motion_collision_detection( return true; } - rct_xy8 location = {.x = (x / 32), .y = (y / 32)}; + LocationXY8 location = {.x = (x / 32), .y = (y / 32)}; bool mayCollide = false; uint16 collideId = SPRITE_INDEX_NULL; @@ -7537,7 +7537,7 @@ loc_6DB41D: } if (vehicle->var_CD != 0 && vehicle->var_CD < 5) { - rct_xy8 curLocation = { + LocationXY8 curLocation = { .x = regs.ax >> 5, .y = regs.cx >> 5 }; @@ -8265,7 +8265,7 @@ loc_6DC743: for (;;) { moveInfo = vehicle_get_move_info(vehicle->var_CD, vehicle->track_type, vehicle->track_progress); - if (moveInfo->x != MAP_LOCATION_NULL) { + if (moveInfo->x != LOCATION_NULL) { break; } switch (moveInfo->y) { diff --git a/src/openrct2/ride/vehicle.h b/src/openrct2/ride/vehicle.h index 4bb4f67103..0664dd544a 100644 --- a/src/openrct2/ride/vehicle.h +++ b/src/openrct2/ride/vehicle.h @@ -126,7 +126,7 @@ typedef struct rct_vehicle { union { sint16 track_direction; // 0x36 (0000 0000 0000 0011) sint16 track_type; // 0x36 (0000 0011 1111 1100) - rct_xy8 boat_location; // 0x36 + LocationXY8 boat_location; // 0x36 }; uint16 track_x; // 0x38 uint16 track_y; // 0x3A @@ -399,7 +399,7 @@ extern uint8 _vehicleVAngleEndF64E36; extern uint8 _vehicleBankEndF64E37; extern uint8 _vehicleF64E2C; extern rct_vehicle * _vehicleFrontVehicle; -extern rct_xyz16 unk_F64E20; +extern LocationXYZ16 unk_F64E20; #ifdef __cplusplus } diff --git a/src/openrct2/ride/water/BoatRide.cpp b/src/openrct2/ride/water/BoatRide.cpp index 8d242f4869..e61f8c54ba 100644 --- a/src/openrct2/ride/water/BoatRide.cpp +++ b/src/openrct2/ride/water/BoatRide.cpp @@ -68,7 +68,7 @@ static void paint_boat_ride_track_flat(paint_session * session, uint8 rideIndex, static void paint_boat_ride_station(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; Ride * ride = get_ride(rideIndex); const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 696b7b977c..ab79350541 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -84,7 +84,7 @@ void vehicle_visual_submarine(paint_session * session, sint32 x, sint32 imageDir static void submarine_ride_paint_track_station(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; Ride * ride = get_ride(rideIndex); const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; sint32 heightLower = height - 16; @@ -116,7 +116,7 @@ static void submarine_ride_paint_track_station(paint_session * session, uint8 ri static void submarine_ride_paint_track_flat(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { - rct_xy16 position = session->MapPosition; + LocationXY16 position = session->MapPosition; sint32 heightLower = height - 16; uint32 imageId; diff --git a/src/openrct2/scenario/scenario.c b/src/openrct2/scenario/scenario.c index 9a97409989..533564de4d 100644 --- a/src/openrct2/scenario/scenario.c +++ b/src/openrct2/scenario/scenario.c @@ -259,7 +259,7 @@ static void scenario_entrance_fee_too_high_check() money16 max_fee = totalRideValue + (totalRideValue / 2); if ((gParkFlags & PARK_FLAGS_PARK_OPEN) && park_get_entrance_fee() > max_fee) { - for (sint32 i = 0; i < MAX_PARK_ENTRANCES && gParkEntrances[i].x != SPRITE_LOCATION_NULL; i++) { + for (sint32 i = 0; i < MAX_PARK_ENTRANCES && gParkEntrances[i].x != LOCATION_NULL; i++) { x = gParkEntrances[i].x + 16; y = gParkEntrances[i].y + 16; } diff --git a/src/openrct2/title/TitleSequencePlayer.cpp b/src/openrct2/title/TitleSequencePlayer.cpp index 61b82a3867..b57ce85475 100644 --- a/src/openrct2/title/TitleSequencePlayer.cpp +++ b/src/openrct2/title/TitleSequencePlayer.cpp @@ -53,7 +53,7 @@ private: sint32 _lastScreenWidth = 0; sint32 _lastScreenHeight = 0; - rct_xy32 _viewCentreLocation = { 0 }; + LocationXY32 _viewCentreLocation = { 0 }; public: TitleSequencePlayer(IScenarioRepository * scenarioRepository) diff --git a/src/openrct2/windows/GameBottomToolbar.cpp b/src/openrct2/windows/GameBottomToolbar.cpp index 1be38c75de..cc906a881e 100644 --- a/src/openrct2/windows/GameBottomToolbar.cpp +++ b/src/openrct2/windows/GameBottomToolbar.cpp @@ -202,7 +202,7 @@ static void window_game_bottom_toolbar_mouseup(rct_window *w, rct_widgetindex wi news_item_get_subject_location(newsItem->Type, subject, &x, &y, &z); - if (x == SPRITE_LOCATION_NULL) + if (x == LOCATION_NULL) break; rct_window *mainWindow = window_get_main(); @@ -303,7 +303,7 @@ static void window_game_bottom_toolbar_invalidate(rct_window *w) sint32 subject = newsItem->Assoc; news_item_get_subject_location(newsItem->Type, subject, &x, &y, &z); - if (x == SPRITE_LOCATION_NULL) + if (x == LOCATION_NULL) w->disabled_widgets |= (1 << WIDX_NEWS_LOCATE); if (!(news_type_properties[newsItem->Type] & NEWS_TYPE_HAS_SUBJECT)) { diff --git a/src/openrct2/windows/Ride.cpp b/src/openrct2/windows/Ride.cpp index 5a2fd1f6e6..a10d9825af 100644 --- a/src/openrct2/windows/Ride.cpp +++ b/src/openrct2/windows/Ride.cpp @@ -1829,7 +1829,7 @@ static void window_ride_init_viewport(rct_window *w) } } while (count >= 0); - rct_xy8 location = ride->station_starts[stationIndex]; + LocationXY8 location = ride->station_starts[stationIndex]; focus.coordinate.x = location.x * 32; focus.coordinate.y = location.y * 32; @@ -4115,7 +4115,7 @@ static void window_ride_set_track_colour_scheme(rct_window *w, sint32 x, sint32 newColourScheme = (uint8)w->ride_colour; - rct_xy16 mapCoord = { 0 }; + LocationXY16 mapCoord = { 0 }; get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_RIDE, &mapCoord.x, &mapCoord.y, &interactionType, &mapElement, nullptr); x = mapCoord.x; y = mapCoord.y; diff --git a/src/openrct2/windows/RideConstruction.cpp b/src/openrct2/windows/RideConstruction.cpp index 177d18887a..5e97047baa 100644 --- a/src/openrct2/windows/RideConstruction.cpp +++ b/src/openrct2/windows/RideConstruction.cpp @@ -2088,7 +2088,7 @@ static bool ride_get_place_position_from_screen_position(sint32 screenX, sint32 if (!_trackPlaceCtrlState) { sub_68A15E(screenX, screenY, &mapX, &mapY, &direction, &mapElement); - if (mapX == MAP_LOCATION_NULL) + if (mapX == LOCATION_NULL) return false; _trackPlaceZ = 0; @@ -2108,7 +2108,7 @@ static bool ride_get_place_position_from_screen_position(sint32 screenX, sint32 _trackPlaceZ = Math::Max(mapZ, 16); } - if (mapX == MAP_LOCATION_NULL) + if (mapX == LOCATION_NULL) return false; *outX = floor2(mapX, 32); @@ -3709,7 +3709,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY) // Raise z above all slopes and water if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) { sint32 highestZ = 0; - rct_xy16 *selectedTile = gMapSelectionTiles; + LocationXY16 *selectedTile = gMapSelectionTiles; while (selectedTile->x != -1) { if (selectedTile->x < (256 * 32) && selectedTile->y < (256 * 32)) { z = map_get_highest_z(selectedTile->x >> 5, selectedTile->y >> 5); @@ -3761,7 +3761,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY) break; _currentTrackBeginZ -= 8; - if (_currentTrackBeginZ & 0x8000) + if (_currentTrackBeginZ & LOCATION_NULL) break; if (bx >= 0) @@ -3784,7 +3784,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY) break; _currentTrackBeginZ -= 8; - if (_currentTrackBeginZ & 0x8000) + if (_currentTrackBeginZ & LOCATION_NULL) break; if (bx >= 0) @@ -3864,7 +3864,7 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY) // Raise z above all slopes and water highestZ = 0; if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) { - rct_xy16 *selectedTile = gMapSelectionTiles; + LocationXY16 *selectedTile = gMapSelectionTiles; while (selectedTile->x != -1) { if (selectedTile->x >= (256 * 32) || selectedTile->y >= (256 * 32)) continue; diff --git a/src/openrct2/windows/TileInspector.cpp b/src/openrct2/windows/TileInspector.cpp index 6a230dd6b1..000d3350cb 100644 --- a/src/openrct2/windows/TileInspector.cpp +++ b/src/openrct2/windows/TileInspector.cpp @@ -1250,7 +1250,7 @@ static void window_tile_inspector_tool_update(rct_window* w, rct_widgetindex wid sint16 mapY = y; sint32 direction; screen_pos_to_map_pos(&mapX, &mapY, &direction); - if (mapX != MAP_LOCATION_NULL) { + if (mapX != LOCATION_NULL) { gMapSelectPositionA.x = gMapSelectPositionB.x = mapX; gMapSelectPositionA.y = gMapSelectPositionB.y = mapY; } @@ -1279,7 +1279,7 @@ static void window_tile_inspector_update_selected_tile(rct_window *w, sint32 x, sint16 mapY = y; sint32 direction; screen_pos_to_map_pos(&mapX, &mapY, &direction); - if (mapX == MAP_LOCATION_NULL) { + if (mapX == LOCATION_NULL) { return; } diff --git a/src/openrct2/windows/TopToolbar.cpp b/src/openrct2/windows/TopToolbar.cpp index d038d6129f..613f2f3746 100644 --- a/src/openrct2/windows/TopToolbar.cpp +++ b/src/openrct2/windows/TopToolbar.cpp @@ -1127,7 +1127,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid rct_window* w = window_find_by_class(WC_SCENERY); if (w == nullptr) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1213,7 +1213,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid if (!gSceneryCtrlPressed) { screen_get_map_xy_quadrant(x, y, grid_x, grid_y, &cl); - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; gSceneryPlaceZ = 0; @@ -1223,7 +1223,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid rct_map_element* map_element = map_get_surface_element_at(*grid_x / 32, *grid_y / 32); if (map_element == nullptr) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1250,7 +1250,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid gSceneryPlaceZ = z; } - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; uint8 rotation = gWindowSceneryRotation; @@ -1280,7 +1280,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid get_map_coordinates_from_pos(x, y, flags, grid_x, grid_y, &interaction_type, &map_element, nullptr); if (interaction_type == VIEWPORT_INTERACTION_ITEM_NONE) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1295,7 +1295,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid map_element = map_get_surface_element_at(*grid_x / 32, *grid_y / 32); if (map_element == nullptr) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1321,7 +1321,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid gSceneryPlaceZ = z; } - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; *grid_x &= 0xFFE0; @@ -1353,14 +1353,14 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid get_map_coordinates_from_pos(x, y, flags, grid_x, grid_y, &interaction_type, &map_element, nullptr); if (interaction_type == VIEWPORT_INTERACTION_ITEM_NONE) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } *parameter_1 = 0 | ((map_element->properties.path.type & 0x7) << 8); *parameter_2 = map_element->base_height | ((map_element->properties.path.type >> 4) << 8); if (map_element->type & 1) { - *parameter_2 |= MAP_LOCATION_NULL; + *parameter_2 |= LOCATION_NULL; } *parameter_3 = (selected_scenery & 0xFF) + 1; break; @@ -1373,7 +1373,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid if (!gSceneryCtrlPressed) { screen_get_map_xy_side(x, y, grid_x, grid_y, &cl); - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; gSceneryPlaceZ = 0; @@ -1383,7 +1383,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid rct_map_element* map_element = map_get_surface_element_at(*grid_x / 32, *grid_y / 32); if (map_element == nullptr) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1409,7 +1409,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid gSceneryPlaceZ = z; } - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; _unkF64F15 = gWindowScenerySecondaryColour | (gWindowSceneryTertiaryColour << 8); @@ -1426,7 +1426,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid if (!gSceneryCtrlPressed) { sub_68A15E(x, y, grid_x, grid_y, nullptr, nullptr); - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; gSceneryPlaceZ = 0; @@ -1436,7 +1436,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid rct_map_element* map_element = map_get_surface_element_at(*grid_x / 32, *grid_y / 32); if (map_element == nullptr) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1462,7 +1462,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid gSceneryPlaceZ = z; } - if (*grid_x == MAP_LOCATION_NULL) + if (*grid_x == LOCATION_NULL) return; *grid_x &= 0xFFE0; @@ -1489,7 +1489,7 @@ static void sub_6E1F34(sint16 x, sint16 y, uint16 selected_scenery, sint16* grid get_map_coordinates_from_pos(x, y, flags, grid_x, grid_y, &interaction_type, &map_element, nullptr); if (interaction_type == VIEWPORT_INTERACTION_ITEM_NONE) { - *grid_x = MAP_LOCATION_NULL; + *grid_x = LOCATION_NULL; return; } @@ -1550,7 +1550,7 @@ static void window_top_toolbar_scenery_tool_down(sint16 x, sint16 y, rct_window sub_6E1F34(x, y, selectedTab, &gridX, &gridY, ¶meter_1, ¶meter_2, ¶meter_3); - if (gridX == MAP_LOCATION_NULL) return; + if (gridX == LOCATION_NULL) return; switch (sceneryType){ case SCENERY_TYPE_SMALL: @@ -1746,10 +1746,10 @@ static void top_toolbar_tool_update_scenery_clear(sint16 x, sint16 y){ map_invalidate_selection_rect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - rct_xy16 mapTile = { 0 }; + LocationXY16 mapTile = { 0 }; screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr); - if (mapTile.x == MAP_LOCATION_NULL) { + if (mapTile.x == LOCATION_NULL) { if (gClearSceneryCost != MONEY32_UNDEFINED) { gClearSceneryCost = MONEY32_UNDEFINED; window_invalidate_by_class(WC_CLEAR_SCENERY); @@ -1823,10 +1823,10 @@ static void top_toolbar_tool_update_land_paint(sint16 x, sint16 y){ map_invalidate_selection_rect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - rct_xy16 mapTile = { 0 }; + LocationXY16 mapTile = { 0 }; screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr); - if (mapTile.x == MAP_LOCATION_NULL) { + if (mapTile.x == LOCATION_NULL) { if (gClearSceneryCost != MONEY32_UNDEFINED) { gClearSceneryCost = MONEY32_UNDEFINED; window_invalidate_by_class(WC_CLEAR_SCENERY); @@ -1907,14 +1907,14 @@ static void top_toolbar_tool_update_land(sint16 x, sint16 y){ } sint16 tool_size = gLandToolSize; - rct_xy16 mapTile = { x, y }; + LocationXY16 mapTile = { x, y }; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; if (tool_size == 1){ sint32 direction; screen_pos_to_map_pos(&mapTile.x, &mapTile.y, &direction); - if (mapTile.x == MAP_LOCATION_NULL) { + if (mapTile.x == LOCATION_NULL) { money32 lower_cost = MONEY32_UNDEFINED; money32 raise_cost = MONEY32_UNDEFINED; @@ -1978,7 +1978,7 @@ static void top_toolbar_tool_update_land(sint16 x, sint16 y){ screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr); - if (mapTile.x == MAP_LOCATION_NULL) { + if (mapTile.x == LOCATION_NULL) { money32 lower_cost = MONEY32_UNDEFINED; money32 raise_cost = MONEY32_UNDEFINED; @@ -2088,7 +2088,7 @@ static void top_toolbar_tool_update_water(sint16 x, sint16 y){ gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - rct_xy16 mapTile = { 0 }; + LocationXY16 mapTile = { 0 }; sint32 interaction_type = 0; get_map_coordinates_from_pos( x, @@ -2187,7 +2187,7 @@ static void top_toolbar_tool_update_water(sint16 x, sint16 y){ * On failure returns MONEY32_UNDEFINED * On success places ghost scenery and returns cost to place proper */ -static money32 try_place_ghost_scenery(rct_xy16 map_tile, uint32 parameter_1, uint32 parameter_2, uint32 parameter_3, uint16 selected_tab){ +static money32 try_place_ghost_scenery(LocationXY16 map_tile, uint32 parameter_1, uint32 parameter_2, uint32 parameter_3, uint16 selected_tab){ scenery_remove_ghost_tool_placement(); uint8 scenery_type = (selected_tab & 0xFF00) >> 8; @@ -2367,12 +2367,12 @@ static void top_toolbar_tool_update_scenery(sint16 x, sint16 y){ uint8 scenery_type = (selected_tab & 0xFF00) >> 8; uint8 selected_scenery = selected_tab & 0xFF; - rct_xy16 mapTile = { 0 }; + LocationXY16 mapTile = { 0 }; uint32 parameter1, parameter2, parameter3; sub_6E1F34(x, y, selected_tab, &mapTile.x, &mapTile.y, ¶meter1, ¶meter2, ¶meter3); - if (mapTile.x == MAP_LOCATION_NULL) { + if (mapTile.x == LOCATION_NULL) { scenery_remove_ghost_tool_placement(); return; } @@ -2523,10 +2523,10 @@ static void top_toolbar_tool_update_scenery(sint16 x, sint16 y){ case 3: { scenery = get_large_scenery_entry(selected_scenery); - rct_xy16* selectedTile = gMapSelectionTiles; + LocationXY16* selectedTile = gMapSelectionTiles; for (rct_large_scenery_tile* tile = scenery->large_scenery.tiles; tile->x_offset != (sint16)(uint16)0xFFFF; tile++){ - rct_xy16 tileLocation = { tile->x_offset, tile->y_offset }; + LocationXY16 tileLocation = { tile->x_offset, tile->y_offset }; rotate_map_coordinates(&tileLocation.x, &tileLocation.y, (parameter1 >> 8) & 0xFF); diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index c46881480b..6b54de8bea 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -101,7 +101,7 @@ static money32 BannerRemove(sint16 x, sint16 y, uint8 baseHeight, uint8 directio { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -237,7 +237,7 @@ static money32 BannerPlace(sint16 x, sint16 y, uint8 pathBaseHeight, uint8 direc { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -490,7 +490,7 @@ extern "C" sint32 i, rideIndex; Ride *ride; - static const rct_xy16 NeighbourCheckOrder[] = + static const LocationXY16 NeighbourCheckOrder[] = { { 32, 0 }, { -32, 0 }, @@ -519,7 +519,7 @@ extern "C" if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP)) continue; - rct_xy8 location = ride->overall_view; + LocationXY8 location = ride->overall_view; if (location.xy == RCT_XY8_UNDEFINED) continue; diff --git a/src/openrct2/world/Duck.cpp b/src/openrct2/world/Duck.cpp index 1c2c8ae7b0..f486f5f6fb 100644 --- a/src/openrct2/world/Duck.cpp +++ b/src/openrct2/world/Duck.cpp @@ -34,7 +34,7 @@ enum DUCK_STATE }; constexpr sint32 DUCK_MAX_STATES = 5; -static const rct_xy16 DuckMoveOffset[] = +static const LocationXY16 DuckMoveOffset[] = { { -1, 0 }, { 0, 1 }, diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 5221630516..3e74446e57 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -28,11 +28,11 @@ #include "../ride/track.h" bool gParkEntranceGhostExists = false; -rct_xyz16 gParkEntranceGhostPosition = { 0, 0, 0 }; +LocationXYZ16 gParkEntranceGhostPosition = { 0, 0, 0 }; uint8 gParkEntranceGhostDirection = 0; -rct_xyzd16 gParkEntrances[MAX_PARK_ENTRANCES]; +LocationXYZD16 gParkEntrances[MAX_PARK_ENTRANCES]; -rct_xyzd16 gRideEntranceExitGhostPosition; +LocationXYZD16 gRideEntranceExitGhostPosition; uint8 gRideEntranceExitGhostStationIndex; static void ParkEntranceRemoveSegment(sint32 x, sint32 y, sint32 z) @@ -75,7 +75,7 @@ static money32 ParkEntranceRemove(sint16 x, sint16 y, uint8 z, uint8 flags) return 0; } - gParkEntrances[entranceIndex].x = MAP_LOCATION_NULL; + gParkEntrances[entranceIndex].x = LOCATION_NULL; direction = (gParkEntrances[entranceIndex].direction - 1) & 3; // Centre (sign) @@ -189,7 +189,7 @@ static money32 RideEntranceExitPlace(sint16 x, ride_remove_peeps(rideIndex); bool requiresRemove = false; - rct_xy16 removeCoord = { 0, 0 }; + LocationXY16 removeCoord = { 0, 0 }; if (isExit) { @@ -275,7 +275,7 @@ static money32 RideEntranceExitPlace(sint16 x, if (flags & GAME_COMMAND_FLAG_APPLY) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -400,7 +400,7 @@ static money32 RideEntranceExitRemove(sint16 x, sint16 y, uint8 rideIndex, uint8 return MONEY32_UNDEFINED; } - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -513,7 +513,7 @@ extern "C" { for (sint32 i = 0; i < MAX_PARK_ENTRANCES; i++) { - gParkEntrances[i].x = MAP_LOCATION_NULL; + gParkEntrances[i].x = LOCATION_NULL; } } diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index c520fff5f6..311e7a2411 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -45,7 +45,7 @@ namespace FOUNTAIN_FLAG const uint32 DIRECTION = 1 << 7; }; -static const rct_xy16 _fountainDirectionsNegative[] = +static const LocationXY16 _fountainDirectionsNegative[] = { { -32, 0 }, { -32, -32 }, @@ -57,7 +57,7 @@ static const rct_xy16 _fountainDirectionsNegative[] = { -32, -32 }, }; -static const rct_xy16 _fountainDirectionsPositive[] = +static const LocationXY16 _fountainDirectionsPositive[] = { { 32, 0 }, { 0, 0 }, diff --git a/src/openrct2/world/Location.h b/src/openrct2/world/Location.h new file mode 100644 index 0000000000..18ab51605e --- /dev/null +++ b/src/openrct2/world/Location.h @@ -0,0 +1,71 @@ +#pragma region Copyright (c) 2017 OpenRCT2 Developers +/***************************************************************************** + * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. + * + * OpenRCT2 is the work of many authors, a full list can be found in contributors.md + * For more information, visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * A full copy of the GNU General Public License can be found in licence.txt + *****************************************************************************/ +#pragma endregion + +#pragma once + +#include "../common.h" + +#define LOCATION_NULL ((sint16)(uint16)0x8000) +#define RCT_XY8_UNDEFINED 0xFFFF +#define MakeXY16(x, y) {(sint16)(x), (sint16)(y)} + +#pragma pack(push, 1) +typedef struct LocationXY8 { + union { + struct { + uint8 x, y; + }; + uint16 xy; + }; +} LocationXY8; +assert_struct_size(LocationXY8, 2); + +typedef struct LocationXYZ8 { + uint8 x, y, z; +} LocationXYZ8; +assert_struct_size(LocationXYZ8, 3); + +typedef struct LocationXYZD8 { + uint8 x, y, z, direction; +} LocationXYZD8; +assert_struct_size(LocationXYZD8, 4); + +typedef struct LocationXY16 { + sint16 x, y; +} LocationXY16; +assert_struct_size(LocationXY16, 4); + + +typedef struct LocationXYZ16 { + sint16 x, y, z; +} LocationXYZ16; +assert_struct_size(LocationXYZ16, 6); + +typedef struct LocationXYZD16 { + sint16 x, y, z; + uint8 direction; +} LocationXYZD16; +assert_struct_size(LocationXYZD16, 7); + +typedef struct LocationXY32 { + sint32 x, y; +} LocationXY32; + +typedef struct LocationXYZ32 { + sint32 x, y, z; +} LocationXYZ32; + +#pragma pack(pop) \ No newline at end of file diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index dcea72d9e1..303adb1398 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -103,7 +103,7 @@ static money32 SmallSceneryRemove(sint16 x, sint16 y, uint8 baseHeight, uint8 qu { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -398,7 +398,7 @@ static money32 SmallSceneryPlace(sint16 x, if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index df84bcf09e..3e8a0c004f 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -311,7 +311,7 @@ static money32 WallPlace(uint8 wallType, uint8 tertiaryColour, uint8 flags) { - rct_xyz16 position = { x, y, z }; + LocationXYZ16 position = { x, y, z }; gCommandExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING; gCommandPosition.x = position.x + 16; @@ -523,7 +523,7 @@ static money32 WallPlace(uint8 wallType, { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = position.x + 16; coord.y = position.y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -625,7 +625,7 @@ static money32 WallRemove(sint16 x, sint16 y, uint8 baseHeight, uint8 direction, if (gGameCommandNestLevel == 1 && !isGhost) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); diff --git a/src/openrct2/world/entrance.h b/src/openrct2/world/entrance.h index 1805e7fc3d..cf686d4696 100644 --- a/src/openrct2/world/entrance.h +++ b/src/openrct2/world/entrance.h @@ -35,19 +35,19 @@ extern "C" { void game_command_remove_park_entrance(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp); -typedef struct rct_xyz16 rct_xyz16; -typedef struct rct_xyzd16 rct_xyzd16; +typedef struct LocationXYZ16 LocationXYZ16; +typedef struct LocationXYZD16 LocationXYZD16; typedef struct rct_map_element rct_map_element; extern bool gParkEntranceGhostExists; -extern rct_xyz16 gParkEntranceGhostPosition; +extern LocationXYZ16 gParkEntranceGhostPosition; extern uint8 gParkEntranceGhostDirection; #define MAX_PARK_ENTRANCES 4 -extern rct_xyzd16 gParkEntrances[MAX_PARK_ENTRANCES]; +extern LocationXYZD16 gParkEntrances[MAX_PARK_ENTRANCES]; -extern rct_xyzd16 gRideEntranceExitGhostPosition; +extern LocationXYZD16 gRideEntranceExitGhostPosition; extern uint8 gRideEntranceExitGhostStationIndex; void park_entrance_remove_ghost(); diff --git a/src/openrct2/world/footpath.c b/src/openrct2/world/footpath.c index 3c0772e9e9..1e609b58ed 100644 --- a/src/openrct2/world/footpath.c +++ b/src/openrct2/world/footpath.c @@ -29,13 +29,13 @@ void footpath_interrupt_peeps(sint32 x, sint32 y, sint32 z); void footpath_update_queue_entrance_banner(sint32 x, sint32 y, rct_map_element *mapElement); uint8 gFootpathProvisionalFlags; -rct_xyz16 gFootpathProvisionalPosition; +LocationXYZ16 gFootpathProvisionalPosition; uint8 gFootpathProvisionalType; uint8 gFootpathProvisionalSlope; uint8 gFootpathConstructionMode; uint16 gFootpathSelectedId; uint8 gFootpathSelectedType; -rct_xyz16 gFootpathConstructFromPosition; +LocationXYZ16 gFootpathConstructFromPosition; uint8 gFootpathConstructDirection; uint8 gFootpathConstructSlope; uint8 gFootpathConstructValidDirections; @@ -46,7 +46,7 @@ static uint8 *_footpathQueueChainNext; static uint8 _footpathQueueChain[64]; /** rct2: 0x00981D6C, 0x00981D6E */ -const rct_xy16 word_981D6C[4] = { +const LocationXY16 word_981D6C[4] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, @@ -380,7 +380,7 @@ static money32 footpath_place_real(sint32 type, sint32 x, sint32 y, sint32 z, si _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -448,7 +448,7 @@ money32 footpath_remove_real(sint32 x, sint32 y, sint32 z, sint32 flags) mapElement = map_get_footpath_element(x / 32, y / 32, z); if (mapElement != NULL && (flags & GAME_COMMAND_FLAG_APPLY)) { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -578,7 +578,7 @@ static money32 footpath_place_from_track(sint32 type, sint32 x, sint32 y, sint32 if (flags & GAME_COMMAND_FLAG_APPLY) { if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -728,19 +728,19 @@ void footpath_get_coordinates_from_pos(sint32 screenX, sint32 screenY, sint32 *x sint32 z = 0, interactionType; rct_map_element *myMapElement; rct_viewport *viewport; - rct_xy16 position = { 0 }; + LocationXY16 position = { 0 }; get_map_coordinates_from_pos(screenX, screenY, VIEWPORT_INTERACTION_MASK_FOOTPATH, &position.x, &position.y, &interactionType, &myMapElement, &viewport); if (interactionType != VIEWPORT_INTERACTION_ITEM_FOOTPATH || !(viewport->flags & (VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_HIDE_BASE | VIEWPORT_FLAG_HIDE_VERTICAL))) { get_map_coordinates_from_pos(screenX, screenY, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN, &position.x, &position.y, &interactionType, &myMapElement, &viewport); if (interactionType == VIEWPORT_INTERACTION_ITEM_NONE) { - if (x != NULL) *x = MAP_LOCATION_NULL; + if (x != NULL) *x = LOCATION_NULL; return; } } - rct_xy16 minPosition = position; - rct_xy16 maxPosition = { position.x + 31, position.y + 31 }; + LocationXY16 minPosition = position; + LocationXY16 maxPosition = { position.x + 31, position.y + 31 }; position.x += 16; position.y += 16; @@ -752,7 +752,7 @@ void footpath_get_coordinates_from_pos(sint32 screenX, sint32 screenY, sint32 *x } } - rct_xy16 start_vp_pos = screen_coord_to_viewport_coord(viewport, screenX, screenY); + LocationXY16 start_vp_pos = screen_coord_to_viewport_coord(viewport, screenX, screenY); for (sint32 i = 0; i < 5; i++) { if (interactionType != VIEWPORT_INTERACTION_ITEM_FOOTPATH) { @@ -802,7 +802,7 @@ void footpath_bridge_get_info_from_pos(sint32 screenX, sint32 screenY, sint32 *x sint32 interactionType; rct_viewport *viewport; - rct_xy16 map_pos = { 0 }; + LocationXY16 map_pos = { 0 }; get_map_coordinates_from_pos(screenX, screenY, VIEWPORT_INTERACTION_MASK_RIDE, &map_pos.x, &map_pos.y, &interactionType, mapElement, &viewport); *x = map_pos.x; *y = map_pos.y; diff --git a/src/openrct2/world/footpath.h b/src/openrct2/world/footpath.h index 3b3dc9fb4e..8cce286cc6 100644 --- a/src/openrct2/world/footpath.h +++ b/src/openrct2/world/footpath.h @@ -68,20 +68,20 @@ extern "C" { #endif extern uint8 gFootpathProvisionalFlags; -extern rct_xyz16 gFootpathProvisionalPosition; +extern LocationXYZ16 gFootpathProvisionalPosition; extern uint8 gFootpathProvisionalType; extern uint8 gFootpathProvisionalSlope; extern uint8 gFootpathConstructionMode; extern uint16 gFootpathSelectedId; extern uint8 gFootpathSelectedType; -extern rct_xyz16 gFootpathConstructFromPosition; +extern LocationXYZ16 gFootpathConstructFromPosition; extern uint8 gFootpathConstructDirection; extern uint8 gFootpathConstructSlope; extern uint8 gFootpathConstructValidDirections; extern money32 gFootpathPrice; extern uint8 gFootpathGroundFlags; -extern const rct_xy16 word_981D6C[4]; +extern const LocationXY16 word_981D6C[4]; money32 footpath_remove_real(sint32 x, sint32 y, sint32 z, sint32 flags); void game_command_place_footpath(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 *edx, sint32 *esi, sint32 *edi, sint32 *ebp); diff --git a/src/openrct2/world/map.c b/src/openrct2/world/map.c index ce3017ffc1..cc08792e19 100644 --- a/src/openrct2/world/map.c +++ b/src/openrct2/world/map.c @@ -44,7 +44,7 @@ /** * Replaces 0x00993CCC, 0x00993CCE */ -const rct_xy16 TileDirectionDelta[] = { +const LocationXY16 TileDirectionDelta[] = { { -32, 0 }, { 0, +32 }, { +32, 0 }, @@ -75,9 +75,9 @@ const money32 TerrainPricing[] = { uint16 gMapSelectFlags; uint16 gMapSelectType; -rct_xy16 gMapSelectPositionA; -rct_xy16 gMapSelectPositionB; -rct_xyz16 gMapSelectArrowPosition; +LocationXY16 gMapSelectPositionA; +LocationXY16 gMapSelectPositionB; +LocationXYZ16 gMapSelectArrowPosition; uint8 gMapSelectArrowDirection; uint8 gMapGroundFlags; @@ -99,7 +99,7 @@ rct_map_element *gMapElementTilePointers[MAX_TILE_MAP_ELEMENT_POINTERS]; rct_map_element *gMapElements = RCT2_ADDRESS(RCT2_ADDRESS_MAP_ELEMENTS, rct_map_element); rct_map_element **gMapElementTilePointers = RCT2_ADDRESS(RCT2_ADDRESS_TILE_MAP_ELEMENT_POINTERS, rct_map_element*); #endif -rct_xy16 gMapSelectionTiles[300]; +LocationXY16 gMapSelectionTiles[300]; rct2_peep_spawn gPeepSpawns[MAX_PEEP_SPAWNS]; rct_map_element *gNextFreeMapElement; @@ -114,7 +114,7 @@ bool gClearFootpath; uint16 gLandRemainingOwnershipSales; uint16 gLandRemainingConstructionSales; -rct_xyz16 gCommandPosition; +LocationXYZ16 gCommandPosition; bool gMapLandRightsUpdateSuccess; @@ -147,8 +147,8 @@ void rotate_map_coordinates(sint16 *x, sint16 *y, sint32 rotation) } } -rct_xy16 coordinate_3d_to_2d(const rct_xyz16* coordinate_3d, sint32 rotation){ - rct_xy16 coordinate_2d; +LocationXY16 coordinate_3d_to_2d(const LocationXYZ16* coordinate_3d, sint32 rotation){ + LocationXY16 coordinate_2d; switch (rotation){ default: @@ -916,7 +916,7 @@ void game_command_remove_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, si } rct_scenery_entry* scenery_entry = get_large_scenery_entry(map_element->properties.scenerymultiple.type & 0x3FF); - rct_xyz16 firstTile = { + LocationXYZ16 firstTile = { .x = scenery_entry->large_scenery.tiles[tileIndex].x_offset, .y = scenery_entry->large_scenery.tiles[tileIndex].y_offset, .z = (base_height * 8) - scenery_entry->large_scenery.tiles[tileIndex].z_offset @@ -930,7 +930,7 @@ void game_command_remove_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, si bool calculate_cost = true; for (sint32 i = 0; scenery_entry->large_scenery.tiles[i].x_offset != -1; i++){ - rct_xyz16 currentTile = { + LocationXYZ16 currentTile = { .x = scenery_entry->large_scenery.tiles[i].x_offset, .y = scenery_entry->large_scenery.tiles[i].y_offset, .z = scenery_entry->large_scenery.tiles[i].z_offset @@ -991,7 +991,7 @@ void game_command_remove_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, si } if (flags & GAME_COMMAND_FLAG_APPLY && gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -1041,7 +1041,7 @@ void game_command_set_large_scenery_colour(sint32* eax, sint32* ebx, sint32* ecx rct_scenery_entry *scenery_entry = get_large_scenery_entry(map_element->properties.scenerymultiple.type & 0x3FF); // Work out the base tile coordinates (Tile with index 0) - rct_xyz16 baseTile = { + LocationXYZ16 baseTile = { .x = scenery_entry->large_scenery.tiles[tileIndex].x_offset, .y = scenery_entry->large_scenery.tiles[tileIndex].y_offset, .z = (base_height * 8) - scenery_entry->large_scenery.tiles[tileIndex].z_offset @@ -1054,7 +1054,7 @@ void game_command_set_large_scenery_colour(sint32* eax, sint32* ebx, sint32* ecx assert(i < MAXIMUM_MAP_SIZE_TECHNICAL); // Work out the current tile coordinates - rct_xyz16 currentTile = { + LocationXYZ16 currentTile = { .x = scenery_entry->large_scenery.tiles[i].x_offset, .y = scenery_entry->large_scenery.tiles[i].y_offset, .z = scenery_entry->large_scenery.tiles[i].z_offset @@ -1240,7 +1240,7 @@ money32 map_clear_scenery(sint32 x0, sint32 y0, sint32 x1, sint32 y1, sint32 cle } if (gGameCommandNestLevel == 1 && flags & GAME_COMMAND_FLAG_APPLY) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = ((x0 + x1) / 2) + 16; coord.y = ((y0 + y1) / 2) + 16; coord.z = map_element_height(coord.x, coord.y); @@ -1388,7 +1388,7 @@ static money32 map_change_surface_style(sint32 x0, sint32 y0, sint32 x1, sint32 } if (flags & GAME_COMMAND_FLAG_APPLY && gGameCommandNestLevel == 1) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = ((x0 + x1) / 2) + 16; coord.y = ((y0 + y1) / 2) + 16; coord.z = map_element_height(coord.x, coord.y); @@ -1668,7 +1668,7 @@ static money32 map_set_land_height(sint32 flags, sint32 x, sint32 y, sint32 heig if(flags & GAME_COMMAND_FLAG_APPLY) { if (gGameCommandNestLevel == 1) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -1961,7 +1961,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags) if (z != 0) z = base_height_z; - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x; coord.y = y; coord.z = z; @@ -2037,7 +2037,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags) if (z == 0) z = base_height_z; - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x; coord.y = y; coord.z = z; @@ -2328,7 +2328,7 @@ static money32 smooth_land(sint32 flags, sint32 centreX, sint32 centreY, sint32 } if (flags & GAME_COMMAND_FLAG_APPLY) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = centreX + 16; coord.y = centreY + 16; coord.z = map_element_height(coord.x, coord.y); @@ -2710,7 +2710,7 @@ void game_command_place_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, sin tile++) { num_elements++; - rct_xy16 curTile = { + LocationXY16 curTile = { .x = tile->x_offset, .y = tile->y_offset }; @@ -2756,7 +2756,7 @@ void game_command_place_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, sin tile->x_offset != -1; tile++, tile_num++) { - rct_xy16 curTile = { + LocationXY16 curTile = { .x = tile->x_offset, .y = tile->y_offset }; @@ -2818,7 +2818,7 @@ void game_command_place_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, sin } } if (gGameCommandNestLevel == 1 && !(*ebx & GAME_COMMAND_FLAG_GHOST)) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = x + 16; coord.y = y + 16; coord.z = map_element_height(coord.x, coord.y); @@ -2993,7 +2993,7 @@ void map_remove_all_rides() */ void map_invalidate_map_selection_tiles() { - rct_xy16 *position; + LocationXY16 *position; if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT)) return; @@ -3949,9 +3949,9 @@ static void translate_3d_to_2d(sint32 rotation, sint32 *x, sint32 *y) *y = ry; } -rct_xy32 translate_3d_to_2d_with_z(sint32 rotation, rct_xyz32 pos) +LocationXY32 translate_3d_to_2d_with_z(sint32 rotation, LocationXYZ32 pos) { - rct_xy32 result; + LocationXY32 result; switch (rotation & 3) { default: case 0: @@ -4410,7 +4410,7 @@ void game_command_modify_tile(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx !(flags & GAME_COMMAND_FLAG_GHOST) && *ebx != MONEY32_UNDEFINED) { - rct_xyz16 coord; + LocationXYZ16 coord; coord.x = (x << 5) + 16; coord.y = (y << 5) + 16; coord.z = map_element_height(coord.x, coord.y); diff --git a/src/openrct2/world/map.h b/src/openrct2/world/map.h index cf2c5e8fa4..fbdd3f7386 100644 --- a/src/openrct2/world/map.h +++ b/src/openrct2/world/map.h @@ -18,6 +18,7 @@ #define _MAP_H_ #include "../common.h" +#include "Location.h" #pragma pack(push, 1) typedef struct rct_map_element_surface_properties { @@ -282,65 +283,17 @@ enum #define MAXIMUM_MAP_SIZE_PRACTICAL (MAXIMUM_MAP_SIZE_TECHNICAL-2) #define MAP_MINIMUM_X_Y -MAXIMUM_MAP_SIZE_TECHNICAL -#define MAP_LOCATION_NULL ((sint16)(uint16)0x8000) #define MAX_MAP_ELEMENTS 196096 // 0x30000 #define MAX_TILE_MAP_ELEMENT_POINTERS (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) #define MAX_PEEP_SPAWNS 2 #define PEEP_SPAWN_UNDEFINED 0xFFFF -#define RCT_XY8_UNDEFINED 0xFFFF #define MAP_ELEMENT_LARGE_TYPE_MASK 0x3FF #define TILE_UNDEFINED_MAP_ELEMENT (rct_map_element*)-1 #pragma pack(push, 1) -typedef struct rct_xy8 { - union { - struct { - uint8 x, y; - }; - uint16 xy; - }; -} rct_xy8; -assert_struct_size(rct_xy8, 2); - -typedef struct rct_xyz8 { - uint8 x, y, z; -} rct_xyz8; -assert_struct_size(rct_xyz8, 3); - -typedef struct rct_xyzd8 { - uint8 x, y, z, direction; -} rct_xyzd8; -assert_struct_size(rct_xyzd8, 4); - -typedef struct rct_xy16 { - sint16 x, y; -} rct_xy16; -assert_struct_size(rct_xy16, 4); - -#define MakeXY16(x, y) {(sint16)(x), (sint16)(y)} - -typedef struct rct_xyz16 { - sint16 x, y, z; -} rct_xyz16; -assert_struct_size(rct_xyz16, 6); - -typedef struct rct_xyzd16 { - sint16 x, y, z; - uint8 direction; -} rct_xyzd16; -assert_struct_size(rct_xyzd16, 7); - -typedef struct rct_xy32 { - sint32 x, y; -} rct_xy32; - -typedef struct rct_xyz32 { - sint32 x, y, z; -} rct_xyz32; - typedef struct rct_xy_element { sint32 x, y; rct_map_element *element; @@ -386,7 +339,7 @@ enum { extern "C" { #endif -extern const rct_xy16 TileDirectionDelta[]; +extern const LocationXY16 TileDirectionDelta[]; extern const money32 TerrainPricing[]; extern uint16 gWidePathTileLoopX; @@ -401,9 +354,9 @@ extern sint16 gMapBaseZ; extern uint16 gMapSelectFlags; extern uint16 gMapSelectType; -extern rct_xy16 gMapSelectPositionA; -extern rct_xy16 gMapSelectPositionB; -extern rct_xyz16 gMapSelectArrowPosition; +extern LocationXY16 gMapSelectPositionA; +extern LocationXY16 gMapSelectPositionB; +extern LocationXYZ16 gMapSelectArrowPosition; extern uint8 gMapSelectArrowDirection; extern uint8 gMapGroundFlags; @@ -416,7 +369,7 @@ extern rct_map_element *gMapElements; extern rct_map_element **gMapElementTilePointers; #endif -extern rct_xy16 gMapSelectionTiles[300]; +extern LocationXY16 gMapSelectionTiles[300]; extern rct2_peep_spawn gPeepSpawns[MAX_PEEP_SPAWNS]; extern rct_map_element *gNextFreeMapElement; @@ -434,7 +387,7 @@ extern bool gClearFootpath; extern uint16 gLandRemainingOwnershipSales; extern uint16 gLandRemainingConstructionSales; -extern rct_xyz16 gCommandPosition; +extern LocationXYZ16 gCommandPosition; extern bool gMapLandRightsUpdateSuccess; @@ -500,7 +453,7 @@ sint32 map_place_scenery_clear_func(rct_map_element** map_element, sint32 x, sin sint32 map_can_construct_with_clear_at(sint32 x, sint32 y, sint32 zLow, sint32 zHigh, CLEAR_FUNC *clearFunc, uint8 bl, uint8 flags, money32 *price); sint32 map_can_construct_at(sint32 x, sint32 y, sint32 zLow, sint32 zHigh, uint8 bl); void rotate_map_coordinates(sint16 *x, sint16 *y, sint32 rotation); -rct_xy16 coordinate_3d_to_2d(const rct_xyz16* coordinate_3d, sint32 rotation); +LocationXY16 coordinate_3d_to_2d(const LocationXYZ16* coordinate_3d, sint32 rotation); money32 map_clear_scenery(sint32 x0, sint32 y0, sint32 x1, sint32 y1, sint32 clear, sint32 flags); sint32 map_get_water_height(const rct_map_element * mapElement); money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags); @@ -583,7 +536,7 @@ bool map_large_scenery_get_origin( ); void map_offset_with_rotation(sint16 *x, sint16 *y, sint16 offsetX, sint16 offsetY, uint8 rotation); -rct_xy32 translate_3d_to_2d_with_z(sint32 rotation, rct_xyz32 pos); +LocationXY32 translate_3d_to_2d_with_z(sint32 rotation, LocationXYZ32 pos); rct_map_element *map_get_track_element_at(sint32 x, sint32 y, sint32 z); rct_map_element *map_get_track_element_at_of_type(sint32 x, sint32 y, sint32 z, sint32 trackType); diff --git a/src/openrct2/world/money_effect.c b/src/openrct2/world/money_effect.c index af2c07a4f0..df19bb9ed8 100644 --- a/src/openrct2/world/money_effect.c +++ b/src/openrct2/world/money_effect.c @@ -20,7 +20,7 @@ #include "../OpenRCT2.h" #include "sprite.h" -static const rct_xy16 _moneyEffectMoveOffset[] = { +static const LocationXY16 _moneyEffectMoveOffset[] = { { 1, -1 }, { 1, 1 }, { -1, 1 }, @@ -71,13 +71,13 @@ void money_effect_create_at(money32 value, sint32 x, sint32 y, sint32 z, bool ve */ void money_effect_create(money32 value) { - rct_xyz16 mapPosition = { + LocationXYZ16 mapPosition = { .x = gCommandPosition.x, .y = gCommandPosition.y, .z = gCommandPosition.z }; - if (mapPosition.x == MAP_LOCATION_NULL) { + if (mapPosition.x == LOCATION_NULL) { rct_window *mainWindow = window_get_main(); if (mainWindow == NULL) return; @@ -90,7 +90,7 @@ void money_effect_create(money32 value) &mapPosition.y, NULL ); - if (mapPosition.x == MAP_LOCATION_NULL) + if (mapPosition.x == LOCATION_NULL) return; mapPosition.z = map_element_height(mapPosition.x, mapPosition.y) & 0xFFFF; diff --git a/src/openrct2/world/scenery.c b/src/openrct2/world/scenery.c index e1fa2e46e1..0310a88f04 100644 --- a/src/openrct2/world/scenery.c +++ b/src/openrct2/world/scenery.c @@ -49,7 +49,7 @@ uint8 gSceneryPlacePathSlope; uint8 gSceneryPlaceRotation; uint8 gSceneryGhostType; -rct_xyz16 gSceneryGhostPosition; +LocationXYZ16 gSceneryGhostPosition; uint32 gSceneryGhostPathObjectType; uint8 gSceneryGhostWallRotation; @@ -66,7 +66,7 @@ uint8 gSceneryGroundFlags; money32 gClearSceneryCost; // rct2: 0x009A3E74 -const rct_xy8 ScenerySubTileOffsets[] = { +const LocationXY8 ScenerySubTileOffsets[] = { { 7, 7 }, { 7, 23 }, { 23, 23 }, diff --git a/src/openrct2/world/scenery.h b/src/openrct2/world/scenery.h index 6b43ee7ea1..ff3714ad98 100644 --- a/src/openrct2/world/scenery.h +++ b/src/openrct2/world/scenery.h @@ -98,7 +98,7 @@ typedef struct rct_large_scenery_text_glyph { assert_struct_size(rct_large_scenery_text_glyph, 4); typedef struct rct_large_scenery_text { - rct_xy16 offset[2]; // 0x0 + LocationXY16 offset[2]; // 0x0 uint16 max_width; // 0x8 uint16 pad_A; // 0xA uint8 flags; // 0xC @@ -263,7 +263,7 @@ extern uint8 gSceneryPlacePathSlope; extern uint8 gSceneryPlaceRotation; extern uint8 gSceneryGhostType; -extern rct_xyz16 gSceneryGhostPosition; +extern LocationXYZ16 gSceneryGhostPosition; extern uint32 gSceneryGhostPathObjectType; extern uint8 gSceneryGhostWallRotation; @@ -277,7 +277,7 @@ extern sint16 gSceneryCtrlPressZ; extern uint8 gSceneryGroundFlags; -extern const rct_xy8 ScenerySubTileOffsets[]; +extern const LocationXY8 ScenerySubTileOffsets[]; extern sint16 window_scenery_tab_entries[20][SCENERY_ENTRIES_BY_TAB + 1]; diff --git a/src/openrct2/world/sprite.c b/src/openrct2/world/sprite.c index cb772dbdf0..eb46c9c89a 100644 --- a/src/openrct2/world/sprite.c +++ b/src/openrct2/world/sprite.c @@ -42,8 +42,8 @@ static bool _spriteFlashingList[MAX_SPRITES]; uint16 gSpriteSpatialIndex[0x10001]; -static rct_xyz16 _spritelocations1[MAX_SPRITES]; -static rct_xyz16 _spritelocations2[MAX_SPRITES]; +static LocationXYZ16 _spritelocations1[MAX_SPRITES]; +static LocationXYZ16 _spritelocations2[MAX_SPRITES]; static size_t GetSpatialIndexOffset(sint32 x, sint32 y); @@ -71,7 +71,7 @@ uint16 sprite_get_first_in_quadrant(sint32 x, sint32 y) static void invalidate_sprite_max_zoom(rct_sprite *sprite, sint32 maxZoom) { - if (sprite->unknown.sprite_left == SPRITE_LOCATION_NULL) return; + if (sprite->unknown.sprite_left == LOCATION_NULL) return; for (sint32 i = 0; i < MAX_VIEWPORT_COUNT; i++) { rct_viewport *viewport = &g_viewport_list[i]; @@ -181,7 +181,7 @@ void reset_sprite_spatial_index() static size_t GetSpatialIndexOffset(sint32 x, sint32 y) { size_t index = SPATIAL_INDEX_LOCATION_NULL; - if (x != SPRITE_LOCATION_NULL) { + if (x != LOCATION_NULL) { x = clamp(0, x, 0xFFFF); y = clamp(0, y, 0xFFFF); @@ -322,15 +322,15 @@ rct_sprite *create_sprite(uint8 bl) // may contain garbage and cause a desync later on. sprite_reset(sprite); - sprite->x = SPRITE_LOCATION_NULL; - sprite->y = SPRITE_LOCATION_NULL; + sprite->x = LOCATION_NULL; + sprite->y = LOCATION_NULL; sprite->z = 0; sprite->name_string_idx = 0; sprite->sprite_width = 0x10; sprite->sprite_height_negative = 0x14; sprite->sprite_height_positive = 0x8; sprite->flags = 0; - sprite->sprite_left = SPRITE_LOCATION_NULL; + sprite->sprite_left = LOCATION_NULL; sprite->next_in_quadrant = gSpriteSpatialIndex[SPATIAL_INDEX_LOCATION_NULL]; gSpriteSpatialIndex[SPATIAL_INDEX_LOCATION_NULL] = sprite->sprite_index; @@ -541,7 +541,7 @@ void sprite_misc_update_all() void sprite_move(sint16 x, sint16 y, sint16 z, rct_sprite *sprite) { if (x < 0 || y < 0 || x > 0x1FFF || y > 0x1FFF) { - x = SPRITE_LOCATION_NULL; + x = LOCATION_NULL; } size_t newIndex = GetSpatialIndexOffset(x, y); @@ -565,8 +565,8 @@ void sprite_move(sint16 x, sint16 y, sint16 z, rct_sprite *sprite) sprite->unknown.next_in_quadrant = tempSpriteIndex; } - if (x == SPRITE_LOCATION_NULL) { - sprite->unknown.sprite_left = SPRITE_LOCATION_NULL; + if (x == LOCATION_NULL) { + sprite->unknown.sprite_left = LOCATION_NULL; sprite->unknown.x = x; sprite->unknown.y = y; sprite->unknown.z = z; @@ -736,7 +736,7 @@ static bool sprite_should_tween(rct_sprite *sprite) return false; } -static void store_sprite_locations(rct_xyz16 * sprite_locations) +static void store_sprite_locations(LocationXYZ16 * sprite_locations) { for (uint16 i = 0; i < MAX_SPRITES; i++) { // skip going through `get_sprite` to not get stalled on assert, @@ -765,8 +765,8 @@ void sprite_position_tween_all(float alpha) for (uint16 i = 0; i < MAX_SPRITES; i++) { rct_sprite * sprite = get_sprite(i); if (sprite_should_tween(sprite)) { - rct_xyz16 posA = _spritelocations1[i]; - rct_xyz16 posB = _spritelocations2[i]; + LocationXYZ16 posA = _spritelocations1[i]; + LocationXYZ16 posB = _spritelocations2[i]; if (posA.x == posB.x && posA.y == posB.y && posA.z == posB.z) { continue; } @@ -791,7 +791,7 @@ void sprite_position_tween_restore() if (sprite_should_tween(sprite)) { invalidate_sprite_2(sprite); - rct_xyz16 pos = _spritelocations2[i]; + LocationXYZ16 pos = _spritelocations2[i]; sprite_set_coordinates(pos.x, pos.y, pos.z, sprite); } } diff --git a/src/openrct2/world/sprite.h b/src/openrct2/world/sprite.h index d18175b2b3..3a9f99647e 100644 --- a/src/openrct2/world/sprite.h +++ b/src/openrct2/world/sprite.h @@ -22,7 +22,6 @@ #include "../ride/vehicle.h" #define SPRITE_INDEX_NULL 0xFFFF -#define SPRITE_LOCATION_NULL ((sint16)(uint16)0x8000) #define MAX_SPRITES 10000 #define NUM_SPRITE_LISTS 6 diff --git a/test/testpaint/FunctionCall.hpp b/test/testpaint/FunctionCall.hpp index 6605657086..8aae9111f5 100644 --- a/test/testpaint/FunctionCall.hpp +++ b/test/testpaint/FunctionCall.hpp @@ -40,10 +40,10 @@ typedef struct struct paint { uint32 image_id; - rct_xy16 offset; - rct_xyz16 bound_box_length; + LocationXY16 offset; + LocationXYZ16 bound_box_length; sint16 z_offset; - rct_xyz16 bound_box_offset; + LocationXYZ16 bound_box_offset; uint32 rotation; paint_struct output_struct; } paint; diff --git a/test/testpaint/PaintIntercept.cpp b/test/testpaint/PaintIntercept.cpp index 1ff5315d0d..a02dd9868a 100644 --- a/test/testpaint/PaintIntercept.cpp +++ b/test/testpaint/PaintIntercept.cpp @@ -278,7 +278,7 @@ namespace PaintIntercept { log_error("Ebp is different from current rotation"); } - rct_xyz16 boundOffset = { + LocationXYZ16 boundOffset = { RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_X, sint16), RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, sint16), RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, sint16) diff --git a/test/testpaint/compat.c b/test/testpaint/compat.c index 6d2be98d90..3d51c9fe00 100644 --- a/test/testpaint/compat.c +++ b/test/testpaint/compat.c @@ -22,7 +22,7 @@ #include #include #include -#include "../../src/openrct2/ride/ride.h" +#include #define RCT2_ADDRESS_SPRITE_LIST 0x010E63BC @@ -39,7 +39,7 @@ bool gTrackDesignSaveMode = false; uint8 gTrackDesignSaveRideIndex = 255; uint8 gClipHeight = 255; -const rct_xy16 TileDirectionDelta[] = { +const LocationXY16 TileDirectionDelta[] = { {-32, 0}, {0, +32}, {+32, 0}, @@ -76,9 +76,9 @@ int object_entry_group_counts[] = { GeneralConfiguration gConfigGeneral; uint16 gMapSelectFlags; uint16 gMapSelectType; -rct_xy16 gMapSelectPositionA; -rct_xy16 gMapSelectPositionB; -rct_xyz16 gMapSelectArrowPosition; +LocationXY16 gMapSelectPositionA; +LocationXY16 gMapSelectPositionB; +LocationXYZ16 gMapSelectArrowPosition; uint8 gMapSelectArrowDirection; void entrance_paint(paint_session * session, uint8 direction, int height, rct_map_element *map_element) { }