1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

prepare for better object loading

This commit is contained in:
Ted John
2016-07-03 21:05:18 +01:00
parent 4e259920b1
commit e8635c1307
5 changed files with 108 additions and 98 deletions

View File

@@ -114,16 +114,9 @@ void S6Importer::LoadSavedGame(SDL_RWops *rw)
// Read packed objects
// TODO try to contain this more and not store objects until later
if (_s6.header.num_packed_objects > 0) {
int j = 0;
for (uint16 i = 0; i < _s6.header.num_packed_objects; i++)
{
j += object_load_packed(rw);
}
if (j > 0)
{
object_list_load();
}
for (uint16 i = 0; i < _s6.header.num_packed_objects; i++)
{
object_load_packed(rw);
}
sawyercoding_read_chunk_safe(rw, &_s6.objects, sizeof(_s6.objects));
@@ -144,16 +137,9 @@ void S6Importer::LoadScenario(SDL_RWops *rw)
// Read packed objects
// TODO try to contain this more and not store objects until later
if (_s6.header.num_packed_objects > 0) {
int j = 0;
for (uint16 i = 0; i < _s6.header.num_packed_objects; i++)
{
j += object_load_packed(rw);
}
if (j > 0)
{
object_list_load();
}
for (uint16 i = 0; i < _s6.header.num_packed_objects; i++)
{
object_load_packed(rw);
}
sawyercoding_read_chunk_safe(rw, &_s6.objects, sizeof(_s6.objects));