Move GetDodgemsTrackSize() to Vehicle.Dodgems.cpp

This commit is contained in:
Gymnasiast committed 2026-03-10 18:33:42 +01:00
1 parent 2b4304f93d
commit dc8bc703db
2 files changed
+25 -24

No files matched your search

+6 -24
View File
@@ -9,34 +9,16 @@
#pragma once
#include "../paint/support/MetalSupports.h"
#include "ted/TrackElemType.h"
#include <cstdint>
namespace OpenRCT2
{
enum class TrackElemType : uint16_t;
}
namespace OpenRCT2::TrackMetadata
{
enum class TrackCurve : uint8_t;
enum class TrackPitch : uint8_t;
enum class TrackRoll : uint8_t;
struct TrackElementDescriptor;
struct DodgemsTrackSize
{
uint8_t left;
uint8_t top;
uint8_t right;
uint8_t bottom;
};
constexpr DodgemsTrackSize GetDodgemsTrackSize(TrackElemType type)
{
if (type == TrackElemType::flatTrack2x2)
return { 4, 4, 59, 59 };
if (type == TrackElemType::flatTrack4x4)
return { 4, 4, 123, 123 };
if (type == TrackElemType::flatTrack2x4)
return { 4, 4, 59, 123 };
return { 0, 0, 0, 0 };
}
const TrackElementDescriptor& GetTrackElementDescriptor(TrackElemType type);
} // namespace OpenRCT2::TrackMetadata
+19
View File
@@ -29,6 +29,25 @@ extern int32_t _vehicleVelocityF64E0C;
extern int32_t _vehicleUnkF64E10;
extern CoordsXYZ _vehicleCurPosition;
struct DodgemsTrackSize
{
uint8_t left;
uint8_t top;
uint8_t right;
uint8_t bottom;
};
constexpr DodgemsTrackSize GetDodgemsTrackSize(TrackElemType type)
{
if (type == TrackElemType::flatTrack2x2)
return { 4, 4, 59, 59 };
if (type == TrackElemType::flatTrack4x4)
return { 4, 4, 123, 123 };
if (type == TrackElemType::flatTrack2x4)
return { 4, 4, 59, 123 };
return { 0, 0, 0, 0 };
}
/** rct2: 0x009A37C4 */
static constexpr CoordsXY kSurroundingTiles[] = {
{ 0, 0 },