1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 16:54:52 +01:00

remove object entry addresses and use constants

This commit is contained in:
Ted John
2016-07-03 15:13:36 +01:00
parent 3bfa747ce4
commit 6f97ec798e
5 changed files with 48 additions and 39 deletions

View File

@@ -132,7 +132,7 @@ void S6Exporter::Save(SDL_RWops * rw, bool isScenario)
// 3: Write available objects chunk
chunkHeader.encoding = CHUNK_ENCODING_ROTATE;
chunkHeader.length = 721 * sizeof(rct_object_entry);
chunkHeader.length = OBJECT_ENTRY_COUNT * sizeof(rct_object_entry);
encodedLength = sawyercoding_write_chunk_buffer(buffer, (uint8*)_s6.objects, chunkHeader);
SDL_RWwrite(rw, buffer, encodedLength, 1);
@@ -228,19 +228,18 @@ void S6Exporter::Export()
{
_s6.info = *gS6Info;
for (int i = 0; i < 721; i++)
for (int i = 0; i < OBJECT_ENTRY_COUNT; i++)
{
rct_object_entry_extended *entry = &(RCT2_ADDRESS(0x00F3F03C, rct_object_entry_extended)[i]);
void *entryData = get_loaded_object_entry(i);
const rct_object_entry * entry = get_loaded_object_entry(i);
void * entryData = get_loaded_object_chunk(i);
if (entryData == (void *)0xFFFFFFFF)
{
memset(&_s6.objects[i], 0xFF, sizeof(rct_object_entry));
Memory::Set(&_s6.objects[i], 0xFF, sizeof(rct_object_entry));
}
else
{
_s6.objects[i] = *((rct_object_entry*)entry);
}
}
_s6.elapsed_months = gDateMonthsElapsed;