From f8b216522bb4a2f2a8279412ff949955706d727e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 1 Oct 2008 18:00:13 +0000 Subject: Use common versions of ticcmd_t and event_t for Hexen code. Remove old i_video definitions and use common i_video.c interface. Subversion-branch: /branches/raven-branch Subversion-revision: 1312 --- src/hexen/h2_main.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'src/hexen/h2_main.c') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 603b2f47..c3d42c5a 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -33,6 +33,7 @@ #include #include #include "h2def.h" +#include "i_system.h" #include "m_argv.h" #include "p_local.h" #include "soundst.h" @@ -118,9 +119,6 @@ int startmap; boolean autostart; boolean advancedemo; FILE *debugfile; -event_t events[MAXEVENTS]; -int eventhead; -int eventtail; // PRIVATE DATA DEFINITIONS ------------------------------------------------ @@ -536,10 +534,15 @@ void H2_ProcessEvents(void) { event_t *ev; - for (; eventtail != eventhead; - eventtail = (eventtail + 1) & (MAXEVENTS - 1)) + for (;;) { - ev = &events[eventtail]; + ev = D_PopEvent(); + + if (ev == NULL) + { + break; + } + if (F_Responder(ev)) { continue; @@ -552,20 +555,6 @@ void H2_ProcessEvents(void) } } -//========================================================================== -// -// H2_PostEvent -// -// Called by the I/O functions when input is detected. -// -//========================================================================== - -void H2_PostEvent(event_t * ev) -{ - events[eventhead] = *ev; - eventhead = (eventhead + 1) & (MAXEVENTS - 1); -} - //========================================================================== // // DrawAndBlit @@ -634,7 +623,7 @@ static void DrawAndBlit(void) NetUpdate(); // Flush buffered stuff to screen - I_Update(); + I_FinishUpdate(); } //========================================================================== -- cgit v1.2.3