Use (RCT12)ObjectEntryIndex in more places

This commit is contained in:
Gymnasiast committed 2020-05-01 22:06:13 +02:00
1 parent 9b2dba62d8
commit cc65564521
26 files changed
+99 -107

No files matched your search

+7 -6
View File
@@ -198,7 +198,8 @@ static ScenerySelection window_scenery_tab_entries[SCENERY_WINDOW_TABS][SCENERY_
* Was part of 0x006DFA00
* The same code repeated five times for every scenery entry type
*/
static void init_scenery_entry(rct_scenery_entry* sceneryEntry, const ScenerySelection& selection, uint8_t sceneryTabId)
static void init_scenery_entry(
rct_scenery_entry* sceneryEntry, const ScenerySelection& selection, ObjectEntryIndex sceneryTabId)
{
Guard::ArgumentInRange<int32_t>(selection.EntryIndex, 0, WINDOW_SCENERY_TAB_SELECTION_UNDEFINED);
if (scenery_is_invented(selection) || gCheatsIgnoreResearchStatus)
@@ -278,7 +279,7 @@ void window_scenery_init()
}
// small scenery
for (uint16_t sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++)
for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++)
{
rct_scenery_entry* sceneryEntry = get_small_scenery_entry(sceneryId);
if (sceneryEntry == nullptr)
@@ -288,7 +289,7 @@ void window_scenery_init()
}
// large scenery
for (uint16_t sceneryId = 0; sceneryId < MAX_LARGE_SCENERY_OBJECTS; sceneryId++)
for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_LARGE_SCENERY_OBJECTS; sceneryId++)
{
rct_scenery_entry* sceneryEntry = get_large_scenery_entry(sceneryId);
if (sceneryEntry == nullptr)
@@ -298,7 +299,7 @@ void window_scenery_init()
}
// walls
for (uint16_t sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++)
for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++)
{
rct_scenery_entry* sceneryEntry = get_wall_entry(sceneryId);
if (sceneryEntry == nullptr)
@@ -308,7 +309,7 @@ void window_scenery_init()
}
// banners
for (uint16_t sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++)
for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++)
{
rct_scenery_entry* sceneryEntry = get_banner_entry(sceneryId);
if (sceneryEntry == nullptr)
@@ -318,7 +319,7 @@ void window_scenery_init()
}
// path bits
for (uint16_t sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++)
for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++)
{
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(sceneryId);
if (sceneryEntry == nullptr)
+1 -1
View File
@@ -298,7 +298,7 @@ namespace Editor
for (BannerIndex i = 0; i < MAX_BANNERS; i++)
{
auto banner = GetBanner(i);
if (banner->type == BANNER_NULL)
if (banner->IsNull())
{
banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE;
}
@@ -125,7 +125,7 @@ void setup_in_use_selection_flags()
tile_element_iterator_begin(&iter);
do
{
uint16_t type;
ObjectEntryIndex type;
switch (iter.element->GetType())
{
+3 -3
View File
@@ -19,7 +19,7 @@ DEFINE_GAME_ACTION(BannerPlaceAction, GAME_COMMAND_PLACE_BANNER, GameActionResul
{
private:
CoordsXYZD _loc;
uint8_t _bannerType{ std::numeric_limits<uint8_t>::max() };
ObjectEntryIndex _bannerType{ BANNER_NULL };
BannerIndex _bannerIndex{ BANNER_INDEX_NULL };
uint8_t _primaryColour;
@@ -91,7 +91,7 @@ public:
}
auto banner = GetBanner(_bannerIndex);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
log_error("Banner index in use, bannerIndex = %u", _bannerIndex);
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE);
@@ -129,7 +129,7 @@ public:
}
auto banner = GetBanner(_bannerIndex);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
log_error("Banner index in use, bannerIndex = %u", _bannerIndex);
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE);
+2 -2
View File
@@ -28,12 +28,12 @@ DEFINE_GAME_ACTION(FootpathPlaceAction, GAME_COMMAND_PLACE_PATH, GameActionResul
private:
CoordsXYZ _loc;
uint8_t _slope;
uint8_t _type;
ObjectEntryIndex _type;
Direction _direction = INVALID_DIRECTION;
public:
FootpathPlaceAction() = default;
FootpathPlaceAction(const CoordsXYZ& loc, uint8_t slope, uint8_t type, Direction direction = INVALID_DIRECTION)
FootpathPlaceAction(const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, Direction direction = INVALID_DIRECTION)
: _loc(loc)
, _slope(slope)
, _type(type)
@@ -48,7 +48,7 @@ DEFINE_GAME_ACTION(LargeSceneryPlaceAction, GAME_COMMAND_PLACE_LARGE_SCENERY, La
{
private:
CoordsXYZD _loc;
uint8_t _sceneryType{ std::numeric_limits<uint8_t>::max() };
ObjectEntryIndex _sceneryType{ OBJECT_ENTRY_INDEX_NULL };
uint8_t _primaryColour;
uint8_t _secondaryColour;
BannerIndex _bannerId{ BANNER_INDEX_NULL };
@@ -56,7 +56,7 @@ private:
public:
LargeSceneryPlaceAction() = default;
LargeSceneryPlaceAction(const CoordsXYZD& loc, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
LargeSceneryPlaceAction(const CoordsXYZD& loc, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
: _loc(loc)
, _sceneryType(sceneryType)
, _primaryColour(primaryColour)
@@ -138,7 +138,7 @@ public:
}
auto banner = GetBanner(_bannerId);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
log_error("No free banners available");
return std::make_unique<LargeSceneryPlaceActionResult>(GA_ERROR::NO_FREE_ELEMENTS);
@@ -253,7 +253,7 @@ public:
}
auto banner = GetBanner(_bannerId);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
log_error("No free banners available");
return std::make_unique<LargeSceneryPlaceActionResult>(GA_ERROR::NO_FREE_ELEMENTS);
+1 -1
View File
@@ -140,7 +140,7 @@ private:
for (BannerIndex i = 0; i < MAX_BANNERS; i++)
{
auto banner = GetBanner(i);
if (banner->type != BANNER_NULL && banner->flags & BANNER_FLAG_LINKED_TO_RIDE && banner->ride_index == _rideIndex)
if (!banner->IsNull() && banner->flags & BANNER_FLAG_LINKED_TO_RIDE && banner->ride_index == _rideIndex)
{
banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE;
banner->text = {};
@@ -28,12 +28,12 @@ DEFINE_GAME_ACTION(SmallSceneryRemoveAction, GAME_COMMAND_REMOVE_SCENERY, GameAc
private:
CoordsXYZ _loc;
uint8_t _quadrant;
uint8_t _sceneryType;
ObjectEntryIndex _sceneryType;
public:
SmallSceneryRemoveAction() = default;
SmallSceneryRemoveAction(const CoordsXYZ& location, uint8_t quadrant, uint8_t sceneryType)
SmallSceneryRemoveAction(const CoordsXYZ& location, uint8_t quadrant, ObjectEntryIndex sceneryType)
: _loc(location)
, _quadrant(quadrant)
, _sceneryType(sceneryType)
@@ -32,7 +32,7 @@ DEFINE_GAME_ACTION(SmallScenerySetColourAction, GAME_COMMAND_SET_SCENERY_COLOUR,
private:
CoordsXYZ _loc;
uint8_t _quadrant;
uint8_t _sceneryType;
ObjectEntryIndex _sceneryType;
uint8_t _primaryColour;
uint8_t _secondaryColour;
@@ -40,7 +40,7 @@ public:
SmallScenerySetColourAction() = default;
SmallScenerySetColourAction(
const CoordsXYZ& loc, uint8_t quadrant, uint8_t sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
const CoordsXYZ& loc, uint8_t quadrant, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour)
: _loc(loc)
, _quadrant(quadrant)
, _sceneryType(sceneryType)
+2 -2
View File
@@ -260,7 +260,7 @@ public:
}
auto banner = GetBanner(_bannerId);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
log_error("No free banners available");
return std::make_unique<WallPlaceActionResult>(GA_ERROR::NO_FREE_ELEMENTS);
@@ -351,7 +351,7 @@ public:
}
auto banner = GetBanner(_bannerId);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
log_error("No free banners available");
return std::make_unique<WallPlaceActionResult>(GA_ERROR::NO_FREE_ELEMENTS);
@@ -1251,7 +1251,7 @@ static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] cons
for (BannerIndex i = 0; i < MAX_BANNERS; ++i)
{
auto banner = GetBanner(i);
if (banner->type != BANNER_NULL)
if (!banner->IsNull())
{
bannerCount++;
}
+2 -2
View File
@@ -23,8 +23,8 @@ void BannerObject::ReadLegacy(IReadObjectContext* context, IStream* stream)
_legacyType.banner.scrolling_mode = stream->ReadValue<uint8_t>();
_legacyType.banner.flags = stream->ReadValue<uint8_t>();
_legacyType.banner.price = stream->ReadValue<int16_t>();
_legacyType.banner.scenery_tab_id = stream->ReadValue<uint8_t>();
stream->Seek(1, STREAM_SEEK_CURRENT);
_legacyType.banner.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
stream->Seek(2, STREAM_SEEK_CURRENT);
GetStringTable().Read(context, stream, OBJ_STRING_ID_NAME);
+2 -2
View File
@@ -27,8 +27,8 @@ void FootpathItemObject::ReadLegacy(IReadObjectContext* context, IStream* stream
_legacyType.path_bit.draw_type = stream->ReadValue<uint8_t>();
_legacyType.path_bit.tool_id = stream->ReadValue<uint8_t>();
_legacyType.path_bit.price = stream->ReadValue<int16_t>();
_legacyType.path_bit.scenery_tab_id = stream->ReadValue<uint8_t>();
stream->Seek(1, STREAM_SEEK_CURRENT);
_legacyType.path_bit.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
stream->Seek(2, STREAM_SEEK_CURRENT);
GetStringTable().Read(context, stream, OBJ_STRING_ID_NAME);
+1 -1
View File
@@ -17,7 +17,7 @@
#include "../world/Water.h"
#include "ObjectLimits.h"
void get_type_entry_index(size_t index, uint8_t* outObjectType, uint16_t* outEntryIndex);
void get_type_entry_index(size_t index, uint8_t* outObjectType, ObjectEntryIndex* outEntryIndex);
const rct_object_entry* get_loaded_object_entry(size_t index);
void* get_loaded_object_chunk(size_t index);
uint8_t object_entry_get_type(const rct_object_entry* objectEntry);
+2 -1
View File
@@ -25,7 +25,8 @@ void WallObject::ReadLegacy(IReadObjectContext* context, IStream* stream)
_legacyType.wall.height = stream->ReadValue<uint8_t>();
_legacyType.wall.flags2 = stream->ReadValue<uint8_t>();
_legacyType.wall.price = stream->ReadValue<uint16_t>();
_legacyType.wall.scenery_tab_id = stream->ReadValue<uint8_t>();
_legacyType.wall.scenery_tab_id = OBJECT_ENTRY_INDEX_NULL;
stream->Seek(1, STREAM_SEEK_CURRENT);
_legacyType.wall.scrolling_mode = stream->ReadValue<uint8_t>();
GetStringTable().Read(context, stream, OBJ_STRING_ID_NAME);
+1 -1
View File
@@ -971,7 +971,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
// Check if the footpath has a queue line TV monitor on it
if (tileElement->AsPath()->HasAddition() && !tileElement->AsPath()->AdditionIsGhost())
{
uint8_t pathSceneryIndex = tileElement->AsPath()->GetAdditionEntryIndex();
auto pathSceneryIndex = tileElement->AsPath()->GetAdditionEntryIndex();
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(pathSceneryIndex);
if (sceneryEntry != nullptr && sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_QUEUE_SCREEN)
{
+3 -3
View File
@@ -2063,7 +2063,7 @@ private:
}
else
{
uint8_t railingsEntryIndex;
ObjectEntryIndex railingsEntryIndex;
switch (src2->GetRCT1SupportType())
{
case RCT1_PATH_SUPPORT_TYPE_COATED_WOOD:
@@ -2083,10 +2083,10 @@ private:
}
// Additions
uint8_t additionType = dst2->GetAddition();
ObjectEntryIndex additionType = dst2->GetAddition();
if (additionType != RCT1_PATH_ADDITION_NONE)
{
uint8_t normalisedType = RCT1::NormalisePathAddition(additionType);
ObjectEntryIndex normalisedType = RCT1::NormalisePathAddition(additionType);
entryIndex = _pathAdditionTypeToEntryMap[normalisedType];
if (additionType != normalisedType)
{
+10 -10
View File
@@ -57,6 +57,9 @@ constexpr const uint8_t RCT12_TILE_ELEMENT_SURFACE_TERRAIN_MASK = 0xE0; //
constexpr uint16_t const RCT12_XY8_UNDEFINED = 0xFFFF;
using RCT12ObjectEntryIndex = uint8_t;
constexpr const RCT12ObjectEntryIndex RCT12_OBJECT_ENTRY_INDEX_NULL = 255;
// Everything before this point has been researched
constexpr const uint32_t RCT12_RESEARCHED_ITEMS_SEPARATOR = 0xFFFFFFFF;
// Everything before this point and after separator still requires research
@@ -357,7 +360,7 @@ private:
};
public:
uint8_t GetEntryIndex() const;
RCT12ObjectEntryIndex GetEntryIndex() const;
uint8_t GetQueueBannerDirection() const;
bool IsSloped() const;
uint8_t GetSlopeDirection() const;
@@ -374,7 +377,7 @@ public:
uint8_t GetRCT1PathType() const;
uint8_t GetRCT1SupportType() const;
void SetPathEntryIndex(uint8_t newIndex);
void SetPathEntryIndex(RCT12ObjectEntryIndex newIndex);
void SetQueueBannerDirection(uint8_t direction);
void SetSloped(bool isSloped);
void SetSlopeDirection(uint8_t newSlope);
@@ -468,14 +471,14 @@ private:
uint8_t colour_1; // 6
uint8_t colour_2; // 7
public:
uint8_t GetEntryIndex() const;
RCT12ObjectEntryIndex GetEntryIndex() const;
uint8_t GetAge() const;
uint8_t GetSceneryQuadrant() const;
colour_t GetPrimaryColour() const;
colour_t GetSecondaryColour() const;
bool NeedsSupports() const;
void SetEntryIndex(uint8_t newIndex);
void SetEntryIndex(RCT12ObjectEntryIndex newIndex);
void SetAge(uint8_t newAge);
void SetSceneryQuadrant(uint8_t newQuadrant);
void SetPrimaryColour(colour_t colour);
@@ -514,7 +517,7 @@ private:
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)
public:
uint8_t GetEntryIndex() const;
RCT12ObjectEntryIndex GetEntryIndex() const;
uint8_t GetSlope() const;
colour_t GetPrimaryColour() const;
colour_t GetSecondaryColour() const;
@@ -527,7 +530,7 @@ public:
int32_t GetRCT1WallType(int32_t edge) const;
colour_t GetRCT1WallColour() const;
void SetEntryIndex(uint8_t newIndex);
void SetEntryIndex(RCT12ObjectEntryIndex newIndex);
void SetSlope(uint8_t newslope);
void SetPrimaryColour(colour_t newColour);
void SetSecondaryColour(colour_t newColour);
@@ -777,7 +780,7 @@ struct RCT12ResearchItem
uint32_t rawValue;
struct
{
uint8_t entryIndex;
RCT12ObjectEntryIndex entryIndex;
uint8_t baseRideType;
uint8_t type; // 0: scenery entry, 1: ride entry
uint8_t flags;
@@ -793,8 +796,5 @@ 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);
+1 -1
View File
@@ -103,7 +103,7 @@ struct rct2_ride
uint8_t type; // 0x000
// pointer to static info. for example, wild mouse type is 0x36, subtype is
// 0x4c.
uint8_t subtype; // 0x001
RCT12ObjectEntryIndex subtype; // 0x001
uint16_t pad_002; // 0x002
uint8_t mode; // 0x004
uint8_t colour_scheme_type; // 0x005
+2 -2
View File
@@ -21,7 +21,7 @@ struct WallElement;
using BannerIndex = uint16_t;
constexpr uint8_t BANNER_NULL = 255;
constexpr ObjectEntryIndex BANNER_NULL = OBJECT_ENTRY_INDEX_NULL;
constexpr size_t MAX_BANNERS = 250;
constexpr BannerIndex BANNER_INDEX_NULL = static_cast<BannerIndex>(-1);
@@ -29,7 +29,7 @@ constexpr uint8_t SCROLLING_MODE_NONE = 255;
struct Banner
{
uint8_t type = BANNER_NULL;
ObjectEntryIndex type = BANNER_NULL;
uint8_t flags{};
std::string text;
uint8_t colour{};
+1 -1
View File
@@ -1535,7 +1535,7 @@ uint8_t PathElement::GetAddition() const
return Additions;
}
uint8_t PathElement::GetAdditionEntryIndex() const
ObjectEntryIndex PathElement::GetAdditionEntryIndex() const
{
return GetAddition() - 1;
}
+1 -1
View File
@@ -263,7 +263,7 @@ bool JumpingFountain::IsJumpingFountain(const int32_t newType, const CoordsXYZ&
if (!tileElement->AsPath()->HasAddition())
continue;
const uint8_t additionIndex = tileElement->AsPath()->GetAdditionEntryIndex();
const auto additionIndex = tileElement->AsPath()->GetAdditionEntryIndex();
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(additionIndex);
if (sceneryEntry != nullptr && sceneryEntry->path_bit.flags & pathBitFlagMask)
{
+4 -4
View File
@@ -229,7 +229,7 @@ void scenery_remove_ghost_tool_placement()
}
}
rct_scenery_entry* get_wall_entry(int32_t entryIndex)
rct_scenery_entry* get_wall_entry(ObjectEntryIndex entryIndex)
{
rct_scenery_entry* result = nullptr;
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
@@ -241,7 +241,7 @@ rct_scenery_entry* get_wall_entry(int32_t entryIndex)
return result;
}
rct_scenery_entry* get_banner_entry(int32_t entryIndex)
rct_scenery_entry* get_banner_entry(ObjectEntryIndex entryIndex)
{
rct_scenery_entry* result = nullptr;
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
@@ -253,7 +253,7 @@ rct_scenery_entry* get_banner_entry(int32_t entryIndex)
return result;
}
rct_scenery_entry* get_footpath_item_entry(int32_t entryIndex)
rct_scenery_entry* get_footpath_item_entry(ObjectEntryIndex entryIndex)
{
rct_scenery_entry* result = nullptr;
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
@@ -265,7 +265,7 @@ rct_scenery_entry* get_footpath_item_entry(int32_t entryIndex)
return result;
}
rct_scenery_group_entry* get_scenery_group_entry(int32_t entryIndex)
rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex)
{
rct_scenery_group_entry* result = nullptr;
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
+39 -51
View File
@@ -23,20 +23,17 @@
#pragma pack(push, 1)
struct rct_small_scenery_entry
{
uint32_t flags; // 0x06
uint8_t height; // 0x0A
uint8_t tool_id; // 0x0B
int16_t price; // 0x0C
int16_t removal_price; // 0x0E
uint8_t* frame_offsets; // 0x10
uint16_t animation_delay; // 0x14
uint16_t animation_mask; // 0x16
uint16_t num_frames; // 0x18
uint8_t scenery_tab_id; // 0x1A
uint32_t flags; // 0x06
uint8_t height; // 0x0A
uint8_t tool_id; // 0x0B
int16_t price; // 0x0C
int16_t removal_price; // 0x0E
uint8_t* frame_offsets; // 0x10
uint16_t animation_delay; // 0x14
uint16_t animation_mask; // 0x16
uint16_t num_frames; // 0x18
ObjectEntryIndex scenery_tab_id; // 0x1A
};
#ifdef PLATFORM_32BIT
assert_struct_size(rct_small_scenery_entry, 21);
#endif
struct rct_large_scenery_tile
{
@@ -83,19 +80,16 @@ enum LARGE_SCENERY_TEXT_FLAGS
struct rct_large_scenery_entry
{
uint8_t tool_id; // 0x06
uint8_t flags; // 0x07
int16_t price; // 0x08
int16_t removal_price; // 0x0A
rct_large_scenery_tile* tiles; // 0x0C
uint8_t scenery_tab_id; // 0x10
uint8_t scrolling_mode; // 0x11
rct_large_scenery_text* text; // 0x12
uint32_t text_image; // 0x16
uint8_t tool_id;
uint8_t flags;
int16_t price;
int16_t removal_price;
rct_large_scenery_tile* tiles;
ObjectEntryIndex scenery_tab_id;
uint8_t scrolling_mode;
rct_large_scenery_text* text;
uint32_t text_image;
};
#ifdef PLATFORM_32BIT
assert_struct_size(rct_large_scenery_entry, 20);
#endif
enum LARGE_SCENERY_FLAGS
{
@@ -108,15 +102,14 @@ enum LARGE_SCENERY_FLAGS
struct rct_wall_scenery_entry
{
uint8_t tool_id; // 0x06
uint8_t flags; // 0x07
uint8_t height; // 0x08
uint8_t flags2; // 0x09
int16_t price; // 0x0A
uint8_t scenery_tab_id; // 0x0C
uint8_t scrolling_mode; // 0x0D 0xFF if no scrolling
uint8_t tool_id;
uint8_t flags;
uint8_t height;
uint8_t flags2;
int16_t price;
ObjectEntryIndex scenery_tab_id;
uint8_t scrolling_mode;
};
assert_struct_size(rct_wall_scenery_entry, 8);
enum WALL_SCENERY_FLAGS
{
@@ -141,22 +134,20 @@ enum WALL_SCENERY_2_FLAGS
struct rct_path_bit_scenery_entry
{
uint16_t flags; // 0x06
uint8_t draw_type; // 0x08
uint8_t tool_id; // 0x09
int16_t price; // 0x0A
uint8_t scenery_tab_id; // 0x0C
uint16_t flags; // 0x06
uint8_t draw_type; // 0x08
uint8_t tool_id; // 0x09
int16_t price; // 0x0A
ObjectEntryIndex scenery_tab_id; // 0x0C
};
assert_struct_size(rct_path_bit_scenery_entry, 7);
struct rct_banner_scenery_entry
{
uint8_t scrolling_mode; // 0x06
uint8_t flags; // 0x07
int16_t price; // 0x08
uint8_t scenery_tab_id; // 0x0A
uint8_t scrolling_mode; // 0x06
uint8_t flags; // 0x07
int16_t price; // 0x08
ObjectEntryIndex scenery_tab_id; // 0x0A
};
assert_struct_size(rct_banner_scenery_entry, 5);
struct rct_scenery_entry
{
@@ -171,9 +162,6 @@ struct rct_scenery_entry
rct_banner_scenery_entry banner;
};
};
#ifdef PLATFORM_32BIT
assert_struct_size(rct_scenery_entry, 6 + 21);
#endif
#pragma pack(pop)
@@ -269,10 +257,10 @@ void scenery_update_tile(const CoordsXY& sceneryPos);
void scenery_set_default_placement_configuration();
void scenery_remove_ghost_tool_placement();
rct_scenery_entry* get_wall_entry(int32_t entryIndex);
rct_scenery_entry* get_banner_entry(int32_t entryIndex);
rct_scenery_entry* get_footpath_item_entry(int32_t entryIndex);
rct_scenery_group_entry* get_scenery_group_entry(int32_t entryIndex);
rct_scenery_entry* get_wall_entry(ObjectEntryIndex entryIndex);
rct_scenery_entry* get_banner_entry(ObjectEntryIndex entryIndex);
rct_scenery_entry* get_footpath_item_entry(ObjectEntryIndex entryIndex);
rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex);
int32_t wall_entry_get_door_sound(const rct_scenery_entry* wallEntry);
+3 -1
View File
@@ -9,6 +9,8 @@
#pragma once
#include "../object/Object.h"
#include <cstdint>
#include <limits>
@@ -17,7 +19,7 @@ constexpr auto WINDOW_SCENERY_TAB_SELECTION_UNDEFINED = std::numeric_limits<uint
struct ScenerySelection
{
uint8_t SceneryType;
uint16_t EntryIndex;
ObjectEntryIndex EntryIndex;
inline bool operator==(const ScenerySelection& rhs)
{
+1 -1
View File
@@ -258,7 +258,7 @@ public:
bool HasAddition() const;
uint8_t GetAddition() const;
uint8_t GetAdditionEntryIndex() const;
ObjectEntryIndex GetAdditionEntryIndex() const;
rct_scenery_entry* GetAdditionEntry() const;
void SetAddition(uint8_t newAddition);