mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Rename snake functions in Station.cpp (#19316)
This commit is contained in:
committed by
GitHub
parent
ccc234fe8c
commit
ece0ee42d5
@@ -17,12 +17,12 @@
|
|||||||
#include "Track.h"
|
#include "Track.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
|
|
||||||
static void ride_update_station_blocksection(Ride& ride, StationIndex stationIndex);
|
static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex);
|
||||||
static void ride_update_station_dodgems(Ride& ride, StationIndex stationIndex);
|
static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex);
|
||||||
static void ride_update_station_normal(Ride& ride, StationIndex stationIndex);
|
static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex);
|
||||||
static void ride_update_station_race(Ride& ride, StationIndex stationIndex);
|
static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex);
|
||||||
static void ride_race_init_vehicle_speeds(const Ride& ride);
|
static void RideRaceInitVehicleSpeeds(const Ride& ride);
|
||||||
static void ride_invalidate_station_start(Ride& ride, StationIndex stationIndex, bool greenLight);
|
static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -36,17 +36,17 @@ void RideUpdateStation(Ride& ride, StationIndex stationIndex)
|
|||||||
switch (ride.mode)
|
switch (ride.mode)
|
||||||
{
|
{
|
||||||
case RideMode::Race:
|
case RideMode::Race:
|
||||||
ride_update_station_race(ride, stationIndex);
|
RideUpdateStationRace(ride, stationIndex);
|
||||||
break;
|
break;
|
||||||
case RideMode::Dodgems:
|
case RideMode::Dodgems:
|
||||||
ride_update_station_dodgems(ride, stationIndex);
|
RideUpdateStationDodgems(ride, stationIndex);
|
||||||
break;
|
break;
|
||||||
case RideMode::ContinuousCircuitBlockSectioned:
|
case RideMode::ContinuousCircuitBlockSectioned:
|
||||||
case RideMode::PoweredLaunchBlockSectioned:
|
case RideMode::PoweredLaunchBlockSectioned:
|
||||||
ride_update_station_blocksection(ride, stationIndex);
|
RideUpdateStationBlockSection(ride, stationIndex);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ride_update_station_normal(ride, stationIndex);
|
RideUpdateStationNormal(ride, stationIndex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ void RideUpdateStation(Ride& ride, StationIndex stationIndex)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006AC0A1
|
* rct2: 0x006AC0A1
|
||||||
*/
|
*/
|
||||||
static void ride_update_station_blocksection(Ride& ride, StationIndex stationIndex)
|
static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex)
|
||||||
{
|
{
|
||||||
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
||||||
auto& station = ride.GetStation(stationIndex);
|
auto& station = ride.GetStation(stationIndex);
|
||||||
@@ -66,18 +66,18 @@ static void ride_update_station_blocksection(Ride& ride, StationIndex stationInd
|
|||||||
station.Depart &= ~STATION_DEPART_FLAG;
|
station.Depart &= ~STATION_DEPART_FLAG;
|
||||||
|
|
||||||
if ((station.Depart & STATION_DEPART_FLAG) || (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight()))
|
if ((station.Depart & STATION_DEPART_FLAG) || (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight()))
|
||||||
ride_invalidate_station_start(ride, stationIndex, false);
|
RideInvalidateStationStart(ride, stationIndex, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(station.Depart & STATION_DEPART_FLAG))
|
if (!(station.Depart & STATION_DEPART_FLAG))
|
||||||
{
|
{
|
||||||
station.Depart |= STATION_DEPART_FLAG;
|
station.Depart |= STATION_DEPART_FLAG;
|
||||||
ride_invalidate_station_start(ride, stationIndex, true);
|
RideInvalidateStationStart(ride, stationIndex, true);
|
||||||
}
|
}
|
||||||
else if (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight())
|
else if (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight())
|
||||||
{
|
{
|
||||||
ride_invalidate_station_start(ride, stationIndex, true);
|
RideInvalidateStationStart(ride, stationIndex, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ static void ride_update_station_blocksection(Ride& ride, StationIndex stationInd
|
|||||||
*
|
*
|
||||||
* rct2: 0x006AC12B
|
* rct2: 0x006AC12B
|
||||||
*/
|
*/
|
||||||
static void ride_update_station_dodgems(Ride& ride, StationIndex stationIndex)
|
static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex)
|
||||||
{
|
{
|
||||||
auto& station = ride.GetStation(stationIndex);
|
auto& station = ride.GetStation(stationIndex);
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ static void ride_update_station_dodgems(Ride& ride, StationIndex stationIndex)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006AC02C
|
* rct2: 0x006AC02C
|
||||||
*/
|
*/
|
||||||
static void ride_update_station_normal(Ride& ride, StationIndex stationIndex)
|
static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex)
|
||||||
{
|
{
|
||||||
auto& station = ride.GetStation(stationIndex);
|
auto& station = ride.GetStation(stationIndex);
|
||||||
int32_t time = station.Depart & STATION_DEPART_MASK;
|
int32_t time = station.Depart & STATION_DEPART_MASK;
|
||||||
@@ -158,14 +158,14 @@ static void ride_update_station_normal(Ride& ride, StationIndex stationIndex)
|
|||||||
time--;
|
time--;
|
||||||
|
|
||||||
station.Depart = time;
|
station.Depart = time;
|
||||||
ride_invalidate_station_start(ride, stationIndex, false);
|
RideInvalidateStationStart(ride, stationIndex, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (time == 0)
|
if (time == 0)
|
||||||
{
|
{
|
||||||
station.Depart |= STATION_DEPART_FLAG;
|
station.Depart |= STATION_DEPART_FLAG;
|
||||||
ride_invalidate_station_start(ride, stationIndex, true);
|
RideInvalidateStationStart(ride, stationIndex, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -173,7 +173,7 @@ static void ride_update_station_normal(Ride& ride, StationIndex stationIndex)
|
|||||||
time--;
|
time--;
|
||||||
|
|
||||||
station.Depart = time;
|
station.Depart = time;
|
||||||
ride_invalidate_station_start(ride, stationIndex, false);
|
RideInvalidateStationStart(ride, stationIndex, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ static void ride_update_station_normal(Ride& ride, StationIndex stationIndex)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006AC1DF
|
* rct2: 0x006AC1DF
|
||||||
*/
|
*/
|
||||||
static void ride_update_station_race(Ride& ride, StationIndex stationIndex)
|
static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex)
|
||||||
{
|
{
|
||||||
auto& station = ride.GetStation(stationIndex);
|
auto& station = ride.GetStation(stationIndex);
|
||||||
if (ride.status == RideStatus::Closed || (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)))
|
if (ride.status == RideStatus::Closed || (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)))
|
||||||
@@ -190,7 +190,7 @@ static void ride_update_station_race(Ride& ride, StationIndex stationIndex)
|
|||||||
if (station.Depart & STATION_DEPART_FLAG)
|
if (station.Depart & STATION_DEPART_FLAG)
|
||||||
{
|
{
|
||||||
station.Depart &= ~STATION_DEPART_FLAG;
|
station.Depart &= ~STATION_DEPART_FLAG;
|
||||||
ride_invalidate_station_start(ride, stationIndex, false);
|
RideInvalidateStationStart(ride, stationIndex, false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ static void ride_update_station_race(Ride& ride, StationIndex stationIndex)
|
|||||||
if (station.Depart & STATION_DEPART_FLAG)
|
if (station.Depart & STATION_DEPART_FLAG)
|
||||||
{
|
{
|
||||||
station.Depart &= ~STATION_DEPART_FLAG;
|
station.Depart &= ~STATION_DEPART_FLAG;
|
||||||
ride_invalidate_station_start(ride, stationIndex, false);
|
RideInvalidateStationStart(ride, stationIndex, false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -246,19 +246,19 @@ static void ride_update_station_race(Ride& ride, StationIndex stationIndex)
|
|||||||
if (station.Depart & STATION_DEPART_FLAG)
|
if (station.Depart & STATION_DEPART_FLAG)
|
||||||
{
|
{
|
||||||
station.Depart &= ~STATION_DEPART_FLAG;
|
station.Depart &= ~STATION_DEPART_FLAG;
|
||||||
ride_invalidate_station_start(ride, stationIndex, false);
|
RideInvalidateStationStart(ride, stationIndex, false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin the race
|
// Begin the race
|
||||||
ride_race_init_vehicle_speeds(ride);
|
RideRaceInitVehicleSpeeds(ride);
|
||||||
ride.lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
|
ride.lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
|
||||||
if (!(station.Depart & STATION_DEPART_FLAG))
|
if (!(station.Depart & STATION_DEPART_FLAG))
|
||||||
{
|
{
|
||||||
station.Depart |= STATION_DEPART_FLAG;
|
station.Depart |= STATION_DEPART_FLAG;
|
||||||
ride_invalidate_station_start(ride, stationIndex, true);
|
RideInvalidateStationStart(ride, stationIndex, true);
|
||||||
}
|
}
|
||||||
ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST;
|
ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST;
|
||||||
}
|
}
|
||||||
@@ -270,7 +270,7 @@ static void ride_update_station_race(Ride& ride, StationIndex stationIndex)
|
|||||||
* set the speed of the go kart type vehicle at the start to a random value or alter if peep name is an easter egg
|
* set the speed of the go kart type vehicle at the start to a random value or alter if peep name is an easter egg
|
||||||
* @param ride (esi)
|
* @param ride (esi)
|
||||||
*/
|
*/
|
||||||
static void ride_race_init_vehicle_speeds(const Ride& ride)
|
static void RideRaceInitVehicleSpeeds(const Ride& ride)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < ride.NumTrains; i++)
|
for (size_t i = 0; i < ride.NumTrains; i++)
|
||||||
{
|
{
|
||||||
@@ -318,7 +318,7 @@ static void ride_race_init_vehicle_speeds(const Ride& ride)
|
|||||||
*
|
*
|
||||||
* rct2: 0x006AC2C7
|
* rct2: 0x006AC2C7
|
||||||
*/
|
*/
|
||||||
static void ride_invalidate_station_start(Ride& ride, StationIndex stationIndex, bool greenLight)
|
static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight)
|
||||||
{
|
{
|
||||||
auto startPos = ride.GetStation(stationIndex).Start;
|
auto startPos = ride.GetStation(stationIndex).Start;
|
||||||
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user