diff options
author | Simon Howard | 2009-05-04 20:07:48 +0000 |
---|---|---|
committer | Simon Howard | 2009-05-04 20:07:48 +0000 |
commit | 5014caee2a000ffd682f04bcbec76265b2163335 (patch) | |
tree | b29dc89bc5edcaa8c9d57c9a550541689af4bec9 /src | |
parent | 2c7cf58786bbf80d519b02b2c112a0a2c55d898e (diff) | |
download | chocolate-doom-5014caee2a000ffd682f04bcbec76265b2163335.tar.gz chocolate-doom-5014caee2a000ffd682f04bcbec76265b2163335.tar.bz2 chocolate-doom-5014caee2a000ffd682f04bcbec76265b2163335.zip |
Fix window close button to bring up F10 quit message.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1506
Diffstat (limited to 'src')
-rw-r--r-- | src/d_event.h | 3 | ||||
-rw-r--r-- | src/doom/m_menu.c | 10 | ||||
-rw-r--r-- | src/heretic/mn_menu.c | 8 | ||||
-rw-r--r-- | src/hexen/mn_menu.c | 8 | ||||
-rw-r--r-- | src/i_video.c | 7 |
5 files changed, 29 insertions, 7 deletions
diff --git a/src/d_event.h b/src/d_event.h index da3ee926..e47f82df 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -42,7 +42,8 @@ typedef enum ev_keydown, ev_keyup, ev_mouse, - ev_joystick + ev_joystick, + ev_quit } evtype_t; // Event structure. diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c index a5e81775..4ca30926 100644 --- a/src/doom/m_menu.c +++ b/src/doom/m_menu.c @@ -1423,7 +1423,15 @@ boolean M_Responder (event_t* ev) static int lasty = 0; static int mousex = 0; static int lastx = 0; - + + // "close" button pressed on window? + if (ev->type == ev_quit) + { + S_StartSound(NULL,sfx_swtchn); + M_QuitDOOM(0); + return true; + } + // key is the key pressed, ch is the actual character typed ch = 0; diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c index 0bc9d994..1dc1f289 100644 --- a/src/heretic/mn_menu.c +++ b/src/heretic/mn_menu.c @@ -1042,6 +1042,14 @@ boolean MN_Responder(event_t * event) extern void G_CheckDemoStatus(void); char *textBuffer; + // "close" button pressed on window? + if (event->type == ev_quit) + { + SCQuitGame(0); + S_StartSound(NULL, sfx_chat); + return true; + } + if (event->data1 == KEY_RSHIFT) { shiftdown = (event->type == ev_keydown); diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c index dd508e28..3ac9c609 100644 --- a/src/hexen/mn_menu.c +++ b/src/hexen/mn_menu.c @@ -1132,6 +1132,14 @@ boolean MN_Responder(event_t * event) extern void G_CheckDemoStatus(void); char *textBuffer; + // "close" button pressed on window? + if (event->type == ev_quit) + { + SCQuitGame(0); + S_StartSound(NULL, SFX_CHAT); + return true; + } + if (event->data1 == KEY_RSHIFT) { shiftdown = (event->type == ev_keydown); diff --git a/src/i_video.c b/src/i_video.c index 8360ab9e..ac25e9ad 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -679,13 +679,10 @@ void I_GetEvent(void) } break; -/* TODO case SDL_QUIT: - // bring up the "quit doom?" prompt - S_StartSound(NULL,sfx_swtchn); - M_QuitDOOM(0); + event.type = ev_quit; + D_PostEvent(&event); break; - */ case SDL_ACTIVEEVENT: // need to update our focus state |