mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 05:53:02 +01:00
Use object_entry_get_type() throughout
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "Game.h"
|
||||
#include "localisation/Localisation.h"
|
||||
#include "object/DefaultObjects.h"
|
||||
#include "object/ObjectList.h"
|
||||
#include "object/ObjectManager.h"
|
||||
#include "object/ObjectRepository.h"
|
||||
#include "OpenRCT2.h"
|
||||
@@ -30,6 +31,7 @@
|
||||
#include "world/Footpath.h"
|
||||
#include "world/LargeScenery.h"
|
||||
|
||||
|
||||
bool _maxObjectsWasHit;
|
||||
std::vector<uint8> _objectSelectionFlags;
|
||||
sint32 _numSelectedObjectsForType[OBJECT_TYPE_COUNT];
|
||||
@@ -53,7 +55,7 @@ static void setup_track_manager_objects()
|
||||
{
|
||||
uint8 * selectionFlags = &_objectSelectionFlags[i];
|
||||
const ObjectRepositoryItem * item = &items[i];
|
||||
uint8 object_type = item->ObjectEntry.flags & 0xF;
|
||||
uint8 object_type = object_entry_get_type(&item->ObjectEntry);
|
||||
if (object_type == OBJECT_TYPE_RIDE)
|
||||
{
|
||||
*selectionFlags |= OBJECT_SELECTION_FLAG_6;
|
||||
@@ -82,7 +84,7 @@ static void setup_track_designer_objects()
|
||||
{
|
||||
uint8 * selectionFlags = &_objectSelectionFlags[i];
|
||||
const ObjectRepositoryItem * item = &items[i];
|
||||
uint8 objectType = item->ObjectEntry.flags & 0xF;
|
||||
uint8 objectType = object_entry_get_type(&item->ObjectEntry);
|
||||
if (objectType == OBJECT_TYPE_RIDE)
|
||||
{
|
||||
*selectionFlags |= OBJECT_SELECTION_FLAG_6;
|
||||
@@ -227,7 +229,7 @@ void sub_6AB211()
|
||||
|
||||
const ObjectRepositoryItem * items = object_repository_get_items();
|
||||
for (sint32 i = 0; i < numObjects; i++) {
|
||||
uint8 objectType = items[i].ObjectEntry.flags & 0xF;
|
||||
uint8 objectType = object_entry_get_type(&items[i].ObjectEntry);
|
||||
_numAvailableObjectsForType[objectType]++;
|
||||
}
|
||||
|
||||
@@ -360,7 +362,7 @@ void reset_selected_object_count_and_size()
|
||||
sint32 numObjects = (sint32)object_repository_get_items_count();
|
||||
const ObjectRepositoryItem * items = object_repository_get_items();
|
||||
for (sint32 i = 0; i < numObjects; i++) {
|
||||
uint8 objectType = items[i].ObjectEntry.flags & 0xF;
|
||||
uint8 objectType = object_entry_get_type(&items[i].ObjectEntry);
|
||||
if (_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED) {
|
||||
_numSelectedObjectsForType[objectType]++;
|
||||
}
|
||||
@@ -415,7 +417,7 @@ sint32 window_editor_object_selection_select_object(uint8 bh, sint32 flags, cons
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 objectType = item->ObjectEntry.flags & 0xF;
|
||||
uint8 objectType = object_entry_get_type(&item->ObjectEntry);
|
||||
if (objectType == OBJECT_TYPE_SCENERY_GROUP && (flags & (1 << 2))) {
|
||||
for (sint32 j = 0; j < item->NumThemeObjects; j++) {
|
||||
window_editor_object_selection_select_object(++bh, flags, &item->ThemeObjects[j]);
|
||||
@@ -435,7 +437,7 @@ sint32 window_editor_object_selection_select_object(uint8 bh, sint32 flags, cons
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8 objectType = item->ObjectEntry.flags & 0xF;
|
||||
uint8 objectType = object_entry_get_type(&item->ObjectEntry);
|
||||
uint16 maxObjects = object_entry_group_counts[objectType];
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) {
|
||||
maxObjects = 4;
|
||||
@@ -480,7 +482,7 @@ bool editor_check_object_group_at_least_one_selected(sint32 checkObjectType)
|
||||
const ObjectRepositoryItem * items = object_repository_get_items();
|
||||
|
||||
for (sint32 i = 0; i < numObjects; i++) {
|
||||
uint8 objectType = items[i].ObjectEntry.flags & 0x0F;
|
||||
uint8 objectType = object_entry_get_type(&items[i].ObjectEntry);
|
||||
if (checkObjectType == objectType && (_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_SELECTED)) {
|
||||
return true;
|
||||
}
|
||||
@@ -502,7 +504,7 @@ sint32 editor_remove_unused_objects()
|
||||
if (!(_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_IN_USE) && !(_objectSelectionFlags[i] & OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED))
|
||||
{
|
||||
const ObjectRepositoryItem * item = &items[i];
|
||||
uint8 objectType = item->ObjectEntry.flags & 0xF;
|
||||
uint8 objectType = object_entry_get_type(&item->ObjectEntry);
|
||||
|
||||
if (objectType == OBJECT_TYPE_PARK_ENTRANCE || objectType == OBJECT_TYPE_SCENARIO_TEXT || objectType == OBJECT_TYPE_WATER || objectType == OBJECT_TYPE_SCENERY_GROUP)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user