Simplify InputQueue: use InputEventPlus. This has the

timestamp it needs, and we can match MenuI from it without
doing extra conversions.
This commit is contained in:
Glenn Maynard
2006-09-08 03:16:35 +00:00
parent 8ebab0dde7
commit 4da8857f1d
3 changed files with 18 additions and 26 deletions
+3 -9
View File
@@ -8,26 +8,20 @@
#include "MenuInput.h"
const unsigned MAX_INPUT_QUEUE_LENGTH = 16;
class InputEventPlus;
class InputQueue
{
public:
InputQueue();
void RememberInput( GameInput gi );
void RememberInput( const InputEventPlus &gi );
bool MatchesSequence( GameController c, const GameButton* button_sequence, int iNumButtons, float fMaxSecondsBack );
bool MatchesSequence( GameController c, const MenuButton* button_sequence, int iNumButtons, float fMaxSecondsBack );
bool AllWerePressedRecently( GameController c, const GameButton* buttons, int iNumButtons, float fMaxSecondsBack );
protected:
struct GameButtonAndTime
{
GameButtonAndTime() {}
GameButtonAndTime( GameButton b, float t ) { button = b; fTime = t; };
GameButton button;
float fTime;
};
vector<GameButtonAndTime> m_aQueue[MAX_GAME_CONTROLLERS];
vector<InputEventPlus> m_aQueue[MAX_GAME_CONTROLLERS];
};