r96 - trunk/src

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 23 10:16:14 EST 2005


Author: jonas
Date: 2005-02-23 10:16:13 -0500 (Wed, 23 Feb 2005)
New Revision: 96

Modified:
   trunk/src/input.cpp
Log:
100l, forgot keypressed/keystate for Menu/Paused...

Modified: trunk/src/input.cpp
===================================================================
--- trunk/src/input.cpp	2005-02-23 15:06:42 UTC (rev 95)
+++ trunk/src/input.cpp	2005-02-23 15:16:13 UTC (rev 96)
@@ -38,6 +38,9 @@
 }
 
 inline void InputHandler::pollMenuEvents() {
+    for (Uint16 i=0; i<SDLK_LAST; i++) {
+        keypressed[i]=false;
+    }
     while(SDL_PollEvent(&event)) {
         switch(event.type) {
            // special events
@@ -51,6 +54,7 @@
             }
             case SDL_KEYDOWN: {
                 SDLKey key=event.key.keysym.sym;
+                keypressed[key]=true;
                 if (key==config.keybind[KEY_UP]) {
                     menu->increaseEntry(false);
                 } else if (key==config.keybind[KEY_DOWN]) {
@@ -78,9 +82,13 @@
             }
         }
     }    
+    keystate = SDL_GetKeyState(NULL);
 }
 
 inline void InputHandler::pollPausedEvents() {
+    for (Uint16 i=0; i<SDLK_LAST; i++) {
+        keypressed[i]=false;
+    }
     while(SDL_PollEvent(&event)) {
         switch(event.type) {
            // special events
@@ -94,6 +102,7 @@
             }
             case SDL_KEYDOWN: {
                 SDLKey key=event.key.keysym.sym;
+                keypressed[key]=true;
                 if (key==config.keybind[KEY_SWITCH]) {
                      scenario->pool->switchPlayer();
                 } else if (key==config.keybind[KEY_PAUSE]) {
@@ -115,6 +124,7 @@
             }
         }
     }    
+    keystate = SDL_GetKeyState(NULL);
 }
 
 inline void InputHandler::pollGameEvents() {




More information about the lostpenguins-commits mailing list