From e47b8d906ee2c6f9e5049ebddd741d235554803c Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 4 Sep 2016 15:21:49 +0100 Subject: [PATCH] Integrate gLastEntranceStyle --- src/addresses.h | 2 +- src/rct2/S6Exporter.cpp | 2 +- src/rct2/S6Importer.cpp | 2 +- src/ride/ride.c | 4 +++- src/ride/ride.h | 2 ++ src/scenario.c | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/addresses.h b/src/addresses.h index 5f23f04cee..d4fc6d3020 100644 --- a/src/addresses.h +++ b/src/addresses.h @@ -209,7 +209,6 @@ #define RCT2_ADDRESS_CURRENT_PARK_VALUE 0x0135853C #define RCT2_ADDRESS_AWARD_LIST 0x01358760 #define RCT2_ADDRESS_SAME_PRICE_THROUGHOUT 0x01358838 -#define RCT2_ADDRESS_LAST_ENTRANCE_STYLE 0x01358840 #define RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED 0x0135934C #define RCT2_ADDRESS_PEEP_SPAWNS 0x013573F2 @@ -572,6 +571,7 @@ #define RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY 0x013580E7 #define RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH 0x013580E8 +#define RCT2_ADDRESS_LAST_ENTRANCE_STYLE 0x01358840 #define RCT2_RESEARCH_ITEMS 0x01358844 #define RCT2_ADDRESS_RESEARCHED_RIDE_TYPES 0x01357404 #define RCT2_ADDRESS_RESEARCHED_RIDE_ENTRIES 0x01357424 diff --git a/src/rct2/S6Exporter.cpp b/src/rct2/S6Exporter.cpp index 222a2d831b..c42e6951ea 100644 --- a/src/rct2/S6Exporter.cpp +++ b/src/rct2/S6Exporter.cpp @@ -368,7 +368,7 @@ void S6Exporter::Export() _s6.same_price_throughout = gSamePriceThroughoutParkA; _s6.suggested_max_guests = _suggestedGuestMaximum; _s6.park_rating_warning_days = gScenarioParkRatingWarningDays; - _s6.last_entrance_style = RCT2_GLOBAL(RCT2_ADDRESS_LAST_ENTRANCE_STYLE, uint8); + _s6.last_entrance_style = gLastEntranceStyle; // rct1_water_colour // pad_01358842 memcpy(_s6.research_items, gResearchItems, sizeof(_s6.research_items)); diff --git a/src/rct2/S6Importer.cpp b/src/rct2/S6Importer.cpp index 5fd3cc8a99..ba83357975 100644 --- a/src/rct2/S6Importer.cpp +++ b/src/rct2/S6Importer.cpp @@ -286,7 +286,7 @@ void S6Importer::Import() gSamePriceThroughoutParkA = _s6.same_price_throughout; _suggestedGuestMaximum = _s6.suggested_max_guests; gScenarioParkRatingWarningDays = _s6.park_rating_warning_days; - RCT2_GLOBAL(RCT2_ADDRESS_LAST_ENTRANCE_STYLE, uint8) = _s6.last_entrance_style; + gLastEntranceStyle = _s6.last_entrance_style; // rct1_water_colour // pad_01358842 memcpy(gResearchItems, _s6.research_items, sizeof(_s6.research_items)); diff --git a/src/ride/ride.c b/src/ride/ride.c index d44800d882..31386b6bdb 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -175,6 +175,8 @@ uint8 gRideEntranceExitPlaceStationIndex; uint8 gRideEntranceExitPlacePreviousRideConstructionState; uint8 gRideEntranceExitPlaceDirection; +uint8 gLastEntranceStyle; + // Static function declarations rct_peep *find_closest_mechanic(int x, int y, int forInspection); static void ride_breakdown_status_update(int rideIndex); @@ -6560,7 +6562,7 @@ void game_command_set_ride_appearance(int *eax, int *ebx, int *ecx, int *edx, in case 6: if (apply) { ride->entrance_style = value; - RCT2_GLOBAL(RCT2_ADDRESS_LAST_ENTRANCE_STYLE, uint8) = value; + gLastEntranceStyle = value; gfx_invalidate_screen(); } break; diff --git a/src/ride/ride.h b/src/ride/ride.h index f232470100..a6a7dd77b6 100644 --- a/src/ride/ride.h +++ b/src/ride/ride.h @@ -973,6 +973,8 @@ extern int gRideRemoveTrackPieceCallbackZ; extern int gRideRemoveTrackPieceCallbackDirection; extern int gRideRemoveTrackPieceCallbackType; +extern uint8 gLastEntranceStyle; + int ride_get_count(); int ride_get_total_queue_length(rct_ride *ride); int ride_get_max_queue_time(rct_ride *ride); diff --git a/src/scenario.c b/src/scenario.c index 6283ae1e4c..71fb15557c 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -267,7 +267,7 @@ void scenario_begin() duck_remove_all(); park_calculate_size(); staff_reset_stats(); - RCT2_GLOBAL(RCT2_ADDRESS_LAST_ENTRANCE_STYLE, uint8) = 0; + gLastEntranceStyle = RIDE_ENTRANCE_STYLE_PLAIN; memset(RCT2_ADDRESS(0x001358102, void), 0, 20); RCT2_GLOBAL(0x00135882E, uint16) = 0;