Codechange: Store objectspecs in std::vector instead of flat array.

This commit is contained in:
Peter Nelson
2022-11-06 19:21:03 +00:00
committed by PeterN
parent 93197f58b7
commit 1f46f080f0
7 changed files with 26 additions and 16 deletions

View File

@@ -275,11 +275,11 @@ public:
uint height[2] = {0, 0}; // The height for the different views; in this case views 1/2 and 4.
/* Get the height and view information. */
for (int i = 0; i < NUM_OBJECTS; i++) {
for (int i = 0; i < ObjectSpec::Count(); i++) {
const ObjectSpec *spec = ObjectSpec::Get(i);
if (!spec->IsEverAvailable()) continue;
two_wide |= spec->views >= 2;
height[spec->views / 4] = std::max<int>(ObjectSpec::Get(i)->height, height[spec->views / 4]);
height[spec->views / 4] = std::max<int>(spec->height, height[spec->views / 4]);
}
/* Determine the pixel heights. */