Add an event mask for SDL1.2
authornemo
Sat, 12 Nov 2011 10:44:10 -0500
changeset 6327 1a69a0d52d32
parent 6326 07d83af9d2a8
child 6329 9eb6c4a8d633
Add an event mask for SDL1.2
hedgewars/SDLh.pas
hedgewars/hwengine.pas
--- a/hedgewars/SDLh.pas	Fri Nov 11 15:28:58 2011 -0500
+++ b/hedgewars/SDLh.pas	Sat Nov 12 10:44:10 2011 -0500
@@ -238,6 +238,8 @@
     SDL_HWPALETTE   = $20000000;
     SDL_DOUBLEBUF   = $40000000;
     SDL_FULLSCREEN  = $80000000;
+
+    HW_EVENT_MASK   = SDL_JOYAXISMOTION or SDL_JOYHATMOTION or SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP or SDL_QUITEV or SDL_KEYDOWN or SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP or SDL_ACTIVEEVENT or SDL_VIDEORESIZE;
 {$ENDIF}
 
 {$IFDEF ENDIAN_LITTLE}
--- a/hedgewars/hwengine.pas	Fri Nov 11 15:28:58 2011 -0500
+++ b/hedgewars/hwengine.pas	Sat Nov 12 10:44:10 2011 -0500
@@ -156,7 +156,7 @@
     while isTerminated = false do
     begin
         SDL_PumpEvents();
-        while SDL_PeepEvents(@event, 1, SDL_GETEVENT, {$IFDEF SDL13}SDL_FIRSTEVENT, SDL_LASTEVENT{$ELSE}SDL_ALLEVENTS{$ENDIF}) > 0 do
+        while SDL_PeepEvents(@event, 1, SDL_GETEVENT, {$IFDEF SDL13}SDL_FIRSTEVENT, SDL_LASTEVENT{$ELSE}HW_EVENT_MASK{$ENDIF}) > 0 do
         begin
             case event.type_ of
 {$IFDEF SDL13}