Use constant for LOCATION_NULL, split off location stuff to Location.h

This commit is contained in:
Michael Steenbeek 2017-10-13 22:23:07 +02:00 committed by GitHub
parent ab3835719a
commit 7f9c25a7a9
118 changed files with 954 additions and 931 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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(

View File

@ -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:

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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];
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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)

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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; }

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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}},

View File

@ -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;
}

View File

@ -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))

View File

@ -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];

View File

@ -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]
};

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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)

View File

@ -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 },

View File

@ -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;

View File

@ -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;

View File

@ -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<sint16>(nearestLitter->x & 0xFFE0), static_cast<sint16>(nearestLitter->y & 0xFFE0) };
LocationXY16 litterTile = { static_cast<sint16>(nearestLitter->x & 0xFFE0), static_cast<sint16>(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<sint16>((nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x),
LocationXY16 nextTile = { static_cast<sint16>((nearestLitter->x & 0xFFE0) - TileDirectionDelta[nextDirection].x),
static_cast<sint16>((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<sint16>(peep->next_x + TileDirectionDelta[chosenDirection].x),
LocationXY16 chosenTile = { static_cast<sint16>(peep->next_x + TileDirectionDelta[chosenDirection].x),
static_cast<sint16>(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<sint16>(peep->next_x + TileDirectionDelta[direction].x),
LocationXY16 chosenTile = { static_cast<sint16>(peep->next_x + TileDirectionDelta[direction].x),
static_cast<sint16>(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<sint16>(peep->next_x + TileDirectionDelta[direction].x),
LocationXY16 chosenTile = { static_cast<sint16>(peep->next_x + TileDirectionDelta[direction].x),
static_cast<sint16>(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<sint16>(peep->next_x + TileDirectionDelta[direction].x),
LocationXY16 chosenTile = { static_cast<sint16>(peep->next_x + TileDirectionDelta[direction].x),
static_cast<sint16>(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<sint16>(location.x * 32), static_cast<sint16>(location.y * 32) };
LocationXY16 chosenTile = { static_cast<sint16>(location.x * 32), static_cast<sint16>(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<sint16>(location.x * 32), static_cast<sint16>(location.y * 32) };
LocationXY16 chosenTile = { static_cast<sint16>(location.x * 32), static_cast<sint16>(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<sint16>(peep->next_x + TileDirectionDelta[direction].x),
LocationXY16 chosenTile = { static_cast<sint16>(peep->next_x + TileDirectionDelta[direction].x),
static_cast<sint16>(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<sint16>(peep->next_x + TileDirectionDelta[direction].x),
LocationXY16 chosenTile = { static_cast<sint16>(peep->next_x + TileDirectionDelta[direction].x),
static_cast<sint16>(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);

View File

@ -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

View File

@ -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<rct_xy8> tiles)
void FixLandOwnershipTiles(std::initializer_list<LocationXY8> 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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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)
{

View File

@ -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

View File

@ -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];

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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];

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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;

View File

@ -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<sint16>(height + 3) };
LocationXYZ8 boundingBox = { 0, 0, 108 };
LocationXYZ16 boundingBoxOffset = { 0, 0, static_cast<sint16>(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);

View File

@ -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;

View File

@ -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;

View File

@ -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)
{

View File

@ -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);

View File

@ -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);

View File

@ -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];

View File

@ -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);

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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);

View File

@ -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<sint16>(height) };
LocationXYZ16 seatCoords = { al, cl, static_cast<sint16>(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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);

View File

@ -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<sint16>(pos.x - delta.x),
static_cast<sint16>(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<sint16>(pos.x + delta.x),
static_cast<sint16>(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;

View File

@ -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());

View File

@ -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)

View File

@ -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());
}

View File

@ -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) {

View File

@ -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
}

View File

@ -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];

View File

@ -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;

View File

@ -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;
}

View File

@ -53,7 +53,7 @@ private:
sint32 _lastScreenWidth = 0;
sint32 _lastScreenHeight = 0;
rct_xy32 _viewCentreLocation = { 0 };
LocationXY32 _viewCentreLocation = { 0 };
public:
TitleSequencePlayer(IScenarioRepository * scenarioRepository)

View File

@ -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)) {

View File

@ -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;

View File

@ -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<sint32>(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;

View File

@ -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;
}

View File

@ -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, &parameter_1, &parameter_2, &parameter_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, &parameter1, &parameter2, &parameter3);
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);

View File

@ -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;

View File

@ -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 },

Some files were not shown because too many files have changed in this diff Show More