mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Refactor custom track piece handling
This commit is contained in:
@@ -2725,7 +2725,7 @@ static void window_ride_construction_update_map_selection()
|
|||||||
static void window_ride_construction_update_possible_ride_configurations()
|
static void window_ride_construction_update_possible_ride_configurations()
|
||||||
{
|
{
|
||||||
int32_t trackType;
|
int32_t trackType;
|
||||||
int32_t edi;
|
int32_t constructionTrackType;
|
||||||
|
|
||||||
auto ride = get_ride(_currentRideIndex);
|
auto ride = get_ride(_currentRideIndex);
|
||||||
if (ride == nullptr)
|
if (ride == nullptr)
|
||||||
@@ -2733,9 +2733,9 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||||||
|
|
||||||
_currentlyShowingBrakeOrBoosterSpeed = false;
|
_currentlyShowingBrakeOrBoosterSpeed = false;
|
||||||
if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE)
|
if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE)
|
||||||
edi = RideData4[ride->type].alternate_type;
|
constructionTrackType = RideData4[ride->type].alternate_type;
|
||||||
else
|
else
|
||||||
edi = ride->type;
|
constructionTrackType = ride->type;
|
||||||
|
|
||||||
int32_t currentPossibleRideConfigurationIndex = 0;
|
int32_t currentPossibleRideConfigurationIndex = 0;
|
||||||
_numCurrentPossibleSpecialTrackPieces = 0;
|
_numCurrentPossibleSpecialTrackPieces = 0;
|
||||||
@@ -2747,10 +2747,10 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||||||
if (edx == 0)
|
if (edx == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (edx & 0x80)
|
if (edx & TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG)
|
||||||
{
|
{
|
||||||
edx &= 0x7F;
|
edx &= ~TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG;
|
||||||
if (edx != edi)
|
if (edx != constructionTrackType)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!is_track_enabled(edx))
|
else if (!is_track_enabled(edx))
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ enum
|
|||||||
|
|
||||||
#define MAX_STATION_PLATFORM_LENGTH 32
|
#define MAX_STATION_PLATFORM_LENGTH 32
|
||||||
constexpr uint16_t const MAX_TRACK_HEIGHT = 254;
|
constexpr uint16_t const MAX_TRACK_HEIGHT = 254;
|
||||||
|
constexpr uint8_t const TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG = 0x80;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -141,13 +142,13 @@ enum
|
|||||||
TRACK_HALF_LOOP_INVERTED,
|
TRACK_HALF_LOOP_INVERTED,
|
||||||
TRACK_BOOSTER = TRACK_ROTATION_CONTROL_TOGGLE,
|
TRACK_BOOSTER = TRACK_ROTATION_CONTROL_TOGGLE,
|
||||||
|
|
||||||
TRACK_WATERFALL = 152,
|
TRACK_WATERFALL = RIDE_TYPE_RIVER_RAPIDS | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
TRACK_WHIRLPOOL = 152,
|
TRACK_WHIRLPOOL = RIDE_TYPE_RIVER_RAPIDS | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
TRACK_BRAKE_FOR_DROP = 172,
|
TRACK_BRAKE_FOR_DROP = RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
TRACK_190 = 190,
|
TRACK_190 = RIDE_TYPE_LAY_DOWN_ROLLER_COASTER | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
TRACK_192 = 192,
|
TRACK_192 = RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
TRACK_194 = 194,
|
TRACK_194 = RIDE_TYPE_HEARTLINE_TWISTER_COASTER | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
TRACK_MINI_GOLF_HOLE = 195,
|
TRACK_MINI_GOLF_HOLE = RIDE_TYPE_MINI_GOLF | TRACK_TYPE_FOR_SPECIFIC_RIDE_FLAG,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
|
|||||||
Reference in New Issue
Block a user