diff options
author | Simon Howard | 2008-09-20 23:27:22 +0000 |
---|---|---|
committer | Simon Howard | 2008-09-20 23:27:22 +0000 |
commit | 69b0c4526e6f2d6fe6920f1efa3b32e27b3db0bc (patch) | |
tree | 8900ee7583b07683222aa79f35b658e888be5639 /src | |
parent | 24cccc7029e2dc6d07d483ee5a8d467d733000ef (diff) | |
download | chocolate-doom-69b0c4526e6f2d6fe6920f1efa3b32e27b3db0bc.tar.gz chocolate-doom-69b0c4526e6f2d6fe6920f1efa3b32e27b3db0bc.tar.bz2 chocolate-doom-69b0c4526e6f2d6fe6920f1efa3b32e27b3db0bc.zip |
Use common event queue code.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1263
Diffstat (limited to 'src')
-rw-r--r-- | src/heretic/d_main.c | 34 | ||||
-rw-r--r-- | src/heretic/d_net.c | 5 | ||||
-rw-r--r-- | src/heretic/doomdef.h | 6 |
3 files changed, 3 insertions, 42 deletions
diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c index 437abed3..6107ba16 100644 --- a/src/heretic/d_main.c +++ b/src/heretic/d_main.c @@ -64,36 +64,6 @@ void D_AdvanceDemo(void); void F_Drawer(void); boolean F_Responder(event_t * ev); -/* -=============================================================================== - - EVENT HANDLING - -Events are asyncronous inputs generally generated by the game user. - -Events can be discarded if no responder claims them - -=============================================================================== -*/ - -event_t events[MAXEVENTS]; -int eventhead; -int eventtail; - -//--------------------------------------------------------------------------- -// -// PROC D_PostEvent -// -// Called by the I/O functions when input is detected. -// -//--------------------------------------------------------------------------- - -void D_PostEvent(event_t * ev) -{ - events[eventhead] = *ev; - eventhead = (eventhead + 1) & (MAXEVENTS - 1); -} - //--------------------------------------------------------------------------- // // PROC D_ProcessEvents @@ -106,10 +76,8 @@ void D_ProcessEvents(void) { event_t *ev; - for (; eventtail != eventhead; - eventtail = (eventtail + 1) & (MAXEVENTS - 1)) + while ((ev = D_PopEvent()) != NULL) { - ev = &events[eventtail]; if (F_Responder(ev)) { continue; diff --git a/src/heretic/d_net.c b/src/heretic/d_net.c index 8b8aba20..fd728de4 100644 --- a/src/heretic/d_net.c +++ b/src/heretic/d_net.c @@ -483,10 +483,9 @@ void CheckAbort(void) I_StartTic(); I_StartTic(); - for (; eventtail != eventhead; - eventtail = (eventtail + 1) & (MAXEVENTS - 1)) + + while ((ev = D_PopEvent()) != NULL) { - ev = &events[eventtail]; if (ev->type == ev_keydown && ev->data1 == KEY_ESCAPE) I_Error("Network game synchronization aborted."); } diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h index 3da11a3c..c60fa350 100644 --- a/src/heretic/doomdef.h +++ b/src/heretic/doomdef.h @@ -544,12 +544,6 @@ extern doomdata_t *netbuffer; // points inside doomcom #define TELEFOGHEIGHT (32*FRACUNIT) -#define MAXEVENTS 64 - -extern event_t events[MAXEVENTS]; -extern int eventhead; -extern int eventtail; - extern gameaction_t gameaction; extern boolean paused; |