1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Create ObjectEntryDescriptor to properly handle mixed DAT and JSON

This commit is contained in:
Gymnasiast
2020-12-02 16:50:21 +01:00
parent aa8a08987f
commit 596aa71093
9 changed files with 99 additions and 17 deletions

View File

@@ -455,7 +455,7 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_
{
for (const auto& sgEntry : item->SceneryGroupInfo.Entries)
{
window_editor_object_selection_select_object(++isMasterObject, flags, &sgEntry);
window_editor_object_selection_select_object(++isMasterObject, flags, sgEntry);
}
}
@@ -494,7 +494,7 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_
{
for (const auto& sgEntry : item->SceneryGroupInfo.Entries)
{
if (!window_editor_object_selection_select_object(++isMasterObject, flags, &sgEntry))
if (!window_editor_object_selection_select_object(++isMasterObject, flags, sgEntry))
{
_maxObjectsWasHit = true;
}
@@ -537,6 +537,14 @@ bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_
return window_editor_object_selection_select_object(isMasterObject, flags, item);
}
bool window_editor_object_selection_select_object(uint8_t isMasterObject, int32_t flags, const ObjectEntryDescriptor& entry)
{
if (entry.Generation == ObjectGeneration::DAT)
return window_editor_object_selection_select_object(isMasterObject, flags, &entry.Entry);
return window_editor_object_selection_select_object(isMasterObject, flags, entry.Identifier);
}
bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType)
{
int32_t numObjects = static_cast<int32_t>(object_repository_get_items_count());