From 010422c7dada9cd89760d515a1eebae72d7c4161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 18 Jul 2016 00:23:33 +0200 Subject: [PATCH] Load and save sprites to S6 explicitly --- src/rct2/S6Exporter.cpp | 5 ++++- src/rct2/S6Importer.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rct2/S6Exporter.cpp b/src/rct2/S6Exporter.cpp index 23a288719f..2a3cb60487 100644 --- a/src/rct2/S6Exporter.cpp +++ b/src/rct2/S6Exporter.cpp @@ -251,7 +251,10 @@ void S6Exporter::Export() memcpy(_s6.map_elements, gMapElements, sizeof(_s6.map_elements)); _s6.dword_010E63B8 = RCT2_GLOBAL(0x0010E63B8, uint32); - memcpy(_s6.sprites, get_sprite(0), sizeof(_s6.sprites)); + for (int i = 0; i < MAX_SPRITES; i++) + { + memcpy(&_s6.sprites[i], get_sprite(i), sizeof(rct_sprite)); + } for (int i = 0; i < NUM_SPRITE_LISTS; i++) { diff --git a/src/rct2/S6Importer.cpp b/src/rct2/S6Importer.cpp index a17dec127b..349a3724c9 100644 --- a/src/rct2/S6Importer.cpp +++ b/src/rct2/S6Importer.cpp @@ -169,7 +169,10 @@ void S6Importer::Import() memcpy(gMapElements, _s6.map_elements, sizeof(_s6.map_elements)); RCT2_GLOBAL(0x0010E63B8, uint32) = _s6.dword_010E63B8; - memcpy(get_sprite(0), _s6.sprites, sizeof(_s6.sprites)); + for (int i = 0; i < MAX_SPRITES; i++) + { + memcpy(get_sprite(i), &_s6.sprites[i], sizeof(rct_sprite)); + } for (int i = 0; i < NUM_SPRITE_LISTS; i++) {