forked from coolsee/OpenMugen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCmdManager.h
37 lines (26 loc) · 925 Bytes
/
CmdManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __COMMAND_MANAGER__CMDMANAGER_H__
#define __COMMAND_MANAGER__CMDMANAGER_H__
//Tokenizer by Nate Pendelton
class CCmdManager
{
// To Get the Game time
CGameTimer *m_pTimer;
public:
CCmdManager( int keyBufferSize = 120 );
~CCmdManager();
bool LoadCMDFile( const char* file ); // returns false upon load failure
void Update( KEYBOARDDATA* keys, bool facingRight );
const char* GetCurrentCommandName();
void SetGameTimer(CGameTimer *t){m_pTimer=t;}
protected:
PLCOMMAND* m_Commands;
int m_CommandCount;
const char* m_CurrCommandName;
//this is the Keyboard buffer
PLCOMMANDFRAMEINPUT* m_KeyBuffer;
short m_KeyBufferSize;
short m_KeyIndex;
inline int AdjustKeyIndex( int keyIndex, int increment )
{ return ( keyIndex + increment + m_KeyBufferSize ) % m_KeyBufferSize; }
};
#endif