1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 19:56:13 +01:00

small fix and refactor of S6Importer / Exporter

This commit is contained in:
Ted John
2016-05-08 23:16:25 +01:00
parent 0570ec27ff
commit c77311a113
5 changed files with 17 additions and 12 deletions

View File

@@ -378,7 +378,8 @@
#define RCT2_ADDRESS_SAVED_AGE 0x01388698
#define RCT2_ADDRESS_SAVED_VIEW_X 0x0138869A
#define RCT2_ADDRESS_SAVED_VIEW_Y 0x0138869C
#define RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION 0x0138869E
#define RCT2_ADDRESS_SAVED_VIEW_ZOOM 0x0138869E
#define RCT2_ADDRESS_SAVED_VIEW_ROTATION 0x0138869F
#define RCT2_ADDRESS_SCENARIO_COMPLETED_BY 0x013587D8
#define RCT2_ADDRESS_RIDE_MEASUREMENTS 0x0138B60C

View File

@@ -88,8 +88,8 @@ typedef struct {
#define gSavedViewX RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_X, sint16)
#define gSavedViewY RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, sint16)
#define gSavedViewZoom RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION, uint8)
#define gSavedViewRotation RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION + 1, uint8)
#define gSavedViewZoom RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM, uint8)
#define gSavedViewRotation RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ROTATION, uint8)
#define gCurrentRotation RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint8)
#define gCurrentViewportFlags RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16)

View File

@@ -398,10 +398,11 @@ void S6Exporter::Export()
_s6.game_ticks_1 = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32);
memcpy(_s6.rides, RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride*), sizeof(_s6.rides));
_s6.saved_age = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16);
_s6.saved_view_x = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_X, uint16);
_s6.saved_view_y = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, uint16);
_s6.saved_view_zoom_and_rotation = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION, uint16);
memcpy(_s6.map_animations, RCT2_ADDRESS(gAnimatedObjects, rct_map_animation), sizeof(_s6.map_animations));
_s6.saved_view_x = gSavedViewX;
_s6.saved_view_y = gSavedViewY;
_s6.saved_view_zoom = gSavedViewZoom;
_s6.saved_view_rotation = gSavedViewRotation;
memcpy(_s6.map_animations, gAnimatedObjects, sizeof(_s6.map_animations));
// rct1_map_animations
_s6.num_map_animations = RCT2_GLOBAL(0x0138B580, uint16);
// pad_0138B582

View File

@@ -22,6 +22,7 @@ extern "C"
{
#include "../config.h"
#include "../game.h"
#include "../interface/viewport.h"
#include "../localisation/date.h"
#include "../localisation/localisation.h"
#include "../management/finance.h"
@@ -329,10 +330,11 @@ void S6Importer::Import()
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) = _s6.game_ticks_1;
memcpy(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride*), _s6.rides, sizeof(_s6.rides));
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16) = _s6.saved_age;
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_X, uint16) = _s6.saved_view_x;
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_Y, uint16) = _s6.saved_view_y;
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_VIEW_ZOOM_AND_ROTATION, uint16) = _s6.saved_view_zoom_and_rotation;
memcpy(RCT2_ADDRESS(gAnimatedObjects, rct_map_animation), _s6.map_animations, sizeof(_s6.map_animations));
gSavedViewX = _s6.saved_view_x;
gSavedViewY = _s6.saved_view_y;
gSavedViewZoom = _s6.saved_view_zoom;
gSavedViewRotation = _s6.saved_view_rotation;
memcpy(gAnimatedObjects, _s6.map_animations, sizeof(_s6.map_animations));
// rct1_map_animations
RCT2_GLOBAL(0x0138B580, uint16) = _s6.num_map_animations;
// pad_0138B582

View File

@@ -298,7 +298,8 @@ typedef struct {
uint16 saved_age;
uint16 saved_view_x;
uint16 saved_view_y;
uint16 saved_view_zoom_and_rotation;
uint8 saved_view_zoom;
uint8 saved_view_rotation;
rct_map_animation map_animations[1000];
rct_map_animation rct1_map_animations[1000];
uint16 num_map_animations;