forked from rosebudai/OpenRCT2-Web
Move over switches to normalised tile element types
This commit is contained in:
23 files changed
+386
-381
No files matched your search
@@ -1471,19 +1471,19 @@ static uint16_t MapWindowGetPixelColourRide(const CoordsXY& c)
|
||||
break;
|
||||
}
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
if (tileElement->AsSurface()->GetWaterHeight() > 0)
|
||||
// Why is this a different water colour as above (195)?
|
||||
colourB = MapColour(PALETTE_INDEX_194);
|
||||
if (!(tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED))
|
||||
colourB = MapColourUnowned(colourB);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
colourA = MapColour(PALETTE_INDEX_14); // lighter grey
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE)
|
||||
break;
|
||||
ride = get_ride(tileElement->AsEntrance()->GetRideIndex());
|
||||
@@ -1493,7 +1493,7 @@ static uint16_t MapWindowGetPixelColourRide(const CoordsXY& c)
|
||||
colourA = RideKeyColours[static_cast<size_t>(colourKey)];
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
@@ -1501,6 +1501,8 @@ static uint16_t MapWindowGetPixelColourRide(const CoordsXY& c)
|
||||
colourA = RideKeyColours[static_cast<size_t>(colourKey)];
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
|
||||
@@ -1357,27 +1357,25 @@ rct_window* WindowRideOpenTrack(TileElement* tileElement)
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
switch (tileElement->GetType())
|
||||
const auto type = tileElement->GetTypeN();
|
||||
if (type == TileElementTypeN::Entrance)
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
// Open ride window in station view
|
||||
auto entranceElement = tileElement->AsEntrance();
|
||||
auto stationIndex = entranceElement->GetStationIndex();
|
||||
return WindowRideOpenStation(ride, stationIndex);
|
||||
}
|
||||
else if (type == TileElementTypeN::Track)
|
||||
{
|
||||
// Open ride window in station view
|
||||
auto trackElement = tileElement->AsTrack();
|
||||
auto trackType = trackElement->GetTrackType();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)
|
||||
{
|
||||
// Open ride window in station view
|
||||
auto entranceElement = tileElement->AsEntrance();
|
||||
auto stationIndex = entranceElement->GetStationIndex();
|
||||
auto stationIndex = trackElement->GetStationIndex();
|
||||
return WindowRideOpenStation(ride, stationIndex);
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
{
|
||||
// Open ride window in station view
|
||||
auto trackElement = tileElement->AsTrack();
|
||||
auto trackType = trackElement->GetTrackType();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN)
|
||||
{
|
||||
auto stationIndex = trackElement->GetStationIndex();
|
||||
return WindowRideOpenStation(ride, stationIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open ride window in overview mode
|
||||
|
||||
@@ -836,9 +836,9 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
return;
|
||||
|
||||
// Page widgets
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_SURFACE_BUTTON_REMOVE_FENCES:
|
||||
@@ -860,7 +860,7 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
} // switch widgetindex
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_PATH_CHECK_SLOPED:
|
||||
@@ -898,7 +898,7 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_TRACK_CHECK_APPLY_TO_ALL:
|
||||
@@ -923,7 +923,7 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_SCENERY_CHECK_QUARTER_N:
|
||||
@@ -943,7 +943,7 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_ENTRANCE_BUTTON_MAKE_USABLE:
|
||||
@@ -952,7 +952,7 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_BANNER_CHECK_BLOCK_NE:
|
||||
@@ -965,8 +965,8 @@ static void WindowTileInspectorMouseup(rct_window* w, rct_widgetindex widgetInde
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
case TileElementTypeN::Wall:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1022,9 +1022,9 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
if (tileElement == nullptr)
|
||||
return;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_SURFACE_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1036,7 +1036,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_PATH_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1048,7 +1048,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_TRACK_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1074,7 +1074,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_SCENERY_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1086,7 +1086,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1101,7 +1101,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_WALL_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1139,7 +1139,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1151,7 +1151,7 @@ static void WindowTileInspectorMousedown(rct_window* w, rct_widgetindex widgetIn
|
||||
} // switch widget index
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_BANNER_SPINNER_HEIGHT_INCREASE:
|
||||
@@ -1378,32 +1378,31 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
if (windowTileInspectorSelectedIndex != -1)
|
||||
{
|
||||
const auto element = WindowTileInspectorGetSelectedElement(w);
|
||||
auto type = element->GetType();
|
||||
switch (type)
|
||||
switch (element->GetTypeN())
|
||||
{
|
||||
default:
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
page = TileInspectorPage::Surface;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
page = TileInspectorPage::Path;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
page = TileInspectorPage::Track;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
page = TileInspectorPage::Scenery;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
page = TileInspectorPage::Entrance;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
page = TileInspectorPage::Wall;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
page = TileInspectorPage::LargeScenery;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
page = TileInspectorPage::Banner;
|
||||
break;
|
||||
}
|
||||
@@ -1482,9 +1481,9 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
if (tileElement == nullptr)
|
||||
return;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
||||
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
||||
w->widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
||||
@@ -1520,7 +1519,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
WidgetSetCheckboxValue(
|
||||
w, WIDX_SURFACE_CHECK_DIAGONAL, tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
w->widgets[WIDX_PATH_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
||||
w->widgets[WIDX_PATH_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
||||
w->widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
||||
@@ -1566,7 +1565,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
WidgetSetCheckboxValue(
|
||||
w, WIDX_PATH_CHECK_EDGE_N, tileElement->AsPath()->GetCorners() & (1 << ((3 - get_current_rotation()) & 3)));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
w->widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].top = GBBT(propertiesAnchor, 0);
|
||||
w->widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].bottom = GBBB(propertiesAnchor, 0);
|
||||
w->widgets[WIDX_TRACK_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 1) + 3;
|
||||
@@ -1586,7 +1585,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
WidgetSetCheckboxValue(w, WIDX_TRACK_CHECK_BLOCK_BRAKE_CLOSED, tileElement->AsTrack()->BlockBrakeClosed());
|
||||
WidgetSetCheckboxValue(w, WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE, tileElement->AsTrack()->IsIndestructible());
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
// Raise / Lower
|
||||
w->widgets[WIDX_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
||||
@@ -1635,7 +1634,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
WidgetSetCheckboxValue(w, WIDX_SCENERY_CHECK_COLLISION_W, W);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
||||
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
||||
w->widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
||||
@@ -1648,7 +1647,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
w, WIDX_ENTRANCE_BUTTON_MAKE_USABLE,
|
||||
tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
bool canBeSloped = false;
|
||||
bool hasAnimation = false;
|
||||
@@ -1688,7 +1687,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
WidgetSetEnabled(w, WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE, hasAnimation);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
||||
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
||||
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
||||
@@ -1696,7 +1695,7 @@ static void WindowTileInspectorInvalidate(rct_window* w)
|
||||
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
||||
w->widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
w->widgets[WIDX_BANNER_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3;
|
||||
w->widgets[WIDX_BANNER_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3;
|
||||
w->widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4;
|
||||
@@ -1767,9 +1766,9 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
if (tileElement == nullptr)
|
||||
return;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
{
|
||||
// Details
|
||||
// Terrain texture name
|
||||
@@ -1837,7 +1836,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
// Details
|
||||
auto pathEl = tileElement->AsPath();
|
||||
@@ -1913,7 +1912,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto trackElement = tileElement->AsTrack();
|
||||
ride_id_t rideId = trackElement->GetRideIndex();
|
||||
@@ -1987,7 +1986,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
// Details
|
||||
// Age
|
||||
@@ -2042,7 +2041,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
// Details
|
||||
// Entrance type
|
||||
@@ -2117,7 +2116,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
// Details
|
||||
// Type
|
||||
@@ -2175,7 +2174,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
// Details
|
||||
// Type
|
||||
@@ -2226,7 +2225,7 @@ static void WindowTileInspectorPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
break;
|
||||
}
|
||||
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
// Details
|
||||
// Banner info
|
||||
@@ -2287,7 +2286,6 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi
|
||||
|
||||
const bool selectedRow = i == windowTileInspectorSelectedIndex;
|
||||
const bool hoveredRow = i == windowTileInspectorHighlightedIndex;
|
||||
int32_t type = tileElement->GetType();
|
||||
const char* typeName = "";
|
||||
|
||||
// Draw row background colour
|
||||
@@ -2318,19 +2316,20 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi
|
||||
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 0 }, stringFormat, checkboxFormatter);
|
||||
}
|
||||
|
||||
const auto type = tileElement->GetTypeN();
|
||||
switch (type)
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
typeName = language_get_string(STR_TILE_INSPECTOR_SURFACE);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
typeName = tileElement->AsPath()->IsQueue() ? language_get_string(STR_QUEUE_LINE_MAP_TIP)
|
||||
: language_get_string(STR_FOOTPATH_MAP_TIP);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
typeName = language_get_string(STR_RIDE_COMPONENT_TRACK_CAPITALISED);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry();
|
||||
snprintf(
|
||||
@@ -2339,10 +2338,10 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi
|
||||
typeName = buffer;
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
typeName = language_get_string(STR_RIDE_CONSTRUCTION_ENTRANCE);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
const auto* entry = tileElement->AsWall()->GetEntry();
|
||||
snprintf(
|
||||
@@ -2351,17 +2350,17 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi
|
||||
typeName = buffer;
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
typeName = language_get_string(STR_OBJECT_SELECTION_LARGE_SCENERY);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
snprintf(
|
||||
buffer, sizeof(buffer), "%s (%d)", language_get_string(STR_BANNER_WINDOW_TITLE),
|
||||
tileElement->AsBanner()->GetIndex());
|
||||
typeName = buffer;
|
||||
break;
|
||||
default:
|
||||
snprintf(buffer, sizeof(buffer), "%s (%d)", language_get_string(STR_UNKNOWN_OBJECT_TYPE), type);
|
||||
snprintf(buffer, sizeof(buffer), "%s (%d)", language_get_string(STR_UNKNOWN_OBJECT_TYPE), EnumValue(type));
|
||||
typeName = buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,10 +132,10 @@ void setup_in_use_selection_flags()
|
||||
{
|
||||
ObjectEntryIndex type;
|
||||
|
||||
switch (iter.element->GetType())
|
||||
switch (iter.element->GetTypeN())
|
||||
{
|
||||
default:
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
{
|
||||
auto surfaceEl = iter.element->AsSurface();
|
||||
auto surfaceIndex = surfaceEl->GetSurfaceStyle();
|
||||
@@ -145,9 +145,9 @@ void setup_in_use_selection_flags()
|
||||
Editor::SetSelectedObject(ObjectType::TerrainEdge, edgeIndex, OBJECT_SELECTION_FLAG_SELECTED);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto footpathEl = iter.element->AsPath();
|
||||
auto legacyPathEntryIndex = footpathEl->GetLegacyPathEntryIndex();
|
||||
@@ -169,11 +169,11 @@ void setup_in_use_selection_flags()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
type = iter.element->AsSmallScenery()->GetEntryIndex();
|
||||
Editor::SetSelectedObject(ObjectType::SmallScenery, type, OBJECT_SELECTION_FLAG_SELECTED);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto parkEntranceEl = iter.element->AsEntrance();
|
||||
if (parkEntranceEl->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE)
|
||||
@@ -197,15 +197,15 @@ void setup_in_use_selection_flags()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
type = iter.element->AsWall()->GetEntryIndex();
|
||||
Editor::SetSelectedObject(ObjectType::Walls, type, OBJECT_SELECTION_FLAG_SELECTED);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
type = iter.element->AsLargeScenery()->GetEntryIndex();
|
||||
Editor::SetSelectedObject(ObjectType::LargeScenery, type, OBJECT_SELECTION_FLAG_SELECTED);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
auto banner = iter.element->AsBanner()->GetBanner();
|
||||
if (banner != nullptr)
|
||||
|
||||
@@ -128,10 +128,9 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin
|
||||
if (tileElement->IsGhost())
|
||||
continue;
|
||||
|
||||
auto type = tileElement->GetType();
|
||||
switch (type)
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_FOOTPATH)
|
||||
{
|
||||
auto footpathRemoveAction = FootpathRemoveAction({ tilePos, tileElement->GetBaseZ() });
|
||||
@@ -147,7 +146,7 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_SMALL)
|
||||
{
|
||||
auto removeSceneryAction = SmallSceneryRemoveAction(
|
||||
@@ -165,7 +164,7 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_SMALL)
|
||||
{
|
||||
CoordsXYZD wallLocation = { tilePos, tileElement->GetBaseZ(), tileElement->GetDirection() };
|
||||
@@ -182,7 +181,7 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_LARGE)
|
||||
{
|
||||
auto removeSceneryAction = LargeSceneryRemoveAction(
|
||||
@@ -200,6 +199,8 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (!tileEdited && !(tileElement++)->IsLastForTile());
|
||||
} while (tileEdited);
|
||||
|
||||
@@ -505,8 +505,8 @@ GameActions::Result WallPlaceAction::WallCheckObstruction(
|
||||
{
|
||||
if (tileElement == nullptr)
|
||||
break;
|
||||
int32_t elementType = tileElement->GetType();
|
||||
if (elementType == TILE_ELEMENT_TYPE_SURFACE)
|
||||
auto elementType = tileElement->GetTypeN();
|
||||
if (elementType == TileElementTypeN::Surface)
|
||||
continue;
|
||||
if (tileElement->IsGhost())
|
||||
continue;
|
||||
@@ -514,7 +514,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction(
|
||||
continue;
|
||||
if (z1 <= tileElement->base_height)
|
||||
continue;
|
||||
if (elementType == TILE_ELEMENT_TYPE_WALL)
|
||||
if (elementType == TileElementTypeN::Wall)
|
||||
{
|
||||
int32_t direction = tileElement->GetDirection();
|
||||
if (_edge == direction)
|
||||
@@ -530,17 +530,17 @@ GameActions::Result WallPlaceAction::WallCheckObstruction(
|
||||
auto res = GameActions::Result(GameActions::Status::NoClearance, STR_CANT_BUILD_THIS_HERE, STR_NONE);
|
||||
switch (elementType)
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
map_obstruction_set_error_text(tileElement, res);
|
||||
return res;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (tileElement->AsPath()->GetEdges() & (1 << _edge))
|
||||
{
|
||||
map_obstruction_set_error_text(tileElement, res);
|
||||
return res;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
const auto* largeSceneryElement = tileElement->AsLargeScenery();
|
||||
const auto* sceneryEntry = largeSceneryElement->GetEntry();
|
||||
@@ -560,7 +560,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto sceneryEntry = tileElement->AsSmallScenery()->GetEntry();
|
||||
if (sceneryEntry != nullptr && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS))
|
||||
@@ -570,12 +570,14 @@ GameActions::Result WallPlaceAction::WallCheckObstruction(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
if (!WallCheckObstructionWithTrack(wall, z0, tileElement->AsTrack(), wallAcrossTrack))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
|
||||
|
||||
@@ -2904,9 +2904,9 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre
|
||||
{
|
||||
Ride* ride;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
if (!tileElement->AsPath()->HasAddition())
|
||||
break;
|
||||
@@ -2930,11 +2930,11 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
num_scenery++;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
@@ -2961,6 +2961,8 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,45 +247,41 @@ static void sub_68B3FB(paint_session* session, int32_t x, int32_t y)
|
||||
{
|
||||
break;
|
||||
}
|
||||
switch (tile_element_sub_iterator->GetType())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
session->PathElementOnSameHeight = tile_element_sub_iterator;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
session->TrackElementOnSameHeight = tile_element_sub_iterator;
|
||||
break;
|
||||
}
|
||||
auto type = tile_element_sub_iterator->GetTypeN();
|
||||
if (type == TileElementTypeN::Path)
|
||||
session->PathElementOnSameHeight = tile_element_sub_iterator;
|
||||
else if (type == TileElementTypeN::Track)
|
||||
session->TrackElementOnSameHeight = tile_element_sub_iterator;
|
||||
}
|
||||
}
|
||||
|
||||
CoordsXY mapPosition = session->MapPosition;
|
||||
session->CurrentlyDrawnItem = tile_element;
|
||||
// Setup the painting of for example: the underground, signs, rides, scenery, etc.
|
||||
switch (tile_element->GetType())
|
||||
switch (tile_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
PaintSurface(session, direction, baseZ, *(tile_element->AsSurface()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
PaintPath(session, baseZ, *(tile_element->AsPath()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
PaintTrack(session, direction, baseZ, *(tile_element->AsTrack()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
PaintSmallScenery(session, direction, baseZ, *(tile_element->AsSmallScenery()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
PaintEntrance(session, direction, baseZ, *(tile_element->AsEntrance()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
PaintWall(session, direction, baseZ, *(tile_element->AsWall()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
PaintLargeScenery(session, direction, baseZ, *(tile_element->AsLargeScenery()));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
PaintBanner(session, direction, baseZ, *(tile_element->AsBanner()));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -338,9 +338,9 @@ static uint8_t footpath_element_dest_in_dir(
|
||||
if (tileElement->IsGhost())
|
||||
continue;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
if (loc.z != tileElement->base_height)
|
||||
continue;
|
||||
@@ -353,7 +353,7 @@ static uint8_t footpath_element_dest_in_dir(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
if (loc.z != tileElement->base_height)
|
||||
continue;
|
||||
switch (tileElement->AsEntrance()->GetEntranceType())
|
||||
@@ -378,7 +378,8 @@ static uint8_t footpath_element_dest_in_dir(
|
||||
return PATH_SEARCH_PARK_EXIT;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
if (!IsValidPathZAndDirection(tileElement, loc.z, chosenDirection))
|
||||
continue;
|
||||
if (tileElement->AsPath()->IsWide())
|
||||
@@ -407,6 +408,9 @@ static uint8_t footpath_element_dest_in_dir(
|
||||
return footpath_element_dest_in_dir(loc, dir, outRideIndex, level + 1);
|
||||
}
|
||||
return PATH_SEARCH_DEAD_END;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
|
||||
@@ -748,9 +752,9 @@ static void peep_pathfind_heuristic_search(
|
||||
continue;
|
||||
|
||||
ride_id_t rideIndex = RIDE_ID_NULL;
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
if (loc.z != tileElement->base_height)
|
||||
continue;
|
||||
@@ -765,7 +769,7 @@ static void peep_pathfind_heuristic_search(
|
||||
searchResult = PATH_SEARCH_SHOP_ENTRANCE;
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
if (loc.z != tileElement->base_height)
|
||||
continue;
|
||||
Direction direction;
|
||||
@@ -810,7 +814,7 @@ static void peep_pathfind_heuristic_search(
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
/* For peeps heading for a ride with a queue, the goal is the last
|
||||
* queue path.
|
||||
|
||||
@@ -469,9 +469,9 @@ namespace RCT1
|
||||
|
||||
while (tileIndex < maxTiles)
|
||||
{
|
||||
switch (tileElement->GetType())
|
||||
switch (static_cast<RCT12TileElementType>(tileElement->GetType()))
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case RCT12TileElementType::Surface:
|
||||
{
|
||||
auto surfaceEl = tileElement->AsSurface();
|
||||
auto surfaceStyle = surfaceEl->GetSurfaceStyle();
|
||||
@@ -480,7 +480,7 @@ namespace RCT1
|
||||
AddEntryForTerrainEdge(edgeStyle);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case RCT12TileElementType::Path:
|
||||
{
|
||||
uint8_t pathType = tileElement->AsPath()->GetRCT1PathType();
|
||||
uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition();
|
||||
@@ -495,13 +495,13 @@ namespace RCT1
|
||||
AddEntryForFootpathRailings(footpathRailingsType);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case RCT12TileElementType::SmallScenery:
|
||||
AddEntryForSmallScenery(tileElement->AsSmallScenery()->GetEntryIndex());
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case RCT12TileElementType::LargeScenery:
|
||||
AddEntryForLargeScenery(tileElement->AsLargeScenery()->GetEntryIndex());
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case RCT12TileElementType::Wall:
|
||||
{
|
||||
for (int32_t edge = 0; edge < 4; edge++)
|
||||
{
|
||||
@@ -514,6 +514,8 @@ namespace RCT1
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if ((tileElement++)->IsLastForTile())
|
||||
@@ -1552,8 +1554,8 @@ namespace RCT1
|
||||
size_t ImportTileElement(TileElement* dst, const RCT12TileElement* src)
|
||||
{
|
||||
// Todo: allow for changing definition of OpenRCT2 tile element types - replace with a map
|
||||
uint8_t tileElementType = src->GetType();
|
||||
dst->ClearAs(static_cast<TileElementTypeN>(tileElementType >> 2));
|
||||
auto tileElementType = static_cast<TileElementTypeN>(src->GetType() >> 2);
|
||||
dst->ClearAs(tileElementType);
|
||||
dst->SetDirection(src->GetDirection());
|
||||
|
||||
// All saved in "flags"
|
||||
@@ -1567,7 +1569,7 @@ namespace RCT1
|
||||
|
||||
switch (tileElementType)
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
{
|
||||
auto dst2 = dst->AsSurface();
|
||||
auto src2 = src->AsSurface();
|
||||
@@ -1586,7 +1588,7 @@ namespace RCT1
|
||||
|
||||
return 1;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto dst2 = dst->AsPath();
|
||||
auto src2 = src->AsPath();
|
||||
@@ -1641,7 +1643,7 @@ namespace RCT1
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto dst2 = dst->AsTrack();
|
||||
auto src2 = src->AsTrack();
|
||||
@@ -1688,7 +1690,7 @@ namespace RCT1
|
||||
|
||||
return 1;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto dst2 = dst->AsSmallScenery();
|
||||
auto src2 = src->AsSmallScenery();
|
||||
@@ -1723,7 +1725,7 @@ namespace RCT1
|
||||
|
||||
return 1;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto dst2 = dst->AsEntrance();
|
||||
auto src2 = src->AsEntrance();
|
||||
@@ -1746,7 +1748,7 @@ namespace RCT1
|
||||
|
||||
return 1;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto src2 = src->AsWall();
|
||||
auto slope = src2->GetRCT1Slope();
|
||||
@@ -1801,7 +1803,7 @@ namespace RCT1
|
||||
|
||||
return numAddedElements;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto dst2 = dst->AsLargeScenery();
|
||||
auto src2 = src->AsLargeScenery();
|
||||
@@ -1814,7 +1816,7 @@ namespace RCT1
|
||||
|
||||
return 1;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
auto dst2 = dst->AsBanner();
|
||||
auto src2 = src->AsBanner();
|
||||
|
||||
@@ -447,33 +447,6 @@ bool is_user_string_id(rct_string_id stringId)
|
||||
return stringId >= 0x8000 && stringId < 0x9000;
|
||||
}
|
||||
|
||||
uint8_t RCT12TileElement::GetBannerIndex()
|
||||
{
|
||||
switch (GetType())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
{
|
||||
auto* sceneryEntry = get_large_scenery_entry(AsLargeScenery()->GetEntryIndex());
|
||||
if (sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE)
|
||||
return RCT12_BANNER_INDEX_NULL;
|
||||
|
||||
return AsLargeScenery()->GetBannerIndex();
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
{
|
||||
auto* wallEntry = get_wall_entry(AsWall()->GetEntryIndex());
|
||||
if (wallEntry == nullptr || wallEntry->scrolling_mode == SCROLLING_MODE_NONE)
|
||||
return RCT12_BANNER_INDEX_NULL;
|
||||
|
||||
return AsWall()->GetBannerIndex();
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
return AsBanner()->GetIndex();
|
||||
default:
|
||||
return RCT12_BANNER_INDEX_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool RCT12PathElement::IsBroken() const
|
||||
{
|
||||
return (flags & RCT12_TILE_ELEMENT_FLAG_BROKEN) != 0;
|
||||
|
||||
@@ -378,7 +378,6 @@ struct RCT12TileElement : public RCT12TileElementBase
|
||||
{
|
||||
return as<RCT12BannerElement, RCT12TileElementType::Banner>();
|
||||
}
|
||||
uint8_t GetBannerIndex();
|
||||
};
|
||||
assert_struct_size(RCT12TileElement, 8);
|
||||
struct RCT12SurfaceElement : RCT12TileElementBase
|
||||
|
||||
@@ -1196,9 +1196,9 @@ namespace RCT2
|
||||
dst->SetLastForTile(src->IsLastForTile());
|
||||
dst->SetInvisible(invisible);
|
||||
|
||||
switch (tileElementType)
|
||||
switch (static_cast<RCT12TileElementType>(tileElementType))
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case RCT12TileElementType::Surface:
|
||||
{
|
||||
auto dst2 = dst->AsSurface();
|
||||
auto src2 = src->AsSurface();
|
||||
@@ -1216,7 +1216,7 @@ namespace RCT2
|
||||
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case RCT12TileElementType::Path:
|
||||
{
|
||||
auto dst2 = dst->AsPath();
|
||||
auto src2 = src->AsPath();
|
||||
@@ -1254,7 +1254,7 @@ namespace RCT2
|
||||
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case RCT12TileElementType::Track:
|
||||
{
|
||||
auto dst2 = dst->AsTrack();
|
||||
auto src2 = src->AsTrack();
|
||||
@@ -1302,7 +1302,7 @@ namespace RCT2
|
||||
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case RCT12TileElementType::SmallScenery:
|
||||
{
|
||||
auto dst2 = dst->AsSmallScenery();
|
||||
auto src2 = src->AsSmallScenery();
|
||||
@@ -1317,7 +1317,7 @@ namespace RCT2
|
||||
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case RCT12TileElementType::Entrance:
|
||||
{
|
||||
auto dst2 = dst->AsEntrance();
|
||||
auto src2 = src->AsEntrance();
|
||||
@@ -1348,7 +1348,7 @@ namespace RCT2
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case RCT12TileElementType::Wall:
|
||||
{
|
||||
auto dst2 = dst->AsWall();
|
||||
auto src2 = src->AsWall();
|
||||
@@ -1385,7 +1385,7 @@ namespace RCT2
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case RCT12TileElementType::LargeScenery:
|
||||
{
|
||||
auto dst2 = dst->AsLargeScenery();
|
||||
auto src2 = src->AsLargeScenery();
|
||||
@@ -1418,7 +1418,7 @@ namespace RCT2
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case RCT12TileElementType::Banner:
|
||||
{
|
||||
auto dst2 = dst->AsBanner();
|
||||
auto src2 = src->AsBanner();
|
||||
|
||||
@@ -429,9 +429,9 @@ static void ride_ratings_score_close_proximity_in_direction(
|
||||
if (tileElement->IsGhost())
|
||||
continue;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
if (state.ProximityBaseHeight <= inputTileElement->base_height)
|
||||
{
|
||||
if (inputTileElement->clearance_height <= tileElement->base_height)
|
||||
@@ -440,13 +440,13 @@ static void ride_ratings_score_close_proximity_in_direction(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (abs(inputTileElement->GetBaseZ() - tileElement->GetBaseZ()) <= 2 * COORDS_Z_STEP)
|
||||
{
|
||||
proximity_score_increment(state, PROXIMITY_PATH_SIDE_CLOSE);
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
if (inputTileElement->AsTrack()->GetRideIndex() != tileElement->AsTrack()->GetRideIndex())
|
||||
{
|
||||
if (abs(inputTileElement->GetBaseZ() - tileElement->GetBaseZ()) <= 2 * COORDS_Z_STEP)
|
||||
@@ -455,8 +455,8 @@ static void ride_ratings_score_close_proximity_in_direction(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
if (tileElement->GetBaseZ() < inputTileElement->GetClearanceZ())
|
||||
{
|
||||
if (inputTileElement->GetBaseZ() > tileElement->GetClearanceZ())
|
||||
@@ -469,6 +469,8 @@ static void ride_ratings_score_close_proximity_in_direction(
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
}
|
||||
@@ -483,38 +485,33 @@ static void ride_ratings_score_close_proximity_loops_helper(RideRatingUpdateStat
|
||||
if (tileElement->IsGhost())
|
||||
continue;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
auto type = tileElement->GetTypeN();
|
||||
if (type == TileElementTypeN::Path)
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
int32_t zDiff = static_cast<int32_t>(tileElement->base_height)
|
||||
- static_cast<int32_t>(coordsElement.element->base_height);
|
||||
if (zDiff >= 0 && zDiff <= 16)
|
||||
{
|
||||
proximity_score_increment(state, PROXIMITY_PATH_TROUGH_VERTICAL_LOOP);
|
||||
}
|
||||
}
|
||||
else if (type == TileElementTypeN::Track)
|
||||
{
|
||||
bool elementsAreAt90DegAngle = ((tileElement->GetDirection() ^ coordsElement.element->GetDirection()) & 1) != 0;
|
||||
if (elementsAreAt90DegAngle)
|
||||
{
|
||||
int32_t zDiff = static_cast<int32_t>(tileElement->base_height)
|
||||
- static_cast<int32_t>(coordsElement.element->base_height);
|
||||
if (zDiff >= 0 && zDiff <= 16)
|
||||
{
|
||||
proximity_score_increment(state, PROXIMITY_PATH_TROUGH_VERTICAL_LOOP);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
{
|
||||
bool elementsAreAt90DegAngle = ((tileElement->GetDirection() ^ coordsElement.element->GetDirection()) & 1) != 0;
|
||||
if (elementsAreAt90DegAngle)
|
||||
{
|
||||
int32_t zDiff = static_cast<int32_t>(tileElement->base_height)
|
||||
- static_cast<int32_t>(coordsElement.element->base_height);
|
||||
if (zDiff >= 0 && zDiff <= 16)
|
||||
proximity_score_increment(state, PROXIMITY_TRACK_THROUGH_VERTICAL_LOOP);
|
||||
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::LeftVerticalLoop
|
||||
|| tileElement->AsTrack()->GetTrackType() == TrackElemType::RightVerticalLoop)
|
||||
{
|
||||
proximity_score_increment(state, PROXIMITY_TRACK_THROUGH_VERTICAL_LOOP);
|
||||
if (tileElement->AsTrack()->GetTrackType() == TrackElemType::LeftVerticalLoop
|
||||
|| tileElement->AsTrack()->GetTrackType() == TrackElemType::RightVerticalLoop)
|
||||
{
|
||||
proximity_score_increment(state, PROXIMITY_INTERSECTING_VERTICAL_LOOP);
|
||||
}
|
||||
proximity_score_increment(state, PROXIMITY_INTERSECTING_VERTICAL_LOOP);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
}
|
||||
@@ -557,9 +554,9 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til
|
||||
continue;
|
||||
|
||||
int32_t waterHeight;
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
state.ProximityBaseHeight = tileElement->base_height;
|
||||
if (tileElement->GetBaseZ() == state.Proximity.z)
|
||||
{
|
||||
@@ -589,7 +586,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (!tileElement->AsPath()->IsQueue())
|
||||
{
|
||||
if (tileElement->GetClearanceZ() == inputTileElement->GetBaseZ())
|
||||
@@ -617,7 +614,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto trackType = tileElement->AsTrack()->GetTrackType();
|
||||
if (trackType == TrackElemType::LeftVerticalLoop || trackType == TrackElemType::RightVerticalLoop)
|
||||
@@ -700,8 +697,10 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
} // switch tileElement->GetType
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
|
||||
|
||||
@@ -148,14 +148,14 @@ static int32_t tile_element_get_total_element_count(TileElement* tileElement)
|
||||
int32_t elementCount;
|
||||
rct_large_scenery_tile* tile;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Path:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
case TileElementTypeN::Wall:
|
||||
return 1;
|
||||
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
|
||||
tile = sceneryEntry->tiles;
|
||||
@@ -585,17 +585,17 @@ static void track_design_save_remove_tile_element(
|
||||
|
||||
static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex, TileElement* tileElement)
|
||||
{
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (tileElement->AsPath()->IsQueue() && tileElement->AsPath()->GetRideIndex() == rideIndex)
|
||||
return true;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
if (tileElement->AsTrack()->GetRideIndex() == rideIndex)
|
||||
return true;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
// FIXME: This will always break and return false!
|
||||
if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE)
|
||||
break;
|
||||
@@ -604,6 +604,8 @@ static bool track_design_save_should_select_scenery_around(ride_id_t rideIndex,
|
||||
if (tileElement->AsEntrance()->GetRideIndex() == rideIndex)
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -622,23 +624,25 @@ static void track_design_save_select_nearby_scenery_for_tile(ride_id_t rideIndex
|
||||
do
|
||||
{
|
||||
ViewportInteractionItem interactionType = ViewportInteractionItem::None;
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (!tileElement->AsPath()->IsQueue())
|
||||
interactionType = ViewportInteractionItem::Footpath;
|
||||
else if (tileElement->AsPath()->GetRideIndex() == rideIndex)
|
||||
interactionType = ViewportInteractionItem::Footpath;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
interactionType = ViewportInteractionItem::Scenery;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
interactionType = ViewportInteractionItem::Wall;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
interactionType = ViewportInteractionItem::LargeScenery;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (interactionType != ViewportInteractionItem::None)
|
||||
|
||||
@@ -37,23 +37,23 @@ namespace OpenRCT2::Scripting
|
||||
|
||||
std::string ScTileElement::type_get() const
|
||||
{
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
return "surface";
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
return "footpath";
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
return "track";
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
return "small_scenery";
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
return "entrance";
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
return "wall";
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
return "large_scenery";
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
return "banner";
|
||||
default:
|
||||
return "unknown";
|
||||
@@ -134,15 +134,15 @@ namespace OpenRCT2::Scripting
|
||||
DukValue ScTileElement::slope_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
{
|
||||
auto el = _element->AsSurface();
|
||||
duk_push_int(ctx, el->GetSlope());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
duk_push_int(ctx, el->GetSlope());
|
||||
@@ -159,22 +159,19 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::slope_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
const auto type = _element->GetTypeN();
|
||||
|
||||
if (type == TileElementTypeN::Surface)
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
{
|
||||
auto el = _element->AsSurface();
|
||||
el->SetSlope(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
el->SetSlope(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
auto el = _element->AsSurface();
|
||||
el->SetSlope(value);
|
||||
Invalidate();
|
||||
}
|
||||
else if (type == TileElementTypeN::Wall)
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
el->SetSlope(value);
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,15 +375,15 @@ namespace OpenRCT2::Scripting
|
||||
DukValue ScTileElement::sequence_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
duk_push_int(ctx, el->GetSequenceIndex());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto el = _element->AsTrack();
|
||||
if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE)
|
||||
@@ -395,7 +392,7 @@ namespace OpenRCT2::Scripting
|
||||
duk_push_null(ctx);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
duk_push_int(ctx, el->GetSequenceIndex());
|
||||
@@ -412,16 +409,16 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::sequence_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
el->SetSequenceIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto el = _element->AsTrack();
|
||||
if (get_ride(el->GetRideIndex())->type != RIDE_TYPE_MAZE)
|
||||
@@ -431,22 +428,24 @@ namespace OpenRCT2::Scripting
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
el->SetSequenceIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DukValue ScTileElement::ride_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto el = _element->AsPath();
|
||||
if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL)
|
||||
@@ -455,13 +454,13 @@ namespace OpenRCT2::Scripting
|
||||
duk_push_null(ctx);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto el = _element->AsTrack();
|
||||
duk_push_int(ctx, EnumValue(el->GetRideIndex()));
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
duk_push_int(ctx, EnumValue(el->GetRideIndex()));
|
||||
@@ -478,9 +477,9 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::ride_set(int32_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto el = _element->AsPath();
|
||||
if (!el->HasAddition())
|
||||
@@ -490,29 +489,31 @@ namespace OpenRCT2::Scripting
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto el = _element->AsTrack();
|
||||
el->SetRideIndex(static_cast<ride_id_t>(value));
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
el->SetRideIndex(static_cast<ride_id_t>(value));
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DukValue ScTileElement::station_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto el = _element->AsPath();
|
||||
if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL)
|
||||
@@ -521,7 +522,7 @@ namespace OpenRCT2::Scripting
|
||||
duk_push_null(ctx);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto el = _element->AsTrack();
|
||||
if (el->IsStation())
|
||||
@@ -530,7 +531,7 @@ namespace OpenRCT2::Scripting
|
||||
duk_push_null(ctx);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
duk_push_int(ctx, el->GetStationIndex());
|
||||
@@ -547,29 +548,31 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::station_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto el = _element->AsPath();
|
||||
el->SetStationIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto el = _element->AsTrack();
|
||||
el->SetStationIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
el->SetStationIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,33 +730,33 @@ namespace OpenRCT2::Scripting
|
||||
DukValue ScTileElement::object_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto el = _element->AsPath();
|
||||
duk_push_int(ctx, el->GetLegacyPathEntryIndex());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto el = _element->AsSmallScenery();
|
||||
duk_push_int(ctx, el->GetEntryIndex());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
duk_push_int(ctx, el->GetEntryIndex());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
duk_push_int(ctx, el->GetEntryIndex());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
duk_push_int(ctx, el->GetEntranceType());
|
||||
@@ -773,43 +776,45 @@ namespace OpenRCT2::Scripting
|
||||
ThrowIfGameStateNotMutable();
|
||||
|
||||
auto index = FromDuk<ObjectEntryIndex>(value);
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto el = _element->AsPath();
|
||||
el->SetLegacyPathEntryIndex(index);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto el = _element->AsSmallScenery();
|
||||
el->SetEntryIndex(index);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
el->SetEntryIndex(index);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
el->SetEntryIndex(index);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto el = _element->AsEntrance();
|
||||
el->SetEntranceType(index);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -892,21 +897,21 @@ namespace OpenRCT2::Scripting
|
||||
DukValue ScTileElement::primaryColour_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto el = _element->AsSmallScenery();
|
||||
duk_push_int(ctx, el->GetPrimaryColour());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
duk_push_int(ctx, el->GetPrimaryColour());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
duk_push_int(ctx, el->GetPrimaryColour());
|
||||
@@ -923,50 +928,52 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::primaryColour_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto el = _element->AsSmallScenery();
|
||||
el->SetPrimaryColour(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
el->SetPrimaryColour(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
el->SetPrimaryColour(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DukValue ScTileElement::secondaryColour_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto el = _element->AsSmallScenery();
|
||||
duk_push_int(ctx, el->GetSecondaryColour());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
duk_push_int(ctx, el->GetSecondaryColour());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
duk_push_int(ctx, el->GetSecondaryColour());
|
||||
@@ -983,29 +990,31 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::secondaryColour_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto el = _element->AsSmallScenery();
|
||||
el->SetSecondaryColour(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
el->SetSecondaryColour(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
el->SetSecondaryColour(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,29 +1052,31 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::bannerIndex_set(uint16_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto el = _element->AsLargeScenery();
|
||||
el->SetBannerIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto el = _element->AsWall();
|
||||
el->SetBannerIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
auto el = _element->AsBanner();
|
||||
el->SetIndex(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1488,16 +1499,16 @@ namespace OpenRCT2::Scripting
|
||||
DukValue ScTileElement::direction_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
auto el = _element->AsBanner();
|
||||
duk_push_int(ctx, el->GetPosition());
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Path:
|
||||
case TileElementTypeN::Surface:
|
||||
{
|
||||
duk_push_null(ctx);
|
||||
break;
|
||||
@@ -1513,17 +1524,17 @@ namespace OpenRCT2::Scripting
|
||||
void ScTileElement::direction_set(uint8_t value)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
switch (_element->GetType())
|
||||
switch (_element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
auto el = _element->AsBanner();
|
||||
el->SetPosition(value);
|
||||
Invalidate();
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Path:
|
||||
case TileElementTypeN::Surface:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -282,15 +282,15 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||
Ride* ride;
|
||||
|
||||
res.ErrorMessage = STR_OBJECT_IN_THE_WAY;
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
res.ErrorMessage = STR_RAISE_OR_LOWER_LAND_FIRST;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
res.ErrorMessage = STR_FOOTPATH_IN_THE_WAY;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
@@ -300,7 +300,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||
ride->FormatNameTo(ft);
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry();
|
||||
res.ErrorMessage = STR_X_IN_THE_WAY;
|
||||
@@ -309,7 +309,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||
ft.Add<rct_string_id>(stringId);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
switch (tileElement->AsEntrance()->GetEntranceType())
|
||||
{
|
||||
case ENTRANCE_TYPE_RIDE_ENTRANCE:
|
||||
@@ -323,7 +323,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto* wallEntry = tileElement->AsWall()->GetEntry();
|
||||
res.ErrorMessage = STR_X_IN_THE_WAY;
|
||||
@@ -332,7 +332,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||
ft.Add<rct_string_id>(stringId);
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
|
||||
res.ErrorMessage = STR_X_IN_THE_WAY;
|
||||
@@ -341,5 +341,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||
ft.Add<rct_string_id>(stringId);
|
||||
break;
|
||||
}
|
||||
case TileElementTypeN::Banner:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -857,9 +857,9 @@ static void loc_6A6D7E(
|
||||
return;
|
||||
do
|
||||
{
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (tileElement->GetBaseZ() == initialTileElementPos.z)
|
||||
{
|
||||
if (!tileElement->AsPath()->IsSloped() || tileElement->AsPath()->GetSlopeDirection() == direction)
|
||||
@@ -882,7 +882,7 @@ static void loc_6A6D7E(
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
if (initialTileElementPos.z == tileElement->GetBaseZ())
|
||||
{
|
||||
auto ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
@@ -918,7 +918,7 @@ static void loc_6A6D7E(
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
if (initialTileElementPos.z == tileElement->GetBaseZ())
|
||||
{
|
||||
if (entrance_has_direction(
|
||||
@@ -942,6 +942,8 @@ static void loc_6A6D7E(
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
@@ -2175,9 +2177,9 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co
|
||||
if (tileElement == elementToBeRemoved)
|
||||
continue;
|
||||
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (tileElement->base_height == coords.z)
|
||||
{
|
||||
if (!tileElement->AsPath()->IsSloped())
|
||||
@@ -2194,7 +2196,7 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
if (tileElement->base_height == coords.z)
|
||||
{
|
||||
auto ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
@@ -2218,7 +2220,7 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
if (tileElement->base_height == coords.z)
|
||||
{
|
||||
if (entrance_has_direction(*(tileElement->AsEntrance()), coords.direction - tileElement->GetDirection()))
|
||||
|
||||
+12
-10
@@ -1116,25 +1116,27 @@ void map_remove_all_rides()
|
||||
tile_element_iterator_begin(&it);
|
||||
do
|
||||
{
|
||||
switch (it.element->GetType())
|
||||
switch (it.element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (it.element->AsPath()->IsQueue())
|
||||
{
|
||||
it.element->AsPath()->SetHasQueueBanner(false);
|
||||
it.element->AsPath()->SetRideIndex(RIDE_ID_NULL);
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
if (it.element->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE)
|
||||
break;
|
||||
[[fallthrough]];
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
footpath_queue_chain_reset();
|
||||
footpath_remove_edges_at(TileCoordsXY{ it.x, it.y }.ToCoordsXY(), it.element);
|
||||
tile_element_remove(it.element);
|
||||
tile_element_iterator_restart_for_tile(&it);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (tile_element_iterator_next(&it));
|
||||
}
|
||||
@@ -1515,9 +1517,9 @@ void map_extend_boundary_surface()
|
||||
static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
|
||||
{
|
||||
TileElement* element = *elementPtr;
|
||||
switch (element->GetType())
|
||||
switch (element->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_SURFACE:
|
||||
case TileElementTypeN::Surface:
|
||||
element->base_height = MINIMUM_LAND_HEIGHT;
|
||||
element->clearance_height = MINIMUM_LAND_HEIGHT;
|
||||
element->owner = 0;
|
||||
@@ -1532,7 +1534,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
|
||||
// The rest of the elements are removed from the array, so the pointer doesn't need to be updated.
|
||||
(*elementPtr)++;
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
int32_t rotation = element->GetDirectionWithOffset(1);
|
||||
auto seqLoc = loc;
|
||||
@@ -1554,7 +1556,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
CoordsXYZD wallLocation = { loc.x, loc.y, element->GetBaseZ(), element->GetDirection() };
|
||||
auto wallRemoveAction = WallRemoveAction(wallLocation);
|
||||
@@ -1566,7 +1568,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto removeSceneryAction = LargeSceneryRemoveAction(
|
||||
{ loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }, element->AsLargeScenery()->GetSequenceIndex());
|
||||
@@ -1578,7 +1580,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
auto bannerRemoveAction = BannerRemoveAction(
|
||||
{ loc.x, loc.y, element->GetBaseZ(), element->AsBanner()->GetPosition() });
|
||||
|
||||
@@ -617,12 +617,12 @@ void AutoCreateMapAnimations()
|
||||
{
|
||||
auto el = it.element;
|
||||
auto loc = CoordsXYZ{ TileCoordsXY(it.x, it.y).ToCoordsXY(), el->GetBaseZ() };
|
||||
switch (el->GetType())
|
||||
switch (el->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
map_animation_create(MAP_ANIMATION_TYPE_BANNER, loc);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto wallEl = el->AsWall();
|
||||
auto* entry = wallEl->GetEntry();
|
||||
@@ -633,7 +633,7 @@ void AutoCreateMapAnimations()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
{
|
||||
auto sceneryEl = el->AsSmallScenery();
|
||||
auto* sceneryEntry = sceneryEl->GetEntry();
|
||||
@@ -643,7 +643,7 @@ void AutoCreateMapAnimations()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto sceneryEl = el->AsLargeScenery();
|
||||
auto entry = sceneryEl->GetEntry();
|
||||
@@ -653,7 +653,7 @@ void AutoCreateMapAnimations()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
{
|
||||
auto path = el->AsPath();
|
||||
if (path->HasQueueBanner())
|
||||
@@ -662,7 +662,7 @@ void AutoCreateMapAnimations()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
auto entrance = el->AsEntrance();
|
||||
switch (entrance->GetEntranceType())
|
||||
@@ -679,7 +679,7 @@ void AutoCreateMapAnimations()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
{
|
||||
auto track = el->AsTrack();
|
||||
switch (track->GetTrackType())
|
||||
@@ -699,6 +699,8 @@ void AutoCreateMapAnimations()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TileElementTypeN::Surface:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,15 +141,15 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos)
|
||||
if (tileElementAbove->IsGhost())
|
||||
continue;
|
||||
|
||||
switch (tileElementAbove->GetType())
|
||||
switch (tileElementAbove->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
case TileElementTypeN::Entrance:
|
||||
case TileElementTypeN::Path:
|
||||
map_invalidate_tile_zoom1({ sceneryPos, tileElementAbove->GetBaseZ(), tileElementAbove->GetClearanceZ() });
|
||||
IncreaseAge(sceneryPos);
|
||||
return;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
sceneryEntry = tileElementAbove->AsSmallScenery()->GetEntry();
|
||||
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE))
|
||||
{
|
||||
@@ -157,6 +157,8 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ bool tile_element_is_underground(TileElement* tileElement)
|
||||
|
||||
BannerIndex TileElement::GetBannerIndex() const
|
||||
{
|
||||
switch (GetType())
|
||||
switch (GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
{
|
||||
auto* sceneryEntry = AsLargeScenery()->GetEntry();
|
||||
if (sceneryEntry == nullptr || sceneryEntry->scrolling_mode == SCROLLING_MODE_NONE)
|
||||
@@ -41,7 +41,7 @@ BannerIndex TileElement::GetBannerIndex() const
|
||||
|
||||
return AsLargeScenery()->GetBannerIndex();
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
{
|
||||
auto* wallEntry = AsWall()->GetEntry();
|
||||
if (wallEntry == nullptr || wallEntry->scrolling_mode == SCROLLING_MODE_NONE)
|
||||
@@ -49,7 +49,7 @@ BannerIndex TileElement::GetBannerIndex() const
|
||||
|
||||
return AsWall()->GetBannerIndex();
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
return AsBanner()->GetIndex();
|
||||
default:
|
||||
return BANNER_INDEX_NULL;
|
||||
@@ -58,15 +58,15 @@ BannerIndex TileElement::GetBannerIndex() const
|
||||
|
||||
void TileElement::SetBannerIndex(BannerIndex bannerIndex)
|
||||
{
|
||||
switch (GetType())
|
||||
switch (GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Wall:
|
||||
AsWall()->SetBannerIndex(bannerIndex);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
AsLargeScenery()->SetBannerIndex(bannerIndex);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
AsBanner()->SetIndex(bannerIndex);
|
||||
break;
|
||||
default:
|
||||
@@ -88,13 +88,13 @@ void TileElement::RemoveBannerEntry()
|
||||
|
||||
ride_id_t TileElement::GetRideIndex() const
|
||||
{
|
||||
switch (GetType())
|
||||
switch (GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TileElementTypeN::Track:
|
||||
return AsTrack()->GetRideIndex();
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
return AsEntrance()->GetRideIndex();
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
return AsPath()->GetRideIndex();
|
||||
default:
|
||||
return RIDE_ID_NULL;
|
||||
|
||||
@@ -223,9 +223,9 @@ namespace OpenRCT2::TileInspector
|
||||
{
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE);
|
||||
}
|
||||
switch (tileElement->GetType())
|
||||
switch (tileElement->GetTypeN())
|
||||
{
|
||||
case TILE_ELEMENT_TYPE_PATH:
|
||||
case TileElementTypeN::Path:
|
||||
if (tileElement->AsPath()->IsSloped())
|
||||
{
|
||||
newRotation = (tileElement->AsPath()->GetSlopeDirection() + 1) & TILE_ELEMENT_DIRECTION_MASK;
|
||||
@@ -236,7 +236,7 @@ namespace OpenRCT2::TileInspector
|
||||
tileElement->AsPath()->SetEdges((pathEdges << 1) | (pathEdges >> 3));
|
||||
tileElement->AsPath()->SetCorners((pathCorners << 1) | (pathCorners >> 3));
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||
case TileElementTypeN::Entrance:
|
||||
{
|
||||
// Update element rotation
|
||||
newRotation = tileElement->GetDirectionWithOffset(1);
|
||||
@@ -267,13 +267,13 @@ namespace OpenRCT2::TileInspector
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TILE_ELEMENT_TYPE_TRACK:
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
case TileElementTypeN::Track:
|
||||
case TileElementTypeN::SmallScenery:
|
||||
case TileElementTypeN::Wall:
|
||||
newRotation = tileElement->GetDirectionWithOffset(1);
|
||||
tileElement->SetDirection(newRotation);
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_BANNER:
|
||||
case TileElementTypeN::Banner:
|
||||
{
|
||||
uint8_t unblockedEdges = tileElement->AsBanner()->GetAllowedEdges();
|
||||
unblockedEdges = (unblockedEdges << 1 | unblockedEdges >> 3) & 0xF;
|
||||
@@ -281,6 +281,9 @@ namespace OpenRCT2::TileInspector
|
||||
tileElement->AsBanner()->SetPosition((tileElement->AsBanner()->GetPosition() + 1) & 3);
|
||||
break;
|
||||
}
|
||||
case TileElementTypeN::Surface:
|
||||
case TileElementTypeN::LargeScenery:
|
||||
break;
|
||||
}
|
||||
|
||||
map_invalidate_tile_full(loc);
|
||||
|
||||
Reference in new issue
Block a user