mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #14163 from Gymnasiast/refactor/get-rtd
Use GetRideTypeDescriptor() in more places
This commit is contained in:
commit
28c680f97f
|
@ -633,7 +633,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window* w, rct_drawpix
|
|||
const rct_string_id itemNameId = researchItem.GetName();
|
||||
|
||||
if (researchItem.type == Research::EntryType::Ride
|
||||
&& !RideTypeDescriptors[researchItem.baseRideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
&& !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
const auto rideEntry = get_ride_entry(researchItem.entryIndex);
|
||||
const rct_string_id rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name;
|
||||
|
@ -674,7 +674,7 @@ static void window_editor_inventions_list_drag_open(ResearchItem* researchItem)
|
|||
|
||||
ptr = buffer;
|
||||
if (researchItem->type == Research::EntryType::Ride
|
||||
&& !RideTypeDescriptors[researchItem->baseRideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
&& !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
const auto rideEntry = get_ride_entry(researchItem->entryIndex);
|
||||
const rct_string_id rideTypeName = get_ride_naming(researchItem->baseRideType, rideEntry).Name;
|
||||
|
@ -768,7 +768,7 @@ static std::pair<rct_string_id, Formatter> window_editor_inventions_list_prepare
|
|||
auto ft = Formatter();
|
||||
|
||||
if (researchItem->type == Research::EntryType::Ride
|
||||
&& !RideTypeDescriptors[researchItem->baseRideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
&& !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
drawString = withGap ? STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME_DRAG : STR_WINDOW_COLOUR_2_STRINGID_STRINGID;
|
||||
rct_string_id rideTypeName = get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex)).Name;
|
||||
|
|
|
@ -1318,7 +1318,7 @@ static void editor_load_selected_objects()
|
|||
{
|
||||
rct_ride_entry* rideEntry = get_ride_entry(entryIndex);
|
||||
uint8_t rideType = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
ResearchCategory category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
ResearchCategory category = static_cast<ResearchCategory>(GetRideTypeDescriptor(rideType).Category);
|
||||
research_insert_ride_entry(rideType, entryIndex, category, true);
|
||||
}
|
||||
else if (objectType == ObjectType::SceneryGroup)
|
||||
|
@ -1485,7 +1485,7 @@ static bool filter_chunks(const ObjectRepositoryItem* item)
|
|||
break;
|
||||
}
|
||||
}
|
||||
return (_filter_flags & (1 << (RideTypeDescriptors[rideType].Category + _numSourceGameItems))) != 0;
|
||||
return (_filter_flags & (1 << (GetRideTypeDescriptor(rideType).Category + _numSourceGameItems))) != 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1519,7 +1519,7 @@ static rct_string_id get_ride_type_string_id(const ObjectRepositoryItem* item)
|
|||
uint8_t rideType = item->RideInfo.RideType[i];
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
result = RideTypeDescriptors[rideType].Naming.Name;
|
||||
result = GetRideTypeDescriptor(rideType).Naming.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ public:
|
|||
if (guestRide != nullptr)
|
||||
{
|
||||
ft.Add<rct_string_id>(
|
||||
ride_type_has_flag(guestRide->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
guestRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
guestRide->FormatNameTo(ft);
|
||||
|
||||
_selectedFilter = GuestFilterType::Guests;
|
||||
|
|
|
@ -252,7 +252,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
else
|
||||
{
|
||||
// Fall back on the technical track name if the vehicle object cannot be loaded
|
||||
ft.Add<rct_string_id>(RideTypeDescriptors[td6->type].Naming.Name);
|
||||
ft.Add<rct_string_id>(GetRideTypeDescriptor(td6->type).Naming.Name);
|
||||
}
|
||||
|
||||
gfx_draw_string_left(dpi, STR_TRACK_DESIGN_TYPE, ft.Data(), COLOUR_BLACK, screenPos);
|
||||
|
@ -321,7 +321,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
screenPos.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
// Maximum positive vertical Gs
|
||||
{
|
||||
|
@ -358,7 +358,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
{
|
||||
// Drops
|
||||
uint16_t drops = td6->drops & 0x3F;
|
||||
|
|
|
@ -1516,7 +1516,7 @@ static uint16_t map_window_get_pixel_colour_ride(const CoordsXY& c)
|
|||
ride = get_ride(tileElement->AsEntrance()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
const auto& colourKey = RideTypeDescriptors[ride->type].ColourKey;
|
||||
const auto& colourKey = ride->GetRideTypeDescriptor().ColourKey;
|
||||
colourA = RideKeyColours[static_cast<size_t>(colourKey)];
|
||||
}
|
||||
break;
|
||||
|
@ -1524,7 +1524,7 @@ static uint16_t map_window_get_pixel_colour_ride(const CoordsXY& c)
|
|||
ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
const auto& colourKey = RideTypeDescriptors[ride->type].ColourKey;
|
||||
const auto& colourKey = ride->GetRideTypeDescriptor().ColourKey;
|
||||
colourA = RideKeyColours[static_cast<size_t>(colourKey)];
|
||||
}
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ static void window_maze_construction_entrance_tooldown(const ScreenCoordsXY& scr
|
|||
if (ride != nullptr && ride_are_all_possible_entrances_and_exits_built(ride))
|
||||
{
|
||||
tool_cancel();
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
window_close_by_class(WC_RIDE_CONSTRUCTION);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -404,10 +404,9 @@ void WindowCampaignRefreshRides()
|
|||
{
|
||||
if (ride.status == RIDE_STATUS_OPEN)
|
||||
{
|
||||
if (!ride_type_has_flag(
|
||||
ride.type,
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(
|
||||
RIDE_TYPE_FLAG_IS_SHOP | RIDE_TYPE_FLAG_SELLS_FOOD | RIDE_TYPE_FLAG_SELLS_DRINKS
|
||||
| RIDE_TYPE_FLAG_IS_TOILET))
|
||||
| RIDE_TYPE_FLAG_IS_TOILET))
|
||||
{
|
||||
window_new_campaign_rides.push_back(ride.id);
|
||||
}
|
||||
|
|
|
@ -305,7 +305,7 @@ static void window_new_ride_populate_list()
|
|||
if (rideType == RIDE_TYPE_NULL)
|
||||
continue;
|
||||
|
||||
if (RideTypeDescriptors[rideType].Category != currentCategory)
|
||||
if (GetRideTypeDescriptor(rideType).Category != currentCategory)
|
||||
continue;
|
||||
|
||||
nextListItem = window_new_ride_iterate_over_ride_type(rideType, nextListItem);
|
||||
|
@ -335,7 +335,7 @@ static RideSelection* window_new_ride_iterate_over_ride_type(uint8_t rideType, R
|
|||
rct_ride_entry* rideEntry = get_ride_entry(rideEntryIndex);
|
||||
|
||||
// Skip if the vehicle isn't the preferred vehicle for this generic track type
|
||||
if (!RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
&& highestVehiclePriority > rideEntry->BuildMenuPriority)
|
||||
{
|
||||
continue;
|
||||
|
@ -343,7 +343,7 @@ static RideSelection* window_new_ride_iterate_over_ride_type(uint8_t rideType, R
|
|||
highestVehiclePriority = rideEntry->BuildMenuPriority;
|
||||
|
||||
// Determines how and where to draw a button for this ride type/vehicle.
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
// Separate, draw apart
|
||||
allowDrawingOverLastButton = false;
|
||||
|
@ -481,7 +481,7 @@ void window_new_ride_focus(RideSelection rideItem)
|
|||
rideEntry = get_ride_entry(rideItem.EntryIndex);
|
||||
uint8_t rideTypeIndex = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
|
||||
window_new_ride_set_page(w, RideTypeDescriptors[rideTypeIndex].Category);
|
||||
window_new_ride_set_page(w, GetRideTypeDescriptor(rideTypeIndex).Category);
|
||||
|
||||
for (RideSelection* listItem = _windowNewRideListItems; listItem->Type != RIDE_TYPE_NULL; listItem++)
|
||||
{
|
||||
|
@ -876,7 +876,7 @@ static int32_t get_num_track_designs(RideSelection item)
|
|||
|
||||
if (item.Type < 0x80)
|
||||
{
|
||||
if (RideTypeDescriptors[item.Type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
entryName = get_ride_entry_name(item.EntryIndex);
|
||||
}
|
||||
|
@ -942,14 +942,14 @@ static void window_new_ride_paint_ride_information(
|
|||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
// Get price of ride
|
||||
int32_t unk2 = RideTypeDescriptors[item.Type].StartTrackPiece;
|
||||
money32 price = RideTypeDescriptors[item.Type].BuildCosts.TrackPrice;
|
||||
int32_t unk2 = GetRideTypeDescriptor(item.Type).StartTrackPiece;
|
||||
money32 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[unk2];
|
||||
price = (price >> 17) * 10 * RideTypeDescriptors[item.Type].BuildCosts.PriceEstimateMultiplier;
|
||||
price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier;
|
||||
|
||||
//
|
||||
rct_string_id stringId = STR_NEW_RIDE_COST;
|
||||
if (!ride_type_has_flag(item.Type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (!GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
stringId = STR_NEW_RIDE_COST_FROM;
|
||||
|
||||
ft = Formatter();
|
||||
|
@ -986,7 +986,7 @@ static void window_new_ride_select(rct_window* w)
|
|||
static void window_new_ride_list_vehicles_for(uint8_t rideType, const rct_ride_entry* rideEntry, char* buffer, size_t bufferLen)
|
||||
{
|
||||
std::fill_n(buffer, bufferLen, 0);
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1477,7 +1477,7 @@ static void window_park_objective_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto rideTypeId = gScenarioObjective.RideId;
|
||||
if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT)
|
||||
{
|
||||
rideTypeString = RideTypeDescriptors[rideTypeId].Naming.Name;
|
||||
rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name;
|
||||
}
|
||||
ft.Add<rct_string_id>(rideTypeString);
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
strings[0] = gResearchNextItem->GetName();
|
||||
if (gResearchNextItem->type == Research::EntryType::Ride)
|
||||
{
|
||||
auto rtd = RideTypeDescriptors[gResearchNextItem->baseRideType];
|
||||
auto rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType);
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
|
@ -380,7 +380,7 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
else
|
||||
{
|
||||
lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL;
|
||||
auto rtd = RideTypeDescriptors[gResearchLastItem->baseRideType];
|
||||
auto rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType);
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
|
|
|
@ -1144,16 +1144,15 @@ static void window_ride_disable_tabs(rct_window* w)
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
uint8_t ride_type = ride->type; // ecx
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
|
||||
disabled_tabs |= (1 << WIDX_TAB_8); // 0x800
|
||||
|
||||
if (ride_type == RIDE_TYPE_MINI_GOLF)
|
||||
if (ride->type == RIDE_TYPE_MINI_GOLF)
|
||||
disabled_tabs |= (1 << WIDX_TAB_2 | 1 << WIDX_TAB_3 | 1 << WIDX_TAB_4); // 0xE0
|
||||
|
||||
if (ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
disabled_tabs |= (1 << WIDX_TAB_2); // 0x20
|
||||
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL)
|
||||
|
@ -1171,7 +1170,7 @@ static void window_ride_disable_tabs(rct_window* w)
|
|||
disabled_tabs |= (1 << WIDX_TAB_6); // 0x200
|
||||
}
|
||||
|
||||
if (ride_type == RIDE_TYPE_CASH_MACHINE || ride_type == RIDE_TYPE_FIRST_AID || (gParkFlags & PARK_FLAGS_NO_MONEY) != 0)
|
||||
if (ride->type == RIDE_TYPE_CASH_MACHINE || ride->type == RIDE_TYPE_FIRST_AID || (gParkFlags & PARK_FLAGS_NO_MONEY) != 0)
|
||||
disabled_tabs |= (1 << WIDX_TAB_9); // 0x1000
|
||||
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) != 0)
|
||||
|
@ -1335,7 +1334,7 @@ static rct_window* window_ride_open_station(Ride* ride, StationIndex stationInde
|
|||
if (ride->type >= RIDE_TYPE_COUNT)
|
||||
return nullptr;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
return window_ride_main_open(ride);
|
||||
|
||||
auto w = window_bring_to_front_by_number(WC_RIDE, ride->id);
|
||||
|
@ -1865,7 +1864,7 @@ static void window_ride_show_view_dropdown(rct_window* w, rct_widget* widget)
|
|||
return;
|
||||
|
||||
int32_t numItems = 1;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
numItems += ride->num_stations;
|
||||
numItems += ride->num_vehicles;
|
||||
|
@ -2017,7 +2016,7 @@ static rct_string_id get_ride_type_name_for_dropdown(uint8_t rideType)
|
|||
case RIDE_TYPE_59:
|
||||
return STR_RIDE_NAME_59;
|
||||
default:
|
||||
return RideTypeDescriptors[rideType].Naming.Name;
|
||||
return GetRideTypeDescriptor(rideType).Naming.Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2086,7 +2085,7 @@ static void populate_vehicle_type_dropdown(Ride* ride)
|
|||
int32_t rideTypeIterator, rideTypeIteratorMax;
|
||||
if (gCheatsShowVehiclesFromOtherTrackTypes
|
||||
&& !(
|
||||
ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
|| ride->type == RIDE_TYPE_MINI_GOLF))
|
||||
{
|
||||
selectionShouldBeExpanded = true;
|
||||
|
@ -2110,7 +2109,7 @@ static void populate_vehicle_type_dropdown(Ride* ride)
|
|||
|
||||
for (; rideTypeIterator <= rideTypeIteratorMax; rideTypeIterator++)
|
||||
{
|
||||
if (selectionShouldBeExpanded && ride_type_has_flag(rideTypeIterator, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (selectionShouldBeExpanded && GetRideTypeDescriptor(rideTypeIterator).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
continue;
|
||||
if (selectionShouldBeExpanded && (rideTypeIterator == RIDE_TYPE_MAZE || rideTypeIterator == RIDE_TYPE_MINI_GOLF))
|
||||
continue;
|
||||
|
@ -2426,7 +2425,7 @@ static void window_ride_main_invalidate(rct_window* w)
|
|||
else
|
||||
{
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::DropdownMenu;
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE].text = RideTypeDescriptors[ride->type].Naming.Name;
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE].text = ride->GetRideTypeDescriptor().Naming.Name;
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button;
|
||||
}
|
||||
|
||||
|
@ -2526,7 +2525,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft
|
|||
|| trackType == TrackElemType::Up25ToFlat || trackType == TrackElemType::Up60ToFlat
|
||||
|| trackType == TrackElemType::DiagUp25ToFlat || trackType == TrackElemType::DiagUp60ToFlat)
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0)
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0)
|
||||
{
|
||||
ft.Add<rct_string_id>(STR_STOPPED_BY_BLOCK_BRAKES);
|
||||
return STR_BLACK_STRING;
|
||||
|
@ -2538,7 +2537,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft
|
|||
return STR_EMPTY;
|
||||
|
||||
auto stringId = VehicleStatusNames[static_cast<size_t>(vehicle->status)];
|
||||
if ((RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_SINGLE_SESSION)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SINGLE_SESSION)
|
||||
&& vehicle->status <= Vehicle::Status::UnloadingPassengers)
|
||||
{
|
||||
stringId = SingleSessionVehicleStatusNames[static_cast<size_t>(vehicle->status)];
|
||||
|
@ -2547,7 +2546,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft
|
|||
ft.Add<rct_string_id>(stringId);
|
||||
uint16_t speedInMph = (abs(vehicle->velocity) * 9) >> 18;
|
||||
ft.Add<uint16_t>(speedInMph);
|
||||
const RideComponentName stationName = GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.station);
|
||||
const RideComponentName stationName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station);
|
||||
ft.Add<rct_string_id>(ride->num_stations > 1 ? stationName.number : stationName.singular);
|
||||
ft.Add<uint16_t>(vehicle->current_station + 1);
|
||||
return stringId != STR_CRASHING && stringId != STR_CRASHED_0 ? STR_BLACK_STRING : STR_RED_OUTLINED_STRING;
|
||||
|
@ -2654,12 +2653,12 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
if (w->ride.view > ride->num_vehicles)
|
||||
{
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.station).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number);
|
||||
ft.Add<uint16_t>(w->ride.view - ride->num_vehicles);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number);
|
||||
ft.Add<uint16_t>(w->ride.view);
|
||||
}
|
||||
}
|
||||
|
@ -2808,7 +2807,7 @@ static OpenRCT2String window_ride_vehicle_tooltip(
|
|||
auto ft = Formatter();
|
||||
ft.Increment(12);
|
||||
|
||||
RideComponentType vehicleType = RideTypeDescriptors[ride->type].NameConvention.vehicle;
|
||||
RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle;
|
||||
rct_string_id stringId = GetRideComponentName(vehicleType).count;
|
||||
if (ride->max_trains > 1)
|
||||
{
|
||||
|
@ -2907,7 +2906,7 @@ static void window_ride_vehicle_invalidate(rct_window* w)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Increment(6);
|
||||
ft.Add<uint16_t>(carsPerTrain);
|
||||
RideComponentType vehicleType = RideTypeDescriptors[ride->type].NameConvention.vehicle;
|
||||
RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle;
|
||||
stringId = GetRideComponentName(vehicleType).count;
|
||||
if (ride->num_vehicles > 1)
|
||||
{
|
||||
|
@ -3106,7 +3105,7 @@ static void window_ride_mode_tweak_increase(rct_window* w)
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
uint8_t maxValue = operatingSettings.MaxValue;
|
||||
uint8_t minValue = gCheatsFastLiftHill ? 0 : operatingSettings.MinValue;
|
||||
|
||||
|
@ -3131,7 +3130,7 @@ static void window_ride_mode_tweak_decrease(rct_window* w)
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
uint8_t maxValue = operatingSettings.MaxValue;
|
||||
uint8_t minValue = gCheatsFastLiftHill ? 0 : operatingSettings.MinValue;
|
||||
if (gCheatsFastLiftHill)
|
||||
|
@ -3288,15 +3287,15 @@ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widge
|
|||
window_ride_mode_tweak_decrease(w);
|
||||
break;
|
||||
case WIDX_LIFT_HILL_SPEED_INCREASE:
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : RideTypeDescriptors[ride->type].LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
set_operating_setting(
|
||||
w->number, RideSetSetting::LiftHillSpeed,
|
||||
std::clamp<int16_t>(ride->lift_hill_speed + 1, lower_bound, upper_bound));
|
||||
break;
|
||||
case WIDX_LIFT_HILL_SPEED_DECREASE:
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : RideTypeDescriptors[ride->type].LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
set_operating_setting(
|
||||
w->number, RideSetSetting::LiftHillSpeed,
|
||||
std::clamp<int16_t>(ride->lift_hill_speed - 1, lower_bound, upper_bound));
|
||||
|
@ -3443,10 +3442,10 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
| (1ULL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX));
|
||||
|
||||
// Sometimes, only one of the alternatives support lift hill pieces. Make sure to check both.
|
||||
bool hasAlternativeType = RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE);
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_LIFT_HILL)
|
||||
bool hasAlternativeType = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE);
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL)
|
||||
|| (hasAlternativeType
|
||||
&& RideTypeDescriptors[RideTypeDescriptors[ride->type].AlternateType].SupportsTrackPiece(TRACK_LIFT_HILL)))
|
||||
&& GetRideTypeDescriptor(ride->GetRideTypeDescriptor().AlternateType).SupportsTrackPiece(TRACK_LIFT_HILL)))
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_LIFT_HILL_SPEED_LABEL].type = WindowWidgetType::Label;
|
||||
window_ride_operating_widgets[WIDX_LIFT_HILL_SPEED].type = WindowWidgetType::Spinner;
|
||||
|
@ -3484,13 +3483,13 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Leave if another vehicle arrives at station
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION)
|
||||
&& ride->num_vehicles > 1 && !ride->IsBlockSectioned())
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].tooltip
|
||||
= STR_LEAVE_IF_ANOTHER_VEHICLE_ARRIVES_TIP;
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = RideTypeDescriptors[ride->type]
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = ride->GetRideTypeDescriptor()
|
||||
.NameConvention.vehicle
|
||||
== RideComponentType::Boat
|
||||
? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES
|
||||
|
@ -3502,7 +3501,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Synchronise with adjacent stations
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
window_ride_operating_widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].image
|
||||
|
@ -3520,7 +3519,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
|
||||
// Waiting
|
||||
window_ride_operating_widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)];
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
window_ride_operating_widgets[WIDX_LOAD].type = WindowWidgetType::DropdownMenu;
|
||||
|
@ -3626,7 +3625,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
format = STR_MAX_PEOPLE_ON_RIDE_VALUE;
|
||||
caption = STR_MAX_PEOPLE_ON_RIDE;
|
||||
tooltip = STR_MAX_PEOPLE_ON_RIDE_TIP;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
format = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -3831,7 +3830,7 @@ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex wid
|
|||
for (int32_t i = 0; i < 8; i++)
|
||||
{
|
||||
assert(j < static_cast<int32_t>(std::size(rideEntry->ride_type)));
|
||||
if (RideTypeDescriptors[rideEntry->ride_type[j]].AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
{
|
||||
if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned())
|
||||
{
|
||||
|
@ -3859,7 +3858,7 @@ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex wid
|
|||
{
|
||||
for (int32_t i = 0; i < 8; i++)
|
||||
{
|
||||
if (RideTypeDescriptors[rideEntry->ride_type[j]].AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
{
|
||||
if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned())
|
||||
{
|
||||
|
@ -3974,7 +3973,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg
|
|||
for (i = 0; i < BREAKDOWN_COUNT; i++)
|
||||
{
|
||||
assert(j < static_cast<int32_t>(std::size(rideEntry->ride_type)));
|
||||
if (RideTypeDescriptors[rideEntry->ride_type[j]].AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
{
|
||||
if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned())
|
||||
{
|
||||
|
@ -4046,7 +4045,7 @@ static void window_ride_maintenance_invalidate(rct_window* w)
|
|||
window_ride_maintenance_widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::Empty;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[ride->type].AvailableBreakdowns == 0 || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED))
|
||||
if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0 || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED))
|
||||
{
|
||||
w->disabled_widgets |= (1 << WIDX_REFURBISH_RIDE);
|
||||
window_ride_maintenance_widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED;
|
||||
|
@ -4186,7 +4185,7 @@ static int32_t window_ride_has_track_colour(Ride* ride, int32_t trackColour)
|
|||
{
|
||||
// Get station flags (shops don't have them)
|
||||
auto stationObjFlags = 0;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
if (stationObj != nullptr)
|
||||
|
@ -4199,12 +4198,12 @@ static int32_t window_ride_has_track_colour(Ride* ride, int32_t trackColour)
|
|||
{
|
||||
case 0:
|
||||
return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR)
|
||||
|| ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN);
|
||||
|| ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN);
|
||||
case 1:
|
||||
return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR)
|
||||
|| ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL);
|
||||
|| ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL);
|
||||
case 2:
|
||||
return ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS);
|
||||
return ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -4373,7 +4372,7 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
|||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = (GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).singular
|
||||
gDropdownItemsArgs[i] = (GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular
|
||||
<< 16)
|
||||
| VehicleColourSchemeNames[i];
|
||||
}
|
||||
|
@ -4396,7 +4395,7 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
|||
{
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = (static_cast<int64_t>(i + 1) << 32)
|
||||
| ((GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).capitalised) << 16)
|
||||
| ((GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised) << 16)
|
||||
| stringId;
|
||||
}
|
||||
|
||||
|
@ -4602,7 +4601,7 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Track, multiple colour schemes
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR))
|
||||
{
|
||||
window_ride_colour_widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu;
|
||||
window_ride_colour_widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button;
|
||||
|
@ -4650,16 +4649,15 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Track preview
|
||||
if (ride_type_has_flag(
|
||||
ride->type,
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(
|
||||
RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL
|
||||
| RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS))
|
||||
| RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS))
|
||||
window_ride_colour_widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Spinner;
|
||||
else
|
||||
window_ride_colour_widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Empty;
|
||||
|
||||
// Entrance style
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT))
|
||||
{
|
||||
window_ride_colour_widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Spinner;
|
||||
window_ride_colour_widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu;
|
||||
|
@ -4681,8 +4679,8 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Vehicle colours
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES)
|
||||
&& ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)
|
||||
&& ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS))
|
||||
{
|
||||
int32_t vehicleColourSchemeType = ride->colour_scheme_type & 3;
|
||||
if (vehicleColourSchemeType == 0)
|
||||
|
@ -4735,7 +4733,7 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Vehicle colour scheme type
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL)
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL)
|
||||
&& (ride->num_cars_per_train | ride->num_vehicles) > 1)
|
||||
{
|
||||
window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu;
|
||||
|
@ -4749,8 +4747,8 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
ft.Rewind();
|
||||
ft.Increment(6);
|
||||
ft.Add<rct_string_id>(VehicleColourSchemeNames[vehicleColourSchemeType]);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).capitalised);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised);
|
||||
ft.Add<uint16_t>(w->vehicleIndex + 1);
|
||||
|
||||
// Vehicle index
|
||||
|
@ -5408,7 +5406,7 @@ static void window_ride_measurements_mousedown(rct_window* w, rct_widgetindex wi
|
|||
{ w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1],
|
||||
Dropdown::Flag::StayOpen, 2);
|
||||
gDropdownDefaultIndex = 0;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
{
|
||||
// Disable saving without scenery if we're a flat ride
|
||||
Dropdown::SetDisabled(0, true);
|
||||
|
@ -5734,7 +5732,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
// Max. positive vertical G's
|
||||
maxPositiveVerticalGs = ride->max_positive_vertical_g;
|
||||
|
@ -5762,7 +5760,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
{
|
||||
// Drops
|
||||
drops = ride->drops & 0x3F;
|
||||
|
@ -5963,7 +5961,7 @@ static OpenRCT2String window_ride_graphs_tooltip(rct_window* w, const rct_widget
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Increment(2);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number);
|
||||
ft.Add<uint16_t>(measurement->vehicle_index + 1);
|
||||
return { fallback, ft };
|
||||
}
|
||||
|
@ -6010,7 +6008,7 @@ static void window_ride_graphs_invalidate(rct_window* w)
|
|||
w->pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + (w->list_information_type & 0xFF)));
|
||||
|
||||
// Hide graph buttons that are not applicable
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
window_ride_graphs_widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Button;
|
||||
window_ride_graphs_widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Button;
|
||||
|
@ -6295,7 +6293,7 @@ static void window_ride_income_toggle_secondary_price(rct_window* w)
|
|||
|
||||
auto shop_item = rideEntry->shop_item[1];
|
||||
if (shop_item == ShopItem::None)
|
||||
shop_item = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
shop_item = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
|
||||
update_same_price_throughout_flags(shop_item);
|
||||
|
||||
|
@ -6601,7 +6599,7 @@ static void window_ride_income_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Get secondary item
|
||||
auto secondaryItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
auto secondaryItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO))
|
||||
{
|
||||
if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::None)
|
||||
|
@ -6689,7 +6687,7 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
screenCoords.y += 44;
|
||||
|
||||
// Secondary item profit / loss per item sold
|
||||
secondaryItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
secondaryItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO))
|
||||
secondaryItem = rideEntry->shop_item[1];
|
||||
|
||||
|
@ -6841,7 +6839,7 @@ static void window_ride_customer_invalidate(rct_window* w)
|
|||
ride->FormatNameTo(ft);
|
||||
|
||||
window_ride_customer_widgets[WIDX_SHOW_GUESTS_THOUGHTS].type = WindowWidgetType::FlatBtn;
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
window_ride_customer_widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::Empty;
|
||||
window_ride_customer_widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::Empty;
|
||||
|
@ -6941,7 +6939,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
|
||||
// Secondary shop items sold / on-ride photos sold
|
||||
shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? RideTypeDescriptors[ride->type].PhotoItem
|
||||
shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->GetRideTypeDescriptor().PhotoItem
|
||||
: ride->GetRideEntry()->shop_item[1];
|
||||
if (shopItem != ShopItem::None)
|
||||
{
|
||||
|
|
|
@ -487,7 +487,7 @@ static bool is_track_enabled(int32_t trackFlagIndex)
|
|||
|
||||
static int32_t ride_get_alternative_type(Ride* ride)
|
||||
{
|
||||
return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? RideTypeDescriptors[ride->type].AlternateType
|
||||
return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? ride->GetRideTypeDescriptor().AlternateType
|
||||
: ride->type;
|
||||
}
|
||||
|
||||
|
@ -549,13 +549,13 @@ rct_window* window_ride_construction_open()
|
|||
_currentBrakeSpeed2 = 8;
|
||||
_currentSeatRotationAngle = 4;
|
||||
|
||||
_currentTrackCurve = RideTypeDescriptors[ride->type].StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackCurve = ride->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackSlopeEnd = 0;
|
||||
_currentTrackBankEnd = 0;
|
||||
_currentTrackLiftHill = 0;
|
||||
_currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES;
|
||||
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED))
|
||||
_currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE;
|
||||
|
||||
_previousTrackBankEnd = 0;
|
||||
|
@ -759,7 +759,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
}
|
||||
if (!is_track_enabled(TRACK_SLOPE) && !is_track_enabled(TRACK_SLOPE_STEEP))
|
||||
{
|
||||
if (!RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (!ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
// Disable all slopes
|
||||
disabledWidgets |= (1ULL << WIDX_SLOPE_GROUPBOX) | (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_DOWN)
|
||||
|
@ -1096,7 +1096,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
disabledWidgets |= (1ULL << WIDX_SLOPE_UP_STEEP);
|
||||
}
|
||||
disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE);
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
disabledWidgets |= (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL)
|
||||
| (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE);
|
||||
|
@ -1109,7 +1109,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP);
|
||||
}
|
||||
disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE);
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
disabledWidgets |= (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL)
|
||||
| (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE);
|
||||
|
@ -1188,7 +1188,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
disabledWidgets |= (1ULL << WIDX_CONSTRUCT);
|
||||
}
|
||||
}
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES))
|
||||
{
|
||||
disabledWidgets &= ~(1ULL << WIDX_BANKING_GROUPBOX);
|
||||
}
|
||||
|
@ -1420,7 +1420,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi
|
|||
{
|
||||
_currentTrackBankEnd = TRACK_BANK_NONE;
|
||||
}
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT && _currentTrackCurve == TRACK_CURVE_NONE)
|
||||
{
|
||||
|
@ -2408,7 +2408,7 @@ static void sub_6CBCE2(
|
|||
CoordsXY coords = originCoords + offsets.Rotate(trackDirection);
|
||||
|
||||
int32_t baseZ = originZ + trackBlock->z;
|
||||
int32_t clearanceZ = trackBlock->var_07 + RideTypeDescriptors[ride->type].Heights.ClearanceHeight + baseZ
|
||||
int32_t clearanceZ = trackBlock->var_07 + ride->GetRideTypeDescriptor().Heights.ClearanceHeight + baseZ
|
||||
+ (4 * COORDS_Z_STEP);
|
||||
|
||||
auto centreTileCoords = TileCoordsXY{ coords };
|
||||
|
@ -2518,7 +2518,7 @@ void window_ride_construction_update_enabled_track_pieces()
|
|||
return;
|
||||
|
||||
int32_t rideType = ride_get_alternative_type(ride);
|
||||
_enabledRidePieces = RideTypeDescriptors[rideType].GetAvailableTrackPieces();
|
||||
_enabledRidePieces = GetRideTypeDescriptor(rideType).GetAvailableTrackPieces();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2727,7 +2727,7 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
if (TrackDefinitions[trackType].type == TRACK_HELIX_SMALL || TrackDefinitions[trackType].type == TRACK_HELIX_LARGE)
|
||||
{
|
||||
|
@ -2749,7 +2749,7 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
_currentDisabledSpecialTrackPieces |= (1 << currentPossibleRideConfigurationIndex);
|
||||
if (_currentTrackPieceDirection < 4 && slope == _previousTrackSlopeEnd && bank == _previousTrackBankEnd
|
||||
&& (trackType != TrackElemType::TowerBase
|
||||
|| ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES)))
|
||||
|| ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES)))
|
||||
{
|
||||
_currentDisabledSpecialTrackPieces &= ~(1 << currentPossibleRideConfigurationIndex);
|
||||
_numCurrentPossibleSpecialTrackPieces++;
|
||||
|
@ -2772,7 +2772,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
int32_t rideType = ride_get_alternative_type(ride);
|
||||
|
||||
w->hold_down_widgets = 0;
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_IS_SHOP) || !_stationConstructed)
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_IS_SHOP) || !_stationConstructed)
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_ENTRANCE_EXIT_GROUPBOX].type = WindowWidgetType::Empty;
|
||||
window_ride_construction_widgets[WIDX_ENTRANCE].type = WindowWidgetType::Empty;
|
||||
|
@ -2803,7 +2803,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
window_ride_construction_widgets[WIDX_STRAIGHT].type = WindowWidgetType::Empty;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_HAS_LARGE_CURVES))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_LARGE_CURVES))
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_LEFT_CURVE_LARGE].type = WindowWidgetType::FlatBtn;
|
||||
window_ride_construction_widgets[WIDX_RIGHT_CURVE_LARGE].type = WindowWidgetType::FlatBtn;
|
||||
|
@ -2868,7 +2868,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].image = SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP;
|
||||
if (RideTypeDescriptors[rideType].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (GetRideTypeDescriptor(rideType).SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_LEVEL].type = WindowWidgetType::FlatBtn;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP].type = WindowWidgetType::FlatBtn;
|
||||
|
@ -2903,7 +2903,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
|
||||
int32_t x;
|
||||
if ((is_track_enabled(TRACK_LIFT_HILL) && (_currentTrackCurve & RideConstructionSpecialPieceSelected) == 0)
|
||||
|| (gCheatsEnableChainLiftOnAllTrack && ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK)))
|
||||
|| (gCheatsEnableChainLiftOnAllTrack && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)))
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn;
|
||||
x = 9;
|
||||
|
@ -3047,7 +3047,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
window_ride_construction_widgets[WIDX_BANK_STRAIGHT].type = WindowWidgetType::FlatBtn;
|
||||
window_ride_construction_widgets[WIDX_BANK_RIGHT].type = WindowWidgetType::FlatBtn;
|
||||
}
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES))
|
||||
{
|
||||
if (rideType == RIDE_TYPE_WATER_COASTER)
|
||||
{
|
||||
|
@ -3150,7 +3150,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
window_ride_construction_widgets[WIDX_CONSTRUCT].type = WindowWidgetType::Empty;
|
||||
window_ride_construction_widgets[WIDX_DEMOLISH].type = WindowWidgetType::FlatBtn;
|
||||
window_ride_construction_widgets[WIDX_ROTATE].type = WindowWidgetType::Empty;
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS))
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty;
|
||||
window_ride_construction_widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty;
|
||||
|
@ -3249,7 +3249,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
|
||||
if (!_currentlyShowingBrakeOrBoosterSpeed)
|
||||
{
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES))
|
||||
{
|
||||
if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES)
|
||||
{
|
||||
|
@ -3540,7 +3540,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
|
|||
}
|
||||
|
||||
if (_autoRotatingShop && _rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE
|
||||
&& ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
&& ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
TileElement* pathsByDir[NumOrthogonalDirections];
|
||||
|
||||
|
@ -3870,7 +3870,7 @@ static void ride_construction_tooldown_entrance_exit(const ScreenCoordsXY& scree
|
|||
if (ride != nullptr && ride_are_all_possible_entrances_and_exits_built(ride))
|
||||
{
|
||||
tool_cancel();
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
window_close_by_class(WC_RIDE_CONSTRUCTION);
|
||||
}
|
||||
|
|
|
@ -514,7 +514,7 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto rideTypeId = scenario->objective_arg_3;
|
||||
if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT)
|
||||
{
|
||||
rideTypeString = RideTypeDescriptors[rideTypeId].Naming.Name;
|
||||
rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name;
|
||||
}
|
||||
ft.Add<rct_string_id>(rideTypeString);
|
||||
}
|
||||
|
|
|
@ -578,7 +578,7 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
screenPos.y += LIST_ROW_HEIGHT + 4;
|
||||
|
||||
// Information for tracked rides.
|
||||
if (ride_type_has_flag(_loadedTrackDesign->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
{
|
||||
if (_loadedTrackDesign->type != RIDE_TYPE_MAZE)
|
||||
{
|
||||
|
@ -610,7 +610,7 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
screenPos.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(_loadedTrackDesign->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
// Maximum positive vertical Gs
|
||||
int32_t gForces = _loadedTrackDesign->max_positive_vertical_g * 32;
|
||||
|
@ -636,7 +636,7 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(_loadedTrackDesign->type, RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
{
|
||||
// Drops
|
||||
uint16_t drops = _loadedTrackDesign->drops & 0x3F;
|
||||
|
@ -760,7 +760,7 @@ static void track_list_load_designs(RideSelection item)
|
|||
std::string entryName;
|
||||
if (item.Type < 0x80)
|
||||
{
|
||||
if (RideTypeDescriptors[item.Type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
entryName = get_ride_entry_name(item.EntryIndex);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ static void setup_track_manager_objects()
|
|||
|
||||
for (auto rideType : item->RideInfo.RideType)
|
||||
{
|
||||
if (rideType != RIDE_TYPE_NULL && ride_type_has_flag(rideType, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
{
|
||||
*selectionFlags &= ~OBJECT_SELECTION_FLAG_6;
|
||||
break;
|
||||
|
@ -93,7 +93,7 @@ static void setup_track_designer_objects()
|
|||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
if (RideTypeDescriptors[rideType].Flags & RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER)
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER))
|
||||
{
|
||||
*selectionFlags &= ~OBJECT_SELECTION_FLAG_6;
|
||||
break;
|
||||
|
|
|
@ -75,7 +75,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const
|
|||
{
|
||||
heightDifference /= COORDS_Z_PER_TINY_Z;
|
||||
|
||||
if (heightDifference > RideTypeDescriptors[RIDE_TYPE_MAZE].Heights.MaxHeight)
|
||||
if (heightDifference > GetRideTypeDescriptor(RIDE_TYPE_MAZE).Heights.MaxHeight)
|
||||
{
|
||||
res->Error = GameActions::Status::TooHigh;
|
||||
res->ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;
|
||||
|
@ -115,7 +115,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const
|
|||
return res;
|
||||
}
|
||||
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = clearCost + price / 2 * 10;
|
||||
|
||||
return res;
|
||||
|
@ -163,7 +163,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const
|
|||
GameActions::Status::NoClearance, res->ErrorTitle.GetStringId(), gGameCommandErrorText, gCommonFormatArgs);
|
||||
}
|
||||
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = clearCost + price / 2 * 10;
|
||||
|
||||
auto startLoc = _loc.ToTileStart();
|
||||
|
|
|
@ -87,7 +87,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const
|
|||
{
|
||||
heightDifference /= COORDS_Z_PER_TINY_Z;
|
||||
|
||||
if (heightDifference > RideTypeDescriptors[RIDE_TYPE_MAZE].Heights.MaxHeight)
|
||||
if (heightDifference > GetRideTypeDescriptor(RIDE_TYPE_MAZE).Heights.MaxHeight)
|
||||
{
|
||||
res->Error = GameActions::Status::TooHigh;
|
||||
res->ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;
|
||||
|
@ -134,7 +134,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const
|
|||
return res;
|
||||
}
|
||||
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = price / 2 * 10;
|
||||
|
||||
return res;
|
||||
|
@ -176,7 +176,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const
|
|||
auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = price / 2 * 10;
|
||||
|
||||
auto startLoc = _loc.ToTileStart();
|
||||
|
|
|
@ -93,7 +93,7 @@ GameActions::Result::Ptr RideCreateAction::Query() const
|
|||
return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_RIDE_TYPE);
|
||||
}
|
||||
|
||||
const auto& colourPresets = RideTypeDescriptors[_rideType].ColourPresets;
|
||||
const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets;
|
||||
if (_colour1 >= colourPresets.count)
|
||||
{
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_NONE);
|
||||
|
@ -167,16 +167,16 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
|
|||
ride->min_waiting_time = 10;
|
||||
ride->max_waiting_time = 60;
|
||||
ride->depart_flags = RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH | 3;
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT))
|
||||
{
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC;
|
||||
}
|
||||
ride->music = RideTypeDescriptors[ride->type].DefaultMusic;
|
||||
ride->music = ride->GetRideTypeDescriptor().DefaultMusic;
|
||||
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
ride->operation_option = (operatingSettings.MinValue * 3 + operatingSettings.MaxValue) / 4;
|
||||
|
||||
ride->lift_hill_speed = RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
ride->lift_hill_speed = ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
|
||||
ride->measurement = {};
|
||||
ride->excitement = RIDE_RATING_UNDEFINED;
|
||||
|
@ -193,7 +193,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
|
|||
{
|
||||
for (auto i = 0; i < NUM_SHOP_ITEMS_PER_RIDE; i++)
|
||||
{
|
||||
ride->price[i] = RideTypeDescriptors[ride->type].DefaultPrices[i];
|
||||
ride->price[i] = ride->GetRideTypeDescriptor().DefaultPrices[i];
|
||||
}
|
||||
|
||||
if (rideEntry->shop_item[0] == ShopItem::None)
|
||||
|
@ -245,7 +245,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
|
|||
}
|
||||
|
||||
// Set the on-ride photo price, whether the ride has one or not (except shops).
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP) && shop_item_has_common_price(ShopItem::Photo))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP) && shop_item_has_common_price(ShopItem::Photo))
|
||||
{
|
||||
money32 price = shop_item_get_common_price(ride, ShopItem::Photo);
|
||||
if (price != MONEY32_UNDEFINED)
|
||||
|
|
|
@ -88,7 +88,7 @@ GameActions::Result::Ptr RideDemolishAction::Query() const
|
|||
}
|
||||
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)
|
||||
|| RideTypeDescriptors[ride->type].AvailableBreakdowns == 0)
|
||||
|| ride->GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
{
|
||||
return std::make_unique<GameActions::Result>(
|
||||
GameActions::Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED);
|
||||
|
|
|
@ -121,7 +121,7 @@ GameActions::Result::Ptr RideSetPriceAction::Execute() const
|
|||
shopItem = rideEntry->shop_item[1];
|
||||
if (shopItem == ShopItem::None)
|
||||
{
|
||||
shopItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
shopItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if ((ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) == 0)
|
||||
{
|
||||
ride->price[1] = _price;
|
||||
|
|
|
@ -239,13 +239,13 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const
|
|||
|
||||
bool RideSetSettingAction::ride_is_mode_valid(Ride* ride) const
|
||||
{
|
||||
return RideTypeDescriptors[ride->type].RideModes & (1ULL << _value);
|
||||
return ride->GetRideTypeDescriptor().RideModes & (1ULL << _value);
|
||||
}
|
||||
|
||||
bool RideSetSettingAction::ride_is_valid_lift_hill_speed(Ride* ride) const
|
||||
{
|
||||
int32_t minSpeed = gCheatsFastLiftHill ? 0 : RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
int32_t maxSpeed = gCheatsFastLiftHill ? 255 : RideTypeDescriptors[ride->type].LiftData.maximum_speed;
|
||||
int32_t minSpeed = gCheatsFastLiftHill ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
int32_t maxSpeed = gCheatsFastLiftHill ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed;
|
||||
return _value >= minSpeed && _value <= maxSpeed;
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ bool RideSetSettingAction::ride_is_valid_num_circuits() const
|
|||
|
||||
bool RideSetSettingAction::ride_is_valid_operation_option(Ride* ride) const
|
||||
{
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
uint8_t minValue = operatingSettings.MinValue;
|
||||
uint8_t maxValue = operatingSettings.MaxValue;
|
||||
if (gCheatsFastLiftHill)
|
||||
|
@ -287,7 +287,7 @@ rct_string_id RideSetSettingAction::GetOperationErrorMessage(Ride* ride) const
|
|||
case RideMode::BackwardRotation:
|
||||
return STR_CANT_CHANGE_NUMBER_OF_ROTATIONS;
|
||||
default:
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
return STR_CANT_CHANGE_THIS;
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ bool RideSetVehicleAction::ride_is_vehicle_type_valid(Ride* ride) const
|
|||
|
||||
if (gCheatsShowVehiclesFromOtherTrackTypes
|
||||
&& !(
|
||||
ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
|| ride->type == RIDE_TYPE_MINI_GOLF))
|
||||
{
|
||||
selectionShouldBeExpanded = true;
|
||||
|
@ -231,7 +231,7 @@ bool RideSetVehicleAction::ride_is_vehicle_type_valid(Ride* ride) const
|
|||
{
|
||||
if (selectionShouldBeExpanded)
|
||||
{
|
||||
if (ride_type_has_flag(rideTypeIterator, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(rideTypeIterator).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
continue;
|
||||
if (rideTypeIterator == RIDE_TYPE_MAZE || rideTypeIterator == RIDE_TYPE_MINI_GOLF)
|
||||
continue;
|
||||
|
|
|
@ -108,7 +108,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
|
||||
res->GroundFlags = 0;
|
||||
|
||||
uint32_t rideTypeFlags = RideTypeDescriptors[ride->type].Flags;
|
||||
uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags;
|
||||
|
||||
if ((ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation)
|
||||
{
|
||||
|
@ -144,7 +144,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
}
|
||||
// Backwards steep lift hills are allowed, even on roller coasters that do not support forwards steep lift hills.
|
||||
if ((_trackPlaceFlags & CONSTRUCTION_LIFT_HILL_SELECTED)
|
||||
&& !RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack)
|
||||
&& !ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack)
|
||||
{
|
||||
if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_IS_STEEP_UP)
|
||||
{
|
||||
|
@ -212,13 +212,13 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
|
||||
int32_t clearanceZ = trackBlock->var_07;
|
||||
if (trackBlock->flags & RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL
|
||||
&& RideTypeDescriptors[ride->type].Heights.ClearanceHeight > 24)
|
||||
&& ride->GetRideTypeDescriptor().Heights.ClearanceHeight > 24)
|
||||
{
|
||||
clearanceZ += 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
clearanceZ += RideTypeDescriptors[ride->type].Heights.ClearanceHeight;
|
||||
clearanceZ += ride->GetRideTypeDescriptor().Heights.ClearanceHeight;
|
||||
}
|
||||
|
||||
clearanceZ = floor2(clearanceZ, COORDS_Z_STEP) + baseZ;
|
||||
|
@ -228,7 +228,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
return std::make_unique<TrackPlaceActionResult>(GameActions::Status::InvalidParameters, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
uint8_t crossingMode = (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
uint8_t crossingMode = (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
&& _trackType == TrackElemType::Flat)
|
||||
? CREATE_CROSSING_MODE_TRACK_OVER_PATH
|
||||
: CREATE_CROSSING_MODE_NONE;
|
||||
|
@ -334,14 +334,14 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
{
|
||||
uint16_t maxHeight;
|
||||
|
||||
if (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
&& rideEntry->max_height != 0)
|
||||
{
|
||||
maxHeight = rideEntry->max_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxHeight = RideTypeDescriptors[ride->type].Heights.MaxHeight;
|
||||
maxHeight = ride->GetRideTypeDescriptor().Heights.MaxHeight;
|
||||
}
|
||||
|
||||
ride_height /= COORDS_Z_PER_TINY_Z;
|
||||
|
@ -358,10 +358,10 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
supportHeight = (10 * COORDS_Z_STEP);
|
||||
}
|
||||
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice) * 5;
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice) * 5;
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[_trackType];
|
||||
|
||||
price >>= 16;
|
||||
|
@ -393,7 +393,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
|
||||
res->GroundFlags = 0;
|
||||
|
||||
uint32_t rideTypeFlags = RideTypeDescriptors[ride->type].Flags;
|
||||
uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags;
|
||||
|
||||
const uint8_t(*wallEdges)[16];
|
||||
wallEdges = &TrackSequenceElementAllowedWallEdges[_trackType];
|
||||
|
@ -412,19 +412,19 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
int32_t baseZ = floor2(mapLoc.z, COORDS_Z_STEP);
|
||||
int32_t clearanceZ = trackBlock->var_07;
|
||||
if (trackBlock->flags & RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL
|
||||
&& RideTypeDescriptors[ride->type].Heights.ClearanceHeight > 24)
|
||||
&& ride->GetRideTypeDescriptor().Heights.ClearanceHeight > 24)
|
||||
{
|
||||
clearanceZ += 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
clearanceZ += RideTypeDescriptors[ride->type].Heights.ClearanceHeight;
|
||||
clearanceZ += ride->GetRideTypeDescriptor().Heights.ClearanceHeight;
|
||||
}
|
||||
|
||||
clearanceZ = floor2(clearanceZ, COORDS_Z_STEP) + baseZ;
|
||||
const auto mapLocWithClearance = CoordsXYRangedZ(mapLoc, baseZ, clearanceZ);
|
||||
|
||||
uint8_t crossingMode = (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
uint8_t crossingMode = (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
&& _trackType == TrackElemType::Flat)
|
||||
? CREATE_CROSSING_MODE_TRACK_OVER_PATH
|
||||
: CREATE_CROSSING_MODE_NONE;
|
||||
|
@ -479,7 +479,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
supportHeight = (10 * COORDS_Z_STEP);
|
||||
}
|
||||
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice) * 5;
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice) * 5;
|
||||
|
||||
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
|
||||
{
|
||||
|
@ -643,7 +643,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
map_invalidate_tile_full(mapLoc);
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[_trackType];
|
||||
|
||||
price >>= 16;
|
||||
|
|
|
@ -222,10 +222,10 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const
|
|||
_support_height = 10;
|
||||
}
|
||||
|
||||
cost += (_support_height / 2) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice;
|
||||
cost += (_support_height / 2) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice;
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[trackType];
|
||||
price >>= 16;
|
||||
price = (price + cost) / 2;
|
||||
|
@ -396,7 +396,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
|||
_support_height = 10;
|
||||
}
|
||||
|
||||
cost += (_support_height / 2) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice;
|
||||
cost += (_support_height / 2) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice;
|
||||
|
||||
// If the removed tile is a station modify station properties.
|
||||
// Don't do this if the ride is simulating and the tile is a ghost to prevent desyncs.
|
||||
|
@ -410,7 +410,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER))
|
||||
{
|
||||
surfaceElement->SetHasTrackThatNeedsWater(false);
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
|||
}
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[trackType];
|
||||
price >>= 16;
|
||||
price = (price + cost) / 2;
|
||||
|
|
|
@ -456,7 +456,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack(
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_ALLOW_DOORS_ON_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_DOORS_ON_TRACK))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ GameActions::Result::Ptr WallPlaceAction::WallCheckObstruction(
|
|||
bool WallPlaceAction::TrackIsAllowedWallEdges(
|
||||
uint8_t rideType, track_type_t trackType, uint8_t trackSequence, uint8_t direction)
|
||||
{
|
||||
if (!ride_type_has_flag(rideType, RIDE_TYPE_FLAG_TRACK_NO_WALLS))
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_NO_WALLS))
|
||||
{
|
||||
if (TrackSequenceElementAllowedWallEdges[trackType][trackSequence] & (1 << direction))
|
||||
{
|
||||
|
|
|
@ -1100,7 +1100,7 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar
|
|||
rideType = rideEntry->ride_type[j];
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, groupIndex, category, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ static bool award_is_deserved_best_food(int32_t activeAwardTypes)
|
|||
{
|
||||
if (ride.status != RIDE_STATUS_OPEN)
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
continue;
|
||||
|
||||
shops++;
|
||||
|
@ -328,7 +328,7 @@ static bool award_is_deserved_worst_food(int32_t activeAwardTypes)
|
|||
{
|
||||
if (ride.status != RIDE_STATUS_OPEN)
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
continue;
|
||||
|
||||
shops++;
|
||||
|
@ -453,7 +453,7 @@ static bool award_is_deserved_best_custom_designed_rides(int32_t activeAwardType
|
|||
auto customDesignedRides = 0;
|
||||
for (const auto& ride : GetRideManager())
|
||||
{
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
if (ride.lifecycle_flags & RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN)
|
||||
continue;
|
||||
|
@ -481,7 +481,7 @@ static bool award_is_deserved_most_dazzling_ride_colours(int32_t activeAwardType
|
|||
auto colourfulRides = 0;
|
||||
for (const auto& ride : GetRideManager())
|
||||
{
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
|
||||
countedRides++;
|
||||
|
|
|
@ -244,7 +244,7 @@ void research_finish_item(ResearchItem* researchItem)
|
|||
|
||||
// If a vehicle is the first to be invented for its ride type, show the ride type/group name.
|
||||
// Independently listed vehicles (like all flat rides and shops) should always be announced as such.
|
||||
if (RideTypeDescriptors[base_ride_type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
if (GetRideTypeDescriptor(base_ride_type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
|| researchItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
{
|
||||
RideNaming naming = get_ride_naming(base_ride_type, rideEntry);
|
||||
|
@ -469,7 +469,7 @@ void research_populate_list_random()
|
|||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, i, category, researched);
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched)
|
|||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, entryIndex, category, researched);
|
||||
}
|
||||
}
|
||||
|
@ -945,7 +945,7 @@ static void research_update_first_of_type(ResearchItem* researchItem)
|
|||
return;
|
||||
}
|
||||
|
||||
const auto& rtd = RideTypeDescriptors[rideType];
|
||||
const auto& rtd = GetRideTypeDescriptor(rideType);
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
researchItem->flags |= RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE;
|
||||
|
@ -978,7 +978,7 @@ void research_determine_first_of_type()
|
|||
if (rideType >= RIDE_TYPE_COUNT)
|
||||
continue;
|
||||
|
||||
const auto& rtd = RideTypeDescriptors[rideType];
|
||||
const auto& rtd = GetRideTypeDescriptor(rideType);
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem* item) const
|
|||
{
|
||||
// Find the first non-null ride type, to be used when checking the ride group and determining the category.
|
||||
uint8_t firstRideType = ride_entry_get_first_non_null_ride_type(&_legacyType);
|
||||
uint8_t category = RideTypeDescriptors[firstRideType].Category;
|
||||
uint8_t category = GetRideTypeDescriptor(firstRideType).Category;
|
||||
|
||||
for (int32_t i = 0; i < RCT2_MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
{
|
||||
|
|
|
@ -777,7 +777,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
|||
auto ride = get_ride(CurrentRide);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
PeepThoughtType thought_type = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE)
|
||||
PeepThoughtType thought_type = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE)
|
||||
? PeepThoughtType::GetOut
|
||||
: PeepThoughtType::GetOff;
|
||||
|
||||
|
@ -1710,7 +1710,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
{
|
||||
// Peeps that are leaving the park will refuse to go on any rides, with the exception of free transport rides.
|
||||
assert(ride->type < std::size(RideTypeDescriptors));
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
|| ride_get_price(ride) != 0)
|
||||
{
|
||||
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||
|
@ -1720,7 +1720,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
return ShouldGoToShop(ride, peepAtRide);
|
||||
}
|
||||
|
@ -1776,7 +1776,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
// Assuming the queue conditions are met, peeps will always go on free transport rides.
|
||||
// Ride ratings, recent crashes and weather will all be ignored.
|
||||
money16 ridePrice = ride_get_price(ride);
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
|| ridePrice != 0)
|
||||
{
|
||||
if (PreviousRide == ride->id)
|
||||
|
@ -1908,7 +1908,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
|
||||
// If the ride has not yet been rated and is capable of having g-forces,
|
||||
// there's a 90% chance that the peep will ignore it.
|
||||
if (!ride_has_ratings(ride) && (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES))
|
||||
if (!ride_has_ratings(ride) && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES))
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) > 0x1999U)
|
||||
{
|
||||
|
@ -2207,7 +2207,7 @@ static void peep_ride_is_too_intense(Guest* peep, Ride* ride, bool peepAtRide)
|
|||
static Vehicle* peep_choose_car_from_ride(Peep* peep, Ride* ride, std::vector<uint8_t>& car_array)
|
||||
{
|
||||
uint8_t chosen_car = scenario_rand();
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES) && ((chosen_car & 0xC) != 0xC))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES) && ((chosen_car & 0xC) != 0xC))
|
||||
{
|
||||
chosen_car = (scenario_rand() & 1) ? 0 : static_cast<uint8_t>(car_array.size()) - 1;
|
||||
}
|
||||
|
@ -2611,7 +2611,7 @@ static void peep_update_ride_nausea_growth(Peep* peep, Ride* ride)
|
|||
|
||||
static bool peep_should_go_on_ride_again(Peep* peep, Ride* ride)
|
||||
{
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_PEEP_WILL_RIDE_AGAIN))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_PEEP_WILL_RIDE_AGAIN))
|
||||
return false;
|
||||
if (!ride_has_ratings(ride))
|
||||
return false;
|
||||
|
@ -2998,7 +2998,7 @@ static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeF
|
|||
return;
|
||||
}
|
||||
peep_head_for_nearest_ride(
|
||||
peep, false, [rideTypeFlags](const Ride& ride) { return ride_type_has_flag(ride.type, rideTypeFlags); });
|
||||
peep, false, [rideTypeFlags](const Ride& ride) { return ride.GetRideTypeDescriptor().HasFlag(rideTypeFlags); });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3012,16 +3012,16 @@ void Guest::StopPurchaseThought(uint8_t ride_type)
|
|||
{
|
||||
auto thoughtType = PeepThoughtType::Hungry;
|
||||
|
||||
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
if (!GetRideTypeDescriptor(ride_type).HasFlag(RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
{
|
||||
thoughtType = PeepThoughtType::Thirsty;
|
||||
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||
if (!GetRideTypeDescriptor(ride_type).HasFlag(RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||
{
|
||||
thoughtType = PeepThoughtType::RunningOut;
|
||||
if (ride_type != RIDE_TYPE_CASH_MACHINE)
|
||||
{
|
||||
thoughtType = PeepThoughtType::Toilet;
|
||||
if (!ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_IS_TOILET))
|
||||
if (!GetRideTypeDescriptor(ride_type).HasFlag(RIDE_TYPE_FLAG_IS_TOILET))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -3229,7 +3229,7 @@ void Guest::UpdateRideAtEntrance()
|
|||
|
||||
std::vector<uint8_t> carArray;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
if (ride->num_riders >= ride->operation_option)
|
||||
return;
|
||||
|
@ -3256,7 +3256,7 @@ void Guest::UpdateRideAtEntrance()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
Vehicle* vehicle = peep_choose_car_from_ride(this, ride, carArray);
|
||||
peep_choose_seat_from_car(this, ride, vehicle);
|
||||
|
@ -3421,7 +3421,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
|||
distanceThreshold += 4;
|
||||
if (xy_distance < distanceThreshold)
|
||||
{
|
||||
actionZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, actionZ });
|
||||
|
@ -3429,7 +3429,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
|||
}
|
||||
|
||||
Guard::Assert(RideSubState == PeepRideSubState::LeaveEntrance, "Peep ridesubstate should be LeaveEntrance");
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
auto entranceLocation = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXYZD();
|
||||
Guard::Assert(!entranceLocation.isNull());
|
||||
|
@ -3534,7 +3534,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
|||
*/
|
||||
static void peep_go_to_ride_exit(Peep* peep, Ride* ride, int16_t x, int16_t y, int16_t z, uint8_t exit_direction)
|
||||
{
|
||||
z += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
z += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
|
||||
peep->MoveTo({ x, y, z });
|
||||
|
||||
|
@ -3617,7 +3617,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride)
|
|||
ride->FormatNameTo(ft);
|
||||
|
||||
rct_string_id msg_string;
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE))
|
||||
msg_string = STR_PEEP_TRACKING_PEEP_IS_IN_X;
|
||||
else
|
||||
msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X;
|
||||
|
@ -3671,7 +3671,7 @@ void Guest::UpdateRideFreeVehicleCheck()
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
if (ride->status != RIDE_STATUS_OPEN || ride->vehicle_change_timeout != 0 || (++RejoinQueueTimeout) == 0)
|
||||
{
|
||||
|
@ -3897,7 +3897,7 @@ void Guest::UpdateRideLeaveVehicle()
|
|||
|
||||
platformLocation.direction = direction_reverse(exitLocation.direction);
|
||||
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
for (; vehicle != nullptr && !vehicle->IsHead(); vehicle = GetEntity<Vehicle>(vehicle->prev_vehicle_on_ride))
|
||||
{
|
||||
|
@ -4003,7 +4003,7 @@ void Guest::UpdateRideLeaveVehicle()
|
|||
Guard::Assert(!exitLocation.isNull());
|
||||
|
||||
auto waypointLoc = CoordsXYZ{ ride->stations[CurrentRideStation].Start.ToTileCentre(),
|
||||
exitLocation.z + RideTypeDescriptors[ride->type].Heights.PlatformHeight };
|
||||
exitLocation.z + ride->GetRideTypeDescriptor().Heights.PlatformHeight };
|
||||
|
||||
TileElement* trackElement = ride_get_station_start_track_element(ride, CurrentRideStation);
|
||||
|
||||
|
@ -4123,7 +4123,7 @@ void Guest::UpdateRideInExit()
|
|||
{
|
||||
int16_t actionZ = ride->stations[CurrentRideStation].GetBaseZ();
|
||||
|
||||
actionZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
MoveTo({ *loc, actionZ });
|
||||
return;
|
||||
}
|
||||
|
@ -4134,7 +4134,7 @@ void Guest::UpdateRideInExit()
|
|||
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)
|
||||
{
|
||||
ShopItem secondaryItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
ShopItem secondaryItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if (DecideAndBuyItem(ride, secondaryItem, ride->price[1]))
|
||||
{
|
||||
ride->no_secondary_items_sold++;
|
||||
|
@ -5948,14 +5948,14 @@ static bool peep_should_watch_ride(TileElement* tileElement)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_INTERESTING_TO_LOOK_AT)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_INTERESTING_TO_LOOK_AT))
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) > 0x3333)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT)
|
||||
else if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT))
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) > 0x1000)
|
||||
{
|
||||
|
|
|
@ -345,7 +345,7 @@ static uint8_t footpath_element_dest_in_dir(
|
|||
continue;
|
||||
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr && ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
*outRideIndex = rideIndex;
|
||||
return PATH_SEARCH_SHOP_ENTRANCE;
|
||||
|
@ -754,7 +754,7 @@ static void peep_pathfind_heuristic_search(
|
|||
* tile. */
|
||||
rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride == nullptr || !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
|
|
@ -1215,7 +1215,7 @@ void peep_problem_warnings_update()
|
|||
break;
|
||||
}
|
||||
ride = get_ride(peep->GuestHeadingToRideId);
|
||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
hunger_counter++;
|
||||
break;
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ void peep_problem_warnings_update()
|
|||
break;
|
||||
}
|
||||
ride = get_ride(peep->GuestHeadingToRideId);
|
||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||
if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||
thirst_counter++;
|
||||
break;
|
||||
|
||||
|
@ -1237,7 +1237,7 @@ void peep_problem_warnings_update()
|
|||
break;
|
||||
}
|
||||
ride = get_ride(peep->GuestHeadingToRideId);
|
||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_TOILET))
|
||||
if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_TOILET))
|
||||
toilet_counter++;
|
||||
break;
|
||||
|
||||
|
@ -1794,7 +1794,8 @@ void Peep::FormatActionTo(Formatter& ft) const
|
|||
auto ride = get_ride(CurrentRide);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
ft.Add<rct_string_id>(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
ft.Add<rct_string_id>(
|
||||
ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
ride->FormatNameTo(ft);
|
||||
}
|
||||
else
|
||||
|
@ -2863,7 +2864,7 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
|
|||
{
|
||||
ride_id_t rideIndex = coords.element->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride == nullptr || !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return false;
|
||||
|
||||
auto* guest = peep->As<Guest>();
|
||||
|
@ -2900,7 +2901,7 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_PEEP_SHOULD_GO_INSIDE_FACILITY))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_PEEP_SHOULD_GO_INSIDE_FACILITY))
|
||||
{
|
||||
peep->TimeLost = 0;
|
||||
if (!guest->ShouldGoOnRide(ride, 0, false, false))
|
||||
|
@ -2933,8 +2934,9 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
|
|||
auto ft = Formatter();
|
||||
peep->FormatNameTo(ft);
|
||||
ride->FormatNameTo(ft);
|
||||
rct_string_id string_id = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_PEEP_TRACKING_PEEP_IS_IN_X
|
||||
: STR_PEEP_TRACKING_PEEP_IS_ON_X;
|
||||
rct_string_id string_id = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE)
|
||||
? STR_PEEP_TRACKING_PEEP_IS_IN_X
|
||||
: STR_PEEP_TRACKING_PEEP_IS_ON_X;
|
||||
if (gConfigNotifications.guest_used_facility)
|
||||
{
|
||||
News::AddItemToQueue(News::ItemType::PeepOnRide, string_id, peep->sprite_index, ft);
|
||||
|
|
|
@ -1458,7 +1458,7 @@ void Staff::UpdateHeadingToInspect()
|
|||
|
||||
if (delta_y < 20)
|
||||
{
|
||||
newZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, newZ });
|
||||
|
@ -1567,7 +1567,7 @@ void Staff::UpdateAnswering()
|
|||
|
||||
if (delta_y < 20)
|
||||
{
|
||||
newZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, newZ });
|
||||
|
@ -2268,7 +2268,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride)
|
|||
{
|
||||
if (!firstRun)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -2354,7 +2354,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride)
|
|||
{
|
||||
if (!firstRun)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -2430,7 +2430,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, const Ride* ride)
|
|||
{
|
||||
if (!firstRun)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -2613,7 +2613,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride)
|
|||
|
||||
if (xy_distance >= 16)
|
||||
{
|
||||
stationHeight += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
stationHeight += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, stationHeight });
|
||||
|
|
|
@ -848,7 +848,7 @@ private:
|
|||
if (_gameVersion == FILE_VERSION_RCT1)
|
||||
{
|
||||
// Original RCT had no music settings, take default style
|
||||
dst->music = RideTypeDescriptors[dst->type].DefaultMusic;
|
||||
dst->music = GetRideTypeDescriptor(dst->type).DefaultMusic;
|
||||
|
||||
// Only merry-go-round and dodgems had music and used
|
||||
// the same flag as synchronise stations for the option to enable it
|
||||
|
@ -2683,7 +2683,7 @@ private:
|
|||
dst->baseRideType = rideType;
|
||||
dst->type = Research::EntryType::Ride;
|
||||
dst->flags = 0;
|
||||
dst->category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2702,7 +2702,7 @@ private:
|
|||
dst->baseRideType = rideType;
|
||||
dst->type = Research::EntryType::Ride;
|
||||
dst->flags = 0;
|
||||
dst->category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ private:
|
|||
td->number_of_cars_per_train = td4Base.number_of_cars_per_train;
|
||||
td->min_waiting_time = td4Base.min_waiting_time;
|
||||
td->max_waiting_time = td4Base.max_waiting_time;
|
||||
td->operation_setting = std::min(td4Base.operation_setting, RideTypeDescriptors[td->type].OperatingSettings.MaxValue);
|
||||
td->operation_setting = std::min(td4Base.operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue);
|
||||
td->max_speed = td4Base.max_speed;
|
||||
td->average_speed = td4Base.average_speed;
|
||||
td->ride_length = td4Base.ride_length;
|
||||
|
@ -250,7 +250,7 @@ private:
|
|||
td->space_required_y = 255;
|
||||
td->lift_hill_speed = 5;
|
||||
td->num_circuits = 0;
|
||||
td->operation_setting = std::min(td->operation_setting, RideTypeDescriptors[td->type].OperatingSettings.MaxValue);
|
||||
td->operation_setting = std::min(td->operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue);
|
||||
|
||||
if (td->type == RIDE_TYPE_MAZE)
|
||||
{
|
||||
|
|
|
@ -1390,7 +1390,7 @@ namespace RCT1
|
|||
|
||||
track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType)
|
||||
{
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
return RCT12FlatTrackTypeToOpenRCT2(origTrackType);
|
||||
|
||||
return origTrackType;
|
||||
|
|
|
@ -145,7 +145,7 @@ bool RCT2TrackTypeIsBooster(uint8_t rideType, uint16_t trackType)
|
|||
|
||||
track_type_t RCT2TrackTypeToOpenRCT2(RCT12TrackType origTrackType, uint8_t rideType)
|
||||
{
|
||||
if (rideType < std::size(RideTypeDescriptors) && ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
return RCT12FlatTrackTypeToOpenRCT2(origTrackType);
|
||||
if (origTrackType == TrackElemType::RotationControlToggleAlias && !RCT2TrackTypeIsBooster(rideType, origTrackType))
|
||||
return TrackElemType::RotationControlToggle;
|
||||
|
|
|
@ -208,8 +208,8 @@ void S6Exporter::Export()
|
|||
// Not used by OpenRCT2 any more, but left in to keep RCT2 export working.
|
||||
for (uint8_t i = 0; i < std::size(RideTypeDescriptors); i++)
|
||||
{
|
||||
researchedTrackPiecesA[i] = (RideTypeDescriptors[i].EnabledTrackPieces) & 0xFFFFFFFFULL;
|
||||
researchedTrackPiecesB[i] = (RideTypeDescriptors[i].EnabledTrackPieces >> 32ULL) & 0xFFFFFFFFULL;
|
||||
researchedTrackPiecesA[i] = (GetRideTypeDescriptor(i).EnabledTrackPieces) & 0xFFFFFFFFULL;
|
||||
researchedTrackPiecesB[i] = (GetRideTypeDescriptor(i).EnabledTrackPieces >> 32ULL) & 0xFFFFFFFFULL;
|
||||
}
|
||||
std::memcpy(_s6.researched_track_types_a, researchedTrackPiecesA, sizeof(_s6.researched_track_types_a));
|
||||
std::memcpy(_s6.researched_track_types_b, researchedTrackPiecesB, sizeof(_s6.researched_track_types_b));
|
||||
|
@ -534,7 +534,7 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
|
|||
if (useDefaultName)
|
||||
{
|
||||
// Default name with number
|
||||
dst->name = RideTypeDescriptors[src->type].Naming.Name;
|
||||
dst->name = GetRideTypeDescriptor(src->type).Naming.Name;
|
||||
dst->name_arguments_number = src->default_name_number;
|
||||
}
|
||||
|
||||
|
|
|
@ -1382,7 +1382,7 @@ public:
|
|||
dst->SetTrackType(src->GetTrackType());
|
||||
// RotationControlToggle and Booster are saved as the same track piece ID
|
||||
// Which one the vehicle is using must be determined
|
||||
if (ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(ride.type).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
dst->SetTrackType(RCT12FlatTrackTypeToOpenRCT2(src->GetTrackType()));
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
td->operation_setting = std::min(td->operation_setting, RideTypeDescriptors[td->type].OperatingSettings.MaxValue);
|
||||
td->operation_setting = std::min(td->operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue);
|
||||
|
||||
if (td->type == RIDE_TYPE_MAZE)
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ Vehicle* cable_lift_segment_create(
|
|||
|
||||
z = z * COORDS_Z_STEP;
|
||||
current->TrackLocation = { x, y, z };
|
||||
z += RideTypeDescriptors[ride.type].Heights.VehicleZOffset;
|
||||
z += ride.GetRideTypeDescriptor().Heights.VehicleZOffset;
|
||||
|
||||
current->MoveTo({ 16, 16, z });
|
||||
current->SetTrackType(TrackElemType::CableLiftHill);
|
||||
|
@ -271,7 +271,7 @@ bool Vehicle::CableLiftUpdateTrackMotionForwards()
|
|||
auto unk = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation;
|
||||
|
||||
uint8_t bx = 0;
|
||||
unk.z += RideTypeDescriptors[curRide->type].Heights.VehicleZOffset;
|
||||
unk.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset;
|
||||
if (unk.x != unk_F64E20.x)
|
||||
bx |= (1 << 0);
|
||||
if (unk.y != unk_F64E20.y)
|
||||
|
@ -337,7 +337,7 @@ bool Vehicle::CableLiftUpdateTrackMotionBackwards()
|
|||
auto unk = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation;
|
||||
|
||||
uint8_t bx = 0;
|
||||
unk.z += RideTypeDescriptors[curRide->type].Heights.VehicleZOffset;
|
||||
unk.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset;
|
||||
if (unk.x != unk_F64E20.x)
|
||||
bx |= (1 << 0);
|
||||
if (unk.y != unk_F64E20.y)
|
||||
|
|
|
@ -398,7 +398,7 @@ money32 Ride::CalculateIncomePerHour() const
|
|||
priceMinusCost -= GetShopItemDescriptor(currentShopItem).Cost;
|
||||
}
|
||||
|
||||
currentShopItem = (lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? RideTypeDescriptors[type].PhotoItem
|
||||
currentShopItem = (lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? GetRideTypeDescriptor().PhotoItem
|
||||
: entry->shop_item[1];
|
||||
|
||||
if (currentShopItem != ShopItem::None)
|
||||
|
@ -808,7 +808,7 @@ void Ride::FormatStatusTo(Formatter& ft) const
|
|||
}
|
||||
else if (status == RIDE_STATUS_CLOSED)
|
||||
{
|
||||
if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
if (num_riders != 0)
|
||||
{
|
||||
|
@ -849,7 +849,7 @@ void Ride::FormatStatusTo(Formatter& ft) const
|
|||
ft.Add<rct_string_id>(STR_NONE);
|
||||
}
|
||||
}
|
||||
else if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
else if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
ft.Add<rct_string_id>(num_riders == 1 ? STR_PERSON_ON_RIDE : STR_PEOPLE_ON_RIDE);
|
||||
ft.Add<uint16_t>(num_riders);
|
||||
|
@ -878,7 +878,7 @@ int32_t ride_get_total_time(Ride* ride)
|
|||
|
||||
bool Ride::CanHaveMultipleCircuits() const
|
||||
{
|
||||
if (!(RideTypeDescriptors[type].Flags & RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS))
|
||||
if (!(GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS)))
|
||||
return false;
|
||||
|
||||
// Only allow circuit or launch modes
|
||||
|
@ -1481,7 +1481,7 @@ void ride_construction_set_default_next_piece()
|
|||
tileElement = trackBeginEnd.begin_element;
|
||||
trackType = tileElement->AsTrack()->GetTrackType();
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
ride_construction_reset_current_piece();
|
||||
return;
|
||||
|
@ -1855,7 +1855,7 @@ bool ride_modify(CoordsXYE* input)
|
|||
return ride_modify_maze(tileElement);
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS))
|
||||
{
|
||||
CoordsXYE endOfTrackElement{};
|
||||
if (ride_find_track_gap(ride, &tileElement, &endOfTrackElement))
|
||||
|
@ -1881,7 +1881,7 @@ bool ride_modify(CoordsXYE* input)
|
|||
_rideConstructionNextArrowPulse = 0;
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
window_ride_construction_update_active_elements();
|
||||
return true;
|
||||
|
@ -1940,13 +1940,13 @@ int32_t ride_initialise_construction_window(Ride* ride)
|
|||
if (ride == nullptr)
|
||||
return 0;
|
||||
|
||||
_currentTrackCurve = RideTypeDescriptors[ride->type].StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackCurve = ride->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackSlopeEnd = 0;
|
||||
_currentTrackBankEnd = 0;
|
||||
_currentTrackLiftHill = 0;
|
||||
_currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES;
|
||||
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED))
|
||||
_currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE;
|
||||
|
||||
_previousTrackBankEnd = 0;
|
||||
|
@ -2275,7 +2275,7 @@ static void ride_inspection_update(Ride* ride)
|
|||
return;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[ride->type].AvailableBreakdowns == 0)
|
||||
if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
return;
|
||||
|
||||
if (inspectionIntervalMinutes > ride->last_inspection)
|
||||
|
@ -2397,7 +2397,7 @@ static int32_t ride_get_new_breakdown_problem(Ride* ride)
|
|||
if (!ride->CanBreakDown())
|
||||
return -1;
|
||||
|
||||
availableBreakdownProblems = RideTypeDescriptors[ride->type].AvailableBreakdowns;
|
||||
availableBreakdownProblems = ride->GetRideTypeDescriptor().AvailableBreakdowns;
|
||||
|
||||
// Calculate the total probability range for all possible breakdown problems
|
||||
totalProbability = 0;
|
||||
|
@ -2446,7 +2446,7 @@ static int32_t ride_get_new_breakdown_problem(Ride* ride)
|
|||
|
||||
bool Ride::CanBreakDown() const
|
||||
{
|
||||
if (RideTypeDescriptors[type].AvailableBreakdowns == 0)
|
||||
if (GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -2624,7 +2624,7 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus)
|
|||
}
|
||||
break;
|
||||
case RIDE_MECHANIC_STATUS_CALLING:
|
||||
if (RideTypeDescriptors[ride->type].AvailableBreakdowns == 0)
|
||||
if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
{
|
||||
ride->lifecycle_flags &= ~(
|
||||
RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION);
|
||||
|
@ -2809,8 +2809,8 @@ Staff* ride_get_assigned_mechanic(Ride* ride)
|
|||
*/
|
||||
static void ride_music_update(Ride* ride)
|
||||
{
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)
|
||||
&& !(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_ALLOW_MUSIC))
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT) && !rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -3070,8 +3070,8 @@ std::pair<RideMeasurement*, OpenRCT2String> Ride::GetMeasurement()
|
|||
else
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[type].NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[type].NameConvention.station).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor().NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor().NameConvention.station).singular);
|
||||
return { nullptr, { STR_DATA_LOGGING_WILL_START_WHEN_NEXT_LEAVES, ft } };
|
||||
}
|
||||
}
|
||||
|
@ -3196,7 +3196,7 @@ void ride_check_all_reachable()
|
|||
if (ride.status != RIDE_STATUS_OPEN || ride.connected_message_throttle != 0)
|
||||
continue;
|
||||
|
||||
if (ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
ride_shop_connected(&ride);
|
||||
else
|
||||
ride_entrance_exit_connected(&ride);
|
||||
|
@ -3373,7 +3373,7 @@ static void ride_station_set_map_tooltip(TileElement* tileElement)
|
|||
ft.Add<rct_string_id>(STR_RIDE_MAP_TIP);
|
||||
ft.Add<rct_string_id>(ride->num_stations <= 1 ? STR_RIDE_STATION : STR_RIDE_STATION_X);
|
||||
ride->FormatNameTo(ft);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.station).capitalised);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).capitalised);
|
||||
ft.Add<uint16_t>(stationIndex + 1);
|
||||
ride->FormatStatusTo(ft);
|
||||
auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP);
|
||||
|
@ -3550,7 +3550,7 @@ static StationIndex ride_mode_check_station_present(Ride* ride)
|
|||
if (stationIndex == STATION_INDEX_NULL)
|
||||
{
|
||||
gGameCommandErrorText = STR_NOT_YET_CONSTRUCTED;
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
return STATION_INDEX_NULL;
|
||||
|
||||
if (ride->type == RIDE_TYPE_MAZE)
|
||||
|
@ -3573,7 +3573,7 @@ static int32_t ride_check_for_entrance_exit(ride_id_t rideIndex)
|
|||
if (ride == nullptr)
|
||||
return 0;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return 1;
|
||||
|
||||
uint8_t entrance = 0;
|
||||
|
@ -4154,7 +4154,7 @@ static Vehicle* vehicle_create_car(
|
|||
vehicle->TrackLocation = dodgemPos;
|
||||
vehicle->current_station = trackElement->GetStationIndex();
|
||||
|
||||
dodgemPos.z += RideTypeDescriptors[ride->type].Heights.VehicleZOffset;
|
||||
dodgemPos.z += ride->GetRideTypeDescriptor().Heights.VehicleZOffset;
|
||||
|
||||
vehicle->SetTrackDirection(0);
|
||||
vehicle->SetTrackType(trackElement->GetTrackType());
|
||||
|
@ -4222,11 +4222,11 @@ static Vehicle* vehicle_create_car(
|
|||
}
|
||||
else
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].StartTrackPiece != TrackElemType::FlatTrack1x4B)
|
||||
if (ride->GetRideTypeDescriptor().StartTrackPiece != TrackElemType::FlatTrack1x4B)
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].StartTrackPiece != TrackElemType::FlatTrack1x4A)
|
||||
if (ride->GetRideTypeDescriptor().StartTrackPiece != TrackElemType::FlatTrack1x4A)
|
||||
{
|
||||
if (ride->type == RIDE_TYPE_ENTERPRISE)
|
||||
{
|
||||
|
@ -4241,7 +4241,7 @@ static Vehicle* vehicle_create_car(
|
|||
}
|
||||
}
|
||||
|
||||
chosenLoc += CoordsXYZ{ word_9A2A60[direction], RideTypeDescriptors[ride->type].Heights.VehicleZOffset };
|
||||
chosenLoc += CoordsXYZ{ word_9A2A60[direction], ride->GetRideTypeDescriptor().Heights.VehicleZOffset };
|
||||
|
||||
vehicle->current_station = trackElement->GetStationIndex();
|
||||
|
||||
|
@ -4473,7 +4473,7 @@ bool Ride::CreateVehicles(const CoordsXYE& element, bool isApplying)
|
|||
}
|
||||
|
||||
//
|
||||
if (type != RIDE_TYPE_SPACE_RINGS && !ride_type_has_flag(type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (type != RIDE_TYPE_SPACE_RINGS && !GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
if (IsBlockSectioned())
|
||||
{
|
||||
|
@ -4936,7 +4936,8 @@ bool Ride::Test(int32_t newStatus, bool isApplying)
|
|||
if (isApplying)
|
||||
ride_set_start_finish_points(id, &trackElement);
|
||||
|
||||
if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
const auto& rtd = GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
{
|
||||
if (!CreateVehicles(trackElement, isApplying))
|
||||
{
|
||||
|
@ -4944,8 +4945,8 @@ bool Ride::Test(int32_t newStatus, bool isApplying)
|
|||
}
|
||||
}
|
||||
|
||||
if ((RideTypeDescriptors[type].Flags & RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL)
|
||||
&& (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) && !(lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT))
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL) && (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED)
|
||||
&& !(lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT))
|
||||
{
|
||||
if (!ride_create_cable_lift(id, isApplying))
|
||||
return false;
|
||||
|
@ -5068,7 +5069,7 @@ bool Ride::Open(bool isApplying)
|
|||
if (isApplying)
|
||||
ride_set_start_finish_points(id, &trackElement);
|
||||
|
||||
if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
{
|
||||
if (!CreateVehicles(trackElement, isApplying))
|
||||
{
|
||||
|
@ -5076,7 +5077,7 @@ bool Ride::Open(bool isApplying)
|
|||
}
|
||||
}
|
||||
|
||||
if ((RideTypeDescriptors[type].Flags & RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL)
|
||||
if ((GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL))
|
||||
&& (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) && !(lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT))
|
||||
{
|
||||
if (!ride_create_cable_lift(id, isApplying))
|
||||
|
@ -5260,7 +5261,7 @@ int32_t ride_get_random_colour_preset_index(uint8_t ride_type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const track_colour_preset_list* colourPresets = &RideTypeDescriptors[ride_type].ColourPresets;
|
||||
const track_colour_preset_list* colourPresets = &GetRideTypeDescriptor(ride_type).ColourPresets;
|
||||
|
||||
// 200 attempts to find a colour preset that hasn't already been used in the park for this ride type
|
||||
for (int32_t i = 0; i < 200; i++)
|
||||
|
@ -5282,7 +5283,7 @@ int32_t ride_get_random_colour_preset_index(uint8_t ride_type)
|
|||
*/
|
||||
void Ride::SetColourPreset(uint8_t index)
|
||||
{
|
||||
const track_colour_preset_list* colourPresets = &RideTypeDescriptors[type].ColourPresets;
|
||||
const track_colour_preset_list* colourPresets = &GetRideTypeDescriptor().ColourPresets;
|
||||
TrackColour colours = { COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK };
|
||||
// Stalls save their default colour in the vehicle settings (since they share a common ride type)
|
||||
if (!IsRide())
|
||||
|
@ -5341,9 +5342,9 @@ void Ride::SetNameToDefault()
|
|||
*/
|
||||
RideNaming get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry)
|
||||
{
|
||||
if (!RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
return RideTypeDescriptors[rideType].Naming;
|
||||
return GetRideTypeDescriptor(rideType).Naming;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5351,19 +5352,6 @@ RideNaming get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry)
|
|||
}
|
||||
}
|
||||
|
||||
bool ride_type_has_flag(int32_t rideType, uint64_t flag)
|
||||
{
|
||||
if (rideType < static_cast<int32_t>(std::size(RideTypeDescriptors)))
|
||||
{
|
||||
return (RideTypeDescriptors[rideType].Flags & flag) != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Guard::Assert(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The next eight functions are helpers to access ride data at the offset 10E &
|
||||
* 110. Known as the turn counts. There are 3 different types (default, banked, sloped)
|
||||
|
@ -5827,7 +5815,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
|
|||
return entranceExitCoords;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
auto mapX = (word_F4418C & 0x1F) - 16;
|
||||
auto mapY = (word_F4418E & 0x1F) - 16;
|
||||
|
@ -6010,7 +5998,7 @@ bool ride_select_forwards_from_back()
|
|||
*/
|
||||
bool ride_are_all_possible_entrances_and_exits_built(Ride* ride)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return true;
|
||||
|
||||
for (int32_t i = 0; i < MAX_STATIONS; i++)
|
||||
|
@ -6095,7 +6083,7 @@ void ride_fix_breakdown(Ride* ride, int32_t reliabilityIncreaseFactor)
|
|||
*/
|
||||
void ride_update_vehicle_colours(Ride* ride)
|
||||
{
|
||||
if (ride->type == RIDE_TYPE_SPACE_RINGS || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (ride->type == RIDE_TYPE_SPACE_RINGS || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
@ -6379,7 +6367,7 @@ void Ride::UpdateMaxVehicles()
|
|||
return;
|
||||
|
||||
auto stationLength = (*stationNumTiles * 0x44180) - 0x16B2A;
|
||||
int32_t maxMass = RideTypeDescriptors[type].MaxMass << 8;
|
||||
int32_t maxMass = GetRideTypeDescriptor().MaxMass << 8;
|
||||
int32_t maxCarsPerTrain = 1;
|
||||
for (int32_t numCars = rideEntry->max_cars_in_train; numCars > 0; numCars--)
|
||||
{
|
||||
|
@ -6441,7 +6429,7 @@ void Ride::UpdateMaxVehicles()
|
|||
} while (totalLength <= stationLength);
|
||||
|
||||
if ((mode != RideMode::StationToStation && mode != RideMode::ContinuousCircuit)
|
||||
|| !(RideTypeDescriptors[type].Flags & RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS))
|
||||
|| !(GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS)))
|
||||
{
|
||||
maxNumTrains = std::min(maxNumTrains, 31);
|
||||
}
|
||||
|
@ -6587,7 +6575,7 @@ void sub_6CB945(Ride* ride)
|
|||
tileElement->AsTrack()->SetStationIndex(stationId);
|
||||
direction = tileElement->GetDirection();
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
specialTrack = true;
|
||||
break;
|
||||
|
@ -7028,7 +7016,7 @@ uint8_t ride_entry_get_first_non_null_ride_type(const rct_ride_entry* rideEntry)
|
|||
|
||||
int32_t get_booster_speed(uint8_t rideType, int32_t rawSpeed)
|
||||
{
|
||||
int8_t shiftFactor = RideTypeDescriptors[rideType].OperatingSettings.BoosterSpeedFactor;
|
||||
int8_t shiftFactor = GetRideTypeDescriptor(rideType).OperatingSettings.BoosterSpeedFactor;
|
||||
if (shiftFactor == 0)
|
||||
{
|
||||
return rawSpeed;
|
||||
|
@ -7080,7 +7068,7 @@ void fix_invalid_vehicle_sprite_sizes()
|
|||
bool ride_entry_has_category(const rct_ride_entry* rideEntry, uint8_t category)
|
||||
{
|
||||
auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
return RideTypeDescriptors[rideType].Category == category;
|
||||
return GetRideTypeDescriptor(rideType).Category == category;
|
||||
}
|
||||
|
||||
int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType)
|
||||
|
@ -7108,7 +7096,7 @@ int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
subType = rideEntryIndex;
|
||||
break;
|
||||
|
@ -7310,8 +7298,8 @@ void Ride::FormatNameTo(Formatter& ft) const
|
|||
}
|
||||
else
|
||||
{
|
||||
auto rideTypeName = RideTypeDescriptors[type].Naming.Name;
|
||||
if (RideTypeDescriptors[type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
auto rideTypeName = GetRideTypeDescriptor().Naming.Name;
|
||||
if (GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
auto rideEntry = GetRideEntry();
|
||||
if (rideEntry != nullptr)
|
||||
|
@ -7333,7 +7321,7 @@ uint64_t Ride::GetAvailableModes() const
|
|||
|
||||
const RideTypeDescriptor& Ride::GetRideTypeDescriptor() const
|
||||
{
|
||||
return RideTypeDescriptors[type];
|
||||
return ::GetRideTypeDescriptor(type);
|
||||
}
|
||||
|
||||
uint8_t Ride::GetMinCarsPerTrain() const
|
||||
|
|
|
@ -1170,7 +1170,6 @@ int32_t get_turn_count_4_plus_elements(Ride* ride, uint8_t type);
|
|||
|
||||
uint8_t ride_get_helix_sections(Ride* ride);
|
||||
|
||||
bool ride_type_has_flag(int32_t rideType, uint64_t flag);
|
||||
bool ride_has_any_track_elements(const Ride* ride);
|
||||
|
||||
void ride_construction_set_default_next_piece();
|
||||
|
|
|
@ -352,4 +352,12 @@ constexpr const RideTypeDescriptor DummyRTD =
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
constexpr const RideTypeDescriptor& GetRideTypeDescriptor(ObjectEntryIndex rideType)
|
||||
{
|
||||
if (rideType >= std::size(RideTypeDescriptors))
|
||||
return DummyRTD;
|
||||
|
||||
return RideTypeDescriptors[rideType];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -222,7 +222,7 @@ static void ride_ratings_update_state_2()
|
|||
if (tileElement->AsTrack()->GetRideIndex() != ride->id)
|
||||
{
|
||||
// Only check that the track belongs to the same ride if ride does not have buildable track
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ static void ride_ratings_update_state_5()
|
|||
if (tileElement->AsTrack()->GetRideIndex() != ride->id)
|
||||
{
|
||||
// Only check that the track belongs to the same ride if ride does not have buildable track
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -809,7 +809,7 @@ static void ride_ratings_calculate_value(Ride* ride)
|
|||
}
|
||||
|
||||
// Start with the base ratings, multiplied by the ride type specific weights for excitement, intensity and nausea.
|
||||
const auto& ratingsMultipliers = RideTypeDescriptors[ride->type].RatingsMultipliers;
|
||||
const auto& ratingsMultipliers = ride->GetRideTypeDescriptor().RatingsMultipliers;
|
||||
int32_t value = (((ride->excitement * ratingsMultipliers.Excitement) * 32) >> 15)
|
||||
+ (((ride->intensity * ratingsMultipliers.Intensity) * 32) >> 15)
|
||||
+ (((ride->nausea * ratingsMultipliers.Nausea) * 32) >> 15);
|
||||
|
@ -870,9 +870,9 @@ static void ride_ratings_calculate_value(Ride* ride)
|
|||
static uint16_t ride_compute_upkeep(Ride* ride)
|
||||
{
|
||||
// data stored at 0x0057E3A8, incrementing 18 bytes at a time
|
||||
uint16_t upkeep = RideTypeDescriptors[ride->type].UpkeepCosts.BaseCost;
|
||||
uint16_t upkeep = ride->GetRideTypeDescriptor().UpkeepCosts.BaseCost;
|
||||
|
||||
uint16_t trackCost = RideTypeDescriptors[ride->type].UpkeepCosts.CostPerTrackPiece;
|
||||
uint16_t trackCost = ride->GetRideTypeDescriptor().UpkeepCosts.CostPerTrackPiece;
|
||||
uint8_t dropFactor = ride->drops;
|
||||
|
||||
dropFactor >>= 6;
|
||||
|
@ -885,7 +885,7 @@ static uint16_t ride_compute_upkeep(Ride* ride)
|
|||
// rides that had tracks. The 0's were fixed rides like crooked house or
|
||||
// dodgems.
|
||||
// Data source is 0x0097E3AC
|
||||
totalLength *= RideTypeDescriptors[ride->type].UpkeepCosts.TrackLengthMultiplier;
|
||||
totalLength *= ride->GetRideTypeDescriptor().UpkeepCosts.TrackLengthMultiplier;
|
||||
upkeep += static_cast<uint16_t>(totalLength >> 10);
|
||||
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)
|
||||
|
@ -912,12 +912,12 @@ static uint16_t ride_compute_upkeep(Ride* ride)
|
|||
// various variables set on the ride itself.
|
||||
|
||||
// https://gist.github.com/kevinburke/e19b803cd2769d96c540
|
||||
upkeep += RideTypeDescriptors[ride->type].UpkeepCosts.CostPerTrain * ride->num_vehicles;
|
||||
upkeep += RideTypeDescriptors[ride->type].UpkeepCosts.CostPerCar * ride->num_cars_per_train;
|
||||
upkeep += ride->GetRideTypeDescriptor().UpkeepCosts.CostPerTrain * ride->num_vehicles;
|
||||
upkeep += ride->GetRideTypeDescriptor().UpkeepCosts.CostPerCar * ride->num_cars_per_train;
|
||||
|
||||
// slight upkeep boosts for some rides - 5 for mini railway, 10 for log
|
||||
// flume/rapids, 10 for roller coaster, 28 for giga coaster
|
||||
upkeep += RideTypeDescriptors[ride->type].UpkeepCosts.CostPerStation * ride->num_stations;
|
||||
upkeep += ride->GetRideTypeDescriptor().UpkeepCosts.CostPerStation * ride->num_stations;
|
||||
|
||||
if (ride->mode == RideMode::ReverseInclineLaunchedShuttle)
|
||||
{
|
||||
|
@ -969,7 +969,7 @@ static void ride_ratings_apply_adjustments(Ride* ride, RatingTuple* ratings)
|
|||
|
||||
// Apply total air time
|
||||
#ifdef ORIGINAL_RATINGS
|
||||
if (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_HAS_AIR_TIME))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_AIR_TIME))
|
||||
{
|
||||
uint16_t totalAirTime = ride->total_air_time;
|
||||
if (rideEntry->flags & RIDE_ENTRY_FLAG_LIMIT_AIRTIME_BONUS)
|
||||
|
@ -988,7 +988,7 @@ static void ride_ratings_apply_adjustments(Ride* ride, RatingTuple* ratings)
|
|||
}
|
||||
}
|
||||
#else
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_HAS_AIR_TIME)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_AIR_TIME))
|
||||
{
|
||||
int32_t excitementModifier;
|
||||
if (rideEntry->flags & RIDE_ENTRY_FLAG_LIMIT_AIRTIME_BONUS)
|
||||
|
@ -1032,7 +1032,7 @@ static void ride_ratings_apply_intensity_penalty(RatingTuple* ratings)
|
|||
static void set_unreliability_factor(Ride* ride)
|
||||
{
|
||||
// The bigger the difference in lift speed and minimum the higher the unreliability
|
||||
uint8_t minLiftSpeed = RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
uint8_t minLiftSpeed = ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
ride->unreliability_factor += (ride->lift_hill_speed - minLiftSpeed) * 2;
|
||||
}
|
||||
|
||||
|
@ -4440,7 +4440,7 @@ void ride_ratings_calculate_single_rail_roller_coaster(Ride* ride)
|
|||
|
||||
ride_ratings_calculation ride_ratings_get_calculate_func(uint8_t rideType)
|
||||
{
|
||||
return RideTypeDescriptors[rideType].RatingsCalculationFunction;
|
||||
return GetRideTypeDescriptor(rideType).RatingsCalculationFunction;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
|
|
@ -390,7 +390,7 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag
|
|||
CoordsXY stationFrontLoc = loc;
|
||||
int32_t stationLength = 1;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
if (ride->num_stations >= MAX_STATIONS)
|
||||
{
|
||||
|
@ -543,7 +543,7 @@ bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, in
|
|||
int32_t stationLength = 0;
|
||||
int32_t byte_F441D1 = -1;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
TileElement* tileElement = map_get_track_element_at_with_direction_from_ride(loc, rideIndex);
|
||||
if (tileElement != nullptr)
|
||||
|
@ -853,7 +853,7 @@ roll_type_t track_get_actual_bank(TileElement* tileElement, roll_type_t bank)
|
|||
|
||||
roll_type_t track_get_actual_bank_2(int32_t rideType, bool isInverted, roll_type_t bank)
|
||||
{
|
||||
if (RideTypeDescriptors[rideType].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (isInverted)
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride)
|
|||
if (trackElement.element->AsTrack()->HasChain())
|
||||
trackFlags |= RCT12_TRACK_ELEMENT_TYPE_FLAG_CHAIN_LIFT;
|
||||
trackFlags |= trackElement.element->AsTrack()->GetColourScheme() << 4;
|
||||
if (RideTypeDescriptors[ride.type].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE
|
||||
if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)
|
||||
&& trackElement.element->AsTrack()->IsInverted())
|
||||
{
|
||||
trackFlags |= TD6_TRACK_ELEMENT_FLAG_INVERTED;
|
||||
|
@ -1913,7 +1913,7 @@ static bool track_design_place_preview(TrackDesign* td6, money32* cost, Ride** o
|
|||
|
||||
// Flat rides need their vehicle colours loaded for display
|
||||
// in the preview window
|
||||
if (!ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
{
|
||||
for (int32_t i = 0; i < RCT12_MAX_VEHICLE_COLOURS; i++)
|
||||
{
|
||||
|
@ -2018,7 +2018,7 @@ void track_design_draw_preview(TrackDesign* td6, uint8_t* pixels)
|
|||
|
||||
// Special case for flat rides - Z-axis info is irrelevant
|
||||
// and must be zeroed out lest the preview be off-centre
|
||||
if (!ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
{
|
||||
centre.z = 0;
|
||||
size_z = 0;
|
||||
|
|
|
@ -155,7 +155,7 @@ public:
|
|||
{
|
||||
const ObjectRepositoryItem* ori = repo.FindObjectLegacy(item.ObjectEntry.c_str());
|
||||
|
||||
if (ori == nullptr || !RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (ori == nullptr || !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
entryIsNotSeparate = true;
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ public:
|
|||
{
|
||||
const ObjectRepositoryItem* ori = repo.FindObjectLegacy(item.ObjectEntry.c_str());
|
||||
|
||||
if (ori == nullptr || !RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (ori == nullptr || !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
entryIsNotSeparate = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2157,7 +2157,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co
|
|||
session->InteractionType = ViewportInteractionItem::None;
|
||||
if (TrackHeightMarkerPositions[trackType] & (1 << trackSequence))
|
||||
{
|
||||
uint16_t ax = RideTypeDescriptors[ride->type].Heights.VehicleZOffset;
|
||||
uint16_t ax = ride->GetRideTypeDescriptor().Heights.VehicleZOffset;
|
||||
// 0x1689 represents 0 height there are -127 to 128 heights above and below it
|
||||
// There are 3 arrays of 256 heights (units, m, ft) chosen with the get_height_marker_offset()
|
||||
uint32_t imageId = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_LIGHT_BLUE) | (0x1689 + get_height_marker_offset());
|
||||
|
@ -2194,7 +2194,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co
|
|||
{
|
||||
return;
|
||||
}
|
||||
TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeDescriptors[ride->type].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = ride->GetRideTypeDescriptor().TrackPaintFunction;
|
||||
if (paintFunctionGetter != nullptr)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType);
|
||||
|
|
|
@ -1597,7 +1597,7 @@ void Vehicle::UpdateMeasurements()
|
|||
curRide->stations[test_segment].SegmentLength, distance);
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
auto gForces = GetGForces();
|
||||
gForces.VerticalG += curRide->previous_vertical_g;
|
||||
|
@ -1970,7 +1970,7 @@ void Vehicle::GetLiftHillSound(Ride* curRide, SoundIdVolume& curSound)
|
|||
if (curRide->type < std::size(RideTypeDescriptors))
|
||||
{
|
||||
// Get lift hill sound
|
||||
curSound.id = RideTypeDescriptors[curRide->type].LiftData.sound_id;
|
||||
curSound.id = GetRideTypeDescriptor(curRide->type).LiftData.sound_id;
|
||||
curSound.volume = 243;
|
||||
if (!(sound2_flags & VEHICLE_SOUND2_FLAGS_LIFT_HILL))
|
||||
curSound.id = OpenRCT2::Audio::SoundId::Null;
|
||||
|
@ -2358,7 +2358,7 @@ void Vehicle::UpdateWaitingForPassengers()
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
{
|
||||
if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH)
|
||||
{
|
||||
|
@ -2403,7 +2403,7 @@ void Vehicle::UpdateWaitingForPassengers()
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)
|
||||
&& curRide->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD)
|
||||
{
|
||||
if (num_peeps_on_train == num_seats_on_train)
|
||||
|
@ -2565,7 +2565,7 @@ void Vehicle::UpdateWaitingToDepart()
|
|||
return;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
{
|
||||
if (curRide->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)
|
||||
{
|
||||
|
@ -3507,7 +3507,7 @@ void Vehicle::CheckIfMissing()
|
|||
if (curRide->IsBlockSectioned())
|
||||
return;
|
||||
|
||||
if (!ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_CHECK_FOR_STALLING))
|
||||
if (!curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CHECK_FOR_STALLING))
|
||||
return;
|
||||
|
||||
lost_time_out++;
|
||||
|
@ -3524,7 +3524,7 @@ void Vehicle::CheckIfMissing()
|
|||
if (gConfigNotifications.ride_stalled_vehicles)
|
||||
{
|
||||
Formatter ft;
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[curRide->type].NameConvention.vehicle).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number);
|
||||
|
||||
uint8_t vehicleIndex = 0;
|
||||
for (; vehicleIndex < curRide->num_vehicles; ++vehicleIndex)
|
||||
|
@ -3534,7 +3534,7 @@ void Vehicle::CheckIfMissing()
|
|||
vehicleIndex++;
|
||||
ft.Add<uint16_t>(vehicleIndex);
|
||||
curRide->FormatNameTo(ft);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[curRide->type].NameConvention.station).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular);
|
||||
|
||||
News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, ride, ft);
|
||||
}
|
||||
|
@ -4019,7 +4019,7 @@ void Vehicle::UpdateArriving()
|
|||
goto loc_6D8E36;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[curRide->type].Flags & RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS
|
||||
if (GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS)
|
||||
&& curRide->mode != RideMode::Shuttle && curRide->mode != RideMode::PoweredLaunch)
|
||||
{
|
||||
SetUpdateFlag(VEHICLE_UPDATE_FLAG_12);
|
||||
|
@ -6263,7 +6263,7 @@ void Vehicle::SetMapToolbar() const
|
|||
ft.Add<rct_string_id>(STR_RIDE_MAP_TIP);
|
||||
ft.Add<rct_string_id>(STR_MAP_TOOLTIP_STRINGID_STRINGID);
|
||||
curRide->FormatNameTo(ft);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[curRide->type].NameConvention.vehicle).capitalised);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).capitalised);
|
||||
ft.Add<uint16_t>(vehicleIndex + 1);
|
||||
curRide->FormatStatusTo(ft);
|
||||
auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP);
|
||||
|
@ -8095,7 +8095,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, Ride* cur
|
|||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
{
|
||||
int32_t rideType = get_ride(tileElement->AsTrack()->GetRideIndex())->type;
|
||||
if (RideTypeDescriptors[rideType].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
|
@ -8221,7 +8221,7 @@ loc_6DAEB9:
|
|||
auto boosterSpeed = get_booster_speed(curRide->type, (brake_speed << 16));
|
||||
if (boosterSpeed > _vehicleVelocityF64E08)
|
||||
{
|
||||
acceleration = RideTypeDescriptors[curRide->type].OperatingSettings.BoosterAcceleration
|
||||
acceleration = GetRideTypeDescriptor(curRide->type).OperatingSettings.BoosterAcceleration
|
||||
<< 16; //_vehicleVelocityF64E08 * 1.2;
|
||||
}
|
||||
}
|
||||
|
@ -8229,7 +8229,7 @@ loc_6DAEB9:
|
|||
if ((trackType == TrackElemType::Flat && curRide->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER)
|
||||
|| (trackType == TrackElemType::PoweredLift))
|
||||
{
|
||||
acceleration = RideTypeDescriptors[curRide->type].OperatingSettings.PoweredLiftAcceleration << 16;
|
||||
acceleration = GetRideTypeDescriptor(curRide->type).OperatingSettings.PoweredLiftAcceleration << 16;
|
||||
}
|
||||
if (trackType == TrackElemType::BrakeForDrop)
|
||||
{
|
||||
|
@ -8292,7 +8292,7 @@ loc_6DAEB9:
|
|||
uint8_t moveInfovehicleSpriteType;
|
||||
{
|
||||
auto loc = TrackLocation
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
uint8_t remainingDistanceFlags = 0;
|
||||
if (loc.x != unk_F64E20.x)
|
||||
|
@ -8470,7 +8470,7 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(uint16_t trackType, Ride* cu
|
|||
|
||||
// Update VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
if (RideTypeDescriptors[curRide->type].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)
|
||||
if (GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
|
@ -8596,7 +8596,7 @@ loc_6DBA33:;
|
|||
auto boosterSpeed = get_booster_speed(curRide->type, (brake_speed << 16));
|
||||
if (boosterSpeed < _vehicleVelocityF64E08)
|
||||
{
|
||||
acceleration = RideTypeDescriptors[curRide->type].OperatingSettings.BoosterAcceleration << 16;
|
||||
acceleration = GetRideTypeDescriptor(curRide->type).OperatingSettings.BoosterAcceleration << 16;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8620,7 +8620,7 @@ loc_6DBA33:;
|
|||
{
|
||||
const rct_vehicle_info* moveInfo = GetMoveInfo();
|
||||
auto loc = TrackLocation
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
uint8_t remainingDistanceFlags = 0;
|
||||
if (loc.x != unk_F64E20.x)
|
||||
|
@ -8855,7 +8855,7 @@ loc_6DC476:
|
|||
{
|
||||
int32_t rideType = get_ride(tileElement->AsTrack()->GetRideIndex())->type;
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
if (RideTypeDescriptors[rideType].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
|
@ -8983,7 +8983,7 @@ loc_6DC743:
|
|||
|
||||
// loc_6DC8A1
|
||||
trackPos = { TrackLocation.x + moveInfo->x, TrackLocation.y + moveInfo->y,
|
||||
TrackLocation.z + moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
TrackLocation.z + moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
remaining_distance -= 0x368A;
|
||||
if (remaining_distance < 0)
|
||||
|
@ -9066,7 +9066,7 @@ loc_6DCA9A:
|
|||
{
|
||||
int32_t rideType = get_ride(tileElement->AsTrack()->GetRideIndex())->type;
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
if (RideTypeDescriptors[rideType].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE)
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
|
@ -9099,7 +9099,7 @@ loc_6DCA9A:
|
|||
loc_6DCC2C:
|
||||
moveInfo = GetMoveInfo();
|
||||
trackPos = { TrackLocation.x + moveInfo->x, TrackLocation.y + moveInfo->y,
|
||||
TrackLocation.z + moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
TrackLocation.z + moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
remaining_distance -= 0x368A;
|
||||
if (remaining_distance < 0)
|
||||
|
@ -9799,7 +9799,7 @@ void Vehicle::UpdateCrossings() const
|
|||
// Many New Element parks have invisible rides hacked into the path.
|
||||
// Limit path blocking to rides actually supporting level crossings to prevent peeps getting stuck everywhere.
|
||||
if (pathElement && curRide != nullptr
|
||||
&& RideTypeDescriptors[curRide->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS))
|
||||
&& GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS))
|
||||
{
|
||||
if (!playedClaxon && !pathElement->IsBlockedByVehicle())
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ money32 place_provisional_track_piece(
|
|||
|
||||
int16_t z_begin, z_end;
|
||||
const rct_track_coordinates& coords = TrackCoordinates[trackType];
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
z_begin = coords.z_begin;
|
||||
z_end = coords.z_end;
|
||||
|
|
|
@ -98,7 +98,7 @@ static uint8_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords)
|
|||
|
||||
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride == nullptr || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride == nullptr || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
continue;
|
||||
|
||||
if ((tileElement->GetClearanceZ()) + (4 * COORDS_Z_STEP) <= bannerCoords.z)
|
||||
|
@ -242,7 +242,7 @@ uint8_t banner_get_closest_ride_index(const CoordsXYZ& mapPos)
|
|||
auto resultDistance = std::numeric_limits<int32_t>::max();
|
||||
for (auto& ride : GetRideManager())
|
||||
{
|
||||
if (ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
continue;
|
||||
|
||||
auto rideCoords = ride.overall_view;
|
||||
|
|
|
@ -563,7 +563,7 @@ uint32_t Park::CalculateSuggestedMaxGuests() const
|
|||
continue;
|
||||
|
||||
// Add guest score for ride type
|
||||
suggestedMaxGuests += RideTypeDescriptors[ride.type].BonusValue;
|
||||
suggestedMaxGuests += ride.GetRideTypeDescriptor().BonusValue;
|
||||
}
|
||||
|
||||
// If difficult guest generation, extra guests are available for good rides
|
||||
|
@ -578,9 +578,9 @@ uint32_t Park::CalculateSuggestedMaxGuests() const
|
|||
continue;
|
||||
if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
|
||||
continue;
|
||||
if (ride.stations[0].SegmentLength < (600 << 16))
|
||||
continue;
|
||||
|
@ -588,7 +588,7 @@ uint32_t Park::CalculateSuggestedMaxGuests() const
|
|||
continue;
|
||||
|
||||
// Bonus guests for good ride
|
||||
suggestedMaxGuests += RideTypeDescriptors[ride.type].BonusValue * 2;
|
||||
suggestedMaxGuests += ride.GetRideTypeDescriptor().BonusValue * 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -213,11 +213,6 @@ TileElement* map_get_first_element_at(const CoordsXY& elementPos)
|
|||
return gTileElementTilePointers[tileElementPos.x + tileElementPos.y * 256];
|
||||
}
|
||||
|
||||
bool ride_type_has_flag(int rideType, uint64_t flag)
|
||||
{
|
||||
return (RideTypeDescriptors[rideType].Flags & flag) != 0;
|
||||
}
|
||||
|
||||
int16_t get_height_marker_offset()
|
||||
{
|
||||
return 0;
|
||||
|
@ -872,7 +867,7 @@ void ride_ratings_calculate_single_rail_roller_coaster([[maybe_unused]] Ride* ri
|
|||
|
||||
const RideTypeDescriptor& Ride::GetRideTypeDescriptor() const
|
||||
{
|
||||
return RideTypeDescriptors[type];
|
||||
return ::GetRideTypeDescriptor(type);
|
||||
}
|
||||
|
||||
uint8_t TileElementBase::GetOwner() const
|
||||
|
|
|
@ -86,7 +86,7 @@ class ChainLiftFilter : public ITestTrackFilter
|
|||
public:
|
||||
bool AppliesTo(uint8_t rideType, uint8_t trackType) override
|
||||
{
|
||||
return !ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE);
|
||||
return !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE);
|
||||
}
|
||||
|
||||
int Variations(uint8_t rideType, uint8_t trackType) override
|
||||
|
@ -193,7 +193,7 @@ static void CallOriginal(
|
|||
static void CallNew(
|
||||
uint8_t rideType, uint8_t trackType, uint8_t direction, uint8_t trackSequence, uint16_t height, TileElement* tileElement)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintFunctionGetter = RideTypeDescriptors[rideType].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintFunctionGetter = GetRideTypeDescriptor(rideType).TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION newPaintFunction = newPaintFunctionGetter(trackType);
|
||||
|
||||
newPaintFunction(&gPaintSession, 0, trackSequence, direction, height, tileElement);
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace Utils
|
|||
|
||||
bool rideSupportsTrackType(uint8_t rideType, uint8_t trackType)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = RideTypeDescriptors[rideType].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = GetRideTypeDescriptor(rideType).TrackPaintFunction;
|
||||
|
||||
if (newPaintGetter == nullptr)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace Utils
|
|||
|
||||
bool rideIsImplemented(uint8_t rideType)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = RideTypeDescriptors[rideType].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = GetRideTypeDescriptor(rideType).TrackPaintFunction;
|
||||
return (newPaintGetter != 0);
|
||||
}
|
||||
} // namespace Utils
|
||||
|
|
|
@ -1163,7 +1163,7 @@ private:
|
|||
|
||||
int generatePaintCode(uint8_t rideType)
|
||||
{
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
fprintf(stderr, "Flat rides not supported.\n");
|
||||
}
|
||||
|
|
|
@ -520,9 +520,9 @@ int main(int argc, char* argv[])
|
|||
TestCase testCase = {};
|
||||
testCase.rideType = rideType;
|
||||
|
||||
if (ride_type_has_flag(rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
testCase.trackTypes.push_back(RideTypeDescriptors[rideType].StartTrackPiece);
|
||||
testCase.trackTypes.push_back(GetRideTypeDescriptor(rideType).StartTrackPiece);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -564,7 +564,7 @@ int main(int argc, char* argv[])
|
|||
for (auto&& trackType : tc.trackTypes)
|
||||
{
|
||||
utf8string trackTypeName;
|
||||
if (ride_type_has_flag(tc.rideType, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (GetRideTypeDescriptor(tc.rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
trackTypeName = FlatTrackNames[trackType];
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ protected:
|
|||
{
|
||||
RatingTuple ratings = ride.ratings;
|
||||
std::string line = String::StdFormat(
|
||||
"%s: (%d, %d, %d)", RideTypeDescriptors[ride.type].EnumName, static_cast<int>(ratings.Excitement),
|
||||
"%s: (%d, %d, %d)", ride.GetRideTypeDescriptor().EnumName, static_cast<int>(ratings.Excitement),
|
||||
static_cast<int>(ratings.Intensity), static_cast<int>(ratings.Nausea));
|
||||
return line;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue