forked from rosebudai/OpenRCT2-Web
Rework Ride and Vehicle headers into OpenRCT2 namespace (#26881)
* Move vehicle flags to their own header * Move Ride, RideConstruction, RideRatings, Vehicle into OpenRCT2 namespace * Rename to SpecialDropdownElement as suggested
This commit is contained in:
1 parent
53a81b1b45
commit
51649e5873
59 files changed
+15809
-15675
No files matched your search
@@ -27,7 +27,7 @@ namespace OpenRCT2
|
||||
|
||||
enum class RideConstructionState : uint8_t;
|
||||
|
||||
struct SpecialElement
|
||||
struct SpecialDropdownElement
|
||||
{
|
||||
TrackElemType TrackType;
|
||||
bool Disabled;
|
||||
@@ -36,7 +36,7 @@ namespace OpenRCT2
|
||||
struct SpecialElementsDropdownState
|
||||
{
|
||||
bool HasActiveElements = false;
|
||||
std::vector<SpecialElement> Elements{};
|
||||
std::vector<SpecialDropdownElement> Elements{};
|
||||
size_t PreferredNumRows{};
|
||||
};
|
||||
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
|
||||
struct ScreenCoordsXY;
|
||||
struct StringWithArgs;
|
||||
struct Ride;
|
||||
struct RideSelection;
|
||||
struct TrackDesign;
|
||||
struct TrackDesignFileRef;
|
||||
struct Vehicle;
|
||||
|
||||
enum class GuestListFilterType : int32_t;
|
||||
enum class ScatterToolDensity : uint8_t;
|
||||
@@ -36,7 +34,9 @@ namespace OpenRCT2
|
||||
class Formatter;
|
||||
struct ObjectEntryDescriptor;
|
||||
struct Peep;
|
||||
struct Ride;
|
||||
struct TileElement;
|
||||
struct Vehicle;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../../core/Money.hpp"
|
||||
#include "../../core/Numerics.hpp"
|
||||
#include "../../management/Finance.h"
|
||||
#include "../../ride/RideColour.h"
|
||||
#include "../../ride/RideData.h"
|
||||
#include "../../ride/Track.h"
|
||||
#include "../../ride/TrackData.h"
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
#undef interface
|
||||
#endif
|
||||
|
||||
enum class RideInspection : uint8_t;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class RideInspection : uint8_t;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::Config
|
||||
{
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#include <cstdint>
|
||||
|
||||
struct CoordsXY;
|
||||
struct Vehicle;
|
||||
struct CoordsXYZ;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct EntityBase;
|
||||
struct Vehicle;
|
||||
struct Viewport;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
#include "Peep.h"
|
||||
|
||||
struct CarEntry;
|
||||
struct Vehicle;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Vehicle;
|
||||
|
||||
constexpr int8_t kPeepMaxThoughts = 5;
|
||||
|
||||
constexpr int8_t kPeepHungerWarningThreshold = 25;
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2::Drawing
|
||||
{
|
||||
enum class Colour : uint8_t;
|
||||
@@ -24,12 +22,12 @@ namespace OpenRCT2::Drawing
|
||||
namespace OpenRCT2
|
||||
{
|
||||
class DataSerialiser;
|
||||
class PatrolArea;
|
||||
|
||||
struct Ride;
|
||||
struct TileElement;
|
||||
struct PathElement;
|
||||
|
||||
class PatrolArea;
|
||||
|
||||
enum class StaffType : uint8_t
|
||||
{
|
||||
handyman,
|
||||
|
||||
@@ -602,6 +602,7 @@
|
||||
<ClInclude Include="ride\Vehicle.h" />
|
||||
<ClInclude Include="ride\VehicleColour.h" />
|
||||
<ClInclude Include="ride\VehicleData.h" />
|
||||
<ClInclude Include="ride\VehicleFlags.h" />
|
||||
<ClInclude Include="ride\VehicleGeometry.h" />
|
||||
<ClInclude Include="ride\VehicleRiderControl.h" />
|
||||
<ClInclude Include="ride\VehicleSubpositionData.h" />
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
enum class RideCategory : uint8_t;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class RideCategory : uint8_t;
|
||||
|
||||
class RideObject final : public Object
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct PaintSession;
|
||||
struct Vehicle;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Vehicle;
|
||||
}
|
||||
|
||||
void PaintVehicle(PaintSession& session, const Vehicle& vehicle, int32_t imageDirection);
|
||||
struct PaintSession;
|
||||
|
||||
void PaintVehicle(PaintSession& session, const OpenRCT2::Vehicle& vehicle, int32_t imageDirection);
|
||||
@@ -16,10 +16,10 @@
|
||||
#include "../tile_element/Paint.TileElement.h"
|
||||
#include "Support.h"
|
||||
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
|
||||
ImageId getPrimaryTrackColourWithSecondarySupportColour(const PaintSession& session);
|
||||
|
||||
template<const bool flipXAxis, const size_t sequenceCount, const size_t spriteCount>
|
||||
|
||||
@@ -12,38 +12,38 @@
|
||||
#include <cstdint>
|
||||
|
||||
struct PaintSession;
|
||||
struct Ride;
|
||||
struct SupportType;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
struct TrackElement;
|
||||
}
|
||||
} // namespace OpenRCT2
|
||||
|
||||
void TwisterRCTrackBooster(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackDiagBrakes(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackDiagBlockBrakes(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackFlatTo60DegUpLongBase(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrack60DegUpToFlatLongBase(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackLeftLargeHalfLoopUp(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackRightLargeHalfLoopUp(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackLeftLargeHalfLoopDown(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
void TwisterRCTrackRightLargeHalfLoopDown(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
@@ -13,7 +13,11 @@
|
||||
|
||||
struct PaintSession;
|
||||
struct CarEntry;
|
||||
struct Vehicle;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Vehicle;
|
||||
}
|
||||
|
||||
struct VehicleBoundBox
|
||||
{
|
||||
@@ -28,40 +32,40 @@ struct VehicleBoundBox
|
||||
extern const VehicleBoundBox VehicleBoundboxes[16][224];
|
||||
|
||||
void VehicleVisualDefault(
|
||||
PaintSession& session, int32_t imageDirection, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry);
|
||||
void VehicleVisualSplashEffect(PaintSession& session, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry);
|
||||
PaintSession& session, int32_t imageDirection, int32_t z, const OpenRCT2::Vehicle* vehicle, const CarEntry* carEntry);
|
||||
void VehicleVisualSplashEffect(PaintSession& session, int32_t z, const OpenRCT2::Vehicle* vehicle, const CarEntry* carEntry);
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
void VehicleVisualRotoDrop(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualObservationTower(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualRiverRapids(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualReverser(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualSplashBoatsOrWaterCoaster(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualLaunchedFreefall(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualVirginiaReel(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualSubmarine(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
void VehicleVisualMiniGolfPlayer(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle);
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle);
|
||||
void VehicleVisualMiniGolfBall(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle);
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle);
|
||||
void VehicleVisualClassicMiniSpinning(
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle,
|
||||
PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const OpenRCT2::Vehicle* vehicle,
|
||||
const CarEntry* carEntry);
|
||||
} // namespace OpenRCT2
|
||||
@@ -35,11 +35,12 @@ namespace OpenRCT2
|
||||
|
||||
struct ObjectEntryDescriptor;
|
||||
class ObjectList;
|
||||
|
||||
enum class SpecialElement : uint8_t;
|
||||
using SpecialElements = FlagHolder<uint8_t, SpecialElement>;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
using ride_type_t = uint16_t;
|
||||
enum class SpecialElement : uint8_t;
|
||||
using SpecialElements = FlagHolder<uint8_t, SpecialElement>;
|
||||
|
||||
std::string_view MapToNewObjectIdentifier(std::string_view s);
|
||||
std::optional<std::string_view> GetDATPathName(std::string_view newPathName);
|
||||
@@ -66,5 +67,5 @@ std::string_view GetClimateObjectIdFromLegacyClimateType(OpenRCT2::RCT12::Climat
|
||||
*/
|
||||
bool TrackTypeMustBeMadeInvisible(const OpenRCT2::TrackElement& trackElement, int32_t parkFileVersion = -1);
|
||||
|
||||
std::pair<uint8_t, SpecialElements> splitCombinedHelicesAndSpecialElements(uint8_t combinedValue);
|
||||
std::pair<uint8_t, OpenRCT2::SpecialElements> splitCombinedHelicesAndSpecialElements(uint8_t combinedValue);
|
||||
std::pair<uint8_t, uint8_t> splitCombinedNumDropsPoweredLifts(uint8_t combinedValue);
|
||||
@@ -22,12 +22,16 @@
|
||||
|
||||
struct RideObjectEntry;
|
||||
|
||||
enum class Breakdown : uint8_t;
|
||||
enum class MechanicStatus : uint8_t;
|
||||
enum class RideInvalidateFlag : uint8_t;
|
||||
enum class VehicleColourSettings : uint8_t;
|
||||
|
||||
using RideInvalidateFlags = FlagHolder<uint8_t, RideInvalidateFlag>;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class Breakdown : uint8_t;
|
||||
enum class MechanicStatus : uint8_t;
|
||||
enum class RideInvalidateFlag : uint8_t;
|
||||
|
||||
using RideInvalidateFlags = FlagHolder<uint8_t, RideInvalidateFlag>;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
namespace OpenRCT2::Editor
|
||||
{
|
||||
|
||||
@@ -11,8 +11,12 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct Vehicle;
|
||||
struct Ride;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Vehicle;
|
||||
struct Ride;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
Vehicle* CableLiftSegmentCreate(
|
||||
Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head);
|
||||
OpenRCT2::Vehicle* CableLiftSegmentCreate(
|
||||
OpenRCT2::Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance,
|
||||
bool head);
|
||||
@@ -23,7 +23,10 @@ namespace OpenRCT2::Audio
|
||||
enum class SoundId : uint8_t;
|
||||
}
|
||||
|
||||
enum class SoundRange : uint8_t;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class SoundRange : uint8_t;
|
||||
}
|
||||
|
||||
enum class CarEntryAnimation : uint8_t
|
||||
{
|
||||
@@ -212,7 +215,7 @@ struct CarEntry
|
||||
uint8_t spinning_friction;
|
||||
OpenRCT2::Audio::SoundId friction_sound_id; // Only valid for front/default car of train
|
||||
uint8_t ReversedCarIndex; // When the car is reversed (using a turntable or reverser), it will be changed to this car.
|
||||
SoundRange soundRange;
|
||||
OpenRCT2::SoundRange soundRange;
|
||||
uint8_t double_sound_frequency; // (Doubles the velocity when working out the sound frequency {used on go karts})
|
||||
uint8_t powered_acceleration;
|
||||
uint8_t powered_max_speed;
|
||||
|
||||
@@ -12,9 +12,10 @@
|
||||
#include "../core/Money.hpp"
|
||||
|
||||
struct CoordsXYZ;
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
|
||||
money64 MazeCalculateCost(money64 constructionCost, const Ride& ride, const CoordsXYZ& loc);
|
||||
}
|
||||
} // namespace OpenRCT2
|
||||
+5180
-5173
File diff suppressed because it is too large.
Load diff
+781
-779
File diff suppressed because it is too large.
Load diff
@@ -15,7 +15,11 @@
|
||||
#include <utility>
|
||||
|
||||
struct CoordsXYZ;
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::RideAudio
|
||||
{
|
||||
|
||||
@@ -13,13 +13,18 @@
|
||||
#include "Ride.h"
|
||||
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
static const EnumMap<Breakdown> kBreakdownMap(
|
||||
{ { "safety_cut_out", Breakdown::safetyCutOut },
|
||||
{ "restraints_stuck_closed", Breakdown::restraintsStuckClosed },
|
||||
{ "restraints_stuck_open", Breakdown::restraintsStuckOpen },
|
||||
{ "doors_stuck_closed", Breakdown::doorsStuckClosed },
|
||||
{ "doors_stuck_open", Breakdown::doorsStuckOpen },
|
||||
{ "vehicle_malfunction", Breakdown::vehicleMalfunction },
|
||||
{ "brakes_failure", Breakdown::brakesFailure },
|
||||
{ "control_failure", Breakdown::controlFailure } });
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
static const EnumMap<Breakdown> kBreakdownMap(
|
||||
{ { "safety_cut_out", Breakdown::safetyCutOut },
|
||||
{ "restraints_stuck_closed", Breakdown::restraintsStuckClosed },
|
||||
{ "restraints_stuck_open", Breakdown::restraintsStuckOpen },
|
||||
{ "doors_stuck_closed", Breakdown::doorsStuckClosed },
|
||||
{ "doors_stuck_open", Breakdown::doorsStuckOpen },
|
||||
{ "vehicle_malfunction", Breakdown::vehicleMalfunction },
|
||||
{ "brakes_failure", Breakdown::brakesFailure },
|
||||
{ "control_failure", Breakdown::controlFailure } });
|
||||
}
|
||||
|
||||
#endif
|
||||
+1543
-1538
File diff suppressed because it is too large.
Load diff
@@ -17,9 +17,25 @@
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
struct CoordsXYE;
|
||||
struct CoordsXYZ;
|
||||
struct CoordsXYZD;
|
||||
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
enum class RideSetSetting : uint8_t;
|
||||
}
|
||||
|
||||
enum class RideColourScheme : uint8_t;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
struct RideTypeDescriptor;
|
||||
struct TrackDrawerDescriptor;
|
||||
struct TrackDrawerEntry;
|
||||
struct TileElement;
|
||||
|
||||
enum class TrackElemType : uint16_t;
|
||||
|
||||
namespace TrackMetadata
|
||||
@@ -29,49 +45,30 @@ namespace OpenRCT2
|
||||
enum class TrackRoll : uint8_t;
|
||||
struct TypeOrCurve;
|
||||
} // namespace TrackMetadata
|
||||
} // namespace OpenRCT2
|
||||
|
||||
namespace OpenRCT2::GameActions
|
||||
{
|
||||
enum class RideSetSetting : uint8_t;
|
||||
}
|
||||
enum class TrackElementSetFlag : uint8_t
|
||||
{
|
||||
highlightOff,
|
||||
highlightOn,
|
||||
colourScheme,
|
||||
cableLiftOn,
|
||||
cableLiftOff,
|
||||
seatRotation,
|
||||
brakeClosed,
|
||||
brakeBoosterSpeed,
|
||||
};
|
||||
using TrackElementSetFlags = FlagHolder<uint16_t, TrackElementSetFlag>;
|
||||
|
||||
struct CoordsXYE;
|
||||
struct CoordsXYZ;
|
||||
struct CoordsXYZD;
|
||||
enum class TrackSelectionFlag : uint8_t
|
||||
{
|
||||
arrow,
|
||||
track,
|
||||
entranceOrExit,
|
||||
recheck,
|
||||
trackPlaceActionQueued,
|
||||
};
|
||||
using TrackSelectionFlags = FlagHolder<uint8_t, TrackSelectionFlag>;
|
||||
|
||||
struct Ride;
|
||||
struct RideTypeDescriptor;
|
||||
struct TrackDrawerDescriptor;
|
||||
struct TrackDrawerEntry;
|
||||
|
||||
enum class RideColourScheme : uint8_t;
|
||||
|
||||
enum class TrackElementSetFlag : uint8_t
|
||||
{
|
||||
highlightOff,
|
||||
highlightOn,
|
||||
colourScheme,
|
||||
cableLiftOn,
|
||||
cableLiftOff,
|
||||
seatRotation,
|
||||
brakeClosed,
|
||||
brakeBoosterSpeed,
|
||||
};
|
||||
using TrackElementSetFlags = FlagHolder<uint16_t, TrackElementSetFlag>;
|
||||
|
||||
enum class TrackSelectionFlag : uint8_t
|
||||
{
|
||||
arrow,
|
||||
track,
|
||||
entranceOrExit,
|
||||
recheck,
|
||||
trackPlaceActionQueued,
|
||||
};
|
||||
using TrackSelectionFlags = FlagHolder<uint8_t, TrackSelectionFlag>;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class RideConstructionState : uint8_t
|
||||
{
|
||||
state0,
|
||||
@@ -98,73 +95,72 @@ namespace OpenRCT2
|
||||
inverted,
|
||||
};
|
||||
using SelectedLiftAndInverted = FlagHolder<uint32_t, LiftHillAndInverted>;
|
||||
|
||||
extern money64 _currentTrackPrice;
|
||||
|
||||
extern TrackMetadata::TypeOrCurve _currentlySelectedTrack;
|
||||
extern RideConstructionState _rideConstructionState;
|
||||
extern RideId _currentRideIndex;
|
||||
|
||||
extern CoordsXYZ _currentTrackBegin;
|
||||
|
||||
extern uint8_t _currentTrackPieceDirection;
|
||||
extern TrackElemType _currentTrackPieceType;
|
||||
extern TrackSelectionFlags _currentTrackSelectionFlags;
|
||||
extern uint32_t _rideConstructionNextArrowPulse;
|
||||
extern TrackMetadata::TrackPitch _currentTrackPitchEnd;
|
||||
extern TrackMetadata::TrackRoll _currentTrackRollEnd;
|
||||
extern bool _currentTrackHasLiftHill;
|
||||
extern SelectedAlternative _currentTrackAlternative;
|
||||
extern TrackElemType _selectedTrackType;
|
||||
|
||||
extern TrackMetadata::TrackRoll _previousTrackRollEnd;
|
||||
extern TrackMetadata::TrackPitch _previousTrackPitchEnd;
|
||||
|
||||
extern CoordsXYZ _previousTrackPiece;
|
||||
|
||||
extern uint8_t _currentBrakeSpeed;
|
||||
extern RideColourScheme _currentColourScheme;
|
||||
extern uint8_t _currentSeatRotationAngle;
|
||||
|
||||
extern CoordsXYZD _unkF440C5;
|
||||
|
||||
extern uint8_t gRideEntranceExitPlaceType;
|
||||
extern RideId gRideEntranceExitPlaceRideIndex;
|
||||
extern StationIndex gRideEntranceExitPlaceStationIndex;
|
||||
extern RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState;
|
||||
extern uint8_t gRideEntranceExitPlaceDirection;
|
||||
|
||||
void RideEntranceExitPlaceProvisionalGhost();
|
||||
void RideEntranceExitRemoveGhost();
|
||||
|
||||
void RideConstructionRemoveGhosts();
|
||||
|
||||
void RideConstructionInvalidateCurrentTrack();
|
||||
|
||||
void RideConstructionSetDefaultNextPiece();
|
||||
|
||||
void RideSelectNextSection();
|
||||
void RideSelectPreviousSection();
|
||||
|
||||
bool RideModify(const CoordsXYE& input);
|
||||
|
||||
money64 SetOperatingSetting(RideId rideId, GameActions::RideSetSetting setting, uint8_t value);
|
||||
money64 SetOperatingSettingNested(
|
||||
RideId rideId, GameActions::RideSetSetting setting, uint8_t value, GameActions::CommandFlags flags);
|
||||
|
||||
bool RideSelectBackwardsFromFront();
|
||||
bool RideSelectForwardsFromBack();
|
||||
|
||||
void RideConstructionStart(Ride& ride);
|
||||
|
||||
TrackDrawerDescriptor getCurrentTrackDrawerDescriptor(const RideTypeDescriptor& rtd);
|
||||
TrackDrawerEntry getCurrentTrackDrawerEntry(const RideTypeDescriptor& rtd);
|
||||
TrackElemType GetTrackTypeFromCurve(
|
||||
TrackMetadata::TrackCurve curve, bool startsDiagonal, TrackMetadata::TrackPitch startSlope,
|
||||
TrackMetadata::TrackPitch endSlope, TrackMetadata::TrackRoll startBank, TrackMetadata::TrackRoll endBank);
|
||||
|
||||
std::optional<CoordsXYZ> GetTrackElementOriginAndApplyChanges(
|
||||
const CoordsXYZD& location, TrackElemType type, uint16_t extra_params, TileElement** output_element,
|
||||
TrackElementSetFlags flags);
|
||||
} // namespace OpenRCT2
|
||||
|
||||
extern money64 _currentTrackPrice;
|
||||
|
||||
extern OpenRCT2::TrackMetadata::TypeOrCurve _currentlySelectedTrack;
|
||||
extern OpenRCT2::RideConstructionState _rideConstructionState;
|
||||
extern RideId _currentRideIndex;
|
||||
|
||||
extern CoordsXYZ _currentTrackBegin;
|
||||
|
||||
extern uint8_t _currentTrackPieceDirection;
|
||||
extern OpenRCT2::TrackElemType _currentTrackPieceType;
|
||||
extern TrackSelectionFlags _currentTrackSelectionFlags;
|
||||
extern uint32_t _rideConstructionNextArrowPulse;
|
||||
extern OpenRCT2::TrackMetadata::TrackPitch _currentTrackPitchEnd;
|
||||
extern OpenRCT2::TrackMetadata::TrackRoll _currentTrackRollEnd;
|
||||
extern bool _currentTrackHasLiftHill;
|
||||
extern OpenRCT2::SelectedAlternative _currentTrackAlternative;
|
||||
extern OpenRCT2::TrackElemType _selectedTrackType;
|
||||
|
||||
extern OpenRCT2::TrackMetadata::TrackRoll _previousTrackRollEnd;
|
||||
extern OpenRCT2::TrackMetadata::TrackPitch _previousTrackPitchEnd;
|
||||
|
||||
extern CoordsXYZ _previousTrackPiece;
|
||||
|
||||
extern uint8_t _currentBrakeSpeed;
|
||||
extern RideColourScheme _currentColourScheme;
|
||||
extern uint8_t _currentSeatRotationAngle;
|
||||
|
||||
extern CoordsXYZD _unkF440C5;
|
||||
|
||||
extern uint8_t gRideEntranceExitPlaceType;
|
||||
extern RideId gRideEntranceExitPlaceRideIndex;
|
||||
extern StationIndex gRideEntranceExitPlaceStationIndex;
|
||||
extern OpenRCT2::RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState;
|
||||
extern uint8_t gRideEntranceExitPlaceDirection;
|
||||
|
||||
void RideEntranceExitPlaceProvisionalGhost();
|
||||
void RideEntranceExitRemoveGhost();
|
||||
|
||||
void RideConstructionRemoveGhosts();
|
||||
|
||||
void RideConstructionInvalidateCurrentTrack();
|
||||
|
||||
void RideConstructionSetDefaultNextPiece();
|
||||
|
||||
void RideSelectNextSection();
|
||||
void RideSelectPreviousSection();
|
||||
|
||||
bool RideModify(const CoordsXYE& input);
|
||||
|
||||
money64 SetOperatingSetting(RideId rideId, OpenRCT2::GameActions::RideSetSetting setting, uint8_t value);
|
||||
money64 SetOperatingSettingNested(
|
||||
RideId rideId, OpenRCT2::GameActions::RideSetSetting setting, uint8_t value, OpenRCT2::GameActions::CommandFlags flags);
|
||||
|
||||
bool RideSelectBackwardsFromFront();
|
||||
bool RideSelectForwardsFromBack();
|
||||
|
||||
void RideConstructionStart(Ride& ride);
|
||||
|
||||
TrackDrawerDescriptor getCurrentTrackDrawerDescriptor(const RideTypeDescriptor& rtd);
|
||||
TrackDrawerEntry getCurrentTrackDrawerEntry(const RideTypeDescriptor& rtd);
|
||||
OpenRCT2::TrackElemType GetTrackTypeFromCurve(
|
||||
OpenRCT2::TrackMetadata::TrackCurve curve, bool startsDiagonal, OpenRCT2::TrackMetadata::TrackPitch startSlope,
|
||||
OpenRCT2::TrackMetadata::TrackPitch endSlope, OpenRCT2::TrackMetadata::TrackRoll startBank,
|
||||
OpenRCT2::TrackMetadata::TrackRoll endBank);
|
||||
|
||||
std::optional<CoordsXYZ> GetTrackElementOriginAndApplyChanges(
|
||||
const CoordsXYZD& location, OpenRCT2::TrackElemType type, uint16_t extra_params, OpenRCT2::TileElement** output_element,
|
||||
TrackElementSetFlags flags);
|
||||
+332
-328
@@ -118,338 +118,342 @@
|
||||
#include "rtd/water/SplashBoats.h"
|
||||
#include "rtd/water/SubmarineRide.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Entity::Yaw;
|
||||
#include <iterator>
|
||||
|
||||
// clang-format off
|
||||
|
||||
const CarEntry kCableLiftVehicle = {
|
||||
.TabRotationMask = 31,
|
||||
.spacing = 0,
|
||||
.car_mass = 0,
|
||||
.tab_height = 0,
|
||||
.num_seats = 0,
|
||||
.spriteWidth = 0,
|
||||
.spriteHeightNegative = 0,
|
||||
.spriteHeightPositive = 0,
|
||||
.animation = CarEntryAnimation::none,
|
||||
.flags = {},
|
||||
.base_num_frames = 1,
|
||||
.base_image_id = 29110,
|
||||
.SpriteGroups = {
|
||||
/* SpriteGroupType::slopeFlat */ { 29110, SpritePrecision::sprites32},
|
||||
/* SpriteGroupType::slopes12 */ { 29142, SpritePrecision::sprites4},
|
||||
/* SpriteGroupType::slopes25 */ { 29150, SpritePrecision::sprites32},
|
||||
/* SpriteGroupType::slopes42 */ { 29214, SpritePrecision::sprites8},
|
||||
/* SpriteGroupType::slopes60 */ { 29230, SpritePrecision::sprites32},
|
||||
/* SpriteGroupType::slopes75 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopesLoop */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopeInverted */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes8 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes16 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes50 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::inlineTwists */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes12Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes8Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes8Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes16Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes16Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes12Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25InlineTwists */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::corkscrews */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::restraintAnimation */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::curvedLiftHillUp */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::curvedLiftHillDown */ { 0, SpritePrecision::none},
|
||||
},
|
||||
.NumCarImages = 0,
|
||||
.no_seating_rows = 0,
|
||||
.spinning_inertia = 0,
|
||||
.spinning_friction = 255,
|
||||
.friction_sound_id = Audio::SoundId::liftClassic,
|
||||
.ReversedCarIndex = 0,
|
||||
.soundRange = SoundRange::screamsMisc,
|
||||
.double_sound_frequency = 0,
|
||||
.powered_acceleration = 0,
|
||||
.powered_max_speed = 0,
|
||||
.PaintStyle = 0,
|
||||
.effect_visual = 1,
|
||||
.draw_order = 14,
|
||||
.num_vertical_frames_override = 0,
|
||||
.peep_loading_waypoint_segments = 0,
|
||||
.AnimationSpeed = 0,
|
||||
.AnimationFrames = 0,
|
||||
.SteamEffect = {
|
||||
.Longitudinal = 0,
|
||||
.Vertical = 0,
|
||||
},
|
||||
.spinningNumFrames = 0,
|
||||
};
|
||||
|
||||
/* rct2: 0x009A0AA0 */
|
||||
const uint16_t kRideFilmLength[3] = {
|
||||
5000, // MOUSE_TAILS
|
||||
6000, // STORM_CHASERS
|
||||
7000, // SPACE_RAIDERS
|
||||
};
|
||||
|
||||
const StringId kRideModeNames[] = {
|
||||
STR_RIDE_MODE_NORMAL,
|
||||
STR_RIDE_MODE_CONTINUOUS_CIRCUIT,
|
||||
STR_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE,
|
||||
STR_RIDE_MODE_POWERED_LAUNCH_PASSTHROUGH,
|
||||
STR_RIDE_MODE_SHUTTLE,
|
||||
STR_RIDE_MODE_BOAT_HIRE,
|
||||
STR_RIDE_MODE_UPWARD_LAUNCH,
|
||||
STR_RIDE_MODE_ROTATING_LIFT,
|
||||
STR_RIDE_MODE_STATION_TO_STATION,
|
||||
STR_RIDE_MODE_SINGLE_RIDE_PER_ADMISSION,
|
||||
STR_RIDE_MODE_UNLIMITED_RIDES_PER_ADMISSION,
|
||||
STR_RIDE_MODE_MAZE,
|
||||
STR_RIDE_MODE_RACE,
|
||||
STR_RIDE_MODE_DODGEMS,
|
||||
STR_RIDE_MODE_SWING,
|
||||
STR_RIDE_MODE_SHOP_STALL,
|
||||
STR_RIDE_MODE_ROTATION,
|
||||
STR_RIDE_MODE_FORWARD_ROTATION,
|
||||
STR_RIDE_MODE_BACKWARD_ROTATION,
|
||||
STR_RIDE_MODE_FILM_AVENGING_AVIATORS,
|
||||
STR_RIDE_MODE_3D_FILM_MOUSE_TAILS,
|
||||
STR_RIDE_MODE_SPACE_RINGS,
|
||||
STR_RIDE_MODE_BEGINNERS,
|
||||
STR_RIDE_MODE_LIM_POWERED_LAUNCH,
|
||||
STR_RIDE_MODE_FILM_THRILL_RIDERS,
|
||||
STR_RIDE_MODE_3D_FILM_STORM_CHASERS,
|
||||
STR_RIDE_MODE_3D_FILM_SPACE_RAIDERS,
|
||||
STR_RIDE_MODE_INTENSE,
|
||||
STR_RIDE_MODE_BERSERK,
|
||||
STR_RIDE_MODE_HAUNTED_HOUSE,
|
||||
STR_RIDE_MODE_CIRCUS_SHOW,
|
||||
STR_RIDE_MODE_DOWNWARD_LAUNCH,
|
||||
STR_RIDE_MODE_CROOKED_HOUSE,
|
||||
STR_RIDE_MODE_FREEFALL_DROP,
|
||||
STR_RIDE_MODE_CONTINUOUS_CIRCUIT_BLOCK_SECTIONED,
|
||||
STR_RIDE_MODE_POWERED_LAUNCH,
|
||||
STR_RIDE_MODE_POWERED_LAUNCH_BLOCK_SECTIONED_MODE,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
constexpr RideTypeDescriptor kRideTypeDescriptors[RIDE_TYPE_COUNT] = {
|
||||
/* RIDE_TYPE_SPIRAL_ROLLER_COASTER */ SpiralRollerCoasterRTD,
|
||||
/* RIDE_TYPE_STAND_UP_ROLLER_COASTER */ StandUpRollerCoasterRTD,
|
||||
/* RIDE_TYPE_SUSPENDED_SWINGING_COASTER */ SuspendedSwingingCoasterRTD,
|
||||
/* RIDE_TYPE_INVERTED_ROLLER_COASTER */ InvertedRollerCoasterRTD,
|
||||
/* RIDE_TYPE_JUNIOR_ROLLER_COASTER */ JuniorRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MINIATURE_RAILWAY */ MiniatureRailwayRTD,
|
||||
/* RIDE_TYPE_MONORAIL */ MonorailRTD,
|
||||
/* RIDE_TYPE_MINI_SUSPENDED_COASTER */ MiniSuspendedCoasterRTD,
|
||||
/* RIDE_TYPE_BOAT_HIRE */ BoatHireRTD,
|
||||
/* RIDE_TYPE_WOODEN_WILD_MOUSE */ WoodenWildMouseRTD,
|
||||
/* RIDE_TYPE_STEEPLECHASE */ SteeplechaseRTD,
|
||||
/* RIDE_TYPE_CAR_RIDE */ CarRideRTD,
|
||||
/* RIDE_TYPE_LAUNCHED_FREEFALL */ LaunchedFreefallRTD,
|
||||
/* RIDE_TYPE_BOBSLEIGH_COASTER */ BobsleighCoasterRTD,
|
||||
/* RIDE_TYPE_OBSERVATION_TOWER */ ObservationTowerRTD,
|
||||
/* RIDE_TYPE_LOOPING_ROLLER_COASTER */ LoopingRollerCoasterRTD,
|
||||
/* RIDE_TYPE_DINGHY_SLIDE */ DinghySlideRTD,
|
||||
/* RIDE_TYPE_MINE_TRAIN_COASTER */ MineTrainCoasterRTD,
|
||||
/* RIDE_TYPE_CHAIRLIFT */ ChairliftRTD,
|
||||
/* RIDE_TYPE_CORKSCREW_ROLLER_COASTER */ CorkscrewRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MAZE */ MazeRTD,
|
||||
/* RIDE_TYPE_SPIRAL_SLIDE */ SpiralSlideRTD,
|
||||
/* RIDE_TYPE_GO_KARTS */ GoKartsRTD,
|
||||
/* RIDE_TYPE_LOG_FLUME */ LogFlumeRTD,
|
||||
/* RIDE_TYPE_RIVER_RAPIDS */ RiverRapidsRTD,
|
||||
/* RIDE_TYPE_DODGEMS */ DodgemsRTD,
|
||||
/* RIDE_TYPE_SWINGING_SHIP */ SwingingShipRTD,
|
||||
/* RIDE_TYPE_SWINGING_INVERTER_SHIP */ SwingingInverterShipRTD,
|
||||
/* RIDE_TYPE_FOOD_STALL */ FoodStallRTD,
|
||||
/* RIDE_TYPE_1D */ kDummyRTD,
|
||||
/* RIDE_TYPE_DRINK_STALL */ DrinkStallRTD,
|
||||
/* RIDE_TYPE_1F */ kDummyRTD,
|
||||
/* RIDE_TYPE_SHOP */ ShopRTD,
|
||||
/* RIDE_TYPE_MERRY_GO_ROUND */ MerryGoRoundRTD,
|
||||
/* RIDE_TYPE_22 */ kDummyRTD,
|
||||
/* RIDE_TYPE_INFORMATION_KIOSK */ InformationKioskRTD,
|
||||
/* RIDE_TYPE_TOILETS */ ToiletsRTD,
|
||||
/* RIDE_TYPE_FERRIS_WHEEL */ FerrisWheelRTD,
|
||||
/* RIDE_TYPE_MOTION_SIMULATOR */ MotionSimulatorRTD,
|
||||
/* RIDE_TYPE_3D_CINEMA */ CinemaRTD,
|
||||
/* RIDE_TYPE_TOP_SPIN */ TopSpinRTD,
|
||||
/* RIDE_TYPE_SPACE_RINGS */ SpaceRingsRTD,
|
||||
/* RIDE_TYPE_REVERSE_FREEFALL_COASTER */ ReverseFreefallCoasterRTD,
|
||||
/* RIDE_TYPE_LIFT */ LiftRTD,
|
||||
/* RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER */ VerticalDropCoasterRTD,
|
||||
/* RIDE_TYPE_CASH_MACHINE */ CashMachineRTD,
|
||||
/* RIDE_TYPE_TWIST */ TwistRTD,
|
||||
/* RIDE_TYPE_HAUNTED_HOUSE */ HauntedHouseRTD,
|
||||
/* RIDE_TYPE_FIRST_AID */ FirstAidRTD,
|
||||
/* RIDE_TYPE_CIRCUS */ CircusRTD,
|
||||
/* RIDE_TYPE_GHOST_TRAIN */ GhostTrainRTD,
|
||||
/* RIDE_TYPE_TWISTER_ROLLER_COASTER */ TwisterRollerCoasterRTD,
|
||||
/* RIDE_TYPE_WOODEN_ROLLER_COASTER */ WoodenRollerCoasterRTD,
|
||||
/* RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER */ SideFrictionRollerCoasterRTD,
|
||||
/* RIDE_TYPE_STEEL_WILD_MOUSE */ SteelWildMouseRTD,
|
||||
/* RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER */ MultiDimensionRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER_ALT */ MultiDimensionRollerCoasterAltRTD,
|
||||
/* RIDE_TYPE_FLYING_ROLLER_COASTER */ FlyingRollerCoasterRTD,
|
||||
/* RIDE_TYPE_FLYING_ROLLER_COASTER_ALT */ FlyingRollerCoasterAltRTD,
|
||||
/* RIDE_TYPE_VIRGINIA_REEL */ VirginiaReelRTD,
|
||||
/* RIDE_TYPE_SPLASH_BOATS */ SplashBoatsRTD,
|
||||
/* RIDE_TYPE_MINI_HELICOPTERS */ MiniHelicoptersRTD,
|
||||
/* RIDE_TYPE_LAY_DOWN_ROLLER_COASTER */ LayDownRollerCoasterRTD,
|
||||
/* RIDE_TYPE_SUSPENDED_MONORAIL */ SuspendedMonorailRTD,
|
||||
/* RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT */ LayDownRollerCoasterAltRTD,
|
||||
/* RIDE_TYPE_REVERSER_ROLLER_COASTER */ ReverserRollerCoasterRTD,
|
||||
/* RIDE_TYPE_HEARTLINE_TWISTER_COASTER */ HeartlineTwisterCoasterRTD,
|
||||
/* RIDE_TYPE_MINI_GOLF */ MiniGolfRTD,
|
||||
/* RIDE_TYPE_GIGA_COASTER */ GigaCoasterRTD,
|
||||
/* RIDE_TYPE_ROTO_DROP */ RotoDropRTD,
|
||||
/* RIDE_TYPE_FLYING_SAUCERS */ FlyingSaucersRTD,
|
||||
/* RIDE_TYPE_CROOKED_HOUSE */ CrookedHouseRTD,
|
||||
/* RIDE_TYPE_MONORAIL_CYCLES */ MonorailCyclesRTD,
|
||||
/* RIDE_TYPE_COMPACT_INVERTED_COASTER */ CompactInvertedCoasterRTD,
|
||||
/* RIDE_TYPE_WATER_COASTER */ WaterCoasterRTD,
|
||||
/* RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER */ AirPoweredVerticalCoasterRTD,
|
||||
/* RIDE_TYPE_INVERTED_HAIRPIN_COASTER */ InvertedHairpinCoasterRTD,
|
||||
/* RIDE_TYPE_MAGIC_CARPET */ MagicCarpetRTD,
|
||||
/* RIDE_TYPE_SUBMARINE_RIDE */ SubmarineRideRTD,
|
||||
/* RIDE_TYPE_RIVER_RAFTS */ RiverRaftsRTD,
|
||||
/* RIDE_TYPE_50 */ kDummyRTD,
|
||||
/* RIDE_TYPE_ENTERPRISE */ EnterpriseRTD,
|
||||
/* RIDE_TYPE_52 */ kDummyRTD,
|
||||
/* RIDE_TYPE_53 */ kDummyRTD,
|
||||
/* RIDE_TYPE_54 */ kDummyRTD,
|
||||
/* RIDE_TYPE_55 */ kDummyRTD,
|
||||
/* RIDE_TYPE_INVERTED_IMPULSE_COASTER */ InvertedImpulseCoasterRTD,
|
||||
/* RIDE_TYPE_MINI_ROLLER_COASTER */ MiniRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MINE_RIDE */ MineRideRTD,
|
||||
/* RIDE_TYPE_59 */ kDummyRTD,
|
||||
/* RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER */ LIMLaunchedRollerCoasterRTD,
|
||||
/* RIDE_TYPE_HYPERCOASTER, */ HypercoasterRTD,
|
||||
/* RIDE_TYPE_HYPER_TWISTER, */ HyperTwisterRTD,
|
||||
/* RIDE_TYPE_MONSTER_TRUCKS, */ MonsterTrucksRTD,
|
||||
/* RIDE_TYPE_SPINNING_WILD_MOUSE, */ SpinningWildMouseRTD,
|
||||
/* RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER, */ ClassicMiniRollerCoasterRTD,
|
||||
/* RIDE_TYPE_HYBRID_COASTER */ HybridCoasterRTD,
|
||||
/* RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER */ SingleRailRollerCoasterRTD,
|
||||
/* RIDE_TYPE_ALPINE_COASTER */ AlpineCoasterRTD,
|
||||
/* RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER */ ClassicWoodenRollerCoasterRTD,
|
||||
/* RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER */ ClassicStandUpRollerCoasterRTD,
|
||||
/* RIDE_TYPE_LSM_LAUNCHED_ROLLER_COASTER */ LSMLaunchedRollerCoasterRTD,
|
||||
/* RIDE_TYPE_CLASSIC_WOODEN_TWISTER_ROLLER_COASTER */ ClassicWoodenTwisterRollerCoasterRTD,
|
||||
};
|
||||
|
||||
bool RideTypeDescriptor::SupportsTrackGroup(const TrackGroup trackGroup) const
|
||||
namespace OpenRCT2
|
||||
{
|
||||
return TrackPaintFunctions.Regular.SupportsTrackGroup(trackGroup);
|
||||
}
|
||||
using namespace OpenRCT2::Entity::Yaw;
|
||||
|
||||
ResearchCategory RideTypeDescriptor::GetResearchCategory() const
|
||||
{
|
||||
switch (Category)
|
||||
// clang-format off
|
||||
|
||||
const CarEntry kCableLiftVehicle = {
|
||||
.TabRotationMask = 31,
|
||||
.spacing = 0,
|
||||
.car_mass = 0,
|
||||
.tab_height = 0,
|
||||
.num_seats = 0,
|
||||
.spriteWidth = 0,
|
||||
.spriteHeightNegative = 0,
|
||||
.spriteHeightPositive = 0,
|
||||
.animation = CarEntryAnimation::none,
|
||||
.flags = {},
|
||||
.base_num_frames = 1,
|
||||
.base_image_id = 29110,
|
||||
.SpriteGroups = {
|
||||
/* SpriteGroupType::slopeFlat */ { 29110, SpritePrecision::sprites32},
|
||||
/* SpriteGroupType::slopes12 */ { 29142, SpritePrecision::sprites4},
|
||||
/* SpriteGroupType::slopes25 */ { 29150, SpritePrecision::sprites32},
|
||||
/* SpriteGroupType::slopes42 */ { 29214, SpritePrecision::sprites8},
|
||||
/* SpriteGroupType::slopes60 */ { 29230, SpritePrecision::sprites32},
|
||||
/* SpriteGroupType::slopes75 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopesLoop */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopeInverted */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes8 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes16 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes50 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::flatBanked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::inlineTwists */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes12Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes8Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes8Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes16Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes16Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes12Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25Banked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes25InlineTwists */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes42Banked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked22 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked45 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked67 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::slopes60Banked90 */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::corkscrews */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::restraintAnimation */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::curvedLiftHillUp */ { 0, SpritePrecision::none},
|
||||
/* SpriteGroupType::curvedLiftHillDown */ { 0, SpritePrecision::none},
|
||||
},
|
||||
.NumCarImages = 0,
|
||||
.no_seating_rows = 0,
|
||||
.spinning_inertia = 0,
|
||||
.spinning_friction = 255,
|
||||
.friction_sound_id = Audio::SoundId::liftClassic,
|
||||
.ReversedCarIndex = 0,
|
||||
.soundRange = SoundRange::screamsMisc,
|
||||
.double_sound_frequency = 0,
|
||||
.powered_acceleration = 0,
|
||||
.powered_max_speed = 0,
|
||||
.PaintStyle = 0,
|
||||
.effect_visual = 1,
|
||||
.draw_order = 14,
|
||||
.num_vertical_frames_override = 0,
|
||||
.peep_loading_waypoint_segments = 0,
|
||||
.AnimationSpeed = 0,
|
||||
.AnimationFrames = 0,
|
||||
.SteamEffect = {
|
||||
.Longitudinal = 0,
|
||||
.Vertical = 0,
|
||||
},
|
||||
.spinningNumFrames = 0,
|
||||
};
|
||||
|
||||
/* rct2: 0x009A0AA0 */
|
||||
const uint16_t kRideFilmLength[3] = {
|
||||
5000, // MOUSE_TAILS
|
||||
6000, // STORM_CHASERS
|
||||
7000, // SPACE_RAIDERS
|
||||
};
|
||||
|
||||
const StringId kRideModeNames[] = {
|
||||
STR_RIDE_MODE_NORMAL,
|
||||
STR_RIDE_MODE_CONTINUOUS_CIRCUIT,
|
||||
STR_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE,
|
||||
STR_RIDE_MODE_POWERED_LAUNCH_PASSTHROUGH,
|
||||
STR_RIDE_MODE_SHUTTLE,
|
||||
STR_RIDE_MODE_BOAT_HIRE,
|
||||
STR_RIDE_MODE_UPWARD_LAUNCH,
|
||||
STR_RIDE_MODE_ROTATING_LIFT,
|
||||
STR_RIDE_MODE_STATION_TO_STATION,
|
||||
STR_RIDE_MODE_SINGLE_RIDE_PER_ADMISSION,
|
||||
STR_RIDE_MODE_UNLIMITED_RIDES_PER_ADMISSION,
|
||||
STR_RIDE_MODE_MAZE,
|
||||
STR_RIDE_MODE_RACE,
|
||||
STR_RIDE_MODE_DODGEMS,
|
||||
STR_RIDE_MODE_SWING,
|
||||
STR_RIDE_MODE_SHOP_STALL,
|
||||
STR_RIDE_MODE_ROTATION,
|
||||
STR_RIDE_MODE_FORWARD_ROTATION,
|
||||
STR_RIDE_MODE_BACKWARD_ROTATION,
|
||||
STR_RIDE_MODE_FILM_AVENGING_AVIATORS,
|
||||
STR_RIDE_MODE_3D_FILM_MOUSE_TAILS,
|
||||
STR_RIDE_MODE_SPACE_RINGS,
|
||||
STR_RIDE_MODE_BEGINNERS,
|
||||
STR_RIDE_MODE_LIM_POWERED_LAUNCH,
|
||||
STR_RIDE_MODE_FILM_THRILL_RIDERS,
|
||||
STR_RIDE_MODE_3D_FILM_STORM_CHASERS,
|
||||
STR_RIDE_MODE_3D_FILM_SPACE_RAIDERS,
|
||||
STR_RIDE_MODE_INTENSE,
|
||||
STR_RIDE_MODE_BERSERK,
|
||||
STR_RIDE_MODE_HAUNTED_HOUSE,
|
||||
STR_RIDE_MODE_CIRCUS_SHOW,
|
||||
STR_RIDE_MODE_DOWNWARD_LAUNCH,
|
||||
STR_RIDE_MODE_CROOKED_HOUSE,
|
||||
STR_RIDE_MODE_FREEFALL_DROP,
|
||||
STR_RIDE_MODE_CONTINUOUS_CIRCUIT_BLOCK_SECTIONED,
|
||||
STR_RIDE_MODE_POWERED_LAUNCH,
|
||||
STR_RIDE_MODE_POWERED_LAUNCH_BLOCK_SECTIONED_MODE,
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
constexpr RideTypeDescriptor kRideTypeDescriptors[RIDE_TYPE_COUNT] = {
|
||||
/* RIDE_TYPE_SPIRAL_ROLLER_COASTER */ SpiralRollerCoasterRTD,
|
||||
/* RIDE_TYPE_STAND_UP_ROLLER_COASTER */ StandUpRollerCoasterRTD,
|
||||
/* RIDE_TYPE_SUSPENDED_SWINGING_COASTER */ SuspendedSwingingCoasterRTD,
|
||||
/* RIDE_TYPE_INVERTED_ROLLER_COASTER */ InvertedRollerCoasterRTD,
|
||||
/* RIDE_TYPE_JUNIOR_ROLLER_COASTER */ JuniorRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MINIATURE_RAILWAY */ MiniatureRailwayRTD,
|
||||
/* RIDE_TYPE_MONORAIL */ MonorailRTD,
|
||||
/* RIDE_TYPE_MINI_SUSPENDED_COASTER */ MiniSuspendedCoasterRTD,
|
||||
/* RIDE_TYPE_BOAT_HIRE */ BoatHireRTD,
|
||||
/* RIDE_TYPE_WOODEN_WILD_MOUSE */ WoodenWildMouseRTD,
|
||||
/* RIDE_TYPE_STEEPLECHASE */ SteeplechaseRTD,
|
||||
/* RIDE_TYPE_CAR_RIDE */ CarRideRTD,
|
||||
/* RIDE_TYPE_LAUNCHED_FREEFALL */ LaunchedFreefallRTD,
|
||||
/* RIDE_TYPE_BOBSLEIGH_COASTER */ BobsleighCoasterRTD,
|
||||
/* RIDE_TYPE_OBSERVATION_TOWER */ ObservationTowerRTD,
|
||||
/* RIDE_TYPE_LOOPING_ROLLER_COASTER */ LoopingRollerCoasterRTD,
|
||||
/* RIDE_TYPE_DINGHY_SLIDE */ DinghySlideRTD,
|
||||
/* RIDE_TYPE_MINE_TRAIN_COASTER */ MineTrainCoasterRTD,
|
||||
/* RIDE_TYPE_CHAIRLIFT */ ChairliftRTD,
|
||||
/* RIDE_TYPE_CORKSCREW_ROLLER_COASTER */ CorkscrewRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MAZE */ MazeRTD,
|
||||
/* RIDE_TYPE_SPIRAL_SLIDE */ SpiralSlideRTD,
|
||||
/* RIDE_TYPE_GO_KARTS */ GoKartsRTD,
|
||||
/* RIDE_TYPE_LOG_FLUME */ LogFlumeRTD,
|
||||
/* RIDE_TYPE_RIVER_RAPIDS */ RiverRapidsRTD,
|
||||
/* RIDE_TYPE_DODGEMS */ DodgemsRTD,
|
||||
/* RIDE_TYPE_SWINGING_SHIP */ SwingingShipRTD,
|
||||
/* RIDE_TYPE_SWINGING_INVERTER_SHIP */ SwingingInverterShipRTD,
|
||||
/* RIDE_TYPE_FOOD_STALL */ FoodStallRTD,
|
||||
/* RIDE_TYPE_1D */ kDummyRTD,
|
||||
/* RIDE_TYPE_DRINK_STALL */ DrinkStallRTD,
|
||||
/* RIDE_TYPE_1F */ kDummyRTD,
|
||||
/* RIDE_TYPE_SHOP */ ShopRTD,
|
||||
/* RIDE_TYPE_MERRY_GO_ROUND */ MerryGoRoundRTD,
|
||||
/* RIDE_TYPE_22 */ kDummyRTD,
|
||||
/* RIDE_TYPE_INFORMATION_KIOSK */ InformationKioskRTD,
|
||||
/* RIDE_TYPE_TOILETS */ ToiletsRTD,
|
||||
/* RIDE_TYPE_FERRIS_WHEEL */ FerrisWheelRTD,
|
||||
/* RIDE_TYPE_MOTION_SIMULATOR */ MotionSimulatorRTD,
|
||||
/* RIDE_TYPE_3D_CINEMA */ CinemaRTD,
|
||||
/* RIDE_TYPE_TOP_SPIN */ TopSpinRTD,
|
||||
/* RIDE_TYPE_SPACE_RINGS */ SpaceRingsRTD,
|
||||
/* RIDE_TYPE_REVERSE_FREEFALL_COASTER */ ReverseFreefallCoasterRTD,
|
||||
/* RIDE_TYPE_LIFT */ LiftRTD,
|
||||
/* RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER */ VerticalDropCoasterRTD,
|
||||
/* RIDE_TYPE_CASH_MACHINE */ CashMachineRTD,
|
||||
/* RIDE_TYPE_TWIST */ TwistRTD,
|
||||
/* RIDE_TYPE_HAUNTED_HOUSE */ HauntedHouseRTD,
|
||||
/* RIDE_TYPE_FIRST_AID */ FirstAidRTD,
|
||||
/* RIDE_TYPE_CIRCUS */ CircusRTD,
|
||||
/* RIDE_TYPE_GHOST_TRAIN */ GhostTrainRTD,
|
||||
/* RIDE_TYPE_TWISTER_ROLLER_COASTER */ TwisterRollerCoasterRTD,
|
||||
/* RIDE_TYPE_WOODEN_ROLLER_COASTER */ WoodenRollerCoasterRTD,
|
||||
/* RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER */ SideFrictionRollerCoasterRTD,
|
||||
/* RIDE_TYPE_STEEL_WILD_MOUSE */ SteelWildMouseRTD,
|
||||
/* RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER */ MultiDimensionRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER_ALT */ MultiDimensionRollerCoasterAltRTD,
|
||||
/* RIDE_TYPE_FLYING_ROLLER_COASTER */ FlyingRollerCoasterRTD,
|
||||
/* RIDE_TYPE_FLYING_ROLLER_COASTER_ALT */ FlyingRollerCoasterAltRTD,
|
||||
/* RIDE_TYPE_VIRGINIA_REEL */ VirginiaReelRTD,
|
||||
/* RIDE_TYPE_SPLASH_BOATS */ SplashBoatsRTD,
|
||||
/* RIDE_TYPE_MINI_HELICOPTERS */ MiniHelicoptersRTD,
|
||||
/* RIDE_TYPE_LAY_DOWN_ROLLER_COASTER */ LayDownRollerCoasterRTD,
|
||||
/* RIDE_TYPE_SUSPENDED_MONORAIL */ SuspendedMonorailRTD,
|
||||
/* RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT */ LayDownRollerCoasterAltRTD,
|
||||
/* RIDE_TYPE_REVERSER_ROLLER_COASTER */ ReverserRollerCoasterRTD,
|
||||
/* RIDE_TYPE_HEARTLINE_TWISTER_COASTER */ HeartlineTwisterCoasterRTD,
|
||||
/* RIDE_TYPE_MINI_GOLF */ MiniGolfRTD,
|
||||
/* RIDE_TYPE_GIGA_COASTER */ GigaCoasterRTD,
|
||||
/* RIDE_TYPE_ROTO_DROP */ RotoDropRTD,
|
||||
/* RIDE_TYPE_FLYING_SAUCERS */ FlyingSaucersRTD,
|
||||
/* RIDE_TYPE_CROOKED_HOUSE */ CrookedHouseRTD,
|
||||
/* RIDE_TYPE_MONORAIL_CYCLES */ MonorailCyclesRTD,
|
||||
/* RIDE_TYPE_COMPACT_INVERTED_COASTER */ CompactInvertedCoasterRTD,
|
||||
/* RIDE_TYPE_WATER_COASTER */ WaterCoasterRTD,
|
||||
/* RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER */ AirPoweredVerticalCoasterRTD,
|
||||
/* RIDE_TYPE_INVERTED_HAIRPIN_COASTER */ InvertedHairpinCoasterRTD,
|
||||
/* RIDE_TYPE_MAGIC_CARPET */ MagicCarpetRTD,
|
||||
/* RIDE_TYPE_SUBMARINE_RIDE */ SubmarineRideRTD,
|
||||
/* RIDE_TYPE_RIVER_RAFTS */ RiverRaftsRTD,
|
||||
/* RIDE_TYPE_50 */ kDummyRTD,
|
||||
/* RIDE_TYPE_ENTERPRISE */ EnterpriseRTD,
|
||||
/* RIDE_TYPE_52 */ kDummyRTD,
|
||||
/* RIDE_TYPE_53 */ kDummyRTD,
|
||||
/* RIDE_TYPE_54 */ kDummyRTD,
|
||||
/* RIDE_TYPE_55 */ kDummyRTD,
|
||||
/* RIDE_TYPE_INVERTED_IMPULSE_COASTER */ InvertedImpulseCoasterRTD,
|
||||
/* RIDE_TYPE_MINI_ROLLER_COASTER */ MiniRollerCoasterRTD,
|
||||
/* RIDE_TYPE_MINE_RIDE */ MineRideRTD,
|
||||
/* RIDE_TYPE_59 */ kDummyRTD,
|
||||
/* RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER */ LIMLaunchedRollerCoasterRTD,
|
||||
/* RIDE_TYPE_HYPERCOASTER, */ HypercoasterRTD,
|
||||
/* RIDE_TYPE_HYPER_TWISTER, */ HyperTwisterRTD,
|
||||
/* RIDE_TYPE_MONSTER_TRUCKS, */ MonsterTrucksRTD,
|
||||
/* RIDE_TYPE_SPINNING_WILD_MOUSE, */ SpinningWildMouseRTD,
|
||||
/* RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER, */ ClassicMiniRollerCoasterRTD,
|
||||
/* RIDE_TYPE_HYBRID_COASTER */ HybridCoasterRTD,
|
||||
/* RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER */ SingleRailRollerCoasterRTD,
|
||||
/* RIDE_TYPE_ALPINE_COASTER */ AlpineCoasterRTD,
|
||||
/* RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER */ ClassicWoodenRollerCoasterRTD,
|
||||
/* RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER */ ClassicStandUpRollerCoasterRTD,
|
||||
/* RIDE_TYPE_LSM_LAUNCHED_ROLLER_COASTER */ LSMLaunchedRollerCoasterRTD,
|
||||
/* RIDE_TYPE_CLASSIC_WOODEN_TWISTER_ROLLER_COASTER */ ClassicWoodenTwisterRollerCoasterRTD,
|
||||
};
|
||||
|
||||
bool RideTypeDescriptor::SupportsTrackGroup(const TrackGroup trackGroup) const
|
||||
{
|
||||
case RideCategory::transport:
|
||||
return ResearchCategory::transport;
|
||||
case RideCategory::gentle:
|
||||
return ResearchCategory::gentle;
|
||||
case RideCategory::rollerCoaster:
|
||||
return ResearchCategory::rollercoaster;
|
||||
case RideCategory::thrill:
|
||||
return ResearchCategory::thrill;
|
||||
case RideCategory::water:
|
||||
return ResearchCategory::water;
|
||||
case RideCategory::shop:
|
||||
return ResearchCategory::shop;
|
||||
case RideCategory::none:
|
||||
break;
|
||||
}
|
||||
LOG_ERROR("Cannot get Research Category of invalid RideCategory");
|
||||
return ResearchCategory::transport;
|
||||
}
|
||||
|
||||
bool RideTypeDescriptor::SupportsRideMode(RideMode rideMode) const
|
||||
{
|
||||
return RideModes & EnumToFlag(rideMode);
|
||||
}
|
||||
|
||||
static RideTrackGroups _enabledRideGroups = {};
|
||||
static RideTrackGroups _disabledRideGroups = {};
|
||||
|
||||
bool IsTrackEnabled(TrackGroup trackGroup)
|
||||
{
|
||||
return _enabledRideGroups.get(EnumValue(trackGroup));
|
||||
}
|
||||
|
||||
void UpdateEnabledRideGroups(TrackDrawerDescriptor trackDrawerDescriptor)
|
||||
{
|
||||
trackDrawerDescriptor.Regular.GetAvailableTrackGroups(_enabledRideGroups);
|
||||
|
||||
if (!getGameState().cheats.enableAllDrawableTrackPieces)
|
||||
{
|
||||
_enabledRideGroups &= ~_disabledRideGroups;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateDisabledRideGroups(const RideTrackGroups& res)
|
||||
{
|
||||
_disabledRideGroups = res;
|
||||
}
|
||||
|
||||
void TrackDrawerEntry::GetAvailableTrackGroups(RideTrackGroups& res) const
|
||||
{
|
||||
res = enabledTrackGroups;
|
||||
if (getGameState().cheats.enableAllDrawableTrackPieces)
|
||||
res |= extraTrackGroups;
|
||||
}
|
||||
|
||||
bool TrackDrawerEntry::SupportsTrackGroup(const TrackGroup trackGroup) const
|
||||
{
|
||||
return enabledTrackGroups.get(EnumValue(trackGroup))
|
||||
|| (getGameState().cheats.enableAllDrawableTrackPieces && extraTrackGroups.get(EnumValue(trackGroup)));
|
||||
}
|
||||
|
||||
bool TrackDrawerDescriptor::HasCoveredPieces() const
|
||||
{
|
||||
return Covered.enabledTrackGroups.count() > 0;
|
||||
}
|
||||
|
||||
TrackDrawerDescriptor getTrackDrawerDescriptor(const RideTypeDescriptor& rtd, bool isInverted)
|
||||
{
|
||||
return isInverted ? rtd.InvertedTrackPaintFunctions : rtd.TrackPaintFunctions;
|
||||
}
|
||||
|
||||
TrackDrawerEntry getTrackDrawerEntry(const RideTypeDescriptor& rtd, bool isInverted, bool isCovered)
|
||||
{
|
||||
auto descriptor = getTrackDrawerDescriptor(rtd, isInverted);
|
||||
|
||||
if (isCovered)
|
||||
{
|
||||
return descriptor.Covered;
|
||||
return TrackPaintFunctions.Regular.SupportsTrackGroup(trackGroup);
|
||||
}
|
||||
|
||||
return descriptor.Regular;
|
||||
}
|
||||
ResearchCategory RideTypeDescriptor::GetResearchCategory() const
|
||||
{
|
||||
switch (Category)
|
||||
{
|
||||
case RideCategory::transport:
|
||||
return ResearchCategory::transport;
|
||||
case RideCategory::gentle:
|
||||
return ResearchCategory::gentle;
|
||||
case RideCategory::rollerCoaster:
|
||||
return ResearchCategory::rollercoaster;
|
||||
case RideCategory::thrill:
|
||||
return ResearchCategory::thrill;
|
||||
case RideCategory::water:
|
||||
return ResearchCategory::water;
|
||||
case RideCategory::shop:
|
||||
return ResearchCategory::shop;
|
||||
case RideCategory::none:
|
||||
break;
|
||||
}
|
||||
LOG_ERROR("Cannot get Research Category of invalid RideCategory");
|
||||
return ResearchCategory::transport;
|
||||
}
|
||||
|
||||
int32_t RideTypeDescriptor::GetUnifiedBoosterSpeed(int32_t relativeSpeed) const
|
||||
{
|
||||
// BoosterSpeedFactor has valid values of 1, 2, 4 representing a 1/2, 1, and 2 multiplier of legacy speed to unified
|
||||
// speed.
|
||||
return relativeSpeed * LegacyBoosterSettings.BoosterSpeedFactor / 2;
|
||||
}
|
||||
bool RideTypeDescriptor::SupportsRideMode(RideMode rideMode) const
|
||||
{
|
||||
return RideModes & EnumToFlag(rideMode);
|
||||
}
|
||||
|
||||
static RideTrackGroups _enabledRideGroups = {};
|
||||
static RideTrackGroups _disabledRideGroups = {};
|
||||
|
||||
bool IsTrackEnabled(TrackGroup trackGroup)
|
||||
{
|
||||
return _enabledRideGroups.get(EnumValue(trackGroup));
|
||||
}
|
||||
|
||||
void UpdateEnabledRideGroups(TrackDrawerDescriptor trackDrawerDescriptor)
|
||||
{
|
||||
trackDrawerDescriptor.Regular.GetAvailableTrackGroups(_enabledRideGroups);
|
||||
|
||||
if (!getGameState().cheats.enableAllDrawableTrackPieces)
|
||||
{
|
||||
_enabledRideGroups &= ~_disabledRideGroups;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateDisabledRideGroups(const RideTrackGroups& res)
|
||||
{
|
||||
_disabledRideGroups = res;
|
||||
}
|
||||
|
||||
void TrackDrawerEntry::GetAvailableTrackGroups(RideTrackGroups& res) const
|
||||
{
|
||||
res = enabledTrackGroups;
|
||||
if (getGameState().cheats.enableAllDrawableTrackPieces)
|
||||
res |= extraTrackGroups;
|
||||
}
|
||||
|
||||
bool TrackDrawerEntry::SupportsTrackGroup(const TrackGroup trackGroup) const
|
||||
{
|
||||
return enabledTrackGroups.get(EnumValue(trackGroup))
|
||||
|| (getGameState().cheats.enableAllDrawableTrackPieces && extraTrackGroups.get(EnumValue(trackGroup)));
|
||||
}
|
||||
|
||||
bool TrackDrawerDescriptor::HasCoveredPieces() const
|
||||
{
|
||||
return Covered.enabledTrackGroups.count() > 0;
|
||||
}
|
||||
|
||||
TrackDrawerDescriptor getTrackDrawerDescriptor(const RideTypeDescriptor& rtd, bool isInverted)
|
||||
{
|
||||
return isInverted ? rtd.InvertedTrackPaintFunctions : rtd.TrackPaintFunctions;
|
||||
}
|
||||
|
||||
TrackDrawerEntry getTrackDrawerEntry(const RideTypeDescriptor& rtd, bool isInverted, bool isCovered)
|
||||
{
|
||||
auto descriptor = getTrackDrawerDescriptor(rtd, isInverted);
|
||||
|
||||
if (isCovered)
|
||||
{
|
||||
return descriptor.Covered;
|
||||
}
|
||||
|
||||
return descriptor.Regular;
|
||||
}
|
||||
|
||||
int32_t RideTypeDescriptor::GetUnifiedBoosterSpeed(int32_t relativeSpeed) const
|
||||
{
|
||||
// BoosterSpeedFactor has valid values of 1, 2, 4 representing a 1/2, 1, and 2 multiplier of legacy speed to unified
|
||||
// speed.
|
||||
return relativeSpeed * LegacyBoosterSettings.BoosterSpeedFactor / 2;
|
||||
}
|
||||
} // namespace OpenRCT2
|
||||
+652
-647
File diff suppressed because it is too large.
Load diff
@@ -137,4 +137,7 @@ struct RideObjectEntry
|
||||
}
|
||||
};
|
||||
|
||||
RideNaming GetRideNaming(ride_type_t rideType, const RideObjectEntry* rideEntry);
|
||||
namespace OpenRCT2
|
||||
{
|
||||
RideNaming GetRideNaming(ride_type_t rideType, const RideObjectEntry* rideEntry);
|
||||
}
|
||||
+2095
-2082
File diff suppressed because it is too large.
Load diff
@@ -15,11 +15,12 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class TrackElemType : uint16_t;
|
||||
|
||||
struct Ride;
|
||||
|
||||
using RideRating_t = fixed16_2dp;
|
||||
namespace RideRating
|
||||
{
|
||||
@@ -73,9 +74,12 @@ namespace OpenRCT2
|
||||
void UpdateRide(const Ride& ride);
|
||||
void UpdateAll();
|
||||
} // namespace RideRating
|
||||
} // namespace OpenRCT2
|
||||
|
||||
// Special Track Element Adjustment functions for RTDs
|
||||
void SpecialTrackElementRatingsAjustment_Default(const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea);
|
||||
void SpecialTrackElementRatingsAjustment_GhostTrain(const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea);
|
||||
void SpecialTrackElementRatingsAjustment_LogFlume(const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea);
|
||||
// Special Track Element Adjustment functions for RTDs
|
||||
void SpecialTrackElementRatingsAdjustment_Default(
|
||||
const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea);
|
||||
void SpecialTrackElementRatingsAdjustment_GhostTrain(
|
||||
const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea);
|
||||
void SpecialTrackElementRatingsAdjustment_LogFlume(
|
||||
const Ride& ride, int32_t& excitement, int32_t& intensity, int32_t& nausea);
|
||||
} // namespace OpenRCT2
|
||||
@@ -16,7 +16,10 @@
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
struct Ride;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
}
|
||||
|
||||
using ride_type_t = uint16_t;
|
||||
static ride_type_t constexpr kRideTypeNull = 0xFF;
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
#include "../core/Money.hpp"
|
||||
#include "../entity/Litter.h"
|
||||
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class PeepThoughtType : uint8_t;
|
||||
}
|
||||
|
||||
struct Ride;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
enum class ShopItem : uint8_t
|
||||
{
|
||||
@@ -131,7 +131,7 @@ enum
|
||||
SHOP_ITEM_FLAG_IS_RECOLOURABLE = (1 << 5),
|
||||
};
|
||||
|
||||
money64 ShopItemGetCommonPrice(Ride* forRide, ShopItem shopItem);
|
||||
money64 ShopItemGetCommonPrice(OpenRCT2::Ride* forRide, ShopItem shopItem);
|
||||
bool ShopItemHasCommonPrice(ShopItem shopItem);
|
||||
|
||||
const ShopItemDescriptor& GetShopItemDescriptor(ShopItem item);
|
||||
+338
-337
@@ -19,409 +19,410 @@
|
||||
#include "RideEntry.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex);
|
||||
static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex);
|
||||
static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex);
|
||||
static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex);
|
||||
static void RideRaceInitVehicleSpeeds(const Ride& ride);
|
||||
static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight);
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006ABFFB
|
||||
*/
|
||||
void RideUpdateStation(Ride& ride, StationIndex stationIndex)
|
||||
namespace OpenRCT2
|
||||
{
|
||||
if (ride.getStation(stationIndex).Start.IsNull())
|
||||
return;
|
||||
static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex);
|
||||
static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex);
|
||||
static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex);
|
||||
static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex);
|
||||
static void RideRaceInitVehicleSpeeds(const Ride& ride);
|
||||
static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight);
|
||||
|
||||
switch (ride.mode)
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006ABFFB
|
||||
*/
|
||||
void RideUpdateStation(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
case RideMode::race:
|
||||
RideUpdateStationRace(ride, stationIndex);
|
||||
break;
|
||||
case RideMode::dodgems:
|
||||
RideUpdateStationDodgems(ride, stationIndex);
|
||||
break;
|
||||
case RideMode::continuousCircuitBlockSectioned:
|
||||
case RideMode::poweredLaunchBlockSectioned:
|
||||
RideUpdateStationBlockSection(ride, stationIndex);
|
||||
break;
|
||||
default:
|
||||
RideUpdateStationNormal(ride, stationIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ride.getStation(stationIndex).Start.IsNull())
|
||||
return;
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC0A1
|
||||
*/
|
||||
static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
|
||||
if ((ride.status == RideStatus::closed && ride.numRiders == 0)
|
||||
|| (tileElement != nullptr && tileElement->asTrack()->IsBrakeClosed()))
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
|
||||
if ((station.Depart & kStationDepartFlag) || (tileElement != nullptr && tileElement->asTrack()->HasGreenLight()))
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(station.Depart & kStationDepartFlag))
|
||||
switch (ride.mode)
|
||||
{
|
||||
station.Depart |= kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
else if (tileElement != nullptr && tileElement->asTrack()->HasGreenLight())
|
||||
{
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
case RideMode::race:
|
||||
RideUpdateStationRace(ride, stationIndex);
|
||||
break;
|
||||
case RideMode::dodgems:
|
||||
RideUpdateStationDodgems(ride, stationIndex);
|
||||
break;
|
||||
case RideMode::continuousCircuitBlockSectioned:
|
||||
case RideMode::poweredLaunchBlockSectioned:
|
||||
RideUpdateStationBlockSection(ride, stationIndex);
|
||||
break;
|
||||
default:
|
||||
RideUpdateStationNormal(ride, stationIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC12B
|
||||
*/
|
||||
static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
|
||||
// Change of station depart flag should really call invalidate_station_start
|
||||
// but since dodgems do not have station lights there is no point.
|
||||
if (ride.status == RideStatus::closed || ride.flags.hasAny(RideFlag::brokenDown, RideFlag::crashed))
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC0A1
|
||||
*/
|
||||
static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
return;
|
||||
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
|
||||
if ((ride.status == RideStatus::closed && ride.numRiders == 0)
|
||||
|| (tileElement != nullptr && tileElement->asTrack()->IsBrakeClosed()))
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
|
||||
if ((station.Depart & kStationDepartFlag) || (tileElement != nullptr && tileElement->asTrack()->HasGreenLight()))
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(station.Depart & kStationDepartFlag))
|
||||
{
|
||||
station.Depart |= kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
else if (tileElement != nullptr && tileElement->asTrack()->HasGreenLight())
|
||||
{
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ride.flags.has(RideFlag::passStationNoStopping))
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC12B
|
||||
*/
|
||||
static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
int32_t dx = ride.timeLimit * 32;
|
||||
int32_t dh = (dx >> 8) & 0xFF;
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
|
||||
// Change of station depart flag should really call invalidate_station_start
|
||||
// but since dodgems do not have station lights there is no point.
|
||||
if (ride.status == RideStatus::closed || ride.flags.hasAny(RideFlag::brokenDown, RideFlag::crashed))
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->NumLaps < dh)
|
||||
continue;
|
||||
|
||||
// End match
|
||||
ride.flags.unset(RideFlag::passStationNoStopping);
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
return;
|
||||
}
|
||||
|
||||
// Continue match
|
||||
station.Depart |= kStationDepartFlag;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if all vehicles are ready to go
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
if (ride.flags.has(RideFlag::passStationNoStopping))
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart)
|
||||
int32_t dx = ride.timeLimit * 32;
|
||||
int32_t dh = (dx >> 8) & 0xFF;
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->NumLaps < dh)
|
||||
continue;
|
||||
|
||||
// End match
|
||||
ride.flags.unset(RideFlag::passStationNoStopping);
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Begin the match
|
||||
ride.flags.set(RideFlag::passStationNoStopping);
|
||||
station.Depart |= kStationDepartFlag;
|
||||
ride.windowInvalidateFlags.set(RideInvalidateFlag::main, RideInvalidateFlag::list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC02C
|
||||
*/
|
||||
static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
int32_t time = station.Depart & kStationDepartMask;
|
||||
const auto currentTicks = getGameState().currentTicks;
|
||||
if (ride.flags.hasAny(RideFlag::brokenDown, RideFlag::crashed)
|
||||
|| (ride.status == RideStatus::closed && ride.numRiders == 0))
|
||||
{
|
||||
if (time != 0 && time != 127 && !(currentTicks & 7))
|
||||
time--;
|
||||
|
||||
station.Depart = time;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (time == 0)
|
||||
{
|
||||
// Continue match
|
||||
station.Depart |= kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (time != 127 && !(currentTicks & 31))
|
||||
// Check if all vehicles are ready to go
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Begin the match
|
||||
ride.flags.set(RideFlag::passStationNoStopping);
|
||||
station.Depart |= kStationDepartFlag;
|
||||
ride.windowInvalidateFlags.set(RideInvalidateFlag::main, RideInvalidateFlag::list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC02C
|
||||
*/
|
||||
static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
int32_t time = station.Depart & kStationDepartMask;
|
||||
const auto currentTicks = getGameState().currentTicks;
|
||||
if (ride.flags.hasAny(RideFlag::brokenDown, RideFlag::crashed)
|
||||
|| (ride.status == RideStatus::closed && ride.numRiders == 0))
|
||||
{
|
||||
if (time != 0 && time != 127 && !(currentTicks & 7))
|
||||
time--;
|
||||
|
||||
station.Depart = time;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC1DF
|
||||
*/
|
||||
static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
if (ride.status == RideStatus::closed || ride.flags.hasAny(RideFlag::brokenDown, RideFlag::crashed))
|
||||
{
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
else
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
if (time == 0)
|
||||
{
|
||||
station.Depart |= kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (time != 127 && !(currentTicks & 31))
|
||||
time--;
|
||||
|
||||
station.Depart = time;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ride.flags.has(RideFlag::passStationNoStopping))
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC1DF
|
||||
*/
|
||||
static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
int32_t numLaps = ride.numLaps;
|
||||
auto& station = ride.getStation(stationIndex);
|
||||
if (ride.status == RideStatus::closed || ride.flags.hasAny(RideFlag::brokenDown, RideFlag::crashed))
|
||||
{
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ride.flags.has(RideFlag::passStationNoStopping))
|
||||
{
|
||||
int32_t numLaps = ride.numLaps;
|
||||
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart && vehicle->NumLaps >= numLaps)
|
||||
{
|
||||
// Found a winner
|
||||
if (vehicle->num_peeps != 0)
|
||||
{
|
||||
auto* peep = getGameState().entities.GetEntity<Guest>(vehicle->peep[0]);
|
||||
if (peep != nullptr)
|
||||
{
|
||||
ride.raceWinner = peep->id;
|
||||
ride.windowInvalidateFlags.set(RideInvalidateFlag::main, RideInvalidateFlag::list);
|
||||
}
|
||||
}
|
||||
|
||||
// Race is over
|
||||
ride.flags.unset(RideFlag::passStationNoStopping);
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Continue racing
|
||||
station.Depart |= kStationDepartFlag;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if all vehicles are ready to go
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart && vehicle->status != Vehicle::Status::departing)
|
||||
{
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Begin the race
|
||||
RideRaceInitVehicleSpeeds(ride);
|
||||
ride.flags.set(RideFlag::passStationNoStopping);
|
||||
if (!(station.Depart & kStationDepartFlag))
|
||||
{
|
||||
station.Depart |= kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
ride.windowInvalidateFlags.set(RideInvalidateFlag::main, RideInvalidateFlag::list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC988
|
||||
* 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)
|
||||
*/
|
||||
static void RideRaceInitVehicleSpeeds(const Ride& ride)
|
||||
{
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart && vehicle->NumLaps >= numLaps)
|
||||
vehicle->flags.unset(VehicleFlag::currentlyColliding);
|
||||
|
||||
const auto* rideEntry = vehicle->GetRideEntry();
|
||||
|
||||
vehicle->speed = (ScenarioRand() & 15) - 8 + rideEntry->Cars[vehicle->vehicle_type].powered_max_speed;
|
||||
|
||||
if (vehicle->num_peeps != 0)
|
||||
{
|
||||
// Found a winner
|
||||
if (vehicle->num_peeps != 0)
|
||||
auto* guest = getGameState().entities.GetEntity<Guest>(vehicle->peep[0]);
|
||||
|
||||
// Easter egg names should only work on guests
|
||||
if (guest != nullptr)
|
||||
{
|
||||
auto* peep = getGameState().entities.GetEntity<Guest>(vehicle->peep[0]);
|
||||
if (peep != nullptr)
|
||||
switch (guest->getEasterEggNameId())
|
||||
{
|
||||
ride.raceWinner = peep->id;
|
||||
ride.windowInvalidateFlags.set(RideInvalidateFlag::main, RideInvalidateFlag::list);
|
||||
case EASTEREGG_PEEP_NAME_MICHAEL_SCHUMACHER:
|
||||
vehicle->speed += 35;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_JACQUES_VILLENEUVE:
|
||||
vehicle->speed += 25;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_DAMON_HILL:
|
||||
vehicle->speed += 55;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_CHRIS_SAWYER:
|
||||
vehicle->speed += 14;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_MR_BEAN:
|
||||
vehicle->speed = 9;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Race is over
|
||||
ride.flags.unset(RideFlag::passStationNoStopping);
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Continue racing
|
||||
station.Depart |= kStationDepartFlag;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if all vehicles are ready to go
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
if (vehicle->status != Vehicle::Status::waitingToDepart && vehicle->status != Vehicle::Status::departing)
|
||||
{
|
||||
if (station.Depart & kStationDepartFlag)
|
||||
{
|
||||
station.Depart &= ~kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Begin the race
|
||||
RideRaceInitVehicleSpeeds(ride);
|
||||
ride.flags.set(RideFlag::passStationNoStopping);
|
||||
if (!(station.Depart & kStationDepartFlag))
|
||||
{
|
||||
station.Depart |= kStationDepartFlag;
|
||||
RideInvalidateStationStart(ride, stationIndex, true);
|
||||
}
|
||||
ride.windowInvalidateFlags.set(RideInvalidateFlag::main, RideInvalidateFlag::list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC988
|
||||
* 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)
|
||||
*/
|
||||
static void RideRaceInitVehicleSpeeds(const Ride& ride)
|
||||
{
|
||||
for (size_t i = 0; i < ride.numTrains; i++)
|
||||
{
|
||||
Vehicle* vehicle = getGameState().entities.GetEntity<Vehicle>(ride.vehicles[i]);
|
||||
if (vehicle == nullptr)
|
||||
continue;
|
||||
|
||||
vehicle->flags.unset(VehicleFlag::currentlyColliding);
|
||||
|
||||
const auto* rideEntry = vehicle->GetRideEntry();
|
||||
|
||||
vehicle->speed = (ScenarioRand() & 15) - 8 + rideEntry->Cars[vehicle->vehicle_type].powered_max_speed;
|
||||
|
||||
if (vehicle->num_peeps != 0)
|
||||
{
|
||||
auto* guest = getGameState().entities.GetEntity<Guest>(vehicle->peep[0]);
|
||||
|
||||
// Easter egg names should only work on guests
|
||||
if (guest != nullptr)
|
||||
{
|
||||
switch (guest->getEasterEggNameId())
|
||||
{
|
||||
case EASTEREGG_PEEP_NAME_MICHAEL_SCHUMACHER:
|
||||
vehicle->speed += 35;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_JACQUES_VILLENEUVE:
|
||||
vehicle->speed += 25;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_DAMON_HILL:
|
||||
vehicle->speed += 55;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_CHRIS_SAWYER:
|
||||
vehicle->speed += 14;
|
||||
break;
|
||||
case EASTEREGG_PEEP_NAME_MR_BEAN:
|
||||
vehicle->speed = 9;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC2C7
|
||||
*/
|
||||
static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight)
|
||||
{
|
||||
auto startPos = ride.getStation(stationIndex).Start;
|
||||
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
||||
|
||||
// If no station track found return
|
||||
if (tileElement == nullptr)
|
||||
return;
|
||||
|
||||
TrackElement* const trackElement = tileElement->asTrack();
|
||||
if (trackElement->HasGreenLight() != greenLight)
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AC2C7
|
||||
*/
|
||||
static void RideInvalidateStationStart(Ride& ride, StationIndex stationIndex, bool greenLight)
|
||||
{
|
||||
trackElement->SetHasGreenLight(greenLight);
|
||||
MapInvalidateTileZoom1({ startPos, tileElement->getBaseZ(), tileElement->getClearanceZ() });
|
||||
}
|
||||
}
|
||||
auto startPos = ride.getStation(stationIndex).Start;
|
||||
TileElement* tileElement = RideGetStationStartTrackElement(ride, stationIndex);
|
||||
|
||||
TileElement* RideGetStationStartTrackElement(const Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
auto stationStart = ride.getStation(stationIndex).GetStart();
|
||||
|
||||
// Find the station track element
|
||||
TileElement* tileElement = MapGetFirstElementAt(stationStart);
|
||||
if (tileElement == nullptr)
|
||||
return nullptr;
|
||||
do
|
||||
{
|
||||
if (tileElement->getType() == TileElementType::track && stationStart.z == tileElement->getBaseZ())
|
||||
return tileElement;
|
||||
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TileElement* RideGetStationExitElement(const CoordsXYZ& elementPos)
|
||||
{
|
||||
// Find the station track element
|
||||
TileElement* tileElement = MapGetFirstElementAt(elementPos);
|
||||
if (tileElement == nullptr)
|
||||
return nullptr;
|
||||
do
|
||||
{
|
||||
// If no station track found return
|
||||
if (tileElement == nullptr)
|
||||
break;
|
||||
if (tileElement->getType() == TileElementType::entrance && elementPos.z == tileElement->getBaseZ())
|
||||
return tileElement;
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
return;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StationIndex RideGetFirstValidStationExit(const Ride& ride)
|
||||
{
|
||||
for (const auto& station : ride.getStations())
|
||||
{
|
||||
if (!station.Exit.IsNull())
|
||||
TrackElement* const trackElement = tileElement->asTrack();
|
||||
if (trackElement->HasGreenLight() != greenLight)
|
||||
{
|
||||
return ride.getStationIndex(&station);
|
||||
trackElement->SetHasGreenLight(greenLight);
|
||||
MapInvalidateTileZoom1({ startPos, tileElement->getBaseZ(), tileElement->getClearanceZ() });
|
||||
}
|
||||
}
|
||||
return StationIndex::GetNull();
|
||||
}
|
||||
|
||||
StationIndex RideGetFirstValidStationStart(const Ride& ride)
|
||||
{
|
||||
for (const auto& station : ride.getStations())
|
||||
TileElement* RideGetStationStartTrackElement(const Ride& ride, StationIndex stationIndex)
|
||||
{
|
||||
if (!station.Start.IsNull())
|
||||
{
|
||||
return ride.getStationIndex(&station);
|
||||
}
|
||||
}
|
||||
return StationIndex::GetNull();
|
||||
}
|
||||
auto stationStart = ride.getStation(stationIndex).GetStart();
|
||||
|
||||
StationIndex RideGetFirstEmptyStationStart(const Ride& ride)
|
||||
{
|
||||
for (const auto& station : ride.getStations())
|
||||
// Find the station track element
|
||||
TileElement* tileElement = MapGetFirstElementAt(stationStart);
|
||||
if (tileElement == nullptr)
|
||||
return nullptr;
|
||||
do
|
||||
{
|
||||
if (tileElement->getType() == TileElementType::track && stationStart.z == tileElement->getBaseZ())
|
||||
return tileElement;
|
||||
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TileElement* RideGetStationExitElement(const CoordsXYZ& elementPos)
|
||||
{
|
||||
if (station.Start.IsNull())
|
||||
// Find the station track element
|
||||
TileElement* tileElement = MapGetFirstElementAt(elementPos);
|
||||
if (tileElement == nullptr)
|
||||
return nullptr;
|
||||
do
|
||||
{
|
||||
return ride.getStationIndex(&station);
|
||||
}
|
||||
if (tileElement == nullptr)
|
||||
break;
|
||||
if (tileElement->getType() == TileElementType::entrance && elementPos.z == tileElement->getBaseZ())
|
||||
return tileElement;
|
||||
} while (!(tileElement++)->isLastForTile());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
return StationIndex::GetNull();
|
||||
}
|
||||
|
||||
int32_t RideStation::GetBaseZ() const
|
||||
{
|
||||
return Height * kCoordsZStep;
|
||||
}
|
||||
StationIndex RideGetFirstValidStationExit(const Ride& ride)
|
||||
{
|
||||
for (const auto& station : ride.getStations())
|
||||
{
|
||||
if (!station.Exit.IsNull())
|
||||
{
|
||||
return ride.getStationIndex(&station);
|
||||
}
|
||||
}
|
||||
return StationIndex::GetNull();
|
||||
}
|
||||
|
||||
void RideStation::SetBaseZ(int32_t newZ)
|
||||
{
|
||||
Height = newZ / kCoordsZStep;
|
||||
}
|
||||
StationIndex RideGetFirstValidStationStart(const Ride& ride)
|
||||
{
|
||||
for (const auto& station : ride.getStations())
|
||||
{
|
||||
if (!station.Start.IsNull())
|
||||
{
|
||||
return ride.getStationIndex(&station);
|
||||
}
|
||||
}
|
||||
return StationIndex::GetNull();
|
||||
}
|
||||
|
||||
CoordsXYZ RideStation::GetStart() const
|
||||
{
|
||||
return { Start, GetBaseZ() };
|
||||
}
|
||||
StationIndex RideGetFirstEmptyStationStart(const Ride& ride)
|
||||
{
|
||||
for (const auto& station : ride.getStations())
|
||||
{
|
||||
if (station.Start.IsNull())
|
||||
{
|
||||
return ride.getStationIndex(&station);
|
||||
}
|
||||
}
|
||||
return StationIndex::GetNull();
|
||||
}
|
||||
|
||||
int32_t RideStation::GetBaseZ() const
|
||||
{
|
||||
return Height * kCoordsZStep;
|
||||
}
|
||||
|
||||
void RideStation::SetBaseZ(int32_t newZ)
|
||||
{
|
||||
Height = newZ / kCoordsZStep;
|
||||
}
|
||||
|
||||
CoordsXYZ RideStation::GetStart() const
|
||||
{
|
||||
return { Start, GetBaseZ() };
|
||||
}
|
||||
} // namespace OpenRCT2
|
||||
@@ -11,9 +11,12 @@
|
||||
|
||||
#include "../Identifiers.h"
|
||||
|
||||
struct Ride;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
|
||||
void RideUpdateStation(Ride& ride, StationIndex stationIndex);
|
||||
StationIndex RideGetFirstValidStationExit(const Ride& ride);
|
||||
StationIndex RideGetFirstValidStationStart(const Ride& ride);
|
||||
StationIndex RideGetFirstEmptyStationStart(const Ride& ride);
|
||||
void RideUpdateStation(OpenRCT2::Ride& ride, StationIndex stationIndex);
|
||||
StationIndex RideGetFirstValidStationExit(const OpenRCT2::Ride& ride);
|
||||
StationIndex RideGetFirstValidStationStart(const OpenRCT2::Ride& ride);
|
||||
StationIndex RideGetFirstEmptyStationStart(const OpenRCT2::Ride& ride);
|
||||
} // namespace OpenRCT2
|
||||
@@ -21,7 +21,19 @@
|
||||
#include "VehicleColour.h"
|
||||
|
||||
#include <memory>
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2::RCT12
|
||||
{
|
||||
enum class TD46Version : uint8_t;
|
||||
}
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
|
||||
enum class RideMode : uint8_t;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
struct ResultWithMessage;
|
||||
enum class ViewportInteractionItem : uint8_t;
|
||||
|
||||
@@ -121,8 +133,6 @@ struct TrackDesignMazeElement
|
||||
uint16_t mazeEntry{};
|
||||
};
|
||||
|
||||
enum class RideMode : uint8_t;
|
||||
|
||||
enum class TrackDesignGameStateFlag
|
||||
{
|
||||
sceneryUnavailable,
|
||||
@@ -140,7 +150,7 @@ struct TrackDesignTrackAndVehicleSettings
|
||||
|
||||
struct TrackDesignOperatingSettings
|
||||
{
|
||||
RideMode rideMode{};
|
||||
OpenRCT2::RideMode rideMode{};
|
||||
uint8_t liftHillSpeed{};
|
||||
uint8_t numCircuits{};
|
||||
uint8_t operationSetting{};
|
||||
@@ -211,15 +221,15 @@ struct TrackDesign
|
||||
OpenRCT2::RCT12::TD46Version version = OpenRCT2::RCT12::TD46Version::td6;
|
||||
|
||||
public:
|
||||
ResultWithMessage CreateTrackDesign(TrackDesignState& tds, const Ride& ride);
|
||||
ResultWithMessage CreateTrackDesign(TrackDesignState& tds, const OpenRCT2::Ride& ride);
|
||||
ResultWithMessage CreateTrackDesignScenery(TrackDesignState& tds);
|
||||
void Serialise(OpenRCT2::DataSerialiser& stream);
|
||||
|
||||
private:
|
||||
uint8_t _saveDirection;
|
||||
ResultWithMessage CreateTrackDesignTrack(TrackDesignState& tds, const Ride& ride);
|
||||
ResultWithMessage CreateTrackDesignMaze(TrackDesignState& tds, const Ride& ride);
|
||||
CoordsXYE MazeGetFirstElement(const Ride& ride);
|
||||
ResultWithMessage CreateTrackDesignTrack(TrackDesignState& tds, const OpenRCT2::Ride& ride);
|
||||
ResultWithMessage CreateTrackDesignMaze(TrackDesignState& tds, const OpenRCT2::Ride& ride);
|
||||
CoordsXYE MazeGetFirstElement(const OpenRCT2::Ride& ride);
|
||||
};
|
||||
|
||||
extern bool gTrackDesignSceneryToggle;
|
||||
@@ -235,11 +245,12 @@ extern RideId gTrackDesignSaveRideIndex;
|
||||
void TrackDesignMirror(TrackDesign& td);
|
||||
|
||||
OpenRCT2::GameActions::Result TrackDesignPlace(
|
||||
const TrackDesign& td, OpenRCT2::GameActions::CommandFlags flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords);
|
||||
void TrackDesignPreviewRemoveGhosts(const TrackDesign& td, Ride& ride, const CoordsXYZD& coords);
|
||||
const TrackDesign& td, OpenRCT2::GameActions::CommandFlags flags, bool placeScenery, OpenRCT2::Ride& ride,
|
||||
const CoordsXYZD& coords);
|
||||
void TrackDesignPreviewRemoveGhosts(const TrackDesign& td, OpenRCT2::Ride& ride, const CoordsXYZD& coords);
|
||||
void TrackDesignPreviewDrawOutlines(
|
||||
TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords, bool placeScenery);
|
||||
int32_t TrackDesignGetZPlacement(const TrackDesign& td, Ride& ride, const CoordsXYZD& coords);
|
||||
TrackDesignState& tds, const TrackDesign& td, OpenRCT2::Ride& ride, const CoordsXYZD& coords, bool placeScenery);
|
||||
int32_t TrackDesignGetZPlacement(const TrackDesign& td, OpenRCT2::Ride& ride, const CoordsXYZD& coords);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Track design preview
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
#include "../world/Location.hpp"
|
||||
|
||||
struct Ride;
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Ride;
|
||||
struct TrackElement;
|
||||
|
||||
struct TrackCircuitIterator
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
class StationObject;
|
||||
}
|
||||
struct Ride;
|
||||
|
||||
struct Ride;
|
||||
class StationObject;
|
||||
} // namespace OpenRCT2
|
||||
|
||||
constexpr uint8_t kTrackMap2x2[][4] = {
|
||||
{ 0, 1, 2, 3 },
|
||||
@@ -413,13 +413,14 @@ ImageId GetStationColourScheme(PaintSession& session, const OpenRCT2::TrackEleme
|
||||
ImageId GetShopSupportColourScheme(PaintSession& session, const OpenRCT2::TrackElement& trackElement);
|
||||
|
||||
bool TrackPaintUtilHasFence(
|
||||
enum edge_t edge, const CoordsXY& position, const OpenRCT2::TrackElement& trackElement, const Ride& ride, uint8_t rotation);
|
||||
enum edge_t edge, const CoordsXY& position, const OpenRCT2::TrackElement& trackElement, const OpenRCT2::Ride& ride,
|
||||
uint8_t rotation);
|
||||
void TrackPaintUtilPaintFloor(
|
||||
PaintSession& session, uint8_t edges, ImageId colourFlags, uint16_t height, const uint32_t floorSprites[4],
|
||||
const OpenRCT2::StationObject* stationStyle);
|
||||
void TrackPaintUtilPaintFences(
|
||||
PaintSession& session, uint8_t edges, const CoordsXY& position, const OpenRCT2::TrackElement& trackElement,
|
||||
const Ride& ride, ImageId colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation);
|
||||
const OpenRCT2::Ride& ride, ImageId colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation);
|
||||
|
||||
enum class StationBaseType
|
||||
{
|
||||
@@ -437,20 +438,21 @@ bool TrackPaintUtilDrawStationCovers2(
|
||||
PaintSession& session, enum edge_t edge, bool hasFence, const OpenRCT2::StationObject* stationObject, uint16_t height,
|
||||
uint8_t stationVariant, ImageId colour);
|
||||
bool TrackPaintUtilDrawNarrowStationPlatform(
|
||||
PaintSession& session, const Ride& ride, Direction direction, int32_t height, int32_t zOffset,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, Direction direction, int32_t height, int32_t zOffset,
|
||||
const OpenRCT2::TrackElement& trackElement, StationBaseType baseType, int32_t baseOffsetZ);
|
||||
bool TrackPaintUtilDrawStation(
|
||||
PaintSession& session, const Ride& ride, Direction direction, uint16_t height, const OpenRCT2::TrackElement& trackElement,
|
||||
StationBaseType baseType, int32_t baseOffsetZ);
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, Direction direction, uint16_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, StationBaseType baseType, int32_t baseOffsetZ);
|
||||
bool TrackPaintUtilDrawStation2(
|
||||
PaintSession& session, const Ride& ride, Direction direction, uint16_t height, const OpenRCT2::TrackElement& trackElement,
|
||||
StationBaseType baseType, int32_t baseOffsetZ, int32_t fenceOffsetA, int32_t fenceOffsetB);
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, Direction direction, uint16_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, StationBaseType baseType, int32_t baseOffsetZ, int32_t fenceOffsetA,
|
||||
int32_t fenceOffsetB);
|
||||
bool TrackPaintUtilDrawStationInverted(
|
||||
PaintSession& session, const Ride& ride, Direction direction, int32_t height, const OpenRCT2::TrackElement& trackElement,
|
||||
uint8_t stationVariant);
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, Direction direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, uint8_t stationVariant);
|
||||
bool TrackPaintUtilShouldPaintSupports(const CoordsXY& position);
|
||||
void TrackPaintUtilDrawPier(
|
||||
PaintSession& session, const Ride& ride, const OpenRCT2::StationObject* stationObject, const CoordsXY& position,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, const OpenRCT2::StationObject* stationObject, const CoordsXY& position,
|
||||
Direction direction, int32_t height, const OpenRCT2::TrackElement& trackElement, uint8_t rotation);
|
||||
inline void TrackPaintUtilDrawStationTunnel(PaintSession& session, Direction direction, int32_t height)
|
||||
{
|
||||
@@ -564,11 +566,11 @@ void DrawSBendRightSupports(
|
||||
int32_t specialA, int32_t specialB);
|
||||
|
||||
using TrackPaintFunction = void (&)(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, Direction direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
|
||||
void TrackPaintFunctionDummy(
|
||||
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
PaintSession& session, const OpenRCT2::Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const OpenRCT2::TrackElement& trackElement, SupportType supportType);
|
||||
|
||||
TrackPaintFunction GetTrackPaintFunctionStandUpRC(OpenRCT2::TrackElemType trackType);
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
|
||||
#include <list>
|
||||
|
||||
struct Vehicle;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct Vehicle;
|
||||
}
|
||||
|
||||
namespace OpenRCT2::TrainManager
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -31,7 +31,7 @@ using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::RideVehicle;
|
||||
using namespace OpenRCT2::TrackMetadata;
|
||||
|
||||
void RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const TrackElemType trackType)
|
||||
void OpenRCT2::RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const TrackElemType trackType)
|
||||
{
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (ted.flags.has(TrackElementFlag::isGolfHole))
|
||||
|
||||
+237
-235
@@ -20,285 +20,287 @@
|
||||
#include "RideData.h"
|
||||
#include "VehicleGeometry.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Audio;
|
||||
using namespace OpenRCT2::RideVehicle;
|
||||
|
||||
static constexpr SoundId _screamSetMisc[] = {
|
||||
SoundId::scream8,
|
||||
SoundId::scream1,
|
||||
};
|
||||
static constexpr SoundId _screamSetWooden[] = {
|
||||
SoundId::scream3, SoundId::scream1, SoundId::scream5, SoundId::scream6,
|
||||
SoundId::scream7, SoundId::scream2, SoundId::scream4,
|
||||
};
|
||||
static constexpr SoundId _screamSetSteel[] = {
|
||||
SoundId::scream1,
|
||||
SoundId::scream6,
|
||||
};
|
||||
|
||||
void VehicleSoundsUpdate()
|
||||
namespace OpenRCT2
|
||||
{
|
||||
auto windowManager = Ui::GetWindowManager();
|
||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_VEHICLE_SOUNDS));
|
||||
}
|
||||
using namespace OpenRCT2::Audio;
|
||||
using namespace OpenRCT2::RideVehicle;
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D7AC0
|
||||
*/
|
||||
static SoundIdVolume VehicleSoundFadeInOut(
|
||||
SoundId currentSoundId, uint8_t currentVolume, SoundId targetSoundId, uint8_t targetVolume)
|
||||
{
|
||||
if (currentSoundId != SoundId::null)
|
||||
static constexpr SoundId _screamSetMisc[] = {
|
||||
SoundId::scream8,
|
||||
SoundId::scream1,
|
||||
};
|
||||
static constexpr SoundId _screamSetWooden[] = {
|
||||
SoundId::scream3, SoundId::scream1, SoundId::scream5, SoundId::scream6,
|
||||
SoundId::scream7, SoundId::scream2, SoundId::scream4,
|
||||
};
|
||||
static constexpr SoundId _screamSetSteel[] = {
|
||||
SoundId::scream1,
|
||||
SoundId::scream6,
|
||||
};
|
||||
|
||||
void VehicleSoundsUpdate()
|
||||
{
|
||||
if (currentSoundId == targetSoundId)
|
||||
auto windowManager = Ui::GetWindowManager();
|
||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_VEHICLE_SOUNDS));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D7AC0
|
||||
*/
|
||||
static SoundIdVolume VehicleSoundFadeInOut(
|
||||
SoundId currentSoundId, uint8_t currentVolume, SoundId targetSoundId, uint8_t targetVolume)
|
||||
{
|
||||
if (currentSoundId != SoundId::null)
|
||||
{
|
||||
currentVolume = std::min<int32_t>(currentVolume + 15, targetVolume);
|
||||
return { currentSoundId, currentVolume };
|
||||
if (currentSoundId == targetSoundId)
|
||||
{
|
||||
currentVolume = std::min<int32_t>(currentVolume + 15, targetVolume);
|
||||
return { currentSoundId, currentVolume };
|
||||
}
|
||||
|
||||
currentVolume -= 9;
|
||||
if (currentVolume >= 80)
|
||||
return { currentSoundId, currentVolume };
|
||||
}
|
||||
|
||||
currentVolume -= 9;
|
||||
if (currentVolume >= 80)
|
||||
return { currentSoundId, currentVolume };
|
||||
// Begin sound at quarter volume
|
||||
currentSoundId = targetSoundId;
|
||||
currentVolume = targetVolume == 255 ? 255 : targetVolume / 4;
|
||||
|
||||
return { currentSoundId, currentVolume };
|
||||
}
|
||||
|
||||
// Begin sound at quarter volume
|
||||
currentSoundId = targetSoundId;
|
||||
currentVolume = targetVolume == 255 ? 255 : targetVolume / 4;
|
||||
|
||||
return { currentSoundId, currentVolume };
|
||||
}
|
||||
|
||||
void Vehicle::GetLiftHillSound(const Ride& curRide, SoundIdVolume& curSound)
|
||||
{
|
||||
scream_sound_id = SoundId::null;
|
||||
if (curRide.type < std::size(kRideTypeDescriptors))
|
||||
void Vehicle::GetLiftHillSound(const Ride& curRide, SoundIdVolume& curSound)
|
||||
{
|
||||
// Get lift hill sound
|
||||
curSound.id = GetRideTypeDescriptor(curRide.type).LiftData.sound_id;
|
||||
curSound.volume = 243;
|
||||
if (!(sound2_flags & VEHICLE_SOUND2_FLAGS_LIFT_HILL))
|
||||
curSound.id = SoundId::null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D7888
|
||||
*/
|
||||
void Vehicle::UpdateSound()
|
||||
{
|
||||
// frictionVolume (bl) should be set before hand
|
||||
SoundIdVolume frictionSound = { SoundId::null, 255 };
|
||||
// bh screamVolume should be set before hand
|
||||
SoundIdVolume screamSound = { SoundId::null, 255 };
|
||||
|
||||
auto curRide = GetRide();
|
||||
if (curRide == nullptr)
|
||||
return;
|
||||
|
||||
auto rideEntry = GetRideEntry();
|
||||
if (rideEntry == nullptr)
|
||||
return;
|
||||
|
||||
// Always use the head car's sound data (Some of the other vehicle subtypes have improperly set data)
|
||||
auto soundCarIndex = (rideEntry->FrontCar == 0xff) ? rideEntry->DefaultCar : rideEntry->FrontCar;
|
||||
const auto& carEntry = rideEntry->Cars[soundCarIndex];
|
||||
|
||||
int32_t ecx = abs(velocity) - 1.0_mph;
|
||||
if (ecx >= 0)
|
||||
{
|
||||
frictionSound.id = carEntry.friction_sound_id;
|
||||
ecx >>= 15;
|
||||
frictionSound.volume = std::min(208 + (ecx & 0xFF), 255);
|
||||
scream_sound_id = SoundId::null;
|
||||
if (curRide.type < std::size(kRideTypeDescriptors))
|
||||
{
|
||||
// Get lift hill sound
|
||||
curSound.id = GetRideTypeDescriptor(curRide.type).LiftData.sound_id;
|
||||
curSound.volume = 243;
|
||||
if (!(sound2_flags & VEHICLE_SOUND2_FLAGS_LIFT_HILL))
|
||||
curSound.id = SoundId::null;
|
||||
}
|
||||
}
|
||||
|
||||
const auto currentTicks = getGameState().currentTicks;
|
||||
switch (carEntry.soundRange)
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D7888
|
||||
*/
|
||||
void Vehicle::UpdateSound()
|
||||
{
|
||||
case SoundRange::steamWhistle:
|
||||
screamSound.id = scream_sound_id;
|
||||
if (!(currentTicks & 0x7F))
|
||||
{
|
||||
if (velocity < 4.0_mph || scream_sound_id != SoundId::null)
|
||||
{
|
||||
GetLiftHillSound(*curRide, screamSound);
|
||||
break;
|
||||
}
|
||||
// frictionVolume (bl) should be set before hand
|
||||
SoundIdVolume frictionSound = { SoundId::null, 255 };
|
||||
// bh screamVolume should be set before hand
|
||||
SoundIdVolume screamSound = { SoundId::null, 255 };
|
||||
|
||||
if ((ScenarioRand() & 0xFFFF) <= 0x5555)
|
||||
{
|
||||
scream_sound_id = SoundId::trainWhistle;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (screamSound.id == SoundId::noScream)
|
||||
screamSound.id = SoundId::null;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
auto curRide = GetRide();
|
||||
if (curRide == nullptr)
|
||||
return;
|
||||
|
||||
case SoundRange::tramBell:
|
||||
screamSound.id = scream_sound_id;
|
||||
if (!(currentTicks & 0x7F))
|
||||
{
|
||||
if (velocity < 4.0_mph || scream_sound_id != SoundId::null)
|
||||
{
|
||||
GetLiftHillSound(*curRide, screamSound);
|
||||
break;
|
||||
}
|
||||
auto rideEntry = GetRideEntry();
|
||||
if (rideEntry == nullptr)
|
||||
return;
|
||||
|
||||
if ((ScenarioRand() & 0xFFFF) <= 0x5555)
|
||||
{
|
||||
scream_sound_id = SoundId::tram;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (screamSound.id == SoundId::noScream)
|
||||
screamSound.id = SoundId::null;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
// Always use the head car's sound data (Some of the other vehicle subtypes have improperly set data)
|
||||
auto soundCarIndex = (rideEntry->FrontCar == 0xff) ? rideEntry->DefaultCar : rideEntry->FrontCar;
|
||||
const auto& carEntry = rideEntry->Cars[soundCarIndex];
|
||||
|
||||
default:
|
||||
if (carEntry.flags.has(CarEntryFlag::hasScreamingRiders))
|
||||
{
|
||||
screamSound.id = UpdateScreamSound();
|
||||
int32_t ecx = abs(velocity) - 1.0_mph;
|
||||
if (ecx >= 0)
|
||||
{
|
||||
frictionSound.id = carEntry.friction_sound_id;
|
||||
ecx >>= 15;
|
||||
frictionSound.volume = std::min(208 + (ecx & 0xFF), 255);
|
||||
}
|
||||
|
||||
const auto currentTicks = getGameState().currentTicks;
|
||||
switch (carEntry.soundRange)
|
||||
{
|
||||
case SoundRange::steamWhistle:
|
||||
screamSound.id = scream_sound_id;
|
||||
if (!(currentTicks & 0x7F))
|
||||
{
|
||||
if (velocity < 4.0_mph || scream_sound_id != SoundId::null)
|
||||
{
|
||||
GetLiftHillSound(*curRide, screamSound);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ScenarioRand() & 0xFFFF) <= 0x5555)
|
||||
{
|
||||
scream_sound_id = SoundId::trainWhistle;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (screamSound.id == SoundId::noScream)
|
||||
{
|
||||
screamSound.id = SoundId::null;
|
||||
break;
|
||||
}
|
||||
if (screamSound.id != SoundId::null)
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
|
||||
case SoundRange::tramBell:
|
||||
screamSound.id = scream_sound_id;
|
||||
if (!(currentTicks & 0x7F))
|
||||
{
|
||||
break;
|
||||
if (velocity < 4.0_mph || scream_sound_id != SoundId::null)
|
||||
{
|
||||
GetLiftHillSound(*curRide, screamSound);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((ScenarioRand() & 0xFFFF) <= 0x5555)
|
||||
{
|
||||
scream_sound_id = SoundId::tram;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
GetLiftHillSound(*curRide, screamSound);
|
||||
if (screamSound.id == SoundId::noScream)
|
||||
screamSound.id = SoundId::null;
|
||||
screamSound.volume = 255;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (carEntry.flags.has(CarEntryFlag::hasScreamingRiders))
|
||||
{
|
||||
screamSound.id = UpdateScreamSound();
|
||||
if (screamSound.id == SoundId::noScream)
|
||||
{
|
||||
screamSound.id = SoundId::null;
|
||||
break;
|
||||
}
|
||||
if (screamSound.id != SoundId::null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
GetLiftHillSound(*curRide, screamSound);
|
||||
}
|
||||
|
||||
// Friction sound
|
||||
auto soundIdVolume = VehicleSoundFadeInOut(sound1_id, sound1_volume, frictionSound.id, frictionSound.volume);
|
||||
sound1_id = soundIdVolume.id;
|
||||
sound1_volume = soundIdVolume.volume;
|
||||
|
||||
// Scream sound
|
||||
soundIdVolume = VehicleSoundFadeInOut(sound2_id, sound2_volume, screamSound.id, screamSound.volume);
|
||||
sound2_id = soundIdVolume.id;
|
||||
sound2_volume = soundIdVolume.volume;
|
||||
|
||||
// Calculate Sound Vector (used for sound frequency calcs)
|
||||
int32_t soundDirection = Geometry::getSoundDirectionFromOrientation(orientation);
|
||||
int32_t soundVector = ((velocity >> 14) * soundDirection) >> 14;
|
||||
soundVector = std::clamp(soundVector, -127, 127);
|
||||
|
||||
dopplerShift = soundVector & 0xFF;
|
||||
}
|
||||
|
||||
// Friction sound
|
||||
auto soundIdVolume = VehicleSoundFadeInOut(sound1_id, sound1_volume, frictionSound.id, frictionSound.volume);
|
||||
sound1_id = soundIdVolume.id;
|
||||
sound1_volume = soundIdVolume.volume;
|
||||
|
||||
// Scream sound
|
||||
soundIdVolume = VehicleSoundFadeInOut(sound2_id, sound2_volume, screamSound.id, screamSound.volume);
|
||||
sound2_id = soundIdVolume.id;
|
||||
sound2_volume = soundIdVolume.volume;
|
||||
|
||||
// Calculate Sound Vector (used for sound frequency calcs)
|
||||
int32_t soundDirection = Geometry::getSoundDirectionFromOrientation(orientation);
|
||||
int32_t soundVector = ((velocity >> 14) * soundDirection) >> 14;
|
||||
soundVector = std::clamp(soundVector, -127, 127);
|
||||
|
||||
dopplerShift = soundVector & 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D796B
|
||||
*/
|
||||
SoundId Vehicle::UpdateScreamSound()
|
||||
{
|
||||
int32_t totalNumPeeps = NumPeepsUntilTrainTail();
|
||||
if (totalNumPeeps == 0)
|
||||
return SoundId::null;
|
||||
|
||||
if (velocity < 0)
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006D796B
|
||||
*/
|
||||
SoundId Vehicle::UpdateScreamSound()
|
||||
{
|
||||
if (velocity > -2.75_mph)
|
||||
int32_t totalNumPeeps = NumPeepsUntilTrainTail();
|
||||
if (totalNumPeeps == 0)
|
||||
return SoundId::null;
|
||||
|
||||
if (velocity < 0)
|
||||
{
|
||||
if (velocity > -2.75_mph)
|
||||
return SoundId::null;
|
||||
|
||||
for (Vehicle* vehicle2 = getGameState().entities.GetEntity<Vehicle>(id); vehicle2 != nullptr;
|
||||
vehicle2 = getGameState().entities.GetEntity<Vehicle>(vehicle2->next_vehicle_on_train))
|
||||
{
|
||||
if (vehicle2->pitch < VehiclePitch::up12)
|
||||
continue;
|
||||
if (vehicle2->pitch <= VehiclePitch::up60)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
if (vehicle2->pitch < VehiclePitch::up75)
|
||||
continue;
|
||||
if (vehicle2->pitch <= VehiclePitch::up165)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
// up50 occurs on diagonal steep hills
|
||||
// up8 and up16 occur on diagonal gentle hills
|
||||
if (vehicle2->pitch == VehiclePitch::up50)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
}
|
||||
return SoundId::null;
|
||||
}
|
||||
|
||||
if (velocity < 2.75_mph)
|
||||
return SoundId::null;
|
||||
|
||||
for (Vehicle* vehicle2 = getGameState().entities.GetEntity<Vehicle>(id); vehicle2 != nullptr;
|
||||
vehicle2 = getGameState().entities.GetEntity<Vehicle>(vehicle2->next_vehicle_on_train))
|
||||
{
|
||||
if (vehicle2->pitch < VehiclePitch::up12)
|
||||
if (vehicle2->pitch < VehiclePitch::down12)
|
||||
continue;
|
||||
if (vehicle2->pitch <= VehiclePitch::up60)
|
||||
if (vehicle2->pitch <= VehiclePitch::down60)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
if (vehicle2->pitch < VehiclePitch::up75)
|
||||
if (vehicle2->pitch <= VehiclePitch::inverted)
|
||||
continue;
|
||||
if (vehicle2->pitch <= VehiclePitch::up165)
|
||||
if (vehicle2->pitch <= VehiclePitch::down165)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
// up50 occurs on diagonal steep hills
|
||||
// up8 and up16 occur on diagonal gentle hills
|
||||
if (vehicle2->pitch == VehiclePitch::up50)
|
||||
// down50 occurs on diagonal steep drops
|
||||
// down8 and down16 occur on diagonal gentle drops
|
||||
if (vehicle2->pitch == VehiclePitch::down50)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
}
|
||||
return SoundId::null;
|
||||
}
|
||||
|
||||
if (velocity < 2.75_mph)
|
||||
return SoundId::null;
|
||||
|
||||
for (Vehicle* vehicle2 = getGameState().entities.GetEntity<Vehicle>(id); vehicle2 != nullptr;
|
||||
vehicle2 = getGameState().entities.GetEntity<Vehicle>(vehicle2->next_vehicle_on_train))
|
||||
SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps)
|
||||
{
|
||||
if (vehicle2->pitch < VehiclePitch::down12)
|
||||
continue;
|
||||
if (vehicle2->pitch <= VehiclePitch::down60)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
if (vehicle2->pitch <= VehiclePitch::inverted)
|
||||
continue;
|
||||
if (vehicle2->pitch <= VehiclePitch::down165)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
// down50 occurs on diagonal steep drops
|
||||
// down8 and down16 occur on diagonal gentle drops
|
||||
if (vehicle2->pitch == VehiclePitch::down50)
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
}
|
||||
return SoundId::null;
|
||||
}
|
||||
const auto* rideEntry = GetRideEntry();
|
||||
|
||||
SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps)
|
||||
{
|
||||
const auto* rideEntry = GetRideEntry();
|
||||
const auto& carEntry = rideEntry->Cars[vehicle_type];
|
||||
|
||||
const auto& carEntry = rideEntry->Cars[vehicle_type];
|
||||
|
||||
if (scream_sound_id == SoundId::null)
|
||||
{
|
||||
auto r = ScenarioRand();
|
||||
if (totalNumPeeps >= static_cast<int32_t>(r % 16))
|
||||
if (scream_sound_id == SoundId::null)
|
||||
{
|
||||
switch (carEntry.soundRange)
|
||||
auto r = ScenarioRand();
|
||||
if (totalNumPeeps >= static_cast<int32_t>(r % 16))
|
||||
{
|
||||
case SoundRange::screamsMisc:
|
||||
scream_sound_id = _screamSetMisc[r % std::size(_screamSetMisc)];
|
||||
break;
|
||||
case SoundRange::screamsWoodenRollerCoaster:
|
||||
scream_sound_id = _screamSetWooden[r % std::size(_screamSetWooden)];
|
||||
break;
|
||||
case SoundRange::screamSteelRollerCoaster:
|
||||
scream_sound_id = _screamSetSteel[r % std::size(_screamSetSteel)];
|
||||
break;
|
||||
default:
|
||||
scream_sound_id = SoundId::noScream;
|
||||
break;
|
||||
switch (carEntry.soundRange)
|
||||
{
|
||||
case SoundRange::screamsMisc:
|
||||
scream_sound_id = _screamSetMisc[r % std::size(_screamSetMisc)];
|
||||
break;
|
||||
case SoundRange::screamsWoodenRollerCoaster:
|
||||
scream_sound_id = _screamSetWooden[r % std::size(_screamSetWooden)];
|
||||
break;
|
||||
case SoundRange::screamSteelRollerCoaster:
|
||||
scream_sound_id = _screamSetSteel[r % std::size(_screamSetSteel)];
|
||||
break;
|
||||
default:
|
||||
scream_sound_id = SoundId::noScream;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
scream_sound_id = SoundId::noScream;
|
||||
}
|
||||
}
|
||||
else
|
||||
return scream_sound_id;
|
||||
}
|
||||
|
||||
void Vehicle::Claxon() const
|
||||
{
|
||||
const auto* rideEntry = GetRideEntry();
|
||||
switch (rideEntry->Cars[vehicle_type].soundRange)
|
||||
{
|
||||
scream_sound_id = SoundId::noScream;
|
||||
case SoundRange::steamWhistle:
|
||||
Play3D(SoundId::trainWhistle, { x, y, z });
|
||||
break;
|
||||
case SoundRange::tramBell:
|
||||
Play3D(SoundId::tram, { x, y, z });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return scream_sound_id;
|
||||
}
|
||||
|
||||
void Vehicle::Claxon() const
|
||||
{
|
||||
const auto* rideEntry = GetRideEntry();
|
||||
switch (rideEntry->Cars[vehicle_type].soundRange)
|
||||
{
|
||||
case SoundRange::steamWhistle:
|
||||
Play3D(SoundId::trainWhistle, { x, y, z });
|
||||
break;
|
||||
case SoundRange::tramBell:
|
||||
Play3D(SoundId::tram, { x, y, z });
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // namespace OpenRCT2
|
||||
+1401
-1396
File diff suppressed because it is too large.
Load diff
+1402
-1396
File diff suppressed because it is too large.
Load diff
+520
-546
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,45 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2026 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../core/FlagHolder.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace OpenRCT2
|
||||
{
|
||||
enum class VehicleFlag : uint8_t
|
||||
{
|
||||
onLiftHill,
|
||||
collisionDisabled,
|
||||
waitingOnAdjacentStation,
|
||||
poweredCarInReverse,
|
||||
readyToDepart,
|
||||
testing,
|
||||
// When go-karts are colliding, they have a higher chance of changing lanes
|
||||
currentlyColliding,
|
||||
// Used on vehicles when a safety cut-out stops them, such as RCs on a lift hill and powered rides
|
||||
stoppedBySafetyCutout,
|
||||
carIsBroken,
|
||||
trainIsBroken,
|
||||
stoppedOnHoldingBrake,
|
||||
// Used on vehicles that can run inverted for extended periods of time, i.e. the Flying, Lay-down and Multi-Dimension
|
||||
// trains
|
||||
carIsInverted,
|
||||
// Set when the vehicle travels backwards through the station for the first time
|
||||
reverseInclineCompletedLap,
|
||||
spinningIsLocked, // After passing a rotation toggle track piece this will enable
|
||||
// OpenRCT2 Flag: Used to override UpdateMotion to move the position of an individual car on a train
|
||||
moveSingleCar,
|
||||
crashed, // Car displays as smoke plume
|
||||
carIsReversed, // Car is displayed running backwards
|
||||
};
|
||||
using VehicleFlags = FlagHolder<uint32_t, VehicleFlag>;
|
||||
} // namespace OpenRCT2
|
||||
@@ -19,7 +19,10 @@
|
||||
constexpr const size_t VehicleTrackSubpositionSizeDefault = EnumValue(OpenRCT2::TrackElemType::count)
|
||||
* kNumOrthogonalDirections;
|
||||
|
||||
struct VehicleInfo;
|
||||
namespace OpenRCT2
|
||||
{
|
||||
struct VehicleInfo;
|
||||
}
|
||||
|
||||
enum class VehicleTrackSubposition : uint8_t
|
||||
{
|
||||
@@ -50,7 +53,7 @@ enum class VehicleTrackSubposition : uint8_t
|
||||
struct VehicleInfoList
|
||||
{
|
||||
uint16_t size;
|
||||
const VehicleInfo* info;
|
||||
const OpenRCT2::VehicleInfo* info;
|
||||
};
|
||||
|
||||
extern const VehicleInfoList* const* const gTrackVehicleInfo[EnumValue(VehicleTrackSubposition::count)];
|
||||
@@ -105,7 +105,7 @@ constexpr RideTypeDescriptor WaterCoasterRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::standard,
|
||||
.RideUpdate = nullptr,
|
||||
|
||||
@@ -66,7 +66,7 @@ constexpr RideTypeDescriptor CircusRTD =
|
||||
.MusicUpdateFunction = CircusMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::standard,
|
||||
.RideUpdate = nullptr,
|
||||
|
||||
@@ -89,7 +89,7 @@ constexpr RideTypeDescriptor GhostTrainRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_GhostTrain,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_GhostTrain,
|
||||
};
|
||||
} // namespace OpenRCT2
|
||||
// clang-format on
|
||||
@@ -72,7 +72,7 @@ constexpr RideTypeDescriptor MazeRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceMaze,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::maze,
|
||||
.specialType = RtdSpecialType::maze,
|
||||
|
||||
@@ -78,7 +78,7 @@ constexpr RideTypeDescriptor MiniGolfRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::standard,
|
||||
.RideUpdate = nullptr,
|
||||
|
||||
@@ -76,7 +76,7 @@ constexpr RideTypeDescriptor SpiralSlideRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceSpiralSlide,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::standard,
|
||||
.RideUpdate = updateSpiralSlide,
|
||||
|
||||
@@ -70,7 +70,7 @@ constexpr RideTypeDescriptor EnterpriseRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationEnterprise,
|
||||
.specialType = RtdSpecialType::enterprise,
|
||||
};
|
||||
|
||||
@@ -68,7 +68,7 @@ constexpr RideTypeDescriptor MotionSimulatorRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::standard,
|
||||
.RideUpdate = nullptr,
|
||||
|
||||
@@ -87,7 +87,7 @@ constexpr RideTypeDescriptor ChairliftRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_Default,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_Default,
|
||||
.GetGuestWaypointLocation = GetGuestWaypointLocationDefault,
|
||||
.ConstructionWindowContext = RideConstructionWindowContext::standard,
|
||||
.RideUpdate = updateChairlift,
|
||||
|
||||
@@ -84,7 +84,7 @@ constexpr RideTypeDescriptor LogFlumeRTD =
|
||||
.MusicUpdateFunction = DefaultMusicUpdate,
|
||||
.Classification = RideClassification::ride,
|
||||
.UpdateLeaveEntrance = PeepUpdateRideLeaveEntranceDefault,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAjustment_LogFlume,
|
||||
.SpecialElementRatingAdjustment = SpecialTrackElementRatingsAdjustment_LogFlume,
|
||||
};
|
||||
} // namespace OpenRCT2
|
||||
// clang-format on
|
||||
@@ -102,7 +102,7 @@ namespace OpenRCT2::Scripting
|
||||
Ride* ScRide::GetRide(JSValue thisVal)
|
||||
{
|
||||
RideData* data = GetRideData(thisVal);
|
||||
return ::GetRide(data->_rideId);
|
||||
return OpenRCT2::GetRide(data->_rideId);
|
||||
}
|
||||
|
||||
JSValue ScRide::id_get(JSContext* ctx, JSValue thisVal)
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRCT2::Scripting
|
||||
RideStation* ScRideStation::GetRideStation(JSValue thisVal)
|
||||
{
|
||||
RideStationData* data = GetRideStationData(thisVal);
|
||||
auto ride = ::GetRide(data->_rideId);
|
||||
auto ride = OpenRCT2::GetRide(data->_rideId);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
if (data->_stationIndex.ToUnderlying() < std::size(ride->getStations()))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
using namespace OpenRCT2::Scripting;
|
||||
using namespace OpenRCT2::TrackMetadata;
|
||||
|
||||
static JSValue VehicleInfoToJSValue(JSContext* ctx, const VehicleInfo& value)
|
||||
static JSValue VehicleInfoToJSValue(JSContext* ctx, const OpenRCT2::VehicleInfo& value)
|
||||
{
|
||||
JSValue obj = JS_NewObject(ctx);
|
||||
JS_SetPropertyStr(ctx, obj, "x", JS_NewInt32(ctx, value.x));
|
||||
|
||||
@@ -87,7 +87,7 @@ void ParkEntranceReset()
|
||||
getGameState().park.entrances.clear();
|
||||
}
|
||||
|
||||
void RideEntranceExitPlaceProvisionalGhost()
|
||||
void OpenRCT2::RideEntranceExitPlaceProvisionalGhost()
|
||||
{
|
||||
if (_currentTrackSelectionFlags.has(TrackSelectionFlag::entranceOrExit))
|
||||
{
|
||||
@@ -97,7 +97,7 @@ void RideEntranceExitPlaceProvisionalGhost()
|
||||
}
|
||||
}
|
||||
|
||||
void RideEntranceExitRemoveGhost()
|
||||
void OpenRCT2::RideEntranceExitRemoveGhost()
|
||||
{
|
||||
if (_currentTrackSelectionFlags.has(TrackSelectionFlag::entranceOrExit))
|
||||
{
|
||||
@@ -114,7 +114,7 @@ void RideEntranceExitRemoveGhost()
|
||||
*
|
||||
* rct2: 0x006CA28C
|
||||
*/
|
||||
money64 RideEntranceExitPlaceGhost(
|
||||
money64 OpenRCT2::RideEntranceExitPlaceGhost(
|
||||
const Ride& ride, const CoordsXY& entranceExitCoords, Direction direction, int32_t placeType, StationIndex stationNum)
|
||||
{
|
||||
RideConstructionRemoveGhosts();
|
||||
|
||||
Reference in new issue
Block a user