1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Close #16231: Do not load image table when creating object index

This commit is contained in:
Michael Steenbeek
2021-12-17 09:45:40 +01:00
committed by GitHub
parent 8282579b63
commit b6c541c805
4 changed files with 24 additions and 19 deletions

View File

@@ -10,6 +10,7 @@
#include "ObjectRepository.h"
#include "../Context.h"
#include "../OpenRCT2.h"
#include "../PlatformEnvironment.h"
#include "../common.h"
#include "../config/Config.h"
@@ -102,15 +103,15 @@ public:
auto extension = Path::GetExtension(path);
if (String::Equals(extension, ".json", true))
{
object = ObjectFactory::CreateObjectFromJsonFile(_objectRepository, path);
object = ObjectFactory::CreateObjectFromJsonFile(_objectRepository, path, false);
}
else if (String::Equals(extension, ".parkobj", true))
{
object = ObjectFactory::CreateObjectFromZipFile(_objectRepository, path);
object = ObjectFactory::CreateObjectFromZipFile(_objectRepository, path, false);
}
else
{
object = ObjectFactory::CreateObjectFromLegacyFile(_objectRepository, path.c_str());
object = ObjectFactory::CreateObjectFromLegacyFile(_objectRepository, path.c_str(), false);
}
if (object != nullptr)
{
@@ -263,14 +264,14 @@ public:
auto extension = Path::GetExtension(ori->Path);
if (String::Equals(extension, ".json", true))
{
return ObjectFactory::CreateObjectFromJsonFile(*this, ori->Path);
return ObjectFactory::CreateObjectFromJsonFile(*this, ori->Path, !gOpenRCT2NoGraphics);
}
if (String::Equals(extension, ".parkobj", true))
{
return ObjectFactory::CreateObjectFromZipFile(*this, ori->Path);
return ObjectFactory::CreateObjectFromZipFile(*this, ori->Path, !gOpenRCT2NoGraphics);
}
return ObjectFactory::CreateObjectFromLegacyFile(*this, ori->Path.c_str());
return ObjectFactory::CreateObjectFromLegacyFile(*this, ori->Path.c_str(), !gOpenRCT2NoGraphics);
}
void RegisterLoadedObject(const ObjectRepositoryItem* ori, std::unique_ptr<Object>&& object) override