mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 03:23:15 +01:00
add global macro for gSamePriceThroughoutPark
This commit is contained in:
@@ -367,7 +367,7 @@ void S6Exporter::Export()
|
||||
_s6.map_size_minus_2 = gMapSizeMinus2;
|
||||
_s6.map_size = gMapSize;
|
||||
_s6.map_max_xy = gMapSizeMaxXY;
|
||||
_s6.same_price_throughout = RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32);
|
||||
_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);
|
||||
@@ -379,7 +379,7 @@ void S6Exporter::Export()
|
||||
memcpy(_s6.scenario_description, gScenarioDetails, sizeof(_s6.scenario_description));
|
||||
_s6.current_interest_rate = gBankLoanInterestRate;
|
||||
// pad_0135934B
|
||||
_s6.same_price_throughout_extended = RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32);
|
||||
_s6.same_price_throughout_extended = gSamePriceThroughoutParkB;
|
||||
memcpy(_s6.park_entrance_x, gParkEntranceX, sizeof(_s6.park_entrance_x));
|
||||
memcpy(_s6.park_entrance_y, gParkEntranceY, sizeof(_s6.park_entrance_y));
|
||||
memcpy(_s6.park_entrance_z, gParkEntranceZ, sizeof(_s6.park_entrance_z));
|
||||
|
||||
@@ -299,7 +299,7 @@ void S6Importer::Import()
|
||||
gMapSizeMinus2 = _s6.map_size_minus_2;
|
||||
gMapSize = _s6.map_size;
|
||||
gMapSizeMaxXY = _s6.map_max_xy;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32) = _s6.same_price_throughout;
|
||||
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;
|
||||
@@ -311,7 +311,7 @@ void S6Importer::Import()
|
||||
memcpy(gScenarioDetails, _s6.scenario_description, sizeof(_s6.scenario_description));
|
||||
gBankLoanInterestRate = _s6.current_interest_rate;
|
||||
// pad_0135934B
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32) = _s6.same_price_throughout_extended;
|
||||
gSamePriceThroughoutParkB = _s6.same_price_throughout_extended;
|
||||
memcpy(gParkEntranceX, _s6.park_entrance_x, sizeof(_s6.park_entrance_x));
|
||||
memcpy(gParkEntranceY, _s6.park_entrance_y, sizeof(_s6.park_entrance_y));
|
||||
memcpy(gParkEntranceZ, _s6.park_entrance_z, sizeof(_s6.park_entrance_z));
|
||||
|
||||
@@ -5850,9 +5850,9 @@ static money32 shop_item_get_common_price(rct_ride *forRide, int shopItem)
|
||||
bool shop_item_has_common_price(int shopItem)
|
||||
{
|
||||
if (shopItem < 32) {
|
||||
return RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32) & (1u << shopItem);
|
||||
return gSamePriceThroughoutParkA & (1u << shopItem);
|
||||
} else {
|
||||
return RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32) & (1u << (shopItem - 32));
|
||||
return gSamePriceThroughoutParkB & (1u << (shopItem - 32));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -884,7 +884,9 @@ rct_ride_measurement *get_ride_measurement(int index);
|
||||
for (i = 0; i < MAX_RIDES; i++) \
|
||||
if ((ride = get_ride(i))->type != RIDE_TYPE_NULL)
|
||||
|
||||
#define gTotalRideValue RCT2_GLOBAL(RCT2_TOTAL_RIDE_VALUE, money16)
|
||||
#define gTotalRideValue RCT2_GLOBAL(RCT2_TOTAL_RIDE_VALUE, money16)
|
||||
#define gSamePriceThroughoutParkA RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32)
|
||||
#define gSamePriceThroughoutParkB RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32)
|
||||
|
||||
extern const uint8 gRideClassifications[255];
|
||||
|
||||
|
||||
@@ -5433,22 +5433,22 @@ static void update_same_price_throughout_flags(uint32 shop_item)
|
||||
uint32 newFlags;
|
||||
|
||||
if (shop_item == SHOP_ITEM_PHOTO || shop_item == SHOP_ITEM_PHOTO2 || shop_item == SHOP_ITEM_PHOTO3 || shop_item == SHOP_ITEM_PHOTO4) {
|
||||
newFlags = RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32);
|
||||
newFlags = gSamePriceThroughoutParkA;
|
||||
newFlags ^= (1 << SHOP_ITEM_PHOTO);
|
||||
game_do_command(0, 1, 0, (0x2 << 8), GAME_COMMAND_SET_PARK_OPEN, newFlags, shop_item);
|
||||
|
||||
newFlags = RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32);
|
||||
newFlags = gSamePriceThroughoutParkB;
|
||||
newFlags ^= (SHOP_ITEM_PHOTO2 - 32) | (SHOP_ITEM_PHOTO3 - 32) | (SHOP_ITEM_PHOTO4 - 32);
|
||||
game_do_command(0, 1, 0, (0x3 << 8), GAME_COMMAND_SET_PARK_OPEN, newFlags, shop_item);
|
||||
}
|
||||
else {
|
||||
if (shop_item < 32) {
|
||||
newFlags = RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32);
|
||||
newFlags = gSamePriceThroughoutParkA;
|
||||
newFlags ^= (1u << shop_item);
|
||||
game_do_command(0, 1, 0, (0x2 << 8), GAME_COMMAND_SET_PARK_OPEN, newFlags, shop_item);
|
||||
}
|
||||
else {
|
||||
newFlags = RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32);
|
||||
newFlags = gSamePriceThroughoutParkB;
|
||||
newFlags ^= (1u << (shop_item - 32));
|
||||
game_do_command(0, 1, 0, (0x3 << 8), GAME_COMMAND_SET_PARK_OPEN, newFlags, shop_item);
|
||||
}
|
||||
|
||||
@@ -697,11 +697,11 @@ void game_command_set_park_open(int* eax, int* ebx, int* ecx, int* edx, int* esi
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT, uint32) = *edi;
|
||||
gSamePriceThroughoutParkA = *edi;
|
||||
window_invalidate_by_class(WC_RIDE);
|
||||
break;
|
||||
case 3:
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SAME_PRICE_THROUGHOUT_EXTENDED, uint32) = *edi;
|
||||
gSamePriceThroughoutParkB = *edi;
|
||||
window_invalidate_by_class(WC_RIDE);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user