mirror of https://github.com/OpenRCT2/OpenRCT2.git
Create conversion functions for entry indices
This commit is contained in:
parent
5ac866c54a
commit
38748fc869
|
@ -1010,3 +1010,19 @@ bool RCT12ResearchItem::IsRandomEndMarker() const
|
|||
{
|
||||
return rawValue == RCT12_RESEARCHED_ITEMS_END_2;
|
||||
}
|
||||
|
||||
ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(RCT12ObjectEntryIndex index)
|
||||
{
|
||||
if (index == RCT12_OBJECT_ENTRY_INDEX_NULL)
|
||||
return OBJECT_ENTRY_INDEX_NULL;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
RCT12ObjectEntryIndex OpenRCT2EntryIndexToRCTEntryIndex(ObjectEntryIndex index)
|
||||
{
|
||||
if (index == OBJECT_ENTRY_INDEX_NULL)
|
||||
return RCT12_OBJECT_ENTRY_INDEX_NULL;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// Structures shared between both RCT1 and RCT2.
|
||||
|
||||
#include "../common.h"
|
||||
#include "../object/Object.h"
|
||||
#include "../world/Location.hpp"
|
||||
|
||||
#include <string>
|
||||
|
@ -49,7 +50,6 @@ constexpr uint16_t const RCT12_MAX_GOLF_HOLES = 31;
|
|||
constexpr uint16_t const RCT12_MAX_HELICES = 31;
|
||||
|
||||
constexpr uint8_t RCT12_BANNER_INDEX_NULL = std::numeric_limits<uint8_t>::max();
|
||||
constexpr const uint8_t RCT12_OBJECT_ENTRY_INDEX_NULL = 255;
|
||||
|
||||
constexpr const uint8_t RCT12_TILE_ELEMENT_SURFACE_EDGE_STYLE_MASK = 0xE0; // in RCT12TileElement.properties.surface.slope
|
||||
constexpr const uint8_t RCT12_TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK = 0x1F; // in RCT12TileElement.properties.surface.terrain
|
||||
|
@ -792,3 +792,9 @@ struct RCT12ResearchItem
|
|||
assert_struct_size(RCT12ResearchItem, 5);
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
using RCT12ObjectEntryIndex = uint8_t;
|
||||
constexpr const RCT12ObjectEntryIndex RCT12_OBJECT_ENTRY_INDEX_NULL = 255;
|
||||
|
||||
ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(RCT12ObjectEntryIndex index);
|
||||
RCT12ObjectEntryIndex OpenRCT2EntryIndexToRCTEntryIndex(ObjectEntryIndex index);
|
||||
|
|
Loading…
Reference in New Issue