Split OBJECT_ENTRY_COUNT into RCT2/OpenRCT2 variants (#10877)

This commit is contained in:
Michael Steenbeek 2020-03-05 17:25:57 +01:00 committed by GitHub
parent 8351a0477d
commit d085a0ed20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 4 deletions

View file

@ -65,8 +65,6 @@ enum OBJECT_SOURCE_GAME
OBJECT_SOURCE_RCT2 = 8
};
#define OBJECT_ENTRY_COUNT 721
#pragma pack(push, 1)
/**
* Object entry structure.

View file

@ -9,6 +9,8 @@
#pragma once
#include <cstdint>
#define MAX_RIDE_OBJECTS 128
#define MAX_SMALL_SCENERY_OBJECTS 252
#define MAX_LARGE_SCENERY_OBJECTS 128
@ -25,4 +27,20 @@
#define MAX_STATION_OBJECTS 255
#define MAX_MUSIC_OBJECTS 0
// clang-format off
constexpr const uint16_t OBJECT_ENTRY_COUNT =
MAX_RIDE_OBJECTS +
MAX_SMALL_SCENERY_OBJECTS +
MAX_LARGE_SCENERY_OBJECTS +
MAX_WALL_SCENERY_OBJECTS +
MAX_BANNER_OBJECTS +
MAX_PATH_OBJECTS +
MAX_PATH_ADDITION_OBJECTS +
MAX_SCENERY_GROUP_OBJECTS +
MAX_PARK_ENTRANCE_OBJECTS +
MAX_WATER_OBJECTS +
MAX_SCENARIO_TEXT_OBJECTS;
// clang-format on
static_assert(OBJECT_ENTRY_COUNT == 721);
#define DAT_NAME_LENGTH 8

View file

@ -34,6 +34,8 @@
#define RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS 56
#define RCT2_MAX_RESEARCHED_SCENERY_ITEMS (RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS * 32) // There are 32 bits per quad.
constexpr const uint16_t RCT2_OBJECT_ENTRY_COUNT = 721;
struct rct2_install_info
{
uint32_t installLevel;

View file

@ -173,7 +173,7 @@ void S6Exporter::Export()
uint32_t researchedTrackPiecesA[128] = {};
uint32_t researchedTrackPiecesB[128] = {};
for (int32_t i = 0; i < OBJECT_ENTRY_COUNT; i++)
for (int32_t i = 0; i < RCT2_OBJECT_ENTRY_COUNT; i++)
{
const rct_object_entry* entry = get_loaded_object_entry(i);
void* entryData = get_loaded_object_chunk(i);

View file

@ -97,7 +97,7 @@ struct rct_s6_data
// packed objects
// SC6[3]
rct_object_entry objects[OBJECT_ENTRY_COUNT];
rct_object_entry objects[RCT2_OBJECT_ENTRY_COUNT];
// SC6[4]
uint16_t elapsed_months;