|
From: knittl <kn...@us...> - 2009-08-03 08:40:01
|
Module: performous
Branch: master
Commit: 68c975c9cb77eb8049caabe8e10089f50779dd56
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Aug 1 13:32:51 2009 +0200
Changed clear event position
---
game/joystick.hh | 1 +
game/main.cc | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index 0450cd8..b62bc55 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -87,6 +87,7 @@ namespace input {
public:
InputDevPrivate(input::Type _type = input::UNKNOWN) : m_assigned(false), m_type(_type) {};
bool tryPoll(InputDevEvent&) {return true;};
+ // this will modify the m_pressed member
void addEvent(InputDevEvent) {};
void clearEvents() {m_events.clear();};
void assign() {m_assigned = true;};
diff --git a/game/main.cc b/game/main.cc
index e5578f5..df9cc97 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -39,6 +39,8 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
}
static bool esc = false;
SDL_Event event;
+ // Clear input event first
+ input::clear();
while(SDL_PollEvent(&event) == 1) {
// catch input event first
if(!input::pushEvent(event)) {
@@ -81,7 +83,6 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
case GL_OUT_OF_MEMORY: std::cerr << "OpenGL error: invalid enum" << std::endl; break;
}
}
- input::clear();
if( config["graphic/fullscreen"].b() != window.getFullscreen() )
window.setFullscreen(config["graphic/fullscreen"].b());
}
|