|
From: Yoda-JM <yo...@us...> - 2009-10-12 20:18:39
|
Module: performous
Branch: master
Commit: e523e2a78471acfd5c85efe3fc73bb82be7bbc71
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Oct 12 22:18:21 2009 +0200
Added joystick events timing
---
game/joystick.hh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index 4e35779..e370668 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -8,6 +8,7 @@
#include "SDL_events.h"
#include "SDL_joystick.h"
+#include "xtime.hh"
#include "configuration.hh"
namespace input {
@@ -21,6 +22,7 @@ namespace input {
int button; // Translated button number for press/release events. 0 for pick down, 1 for pick up (NOTE: these are NOT pick press/release events but rather different directions)
bool pressed[BUTTONS]; // All events tell the button state right after the event happened
// More stuff later, when it is actually used
+ boost::xtime time;
};
namespace Private {
@@ -45,6 +47,8 @@ namespace input {
return true;
};
void addEvent(Event _event) {
+ // Add event time
+ _event.time = now();
// only add event if the device is assigned
if( m_assigned ) m_events.push_back(_event);
/*
|