Integrate gSavedAge

This commit is contained in:
Ted John 2016-09-04 15:01:49 +01:00
parent 8993328232
commit 3c80df07d4
8 changed files with 8 additions and 6 deletions

View File

@ -240,7 +240,6 @@
#define RCT2_ADDRESS_RIDE_FLAGS 0x0097CF40
//How many ticks the scenario has existed for
#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 0x0138869E
@ -587,6 +586,7 @@
#define RCT2_ADDRESS_SCENARIO_COMPLETED_BY 0x013587D8
#define RCT2_ADDRESS_SCENARIO_NAME 0x0135920A
#define RCT2_ADDRESS_SCENARIO_DETAILS 0x0135924A
#define RCT2_ADDRESS_SAVED_AGE 0x01388698
#define RCT2_ADDRESS_NUM_MAP_ANIMATIONS 0x0138B580
#define RCT2_ADDRESS_CLIMATE 0x013CA746

View File

@ -387,7 +387,7 @@ void game_logic_update()
climate_update_sound();
editor_open_windows_for_current_step();
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16)++;
gSavedAge++;
// Update windows
//window_dispatch_update_all();

View File

@ -388,7 +388,7 @@ void S6Exporter::Export()
memcpy(_s6.custom_strings, gUserStrings, sizeof(_s6.custom_strings));
_s6.game_ticks_1 = gCurrentTicks;
memcpy(_s6.rides, gRideList, sizeof(_s6.rides));
_s6.saved_age = RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16);
_s6.saved_age = gSavedAge;
_s6.saved_view_x = gSavedViewX;
_s6.saved_view_y = gSavedViewY;
_s6.saved_view_zoom = gSavedViewZoom;

View File

@ -306,7 +306,7 @@ void S6Importer::Import()
memcpy(gUserStrings, _s6.custom_strings, sizeof(_s6.custom_strings));
gCurrentTicks = _s6.game_ticks_1;
memcpy(gRideList, _s6.rides, sizeof(_s6.rides));
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16) = _s6.saved_age;
gSavedAge = _s6.saved_age;
gSavedViewX = _s6.saved_view_x;
gSavedViewY = _s6.saved_view_y;
gSavedViewZoom = _s6.saved_view_zoom;

View File

@ -64,6 +64,7 @@ char gScenarioDetails[256];
char gScenarioCompletedBy[32];
char gScenarioSavePath[MAX_PATH];
int gFirstTimeSave = 1;
uint16 gSavedAge;
uint32 gLastAutoSaveTick = 0;
#if defined(NO_RCT2)

View File

@ -441,6 +441,7 @@ extern char gScenarioDetails[256];
extern char gScenarioCompletedBy[32];
extern char gScenarioSavePath[MAX_PATH];
extern int gFirstTimeSave;
extern uint16 gSavedAge;
extern uint32 gLastAutoSaveTick;
extern const char *_scenarioFileName;

View File

@ -539,7 +539,7 @@ void title_update()
window_map_tooltip_update_visibility();
window_dispatch_update_all();
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16)++;
gSavedAge++;
// Input
game_handle_input();

View File

@ -98,7 +98,7 @@ void invalidate_sprite_2(rct_sprite *sprite)
*/
void reset_sprite_list()
{
RCT2_GLOBAL(RCT2_ADDRESS_SAVED_AGE, uint16) = 0;
gSavedAge = 0;
memset(sprite_list, 0, sizeof(rct_sprite) * MAX_SPRITES);
for (int i = 0; i < NUM_SPRITE_LISTS; i++) {