2015-02-07 19:38:48 +01:00
|
|
|
/*****************************************************************************
|
2020-07-21 15:04:34 +02:00
|
|
|
* Copyright (c) 2014-2020 OpenRCT2 developers
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
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
|
2016-05-04 19:24:41 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-05-04 19:24:41 +02:00
|
|
|
*****************************************************************************/
|
2015-06-27 23:53:52 +02:00
|
|
|
|
2016-11-13 14:08:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
2015-02-07 19:38:48 +01:00
|
|
|
#include "../common.h"
|
2017-10-17 13:51:47 +02:00
|
|
|
#include "Track.h"
|
2018-01-10 00:00:09 +01:00
|
|
|
#include "TrackPaint.h"
|
2015-02-07 19:38:48 +01:00
|
|
|
|
2020-11-11 01:24:02 +01:00
|
|
|
constexpr const uint8_t MaxSequencesPerPiece = 16;
|
|
|
|
|
2015-02-07 19:38:48 +01:00
|
|
|
// 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3
|
2015-06-27 23:53:52 +02:00
|
|
|
|
2018-02-14 09:42:26 +01:00
|
|
|
struct track_curve_chain
|
2017-10-16 12:04:35 +02:00
|
|
|
{
|
2021-01-29 16:24:53 +01:00
|
|
|
int32_t next;
|
|
|
|
int32_t previous;
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2015-07-13 13:47:31 +02:00
|
|
|
|
2018-02-14 09:42:26 +01:00
|
|
|
struct track_descriptor
|
2017-10-16 12:04:35 +02:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
bool starts_diagonal;
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t slope_start;
|
|
|
|
uint8_t bank_start;
|
|
|
|
uint8_t track_curve;
|
|
|
|
uint8_t slope_end;
|
|
|
|
uint8_t bank_end;
|
|
|
|
uint8_t track_element;
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2016-02-20 17:53:20 +01:00
|
|
|
|
2016-04-27 19:54:07 +02:00
|
|
|
extern const track_descriptor gTrackDescriptors[142];
|
2016-05-15 11:30:03 +02:00
|
|
|
|
2018-02-14 09:42:26 +01:00
|
|
|
struct dodgems_track_size
|
2017-10-16 12:04:35 +02:00
|
|
|
{
|
2018-06-20 17:28:51 +02:00
|
|
|
uint8_t left;
|
|
|
|
uint8_t top;
|
|
|
|
uint8_t right;
|
|
|
|
uint8_t bottom;
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2016-08-07 14:19:56 +02:00
|
|
|
|
2021-02-08 21:28:41 +01:00
|
|
|
constexpr const dodgems_track_size DodgemsTrackSize(track_type_t 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 };
|
|
|
|
}
|
2016-08-12 21:22:25 +02:00
|
|
|
|
2021-08-22 15:06:58 +02:00
|
|
|
struct TrackElementDescriptor
|
|
|
|
{
|
|
|
|
rct_track_coordinates Coordinates;
|
|
|
|
|
|
|
|
rct_preview_track* Block;
|
|
|
|
uint8_t PieceLength;
|
|
|
|
track_curve_chain CurveChain;
|
|
|
|
track_type_t AlternativeType;
|
2021-08-29 16:08:54 +02:00
|
|
|
money32 Price;
|
|
|
|
track_type_t MirrorElement;
|
2021-08-22 15:06:58 +02:00
|
|
|
uint32_t HeightMarkerPositions;
|
|
|
|
uint16_t Flags;
|
|
|
|
|
|
|
|
std::array<uint8_t, MaxSequencesPerPiece> SequenceElementAllowedWallEdges;
|
2021-08-29 16:08:54 +02:00
|
|
|
std::array<uint8_t, MaxSequencesPerPiece> SequenceProperties;
|
2021-08-30 02:15:44 +02:00
|
|
|
|
|
|
|
rct_trackdefinition Definition;
|
2021-08-22 15:06:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace OpenRCT2
|
|
|
|
{
|
|
|
|
namespace TrackMetaData
|
|
|
|
{
|
|
|
|
void Init();
|
2021-08-27 23:44:33 +02:00
|
|
|
const TrackElementDescriptor& GetTrackElementDescriptor(const uint32_t type);
|
2021-08-22 15:06:58 +02:00
|
|
|
} // namespace TrackMetaData
|
|
|
|
} // namespace OpenRCT2
|