2018-05-01 17:47:00 +02:00
|
|
|
/*****************************************************************************
|
2019-03-17 08:16:15 +01:00
|
|
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
2018-06-15 14:07:34 +02:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*****************************************************************************/
|
2018-05-01 17:47:00 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../common.h"
|
2019-01-12 11:11:55 +01:00
|
|
|
#include "../ride/RideTypes.h"
|
2019-01-20 21:38:38 +01:00
|
|
|
#include "Footpath.h"
|
2018-09-14 14:54:12 +02:00
|
|
|
#include "Location.hpp"
|
2018-05-01 17:47:00 +02:00
|
|
|
|
2019-07-25 18:51:22 +02:00
|
|
|
struct Banner;
|
2018-09-13 18:12:20 +02:00
|
|
|
struct rct_scenery_entry;
|
2018-09-16 17:19:56 +02:00
|
|
|
struct rct_footpath_entry;
|
2019-08-31 13:14:19 +02:00
|
|
|
typedef uint16_t track_type_t;
|
2018-09-13 18:12:20 +02:00
|
|
|
|
2018-05-01 17:47:00 +02:00
|
|
|
#pragma pack(push, 1)
|
|
|
|
|
2018-09-13 15:19:08 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TILE_ELEMENT_TYPE_SURFACE = (0 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_PATH = (1 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_TRACK = (2 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_SMALL_SCENERY = (3 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_ENTRANCE = (4 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_WALL = (5 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_LARGE_SCENERY = (6 << 2),
|
|
|
|
TILE_ELEMENT_TYPE_BANNER = (7 << 2),
|
|
|
|
// The corrupt element type is used for skipping drawing other following
|
|
|
|
// elements on a given tile.
|
|
|
|
TILE_ELEMENT_TYPE_CORRUPT = (8 << 2),
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class TileElementType : uint8_t
|
|
|
|
{
|
|
|
|
Surface = (0 << 2),
|
|
|
|
Path = (1 << 2),
|
|
|
|
Track = (2 << 2),
|
|
|
|
SmallScenery = (3 << 2),
|
|
|
|
Entrance = (4 << 2),
|
|
|
|
Wall = (5 << 2),
|
|
|
|
LargeScenery = (6 << 2),
|
|
|
|
Banner = (7 << 2),
|
|
|
|
Corrupt = (8 << 2),
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SurfaceElement;
|
|
|
|
struct PathElement;
|
|
|
|
struct TrackElement;
|
|
|
|
struct SmallSceneryElement;
|
|
|
|
struct LargeSceneryElement;
|
|
|
|
struct WallElement;
|
|
|
|
struct EntranceElement;
|
|
|
|
struct BannerElement;
|
|
|
|
struct CorruptElement;
|
|
|
|
|
|
|
|
struct TileElementBase
|
2018-06-22 23:17:03 +02:00
|
|
|
{
|
|
|
|
uint8_t type; // 0
|
2019-08-27 21:12:48 +02:00
|
|
|
uint8_t flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant).
|
2018-06-22 23:17:03 +02:00
|
|
|
uint8_t base_height; // 2
|
|
|
|
uint8_t clearance_height; // 3
|
2019-08-18 14:36:16 +02:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t GetType() const;
|
2018-06-22 23:17:03 +02:00
|
|
|
void SetType(uint8_t newType);
|
2019-08-26 12:25:57 +02:00
|
|
|
Direction GetDirection() const;
|
|
|
|
void SetDirection(Direction direction);
|
|
|
|
Direction GetDirectionWithOffset(uint8_t offset) const;
|
2018-06-22 23:17:03 +02:00
|
|
|
bool IsLastForTile() const;
|
2019-08-25 16:13:02 +02:00
|
|
|
void SetLastForTile(bool on);
|
2018-06-22 23:17:03 +02:00
|
|
|
bool IsGhost() const;
|
2019-02-25 21:44:12 +01:00
|
|
|
void SetGhost(bool isGhost);
|
2018-09-26 13:20:47 +02:00
|
|
|
void Remove();
|
2019-08-27 21:12:48 +02:00
|
|
|
uint8_t GetOccupiedQuadrants() const;
|
|
|
|
void SetOccupiedQuadrants(uint8_t quadrants);
|
2019-12-22 22:14:02 +01:00
|
|
|
int32_t GetBaseZ() const;
|
2019-12-27 15:26:40 +01:00
|
|
|
void SetBaseZ(int32_t newZ);
|
2019-12-22 22:14:02 +01:00
|
|
|
int32_t GetClearanceZ() const;
|
2019-12-27 15:26:40 +01:00
|
|
|
void SetClearanceZ(int32_t newZ);
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Map element structure
|
2019-08-19 18:51:14 +02:00
|
|
|
* size: 0x10
|
2018-09-13 15:19:08 +02:00
|
|
|
*/
|
2018-11-01 13:53:50 +01:00
|
|
|
struct TileElement : public TileElementBase
|
2018-09-13 15:19:08 +02:00
|
|
|
{
|
2018-10-05 13:33:46 +02:00
|
|
|
uint8_t pad_04[4];
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2018-09-13 15:19:08 +02:00
|
|
|
|
2018-09-13 19:42:33 +02:00
|
|
|
template<typename TType, TileElementType TClass> TType* as() const
|
2018-09-13 15:19:08 +02:00
|
|
|
{
|
|
|
|
return (TileElementType)GetType() == TClass ? (TType*)this : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2018-09-13 19:42:33 +02:00
|
|
|
SurfaceElement* AsSurface() const
|
|
|
|
{
|
|
|
|
return as<SurfaceElement, TileElementType::Surface>();
|
|
|
|
}
|
|
|
|
PathElement* AsPath() const
|
|
|
|
{
|
|
|
|
return as<PathElement, TileElementType::Path>();
|
|
|
|
}
|
|
|
|
TrackElement* AsTrack() const
|
|
|
|
{
|
|
|
|
return as<TrackElement, TileElementType::Track>();
|
|
|
|
}
|
|
|
|
SmallSceneryElement* AsSmallScenery() const
|
|
|
|
{
|
|
|
|
return as<SmallSceneryElement, TileElementType::SmallScenery>();
|
|
|
|
}
|
|
|
|
LargeSceneryElement* AsLargeScenery() const
|
|
|
|
{
|
|
|
|
return as<LargeSceneryElement, TileElementType::LargeScenery>();
|
|
|
|
}
|
|
|
|
WallElement* AsWall() const
|
|
|
|
{
|
|
|
|
return as<WallElement, TileElementType::Wall>();
|
|
|
|
}
|
|
|
|
EntranceElement* AsEntrance() const
|
|
|
|
{
|
|
|
|
return as<EntranceElement, TileElementType::Entrance>();
|
|
|
|
}
|
|
|
|
BannerElement* AsBanner() const
|
|
|
|
{
|
|
|
|
return as<BannerElement, TileElementType::Banner>();
|
|
|
|
}
|
2018-09-23 14:05:17 +02:00
|
|
|
|
|
|
|
void ClearAs(uint8_t newType);
|
2018-05-01 17:47:00 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(TileElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct SurfaceElement : TileElementBase
|
|
|
|
{
|
2018-09-14 14:54:12 +02:00
|
|
|
private:
|
2019-08-30 22:22:08 +02:00
|
|
|
uint8_t Slope;
|
|
|
|
uint8_t WaterHeight;
|
|
|
|
uint8_t GrassLength;
|
|
|
|
uint8_t Ownership;
|
|
|
|
uint8_t SurfaceStyle;
|
|
|
|
uint8_t EdgeStyle;
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2019-08-30 22:22:08 +02:00
|
|
|
uint8_t pad_08[6];
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic pop
|
2019-08-18 18:28:01 +02:00
|
|
|
|
2018-09-14 14:54:12 +02:00
|
|
|
public:
|
|
|
|
uint8_t GetSlope() const;
|
|
|
|
void SetSlope(uint8_t newSlope);
|
|
|
|
|
|
|
|
uint32_t GetSurfaceStyle() const;
|
|
|
|
void SetSurfaceStyle(uint32_t newStyle);
|
|
|
|
uint32_t GetEdgeStyle() const;
|
|
|
|
void SetEdgeStyle(uint32_t newStyle);
|
|
|
|
|
2018-12-12 00:31:06 +01:00
|
|
|
bool CanGrassGrow() const;
|
2018-09-14 14:54:12 +02:00
|
|
|
uint8_t GetGrassLength() const;
|
|
|
|
void SetGrassLength(uint8_t newLength);
|
2020-02-13 10:25:42 +01:00
|
|
|
void SetGrassLengthAndInvalidate(uint8_t newLength, const CoordsXY& coords);
|
|
|
|
void UpdateGrassLength(const CoordsXY& coords);
|
2018-09-14 14:54:12 +02:00
|
|
|
|
|
|
|
uint8_t GetOwnership() const;
|
|
|
|
void SetOwnership(uint8_t newOwnership);
|
|
|
|
|
2020-01-19 16:12:48 +01:00
|
|
|
int32_t GetWaterHeight() const;
|
|
|
|
void SetWaterHeight(int32_t newWaterHeight);
|
2018-09-14 14:54:12 +02:00
|
|
|
|
|
|
|
uint8_t GetParkFences() const;
|
|
|
|
void SetParkFences(uint8_t newParkFences);
|
2018-10-03 11:39:33 +02:00
|
|
|
|
|
|
|
bool HasTrackThatNeedsWater() const;
|
|
|
|
void SetHasTrackThatNeedsWater(bool on);
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(SurfaceElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct PathElement : TileElementBase
|
|
|
|
{
|
2018-09-16 16:17:35 +02:00
|
|
|
private:
|
2018-10-05 12:30:58 +02:00
|
|
|
uint8_t entryIndex; // 4, 0xF0 Path type, 0x08 Ride sign, 0x04 Set when path is sloped, 0x03 Rotation
|
|
|
|
uint8_t additions; // 5, 0bGSSSAAAA: G = Ghost, S = station index, A = addition (0 means no addition)
|
2018-09-16 16:32:06 +02:00
|
|
|
uint8_t edges; // 6
|
2018-10-03 10:38:46 +02:00
|
|
|
union
|
|
|
|
{
|
|
|
|
uint8_t additionStatus; // 7
|
2019-01-12 11:11:55 +01:00
|
|
|
ride_id_t rideIndex;
|
2018-10-03 10:38:46 +02:00
|
|
|
};
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic pop
|
2018-10-03 10:38:46 +02:00
|
|
|
|
|
|
|
public:
|
2019-01-02 19:52:53 +01:00
|
|
|
uint8_t GetPathEntryIndex() const;
|
2019-01-20 21:38:38 +01:00
|
|
|
PathSurfaceEntry* GetPathEntry() const;
|
2019-01-02 19:52:53 +01:00
|
|
|
void SetPathEntryIndex(uint8_t newIndex);
|
|
|
|
|
|
|
|
uint8_t GetRailingEntryIndex() const;
|
2019-01-20 21:38:38 +01:00
|
|
|
PathRailingsEntry* GetRailingEntry() const;
|
2019-01-02 19:52:53 +01:00
|
|
|
void SetRailingEntryIndex(uint8_t newIndex);
|
2018-09-16 17:24:49 +02:00
|
|
|
|
|
|
|
uint8_t GetQueueBannerDirection() const;
|
|
|
|
void SetQueueBannerDirection(uint8_t direction);
|
|
|
|
|
2018-09-16 16:32:06 +02:00
|
|
|
bool IsSloped() const;
|
|
|
|
void SetSloped(bool isSloped);
|
|
|
|
|
2019-08-26 11:58:24 +02:00
|
|
|
Direction GetSlopeDirection() const;
|
|
|
|
void SetSlopeDirection(Direction newSlope);
|
2018-10-04 15:07:48 +02:00
|
|
|
|
2019-01-12 11:11:55 +01:00
|
|
|
ride_id_t GetRideIndex() const;
|
|
|
|
void SetRideIndex(ride_id_t newRideIndex);
|
2018-10-05 12:39:37 +02:00
|
|
|
|
2018-09-16 18:21:10 +02:00
|
|
|
uint8_t GetStationIndex() const;
|
|
|
|
void SetStationIndex(uint8_t newStationIndex);
|
|
|
|
|
2018-09-16 16:40:03 +02:00
|
|
|
bool IsWide() const;
|
|
|
|
void SetWide(bool isWide);
|
2018-10-03 21:45:52 +02:00
|
|
|
|
2018-10-03 10:57:29 +02:00
|
|
|
bool IsQueue() const;
|
|
|
|
void SetIsQueue(bool isQueue);
|
2018-09-16 16:32:06 +02:00
|
|
|
bool HasQueueBanner() const;
|
2018-10-04 15:40:55 +02:00
|
|
|
void SetHasQueueBanner(bool hasQueueBanner);
|
2018-10-03 10:57:29 +02:00
|
|
|
|
2019-02-26 10:08:22 +01:00
|
|
|
bool IsBroken() const;
|
|
|
|
void SetIsBroken(bool isBroken);
|
|
|
|
|
|
|
|
bool IsBlockedByVehicle() const;
|
|
|
|
void SetIsBlockedByVehicle(bool isBlocked);
|
|
|
|
|
2018-10-05 13:11:44 +02:00
|
|
|
uint8_t GetEdges() const;
|
|
|
|
void SetEdges(uint8_t newEdges);
|
|
|
|
uint8_t GetCorners() const;
|
|
|
|
void SetCorners(uint8_t newCorners);
|
|
|
|
uint8_t GetEdgesAndCorners() const;
|
|
|
|
void SetEdgesAndCorners(uint8_t newEdgesAndCorners);
|
|
|
|
|
2018-09-16 17:08:15 +02:00
|
|
|
bool HasAddition() const;
|
|
|
|
uint8_t GetAddition() const;
|
|
|
|
uint8_t GetAdditionEntryIndex() const;
|
|
|
|
rct_scenery_entry* GetAdditionEntry() const;
|
|
|
|
void SetAddition(uint8_t newAddition);
|
|
|
|
|
2018-09-16 16:46:23 +02:00
|
|
|
bool AdditionIsGhost() const;
|
|
|
|
void SetAdditionIsGhost(bool isGhost);
|
2018-10-03 21:45:52 +02:00
|
|
|
|
2018-10-05 12:49:26 +02:00
|
|
|
uint8_t GetAdditionStatus() const;
|
|
|
|
void SetAdditionStatus(uint8_t newStatus);
|
|
|
|
|
2019-01-20 12:26:57 +01:00
|
|
|
bool ShouldDrawPathOverSupports();
|
|
|
|
void SetShouldDrawPathOverSupports(bool on);
|
2020-01-05 17:59:02 +01:00
|
|
|
|
2020-02-13 10:25:42 +01:00
|
|
|
bool IsLevelCrossing(const CoordsXY& coords) const;
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(PathElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct TrackElement : TileElementBase
|
|
|
|
{
|
2019-08-31 13:14:19 +02:00
|
|
|
private:
|
|
|
|
track_type_t TrackType;
|
2018-09-17 21:54:36 +02:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2019-08-31 13:14:19 +02:00
|
|
|
uint8_t Sequence;
|
|
|
|
uint8_t ColourScheme;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
// - Bits 3 and 4 are never set
|
|
|
|
// - Bits 1 and 2 are set when a vehicle triggers the on-ride photo and act like a countdown from 3.
|
|
|
|
// - If any of the bits 1-4 are set, the game counts it as a photo being taken.
|
|
|
|
uint8_t OnridePhotoBits;
|
|
|
|
// Contains the brake/booster speed, divided by 2.
|
|
|
|
uint8_t BrakeBoosterSpeed;
|
|
|
|
};
|
|
|
|
uint8_t StationIndex;
|
|
|
|
};
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
uint16_t MazeEntry; // 5
|
2018-09-17 21:54:36 +02:00
|
|
|
};
|
|
|
|
};
|
2019-08-31 13:14:19 +02:00
|
|
|
uint8_t Flags2;
|
|
|
|
ride_idnew_t RideIndex;
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2020-02-10 22:41:49 +01:00
|
|
|
uint8_t pad[3];
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic pop
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2018-09-17 21:54:36 +02:00
|
|
|
public:
|
2019-08-31 13:14:19 +02:00
|
|
|
track_type_t GetTrackType() const;
|
|
|
|
void SetTrackType(track_type_t newEntryIndex);
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2018-09-17 21:54:36 +02:00
|
|
|
uint8_t GetSequenceIndex() const;
|
|
|
|
void SetSequenceIndex(uint8_t newSequenceIndex);
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2020-02-10 22:41:49 +01:00
|
|
|
ride_idnew_t GetRideIndex() const;
|
|
|
|
void SetRideIndex(ride_idnew_t newRideIndex);
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2018-09-17 22:51:28 +02:00
|
|
|
uint8_t GetColourScheme() const;
|
|
|
|
void SetColourScheme(uint8_t newColourScheme);
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2018-09-17 22:51:28 +02:00
|
|
|
uint8_t GetStationIndex() const;
|
|
|
|
void SetStationIndex(uint8_t newStationIndex);
|
2018-09-18 13:01:09 +02:00
|
|
|
|
|
|
|
bool HasChain() const;
|
|
|
|
void SetHasChain(bool on);
|
|
|
|
|
2018-09-18 13:22:56 +02:00
|
|
|
bool HasCableLift() const;
|
|
|
|
void SetHasCableLift(bool on);
|
2018-09-18 13:37:44 +02:00
|
|
|
|
2018-09-18 13:30:00 +02:00
|
|
|
bool IsInverted() const;
|
|
|
|
void SetInverted(bool inverted);
|
2018-09-18 13:22:56 +02:00
|
|
|
|
2019-02-26 10:08:22 +01:00
|
|
|
bool BlockBrakeClosed() const;
|
|
|
|
void SetBlockBrakeClosed(bool isClosed);
|
|
|
|
|
|
|
|
bool IsIndestructible() const;
|
|
|
|
void SetIsIndestructible(bool isIndestructible);
|
|
|
|
|
2018-09-18 13:37:44 +02:00
|
|
|
uint8_t GetBrakeBoosterSpeed() const;
|
|
|
|
void SetBrakeBoosterSpeed(uint8_t speed);
|
|
|
|
|
2019-08-31 13:14:19 +02:00
|
|
|
bool HasGreenLight() const;
|
|
|
|
void SetHasGreenLight(bool on);
|
2018-09-18 13:43:55 +02:00
|
|
|
|
2018-09-17 22:15:19 +02:00
|
|
|
uint8_t GetSeatRotation() const;
|
|
|
|
void SetSeatRotation(uint8_t newSeatRotation);
|
2018-09-18 13:49:58 +02:00
|
|
|
|
2018-09-18 14:04:23 +02:00
|
|
|
uint16_t GetMazeEntry() const;
|
|
|
|
void SetMazeEntry(uint16_t newMazeEntry);
|
|
|
|
void MazeEntryAdd(uint16_t addVal);
|
|
|
|
void MazeEntrySubtract(uint16_t subVal);
|
|
|
|
|
2018-09-18 13:49:58 +02:00
|
|
|
bool IsTakingPhoto() const;
|
|
|
|
void SetPhotoTimeout();
|
2018-11-02 13:45:35 +01:00
|
|
|
void SetPhotoTimeout(uint8_t newValue);
|
2018-09-18 13:49:58 +02:00
|
|
|
void DecrementPhotoTimeout();
|
2019-08-18 18:18:44 +02:00
|
|
|
uint8_t GetPhotoTimeout() const;
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2018-10-03 11:39:33 +02:00
|
|
|
bool IsHighlighted() const;
|
|
|
|
void SetHighlight(bool on);
|
|
|
|
|
2019-08-31 13:14:19 +02:00
|
|
|
// Used by ghost train, RCT1 feature, will be reintroduced at some point.
|
2018-09-17 21:57:12 +02:00
|
|
|
// (See https://github.com/OpenRCT2/OpenRCT2/issues/7059)
|
|
|
|
uint8_t GetDoorAState() const;
|
|
|
|
uint8_t GetDoorBState() const;
|
2019-08-31 13:14:19 +02:00
|
|
|
void SetDoorAState(uint8_t newState);
|
|
|
|
void SetDoorBState(uint8_t newState);
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(TrackElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct SmallSceneryElement : TileElementBase
|
|
|
|
{
|
2018-09-13 18:12:20 +02:00
|
|
|
private:
|
2018-09-13 17:10:45 +02:00
|
|
|
uint8_t entryIndex; // 4
|
|
|
|
uint8_t age; // 5
|
|
|
|
uint8_t colour_1; // 6
|
|
|
|
uint8_t colour_2; // 7
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic pop
|
2019-08-18 18:28:01 +02:00
|
|
|
|
2018-09-13 15:19:08 +02:00
|
|
|
public:
|
2018-09-13 17:02:38 +02:00
|
|
|
uint8_t GetEntryIndex() const;
|
2018-09-13 17:26:36 +02:00
|
|
|
void SetEntryIndex(uint8_t newIndex);
|
2018-09-13 18:12:20 +02:00
|
|
|
rct_scenery_entry* GetEntry() const;
|
2018-09-13 17:26:36 +02:00
|
|
|
uint8_t GetAge() const;
|
|
|
|
void SetAge(uint8_t newAge);
|
2020-01-04 12:45:51 +01:00
|
|
|
void IncreaseAge(const CoordsXY& sceneryPos);
|
2018-09-13 18:12:20 +02:00
|
|
|
uint8_t GetSceneryQuadrant() const;
|
2018-09-17 15:18:07 +02:00
|
|
|
void SetSceneryQuadrant(uint8_t newQuadrant);
|
2018-09-13 18:12:20 +02:00
|
|
|
colour_t GetPrimaryColour() const;
|
|
|
|
void SetPrimaryColour(colour_t colour);
|
|
|
|
colour_t GetSecondaryColour() const;
|
|
|
|
void SetSecondaryColour(colour_t colour);
|
|
|
|
bool NeedsSupports() const;
|
|
|
|
void SetNeedsSupports();
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(SmallSceneryElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct LargeSceneryElement : TileElementBase
|
|
|
|
{
|
2018-09-14 12:12:22 +02:00
|
|
|
private:
|
2019-08-30 22:07:07 +02:00
|
|
|
uint32_t EntryIndex;
|
|
|
|
uint32_t BannerIndex;
|
|
|
|
uint8_t SequenceIndex;
|
|
|
|
uint8_t Colour[3];
|
2019-08-18 18:28:01 +02:00
|
|
|
|
2018-09-14 12:12:22 +02:00
|
|
|
public:
|
|
|
|
uint32_t GetEntryIndex() const;
|
|
|
|
void SetEntryIndex(uint32_t newIndex);
|
|
|
|
rct_scenery_entry* GetEntry() const;
|
|
|
|
|
2019-08-30 22:07:07 +02:00
|
|
|
uint8_t GetSequenceIndex() const;
|
|
|
|
void SetSequenceIndex(uint8_t newIndex);
|
2018-09-14 12:12:22 +02:00
|
|
|
|
|
|
|
colour_t GetPrimaryColour() const;
|
|
|
|
void SetPrimaryColour(colour_t colour);
|
|
|
|
colour_t GetSecondaryColour() const;
|
|
|
|
void SetSecondaryColour(colour_t colour);
|
|
|
|
|
2019-07-25 18:51:22 +02:00
|
|
|
Banner* GetBanner() const;
|
2019-08-30 22:07:07 +02:00
|
|
|
::BannerIndex GetBannerIndex() const;
|
|
|
|
void SetBannerIndex(::BannerIndex newIndex);
|
2019-02-26 10:08:22 +01:00
|
|
|
|
|
|
|
bool IsAccounted() const;
|
|
|
|
void SetIsAccounted(bool isAccounted);
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(LargeSceneryElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct WallElement : TileElementBase
|
|
|
|
{
|
2018-09-17 16:12:11 +02:00
|
|
|
private:
|
2018-09-17 14:10:05 +02:00
|
|
|
uint8_t entryIndex; // 4
|
|
|
|
union
|
|
|
|
{
|
|
|
|
uint8_t colour_3; // 5
|
|
|
|
BannerIndex banner_index; // 5
|
|
|
|
};
|
|
|
|
uint8_t colour_1; // 6 0b_2221_1111 2 = colour_2 (uses flags for rest of colour2), 1 = colour_1
|
|
|
|
uint8_t animation; // 7 0b_dfff_ft00 d = direction, f = frame num, t = across track flag (not used)
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic pop
|
2018-09-13 19:42:33 +02:00
|
|
|
|
2018-09-13 15:19:08 +02:00
|
|
|
public:
|
2018-09-17 15:42:34 +02:00
|
|
|
uint8_t GetEntryIndex() const;
|
|
|
|
void SetEntryIndex(uint8_t newIndex);
|
|
|
|
rct_scenery_entry* GetEntry() const;
|
|
|
|
|
2018-09-13 15:19:08 +02:00
|
|
|
uint8_t GetSlope() const;
|
2018-09-17 14:10:05 +02:00
|
|
|
void SetSlope(uint8_t newslope);
|
|
|
|
|
|
|
|
colour_t GetPrimaryColour() const;
|
|
|
|
void SetPrimaryColour(colour_t newColour);
|
|
|
|
colour_t GetSecondaryColour() const;
|
|
|
|
void SetSecondaryColour(colour_t newColour);
|
|
|
|
colour_t GetTertiaryColour() const;
|
|
|
|
void SetTertiaryColour(colour_t newColour);
|
2018-09-17 14:48:27 +02:00
|
|
|
|
|
|
|
uint8_t GetAnimationFrame() const;
|
|
|
|
void SetAnimationFrame(uint8_t frameNum);
|
|
|
|
|
2019-07-25 18:51:22 +02:00
|
|
|
Banner* GetBanner() const;
|
2018-09-17 15:42:34 +02:00
|
|
|
BannerIndex GetBannerIndex() const;
|
|
|
|
void SetBannerIndex(BannerIndex newIndex);
|
|
|
|
|
|
|
|
bool IsAcrossTrack() const;
|
|
|
|
void SetAcrossTrack(bool acrossTrack);
|
|
|
|
bool AnimationIsBackwards() const;
|
|
|
|
void SetAnimationIsBackwards(bool isBackwards);
|
|
|
|
|
2018-11-13 21:48:20 +01:00
|
|
|
void SetRawRCT1Data(uint32_t rawData);
|
2018-09-17 14:48:27 +02:00
|
|
|
int32_t GetRCT1WallType(int32_t edge) const;
|
|
|
|
colour_t GetRCT1WallColour() const;
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(WallElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct EntranceElement : TileElementBase
|
|
|
|
{
|
2018-09-26 12:02:41 +02:00
|
|
|
private:
|
|
|
|
uint8_t entranceType; // 4
|
2018-09-26 12:30:27 +02:00
|
|
|
uint8_t index; // 5. 0bUSSS????, S = station index.
|
2018-09-26 12:02:41 +02:00
|
|
|
uint8_t pathType; // 6
|
2019-01-12 11:11:55 +01:00
|
|
|
ride_id_t rideIndex; // 7
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2019-08-18 19:53:01 +02:00
|
|
|
#pragma clang diagnostic pop
|
2018-09-23 11:55:37 +02:00
|
|
|
|
2018-09-17 22:51:28 +02:00
|
|
|
public:
|
2018-09-26 12:13:44 +02:00
|
|
|
uint8_t GetEntranceType() const;
|
|
|
|
void SetEntranceType(uint8_t newType);
|
|
|
|
|
2019-01-12 11:11:55 +01:00
|
|
|
ride_id_t GetRideIndex() const;
|
|
|
|
void SetRideIndex(ride_id_t newRideIndex);
|
2018-09-26 12:30:27 +02:00
|
|
|
|
2018-09-17 22:51:28 +02:00
|
|
|
uint8_t GetStationIndex() const;
|
|
|
|
void SetStationIndex(uint8_t stationIndex);
|
2018-09-26 12:54:44 +02:00
|
|
|
|
|
|
|
uint8_t GetSequenceIndex() const;
|
|
|
|
void SetSequenceIndex(uint8_t newSequenceIndex);
|
2018-09-26 13:02:51 +02:00
|
|
|
|
|
|
|
uint8_t GetPathType() const;
|
|
|
|
void SetPathType(uint8_t newPathType);
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(EntranceElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct BannerElement : TileElementBase
|
|
|
|
{
|
2018-09-26 14:07:04 +02:00
|
|
|
private:
|
|
|
|
BannerIndex index; // 4
|
2018-09-26 14:52:16 +02:00
|
|
|
uint8_t position; // 5
|
2018-09-26 14:07:04 +02:00
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-private-field"
|
2018-09-26 15:44:09 +02:00
|
|
|
uint8_t flags; // 6
|
|
|
|
uint8_t unused; // 7
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2018-09-26 14:07:04 +02:00
|
|
|
#pragma clang diagnostic pop
|
|
|
|
public:
|
2019-07-25 18:51:22 +02:00
|
|
|
Banner* GetBanner() const;
|
|
|
|
rct_scenery_entry* GetEntry() const;
|
|
|
|
|
2018-09-26 14:07:04 +02:00
|
|
|
BannerIndex GetIndex() const;
|
|
|
|
void SetIndex(BannerIndex newIndex);
|
2018-09-26 14:52:16 +02:00
|
|
|
|
|
|
|
uint8_t GetPosition() const;
|
|
|
|
void SetPosition(uint8_t newPosition);
|
|
|
|
|
|
|
|
uint8_t GetAllowedEdges() const;
|
|
|
|
void SetAllowedEdges(uint8_t newEdges);
|
|
|
|
void ResetAllowedEdges();
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(BannerElement, 16);
|
2018-09-13 15:19:08 +02:00
|
|
|
|
|
|
|
struct CorruptElement : TileElementBase
|
|
|
|
{
|
|
|
|
uint8_t pad[4];
|
2019-08-18 18:28:01 +02:00
|
|
|
uint8_t pad_08[8];
|
2018-09-13 15:19:08 +02:00
|
|
|
};
|
2019-08-18 14:03:36 +02:00
|
|
|
assert_struct_size(CorruptElement, 16);
|
2018-05-01 17:47:00 +02:00
|
|
|
#pragma pack(pop)
|
|
|
|
|
2019-02-20 09:32:34 +01:00
|
|
|
class QuarterTile
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
uint8_t _val{ 0 };
|
|
|
|
|
|
|
|
public:
|
|
|
|
constexpr QuarterTile(uint8_t tileQuarter, uint8_t zQuarter)
|
|
|
|
: _val(tileQuarter | (zQuarter << 4))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QuarterTile(uint8_t tileAndZQuarter)
|
|
|
|
: _val(tileAndZQuarter)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Rotate both of the values amount. Returns new RValue QuarterTile
|
|
|
|
const QuarterTile Rotate(uint8_t amount) const;
|
|
|
|
|
|
|
|
uint8_t GetBaseQuarterOccupied() const
|
|
|
|
{
|
|
|
|
return _val & 0xF;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t GetZQuarterOccupied() const
|
|
|
|
{
|
|
|
|
return (_val >> 4) & 0xF;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
enum
|
|
|
|
{
|
2018-05-01 17:47:00 +02:00
|
|
|
TILE_ELEMENT_QUADRANT_SW,
|
|
|
|
TILE_ELEMENT_QUADRANT_NW,
|
|
|
|
TILE_ELEMENT_QUADRANT_NE,
|
|
|
|
TILE_ELEMENT_QUADRANT_SE
|
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
enum
|
|
|
|
{
|
2018-10-03 11:39:33 +02:00
|
|
|
SURFACE_ELEMENT_HAS_TRACK_THAT_NEEDS_WATER = (1 << 6),
|
2018-05-01 17:47:00 +02:00
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
enum
|
|
|
|
{
|
2018-05-01 17:47:00 +02:00
|
|
|
TILE_ELEMENT_DIRECTION_WEST,
|
|
|
|
TILE_ELEMENT_DIRECTION_NORTH,
|
|
|
|
TILE_ELEMENT_DIRECTION_EAST,
|
|
|
|
TILE_ELEMENT_DIRECTION_SOUTH
|
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
enum
|
|
|
|
{
|
2018-05-01 17:47:00 +02:00
|
|
|
TILE_ELEMENT_FLAG_GHOST = (1 << 4),
|
|
|
|
TILE_ELEMENT_FLAG_BROKEN = (1 << 5),
|
|
|
|
TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED = (1 << 5),
|
|
|
|
TILE_ELEMENT_FLAG_INDESTRUCTIBLE_TRACK_PIECE = (1 << 6),
|
2018-01-11 00:25:37 +01:00
|
|
|
TILE_ELEMENT_FLAG_BLOCKED_BY_VEHICLE = (1 << 6),
|
2019-02-20 09:32:34 +01:00
|
|
|
TILE_ELEMENT_FLAG_LARGE_SCENERY_ACCOUNTED = (1 << 6),
|
2018-05-01 17:47:00 +02:00
|
|
|
TILE_ELEMENT_FLAG_LAST_TILE = (1 << 7)
|
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
enum
|
|
|
|
{
|
2018-05-01 17:47:00 +02:00
|
|
|
ENTRANCE_TYPE_RIDE_ENTRANCE,
|
|
|
|
ENTRANCE_TYPE_RIDE_EXIT,
|
|
|
|
ENTRANCE_TYPE_PARK_ENTRANCE
|
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
enum
|
|
|
|
{
|
2018-05-01 17:47:00 +02:00
|
|
|
ELEMENT_IS_ABOVE_GROUND = 1 << 0,
|
|
|
|
ELEMENT_IS_UNDERGROUND = 1 << 1,
|
|
|
|
ELEMENT_IS_UNDERWATER = 1 << 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT = (1 << 7),
|
|
|
|
};
|
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
#define TILE_ELEMENT_QUADRANT_MASK 0b11000000
|
|
|
|
#define TILE_ELEMENT_TYPE_MASK 0b00111100
|
2018-05-02 13:30:15 +02:00
|
|
|
#define TILE_ELEMENT_DIRECTION_MASK 0b00000011
|
2019-08-27 21:12:48 +02:00
|
|
|
#define TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK 0b00001111
|
2018-05-01 17:47:00 +02:00
|
|
|
|
2018-06-22 23:17:03 +02:00
|
|
|
#define TILE_ELEMENT_COLOUR_MASK 0b00011111
|
2018-05-01 17:47:00 +02:00
|
|
|
|
2018-05-02 13:30:15 +02:00
|
|
|
#define MAP_ELEM_TRACK_SEQUENCE_STATION_INDEX_MASK 0b01110000
|
2018-06-22 23:17:03 +02:00
|
|
|
#define MAP_ELEM_TRACK_SEQUENCE_SEQUENCE_MASK 0b00001111
|
|
|
|
#define MAP_ELEM_TRACK_SEQUENCE_TAKING_PHOTO_MASK 0b11110000
|
2018-05-01 17:47:00 +02:00
|
|
|
|
2018-11-01 13:53:50 +01:00
|
|
|
BannerIndex tile_element_get_banner_index(TileElement* tileElement);
|
|
|
|
bool tile_element_is_underground(TileElement* tileElement);
|
2018-05-01 17:47:00 +02:00
|
|
|
|
2018-05-01 18:08:11 +02:00
|
|
|
// ~Oli414: The banner functions should probably be part of banner.
|
2018-11-01 13:53:50 +01:00
|
|
|
void tile_element_set_banner_index(TileElement* tileElement, BannerIndex bannerIndex);
|
|
|
|
void tile_element_remove_banner_entry(TileElement* tileElement);
|
2018-05-01 17:47:00 +02:00
|
|
|
|
2018-11-01 13:53:50 +01:00
|
|
|
uint8_t tile_element_get_ride_index(const TileElement* tileElement);
|