1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

save object details to repository file

This commit is contained in:
Ted John
2016-06-25 14:44:04 +01:00
parent 2449b7dbf0
commit e93b2141a1
9 changed files with 64 additions and 28 deletions

View File

@@ -39,8 +39,7 @@ namespace ObjectFactory
rct_object_entry entry;
if (SDL_RWread(file, &entry, sizeof(entry), 1) == 1)
{
uint8 objectType = entry.flags & 0x0F;
result = CreateObject(objectType);
result = CreateObject(entry);
if (result != nullptr)
{
size_t bufferSize = 0x600000;
@@ -56,13 +55,14 @@ namespace ObjectFactory
return result;
}
Object * CreateObject(uint8 type)
Object * CreateObject(const rct_object_entry &entry)
{
Object * result = nullptr;
switch (type) {
uint8 objectType = entry.flags & 0x0F;
switch (objectType) {
case OBJECT_TYPE_PARK_ENTRANCE:
result = new EntranceObject();
result = new EntranceObject(entry);
break;
}