Addendum to #15340: guard size of object_entry_group_counts

This commit is contained in:
Michael Steenbeek 2021-09-05 16:06:34 +02:00 committed by GitHub
parent bdf300bcdb
commit 7b2554cdae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 11 deletions

View File

@ -18,6 +18,7 @@
#include "ObjectRepository.h"
#include <algorithm>
#include <array>
#include <cstring>
// 98DA00
@ -41,6 +42,7 @@ int32_t object_entry_group_counts[] = {
MAX_FOOTPATH_SURFACE_OBJECTS,
MAX_FOOTPATH_RAILINGS_OBJECTS,
};
static_assert(std::size(object_entry_group_counts) == EnumValue(ObjectType::Count));
// 98DA2C
int32_t object_entry_group_encoding[] = {

View File

@ -9,6 +9,7 @@
#include "Addresses.h"
#include <array>
#include <openrct2/Context.h>
#include <openrct2/config/Config.h>
#include <openrct2/interface/Colour.h>
@ -72,18 +73,25 @@ uint8_t get_current_rotation()
}
int object_entry_group_counts[] = {
128, // rides
252, // small scenery
128, // large scenery
128, // walls
32, // banners
16, // paths
15, // path bits
19, // scenery sets
1, // park entrance
1, // water
1 // scenario text
128, // ObjectType::Ride
252, // ObjectType::SmallScenery
128, // ObjectType::LargeScenery
128, // ObjectType::Walls
32, // ObjectType::Banners
16, // ObjectType::Paths
15, // ObjectType::PathBits
19, // ObjectType::SceneryGroup
1, // ObjectType::ParkEntrance
1, // ObjectType::Water
1, // ObjectType::ScenarioText
0, // ObjectType::TerrainSurface
0, // ObjectType::TerrainEdge
0, // ObjectType::Station
0, // ObjectType::Music
0, // ObjectType::FootpathSurface
0, // ObjectType::FootpathRailings
};
static_assert(std::size(object_entry_group_counts) == EnumValue(ObjectType::Count));
GeneralConfiguration gConfigGeneral;
uint16_t gMapSelectFlags;