From 9c796816a17d330b32da5054b2af53e3d6ec54d2 Mon Sep 17 00:00:00 2001 From: frutiemax Date: Mon, 13 Jun 2022 07:39:37 -0400 Subject: [PATCH] Add DesignCreateMode field to the RTD (#16987) --- src/openrct2/ride/RideData.h | 7 +++++++ src/openrct2/ride/TrackDesign.cpp | 10 +++++++--- src/openrct2/ride/coaster/meta/HybridCoaster.h | 4 ++-- src/openrct2/ride/gentle/meta/Circus.h | 1 + src/openrct2/ride/gentle/meta/Maze.h | 1 + src/openrct2/ride/shops/meta/CashMachine.h | 1 + src/openrct2/ride/shops/meta/DrinkStall.h | 1 + src/openrct2/ride/shops/meta/FirstAid.h | 1 + src/openrct2/ride/shops/meta/FoodStall.h | 1 + src/openrct2/ride/shops/meta/InformationKiosk.h | 1 + src/openrct2/ride/shops/meta/Shop.h | 1 + src/openrct2/ride/shops/meta/Toilets.h | 1 + 12 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 12c5c1f666..9c2af71b4f 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -77,6 +77,12 @@ enum class RideColourKey : uint8_t Toilets }; +enum class TrackDesignCreateMode : uint_fast8_t +{ + Default, + Maze +}; + struct RideNameConvention { RideComponentType vehicle; @@ -189,6 +195,7 @@ struct RideTypeDescriptor track_colour_preset_list ColourPresets; RideColourPreview ColourPreview; RideColourKey ColourKey; + TrackDesignCreateMode DesignCreateMode = TrackDesignCreateMode::Default; RideMusicUpdateFunction MusicUpdateFunction = DefaultMusicUpdate; RideClassification Classification = RideClassification::Ride; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 641f821e87..91a39735fc 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -149,12 +149,16 @@ rct_string_id TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ride& flags = 0; flags2 = 0; - if (type == RIDE_TYPE_MAZE) + const auto& rtd = GetRideTypeDescriptor(type); + + if (rtd.DesignCreateMode == TrackDesignCreateMode::Maze) { return CreateTrackDesignMaze(tds, ride); } - - return CreateTrackDesignTrack(tds, ride); + else + { + return CreateTrackDesignTrack(tds, ride); + } } rct_string_id TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const Ride& ride) diff --git a/src/openrct2/ride/coaster/meta/HybridCoaster.h b/src/openrct2/ride/coaster/meta/HybridCoaster.h index d8c3699e9d..076b52a143 100644 --- a/src/openrct2/ride/coaster/meta/HybridCoaster.h +++ b/src/openrct2/ride/coaster/meta/HybridCoaster.h @@ -48,7 +48,7 @@ constexpr const RideTypeDescriptor HybridCoasterRTD = { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_SATURATED_BROWN}, { COLOUR_LIGHT_BLUE, COLOUR_LIGHT_BLUE, COLOUR_WHITE} )), - SET_FIELD(ColourPreview, { SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_TRACK, SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_SUPPORTS }), - SET_FIELD(ColourKey, RideColourKey::Ride), + SET_FIELD(ColourPreview, { SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_TRACK, SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_SUPPORTS }), + SET_FIELD(ColourKey, RideColourKey::Ride), }; // clang-format on diff --git a/src/openrct2/ride/gentle/meta/Circus.h b/src/openrct2/ride/gentle/meta/Circus.h index 75fd9f5d5b..ae20074fcb 100644 --- a/src/openrct2/ride/gentle/meta/Circus.h +++ b/src/openrct2/ride/gentle/meta/Circus.h @@ -49,6 +49,7 @@ constexpr const RideTypeDescriptor CircusRTD = SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::Ride), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, CircusMusicUpdate), }; // clang-format on diff --git a/src/openrct2/ride/gentle/meta/Maze.h b/src/openrct2/ride/gentle/meta/Maze.h index 5f8eda50c4..697f52157d 100644 --- a/src/openrct2/ride/gentle/meta/Maze.h +++ b/src/openrct2/ride/gentle/meta/Maze.h @@ -50,5 +50,6 @@ constexpr const RideTypeDescriptor MazeRTD = )), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::Ride), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Maze), }; // clang-format on diff --git a/src/openrct2/ride/shops/meta/CashMachine.h b/src/openrct2/ride/shops/meta/CashMachine.h index 1d88b3fef5..00cfd466f4 100644 --- a/src/openrct2/ride/shops/meta/CashMachine.h +++ b/src/openrct2/ride/shops/meta/CashMachine.h @@ -46,6 +46,7 @@ constexpr const RideTypeDescriptor CashMachineRTD = SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::CashMachine), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::KioskOrFacility), }; diff --git a/src/openrct2/ride/shops/meta/DrinkStall.h b/src/openrct2/ride/shops/meta/DrinkStall.h index 02393d3105..dc0e924519 100644 --- a/src/openrct2/ride/shops/meta/DrinkStall.h +++ b/src/openrct2/ride/shops/meta/DrinkStall.h @@ -47,6 +47,7 @@ constexpr const RideTypeDescriptor DrinkStallRTD = SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::Drink), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::ShopOrStall), }; diff --git a/src/openrct2/ride/shops/meta/FirstAid.h b/src/openrct2/ride/shops/meta/FirstAid.h index 40ed4ebd26..565acf217c 100644 --- a/src/openrct2/ride/shops/meta/FirstAid.h +++ b/src/openrct2/ride/shops/meta/FirstAid.h @@ -47,6 +47,7 @@ constexpr const RideTypeDescriptor FirstAidRTD = SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::FirstAid), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::KioskOrFacility), }; diff --git a/src/openrct2/ride/shops/meta/FoodStall.h b/src/openrct2/ride/shops/meta/FoodStall.h index 42f9ca9d2e..8672fa1e9d 100644 --- a/src/openrct2/ride/shops/meta/FoodStall.h +++ b/src/openrct2/ride/shops/meta/FoodStall.h @@ -47,6 +47,7 @@ constexpr const RideTypeDescriptor FoodStallRTD = SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::Food), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::ShopOrStall), }; diff --git a/src/openrct2/ride/shops/meta/InformationKiosk.h b/src/openrct2/ride/shops/meta/InformationKiosk.h index 2fa2e171c3..39495a61a4 100644 --- a/src/openrct2/ride/shops/meta/InformationKiosk.h +++ b/src/openrct2/ride/shops/meta/InformationKiosk.h @@ -47,6 +47,7 @@ constexpr const RideTypeDescriptor InformationKioskRTD = SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::InfoKiosk), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::KioskOrFacility), }; diff --git a/src/openrct2/ride/shops/meta/Shop.h b/src/openrct2/ride/shops/meta/Shop.h index e6761aac56..0d390b7b12 100644 --- a/src/openrct2/ride/shops/meta/Shop.h +++ b/src/openrct2/ride/shops/meta/Shop.h @@ -47,6 +47,7 @@ constexpr const RideTypeDescriptor ShopRTD = SET_FIELD(ColourPresets, DEFAULT_STALL_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::Shop), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::ShopOrStall), }; diff --git a/src/openrct2/ride/shops/meta/Toilets.h b/src/openrct2/ride/shops/meta/Toilets.h index f6f79b1efb..8381d6eb9f 100644 --- a/src/openrct2/ride/shops/meta/Toilets.h +++ b/src/openrct2/ride/shops/meta/Toilets.h @@ -47,6 +47,7 @@ constexpr const RideTypeDescriptor ToiletsRTD = SET_FIELD(ColourPresets, DEFAULT_FLAT_RIDE_COLOUR_PRESET), SET_FIELD(ColourPreview, { 0, 0 }), SET_FIELD(ColourKey, RideColourKey::Toilets), + SET_FIELD(DesignCreateMode, TrackDesignCreateMode::Default), SET_FIELD(MusicUpdateFunction, DefaultMusicUpdate), SET_FIELD(Classification, RideClassification::KioskOrFacility), };