/***********************************************************
-* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-98 Artsoft Entertainment *
-* Holger Schemel *
-* Oststrasse 11a *
-* 33604 Bielefeld *
-* phone: ++49 +521 290471 *
-* email: aeglos@valinor.owl.de *
+* (c) 1995-2001 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
*----------------------------------------------------------*
-* events.c *
+* events.c *
***********************************************************/
#include "libgame/libgame.h"
#include "tools.h"
#include "game.h"
#include "editor.h"
+#include "files.h"
#include "tape.h"
#include "joystick.h"
#include "network.h"
return 1;
}
+/* this is only really needed for non-SDL targets to filter unwanted events;
+ when using SDL with properly installed event filter, this function can be
+ replaced with a simple "NextEvent()" call, but it doesn't hurt either */
+
+static boolean NextValidEvent(Event *event)
+{
+ while (PendingEvent())
+ {
+ NextEvent(event);
+
+ if (FilterMouseMotionEvents(event))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
void EventLoop(void)
{
while(1)
{
Event event;
- NextEvent(&event);
-
- if (FilterMouseMotionEvents(&event))
+ if (NextValidEvent(&event))
{
switch(event.type)
{
HandleChooseLevel(0,0, 0,SCR_FIELDY, MB_MENU_MARK);
break;
+#ifdef DEBUG
+ case KSYM_t:
+ DumpTape(&tape);
+ break;
+#endif
+
default:
break;
}