program_state moved to g.

This commit is contained in:
Bart House
2018-12-25 10:09:04 -08:00
parent ab73df996f
commit b1ab64db43
45 changed files with 130 additions and 132 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ mswin_have_input()
return
#ifdef SAFERHANGUP
/* we always have input (ESC) if hangup was requested */
program_state.done_hup ||
g.program_state.done_hup ||
#endif
(nhi_read_pos != nhi_write_pos);
}
@@ -69,7 +69,7 @@ mswin_input_pop()
#ifdef SAFERHANGUP
/* always return ESC when hangup was requested */
if (program_state.done_hup) {
if (g.program_state.done_hup) {
static MSNHEvent hangup_event;
hangup_event.type = NHEVENT_CHAR;
hangup_event.kbd.ch = '\033';
@@ -98,7 +98,7 @@ mswin_input_peek()
#ifdef SAFERHANGUP
/* always return ESC when hangup was requested */
if (program_state.done_hup) {
if (g.program_state.done_hup) {
static MSNHEvent hangup_event;
hangup_event.type = NHEVENT_CHAR;
hangup_event.kbd.ch = '\033';
+4 -4
View File
@@ -452,16 +452,16 @@ MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CLOSE: {
/* exit gracefully */
if (program_state.gameover) {
if (g.program_state.gameover) {
/* assume the user really meant this, as the game is already
* over... */
/* to make sure we still save bones, just set stop printing flag
*/
program_state.stopprint++;
g.program_state.stopprint++;
NHEVENT_KBD(
'\033'); /* and send keyboard input as if user pressed ESC */
/* additional code for this is done in menu and rip windows */
} else if (!program_state.something_worth_saving) {
} else if (!g.program_state.something_worth_saving) {
/* User exited before the game started, e.g. during splash display
*/
/* Just get out. */
@@ -837,7 +837,7 @@ onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
case IDM_SAVE:
if (iflags.debug_fuzzer)
break;
if (!program_state.gameover && !program_state.done_hup)
if (!g.program_state.gameover && !g.program_state.done_hup)
dosave();
else
MessageBeep(0);
+2 -2
View File
@@ -348,10 +348,10 @@ MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
return FALSE;
case WM_CLOSE:
if (program_state.gameover) {
if (g.program_state.gameover) {
data->result = -1;
data->done = 1;
program_state.stopprint++;
g.program_state.stopprint++;
return TRUE;
} else
return FALSE;
+1 -1
View File
@@ -227,7 +227,7 @@ NHRIPWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
GetNHApp()->hMainWnd = NULL;
DestroyWindow(hWnd);
SetFocus(GetNHApp()->hMainWnd);
program_state.stopprint++;
g.program_state.stopprint++;
return TRUE;
case WM_DESTROY:
+1 -1
View File
@@ -1224,7 +1224,7 @@ void
mswin_update_inventory()
{
logDebug("mswin_update_inventory()\n");
if (iflags.perm_invent && program_state.something_worth_saving
if (iflags.perm_invent && g.program_state.something_worth_saving
&& iflags.window_inited && WIN_INVEN != WIN_ERR)
display_inventory(NULL, FALSE);
}