forked from rosebudai/OpenRCT2-Web
integrate game paused variable and refactor
This commit is contained in:
1 parent
28aa9fe707
commit
ee509caf35
25 files changed
+79
-69
No files matched your search
+1
-5
@@ -215,11 +215,6 @@
|
||||
#define RCT2_ADDRESS_COMMAND_MAP_Z 0x009DEA62
|
||||
|
||||
#define RCT2_ADDRESS_SCREENSHOT_COUNTDOWN 0x009DEA6D
|
||||
// Note: not only the zeroth bit can be set to control pause
|
||||
// When paused by saving track 2nd bit is set
|
||||
// When paused by save menu 1st bit is set
|
||||
// When paused by pause button 0th bit is set
|
||||
#define RCT2_ADDRESS_GAME_PAUSED 0x009DEA6E
|
||||
#define RCT2_ADDRESS_PLACE_OBJECT_MODIFIER 0x009DEA70
|
||||
#define RCT2_ADDRESS_ON_TUTORIAL 0x009DEA71
|
||||
|
||||
@@ -595,6 +590,7 @@
|
||||
|
||||
#define RCT2_ADDRESS_SCREEN_AGE 0x009DEA66
|
||||
#define RCT2_ADDRESS_SCREEN_FLAGS 0x009DEA68
|
||||
#define RCT2_ADDRESS_GAME_PAUSED 0x009DEA6E
|
||||
|
||||
#define RCT2_ADDRESS_PARK_ENTRANCE_GHOST_X 0x009E32CC
|
||||
#define RCT2_ADDRESS_PARK_ENTRANCE_GHOST_Y 0x009E32CE
|
||||
|
||||
+15
-4
@@ -61,6 +61,7 @@
|
||||
|
||||
#define NUMBER_OF_AUTOSAVES_TO_KEEP 9
|
||||
|
||||
uint8 gGamePaused = 0;
|
||||
int gGameSpeed = 1;
|
||||
float gDayNightCycle = 0;
|
||||
bool gInUpdateCode = false;
|
||||
@@ -270,7 +271,7 @@ void game_update()
|
||||
numUpdates += 10;
|
||||
}
|
||||
} else {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0) {
|
||||
if (game_is_paused()) {
|
||||
numUpdates = 0;
|
||||
// Update the animation list. Note this does not
|
||||
// increment the map animation.
|
||||
@@ -569,9 +570,9 @@ int game_do_command_p(int command, int *eax, int *ebx, int *ecx, int *edx, int *
|
||||
|
||||
void pause_toggle()
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) ^= 1;
|
||||
gGamePaused ^= GAME_PAUSED_NORMAL;
|
||||
window_invalidate_by_class(WC_TOP_TOOLBAR);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) & 1) {
|
||||
if (gGamePaused & GAME_PAUSED_NORMAL) {
|
||||
audio_pause_sounds();
|
||||
audio_unpause_sounds();
|
||||
} else {
|
||||
@@ -579,6 +580,16 @@ void pause_toggle()
|
||||
}
|
||||
}
|
||||
|
||||
bool game_is_paused()
|
||||
{
|
||||
return gGamePaused != 0;
|
||||
}
|
||||
|
||||
bool game_is_not_paused()
|
||||
{
|
||||
return gGamePaused == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00667C15
|
||||
@@ -860,7 +871,7 @@ int game_load_network(SDL_RWops* rw)
|
||||
SDL_RWread(rw, &checksum, sizeof(uint32), 1);
|
||||
|
||||
// Read other data not in normal save files
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) = SDL_ReadLE32(rw);
|
||||
gGamePaused = SDL_ReadLE32(rw);
|
||||
_guestGenerationProbability = SDL_ReadLE32(rw);
|
||||
_suggestedGuestMaximum = SDL_ReadLE32(rw);
|
||||
gCheatsSandboxMode = SDL_ReadU8(rw);
|
||||
|
||||
+8
-2
@@ -105,8 +105,11 @@ enum {
|
||||
GAME_COMMAND_FLAG_NETWORKED = (1 << 31) // Game command is coming from network
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
GAME_PAUSED_NORMAL = 1 << 0,
|
||||
GAME_PAUSED_MODAL = 1 << 1,
|
||||
GAME_PAUSED_SAVING_TRACK = 1 << 2,
|
||||
};
|
||||
|
||||
typedef void (GAME_COMMAND_POINTER)(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* edi, int* ebp);
|
||||
|
||||
@@ -124,6 +127,7 @@ extern GAME_COMMAND_POINTER* new_game_command_table[66];
|
||||
|
||||
#define gCurrentTicks RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32)
|
||||
|
||||
extern uint8 gGamePaused;
|
||||
extern int gGameSpeed;
|
||||
extern float gDayNightCycle;
|
||||
extern bool gInUpdateCode;
|
||||
@@ -150,6 +154,8 @@ bool game_load_save(const utf8 *path);
|
||||
void game_load_init();
|
||||
void game_pause_toggle(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
void pause_toggle();
|
||||
bool game_is_paused();
|
||||
bool game_is_not_paused();
|
||||
void save_game();
|
||||
void save_game_as();
|
||||
void rct2_exit();
|
||||
|
||||
@@ -137,7 +137,7 @@ int viewport_interaction_left_click(int x, int y)
|
||||
window_guest_open(info.peep);
|
||||
break;
|
||||
case SPRITE_IDENTIFIER_MISC:
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0) {
|
||||
if (game_is_not_paused()) {
|
||||
switch (info.sprite->unknown.misc_identifier) {
|
||||
case SPRITE_MISC_BALLOON:
|
||||
balloon_press(&info.sprite->balloon);
|
||||
|
||||
@@ -2228,7 +2228,7 @@ void sub_6EA73F()
|
||||
{
|
||||
rct_window *w;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0)
|
||||
if (game_is_paused())
|
||||
RCT2_GLOBAL(0x01423604, uint32)++;
|
||||
|
||||
for (w = RCT2_LAST_WINDOW; w >= g_window_list; w--) {
|
||||
|
||||
@@ -22,6 +22,7 @@ extern "C"
|
||||
#include "../addresses.h"
|
||||
#include "../config.h"
|
||||
#include "../drawing/drawing.h"
|
||||
#include "../game.h"
|
||||
#include "../interface/console.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../management/news_item.h"
|
||||
@@ -119,7 +120,7 @@ namespace Twitch
|
||||
{
|
||||
if (!_twitchIdle) return;
|
||||
if (IsTwitchEnabled()) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0) return;
|
||||
if (game_is_paused()) return;
|
||||
|
||||
switch (_twitchState) {
|
||||
case TWITCH_STATE_LEFT:
|
||||
|
||||
@@ -210,7 +210,7 @@ static void overlay_post_render_check(int width, int height) {
|
||||
|
||||
// Toggle game pause state consistently with base pause state
|
||||
if (!overlayActive && newOverlayActive) {
|
||||
pausedBeforeOverlay = RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) & 1;
|
||||
pausedBeforeOverlay = gGamePaused & GAME_PAUSED_NORMAL;
|
||||
|
||||
if (!pausedBeforeOverlay) pause_toggle();
|
||||
} else if (overlayActive && !newOverlayActive && !pausedBeforeOverlay) {
|
||||
|
||||
+1
-1
@@ -447,7 +447,7 @@ void rct2_update()
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TICKS_SINCE_LAST_UPDATE, sint16) = tick2 = min(tick2, 500);
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_LAST_TICK_COUNT, sint32) = tick;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0)
|
||||
if (game_is_not_paused())
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PALETTE_EFFECT_FRAME_NO, sint32) += tick2;
|
||||
|
||||
// TODO: screenshot countdown process
|
||||
|
||||
+6
-6
@@ -5587,8 +5587,8 @@ void game_command_set_ride_name(int *eax, int *ebx, int *ecx, int *edx, int *esi
|
||||
*/
|
||||
int ride_get_refund_price(int ride_id)
|
||||
{
|
||||
uint8 oldpaused = RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) = 0;
|
||||
uint8 oldpaused = gGamePaused;
|
||||
gGamePaused = 0;
|
||||
RCT2_GLOBAL(0x00F4413A, money32) = 0;
|
||||
|
||||
map_element_iterator it;
|
||||
@@ -5658,7 +5658,7 @@ int ride_get_refund_price(int ride_id)
|
||||
0);
|
||||
map_element_iterator_restart_for_tile(&it);
|
||||
}
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) = oldpaused;
|
||||
gGamePaused = oldpaused;
|
||||
return RCT2_GLOBAL(0x00F4413A, int);
|
||||
}
|
||||
|
||||
@@ -6231,7 +6231,7 @@ void game_command_demolish_ride(int *eax, int *ebx, int *ecx, int *edx, int *esi
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z;
|
||||
}
|
||||
if(!(*ebx & 0x40) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) && !gCheatsBuildInPauseMode){
|
||||
if(!(*ebx & 0x40) && game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -8076,7 +8076,7 @@ money32 place_ride_entrance_or_exit(sint16 x, sint16 y, sint16 z, uint8 directio
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -8279,7 +8279,7 @@ money32 remove_ride_entrance_or_exit(sint16 x, sint16 y, uint8 rideIndex, uint8
|
||||
}
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_GHOST)){
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
+5
-5
@@ -3257,7 +3257,7 @@ void game_command_place_track_design(int* eax, int* ebx, int* ecx, int* edx, int
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, sint16) = z;
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)){
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -3410,7 +3410,7 @@ money32 place_maze_design(uint8 flags, uint8 rideIndex, uint16 mazeEntry, sint16
|
||||
}
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) != 0) {
|
||||
if (game_is_paused()) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -4430,7 +4430,7 @@ static money32 track_place(int rideIndex, int type, int originX, int originY, in
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -4922,7 +4922,7 @@ money32 track_remove(uint8 type, uint8 sequence, sint16 originX, sint16 originY,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(flags & (1 << 3)) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if (!(flags & (1 << 3)) && game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -5227,7 +5227,7 @@ money32 set_maze_track(uint16 x, uint8 flags, uint8 direction, uint16 y, uint8 r
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !gCheatsBuildInPauseMode && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0) {
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !gCheatsBuildInPauseMode && game_is_paused()) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1100,7 +1100,7 @@ int scenario_save_network(SDL_RWops* rw)
|
||||
reset_loaded_objects();
|
||||
|
||||
// Write other data not in normal save files
|
||||
SDL_WriteLE32(rw, RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32));
|
||||
SDL_WriteLE32(rw, gGamePaused);
|
||||
SDL_WriteLE32(rw, _guestGenerationProbability);
|
||||
SDL_WriteLE32(rw, _suggestedGuestMaximum);
|
||||
SDL_WriteU8(rw, gCheatsSandboxMode);
|
||||
|
||||
+2
-2
@@ -105,7 +105,7 @@ void title_load()
|
||||
{
|
||||
log_verbose("loading title");
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) & 1)
|
||||
if (gGamePaused & GAME_PAUSED_NORMAL)
|
||||
pause_toggle();
|
||||
|
||||
gScreenFlags = SCREEN_FLAGS_TITLE_DEMO;
|
||||
@@ -523,7 +523,7 @@ void title_update()
|
||||
screenshot_check();
|
||||
title_handle_keyboard_input();
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0) {
|
||||
if (game_is_not_paused()) {
|
||||
title_update_showcase();
|
||||
|
||||
if (gGameSpeed > 1) {
|
||||
|
||||
@@ -423,7 +423,7 @@ static void window_game_bottom_toolbar_draw_park_rating(rct_drawpixelinfo *dpi,
|
||||
|
||||
bar_width = (factor * (90 + WIDTH_MOD)) / 256;
|
||||
gfx_fill_rect_inset(dpi, x, y + 1, x + (93 + WIDTH_MOD), y + 9, w->colours[1], 48);
|
||||
if (!(colour & 0x80000000) || RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 || (gCurrentTicks & 8)) {
|
||||
if (!(colour & 0x80000000) || game_is_paused() || (gCurrentTicks & 8)) {
|
||||
if (bar_width > 2)
|
||||
gfx_fill_rect_inset(dpi, x + 2, y + 2, x + bar_width - 1, y + 8, colour & 0x7FFFFFFF, 0);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1403,7 +1403,7 @@ void window_guest_stats_bars_paint(int value, int x, int y, rct_window *w, rct_d
|
||||
int blink_flag = colour & (1 << 0x1F); //0x80000000
|
||||
colour &= ~(1 << 0x1F);
|
||||
if (!blink_flag ||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 ||
|
||||
game_is_paused() ||
|
||||
(gCurrentTicks & 8) == 0)
|
||||
{
|
||||
if (value <= 2)
|
||||
|
||||
@@ -178,10 +178,10 @@ static void window_maze_construction_close(rct_window *w)
|
||||
uint8 rideIndex = _currentRideIndex;
|
||||
rct_ride* ride = get_ride(rideIndex);
|
||||
if (ride->overall_view == 0xFFFF) {
|
||||
int savedPausedState = RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) = 0;
|
||||
int savedPausedState = gGamePaused;
|
||||
gGamePaused = 0;
|
||||
game_do_command(0, 9, 0, rideIndex, GAME_COMMAND_DEMOLISH_RIDE, 0, 0);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) = savedPausedState;
|
||||
gGamePaused = savedPausedState;
|
||||
} else {
|
||||
window_ride_main_open(rideIndex);
|
||||
}
|
||||
|
||||
@@ -683,10 +683,6 @@ static void window_new_ride_scrollmousedown(rct_window *w, int scrollIndex, int
|
||||
{
|
||||
ride_list_item item;
|
||||
|
||||
// Made it impossible to click a ride in pause mode. Since the UI now stays responsive in pause mode, always allow clicking a ride.
|
||||
/*if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0)
|
||||
return;*/
|
||||
|
||||
item = window_new_ride_scroll_get_ride_list_item_at(w, x, y);
|
||||
if (item.type == 255 && item.entry_index == 255)
|
||||
return;
|
||||
|
||||
+3
-3
@@ -3361,7 +3361,7 @@ static void window_ride_maintenance_draw_bar(rct_window *w, rct_drawpixelinfo *d
|
||||
gfx_fill_rect_inset(dpi, x, y, x + 149, y + 8, w->colours[1], 0x30);
|
||||
if (unk & (1u << 31)) {
|
||||
unk &= ~(1u << 31);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0 && (gCurrentTicks & 8))
|
||||
if (game_is_not_paused() && (gCurrentTicks & 8))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4646,7 +4646,7 @@ static void window_ride_music_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
* rct2: 0x006D2804
|
||||
when al == 0*/
|
||||
static void cancel_scenery_selection(){
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) &= ~(1 << 2);
|
||||
gGamePaused &= ~GAME_PAUSED_SAVING_TRACK;
|
||||
RCT2_GLOBAL(0x9DEA6F, uint8) &= ~(1 << 0);
|
||||
audio_unpause_sounds();
|
||||
|
||||
@@ -4677,7 +4677,7 @@ static void setup_scenery_selection(rct_window* w){
|
||||
RCT2_GLOBAL(0x009DA193, uint8) = 0xFF;
|
||||
|
||||
gTrackSavedMapElements[0] = (rct_map_element*)-1;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) |= (1 << 2);
|
||||
gGamePaused |= GAME_PAUSED_SAVING_TRACK;
|
||||
RCT2_GLOBAL(0x009DEA6F, uint8) |= 1;
|
||||
|
||||
audio_pause_sounds();
|
||||
|
||||
@@ -618,12 +618,12 @@ static void window_ride_construction_close(rct_window *w)
|
||||
|
||||
window_ride_main_open(rideIndex);
|
||||
} else {
|
||||
int eax = RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8);
|
||||
int eax = gGamePaused;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) = 0;
|
||||
gGamePaused = 0;
|
||||
game_do_command(0, 9, 0, rideIndex, GAME_COMMAND_DEMOLISH_RIDE, 0, 0);
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) = eax;
|
||||
gGamePaused = eax;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ void window_save_prompt_open()
|
||||
window_init_scroll_widgets(window);
|
||||
|
||||
// Pause the game
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) |= 2;
|
||||
gGamePaused |= GAME_PAUSED_MODAL;
|
||||
audio_pause_sounds();
|
||||
window_invalidate_by_class(WC_TOP_TOOLBAR);
|
||||
|
||||
@@ -197,7 +197,7 @@ void window_save_prompt_open()
|
||||
static void window_save_prompt_close(rct_window *w)
|
||||
{
|
||||
// Unpause the game
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) &= ~2;
|
||||
gGamePaused &= ~GAME_PAUSED_MODAL;
|
||||
audio_unpause_sounds();
|
||||
window_invalidate_by_class(WC_TOP_TOOLBAR);
|
||||
}
|
||||
|
||||
@@ -770,10 +770,10 @@ static void window_top_toolbar_invalidate(rct_window *w)
|
||||
else
|
||||
w->pressed_widgets |= (1 << WIDX_PATH);
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) & 1))
|
||||
w->pressed_widgets &= ~(1 << WIDX_PAUSE);
|
||||
else
|
||||
if (gGamePaused & GAME_PAUSED_NORMAL)
|
||||
w->pressed_widgets |= (1 << WIDX_PAUSE);
|
||||
else
|
||||
w->pressed_widgets &= ~(1 << WIDX_PAUSE);
|
||||
|
||||
// Zoomed out/in disable. Not sure where this code is in the original.
|
||||
if (window_get_main()->viewport->zoom == 0){
|
||||
|
||||
@@ -486,7 +486,7 @@ static void window_track_place_toolupdate(rct_window* w, int widgetIndex, int x,
|
||||
|
||||
// Get base Z position
|
||||
mapZ = window_track_place_get_base_z(mapX, mapY);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0 || gCheatsBuildInPauseMode) {
|
||||
if (game_is_not_paused() || gCheatsBuildInPauseMode) {
|
||||
window_track_place_clear_provisional();
|
||||
|
||||
// Try increasing Z until a feasible placement is found
|
||||
|
||||
@@ -318,7 +318,7 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z * 8;
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -395,7 +395,7 @@ money32 footpath_remove_real(int x, int y, int z, int flags)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z * 8;
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -455,7 +455,7 @@ static money32 footpath_place_from_track(int type, int x, int y, int z, int slop
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z * 8;
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (!(flags & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
|
||||
+11
-11
@@ -725,7 +725,7 @@ void game_command_remove_scenery(int* eax, int* ebx, int* ecx, int* edx, int* es
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = base_height * 8;
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_GHOST) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (!(flags & GAME_COMMAND_FLAG_GHOST) && game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -803,7 +803,7 @@ void game_command_remove_large_scenery(int* eax, int* ebx, int* ecx, int* edx, i
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4;
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_GHOST) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (!(flags & GAME_COMMAND_FLAG_GHOST) && game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -953,7 +953,7 @@ void game_command_remove_banner(int* eax, int* ebx, int* ecx, int* edx, int* esi
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = z;
|
||||
|
||||
if(!(flags & GAME_COMMAND_FLAG_GHOST) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if(!(flags & GAME_COMMAND_FLAG_GHOST) && game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -1455,7 +1455,7 @@ money32 map_change_surface_style(int x0, int y0, int x1, int y1, uint8 surfaceSt
|
||||
|
||||
money32 cost = 0;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
cost += RCT2_GLOBAL(0x009E32B4, uint32);
|
||||
return (gParkFlags & PARK_FLAGS_NO_MONEY) ? 0 : cost;
|
||||
}
|
||||
@@ -1600,7 +1600,7 @@ static money32 map_set_land_height(int flags, int x, int y, int height, int styl
|
||||
{
|
||||
rct_map_element *mapElement;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
return MONEY32_UNDEFINED;
|
||||
}
|
||||
@@ -2569,7 +2569,7 @@ void game_command_set_water_height(int* eax, int* ebx, int* ecx, int* edx, int*
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, sint16) = x + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, sint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint32) = base_height * 8;
|
||||
if(RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if(game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -2657,7 +2657,7 @@ void game_command_remove_fence(int* eax, int* ebx, int* ecx, int* edx, int* esi,
|
||||
uint8 direction = *edx;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4;
|
||||
if(!(*ebx & 0x40) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if(!(*ebx & 0x40) && game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -2713,7 +2713,7 @@ void game_command_place_banner(int* eax, int* ebx, int* ecx, int* edx, int* esi,
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) = y + 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, uint16) = base_height * 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE, uint8) = RCT_EXPENDITURE_TYPE_LANDSCAPING * 4;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -2916,7 +2916,7 @@ void game_command_place_scenery(int* eax, int* ebx, int* ecx, int* edx, int* esi
|
||||
}
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_X, uint16) += 16;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Y, uint16) += 16;
|
||||
if(RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0 || gCheatsBuildInPauseMode){
|
||||
if(game_is_not_paused() || gCheatsBuildInPauseMode){
|
||||
if(sub_68B044()){
|
||||
if(RCT2_GLOBAL(0x009D8150, uint8) & 1 || (x <= RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAX_XY, uint16) && y <= RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAX_XY, uint16))){
|
||||
rct_scenery_entry* scenery_entry = (rct_scenery_entry*)object_entry_groups[OBJECT_TYPE_SMALL_SCENERY].chunks[scenery_type];
|
||||
@@ -3289,7 +3289,7 @@ void game_command_place_fence(int* eax, int* ebx, int* ecx, int* edx, int* esi,
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMAND_MAP_Z, sint16) = map_element_height(position.x, position.y) & 0xFFFF;
|
||||
}
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode){
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode){
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
@@ -3550,7 +3550,7 @@ void game_command_place_large_scenery(int* eax, int* ebx, int* ecx, int* edx, in
|
||||
// Supports cost
|
||||
RCT2_GLOBAL(0x00F4389A, money32) = 0;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0 && !gCheatsBuildInPauseMode) {
|
||||
if (game_is_paused() && !gCheatsBuildInPauseMode) {
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
*ebx = MONEY32_UNDEFINED;
|
||||
return;
|
||||
|
||||
@@ -195,7 +195,7 @@ static bool map_animation_invalidate_small_scenery(int x, int y, int baseZ)
|
||||
|
||||
if (sceneryEntry->small_scenery.flags & SMALL_SCENERY_FLAG_IS_CLOCK) {
|
||||
// Peep, looking at scenery
|
||||
if (!(gCurrentTicks & 0x3FF) && RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0) {
|
||||
if (!(gCurrentTicks & 0x3FF) && game_is_not_paused()) {
|
||||
int direction = mapElement->type & 3;
|
||||
int x2 = x - TileDirectionDelta[direction].x;
|
||||
int y2 = y - TileDirectionDelta[direction].y;
|
||||
@@ -325,7 +325,7 @@ static bool map_animation_invalidate_track_onridephoto(int x, int y, int baseZ)
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_ON_RIDE_PHOTO) {
|
||||
int z = mapElement->base_height * 8;
|
||||
map_invalidate_tile_zoom1(x, y, mapElement->base_height * 8, mapElement->clearance_height * 8);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0) {
|
||||
if (game_is_paused()) {
|
||||
return false;
|
||||
}
|
||||
if (mapElement->properties.track.sequence & 0xF0) {
|
||||
@@ -493,7 +493,7 @@ static bool map_animation_invalidate_wall_door(int x, int y, int baseZ)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) != 0) {
|
||||
if (game_is_paused()) {
|
||||
return false;
|
||||
}
|
||||
mapElement->properties.fence.item[2] = bl;
|
||||
|
||||
+1
-1
@@ -1077,7 +1077,7 @@ int map_buy_land_rights(int x0, int y0, int x1, int y1, int setting, int flags)
|
||||
// Game command modified to accept selection size
|
||||
totalCost = 0;
|
||||
gGameCommandErrorText = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
|
||||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) != 0 || RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0 || gCheatsBuildInPauseMode) {
|
||||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) != 0 || game_is_not_paused() || gCheatsBuildInPauseMode) {
|
||||
for (y = y0; y <= y1; y += 32) {
|
||||
for (x = x0; x <= x1; x += 32) {
|
||||
cost = map_buy_land_rights_for_tile(x, y, setting, flags);
|
||||
|
||||
Reference in new issue
Block a user