Don't unnecessarily expose internal constant
This commit is contained in:
parent
ad63c962c6
commit
5ba40369cc
|
@ -31,7 +31,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const int Input::buttonCodeSize = 24;
|
#define BUTTON_CODE_COUNT 24
|
||||||
|
|
||||||
struct ButtonState
|
struct ButtonState
|
||||||
{
|
{
|
||||||
|
@ -285,7 +285,7 @@ struct InputPrivate
|
||||||
/* Collective binding array */
|
/* Collective binding array */
|
||||||
std::vector<Binding*> bindings;
|
std::vector<Binding*> bindings;
|
||||||
|
|
||||||
ButtonState stateArray[Input::buttonCodeSize*2];
|
ButtonState stateArray[BUTTON_CODE_COUNT*2];
|
||||||
|
|
||||||
ButtonState *states;
|
ButtonState *states;
|
||||||
ButtonState *statesOld;
|
ButtonState *statesOld;
|
||||||
|
@ -312,7 +312,7 @@ struct InputPrivate
|
||||||
initMsBindings();
|
initMsBindings();
|
||||||
|
|
||||||
states = stateArray;
|
states = stateArray;
|
||||||
statesOld = stateArray + Input::buttonCodeSize;
|
statesOld = stateArray + BUTTON_CODE_COUNT;
|
||||||
|
|
||||||
/* Clear buffers */
|
/* Clear buffers */
|
||||||
clearBuffer();
|
clearBuffer();
|
||||||
|
@ -359,7 +359,7 @@ struct InputPrivate
|
||||||
|
|
||||||
void clearBuffer()
|
void clearBuffer()
|
||||||
{
|
{
|
||||||
const size_t size = sizeof(ButtonState) * Input::buttonCodeSize;
|
const size_t size = sizeof(ButtonState) * BUTTON_CODE_COUNT;
|
||||||
memset(states, 0, size);
|
memset(states, 0, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,6 @@ public:
|
||||||
MouseLeft = 38, MouseMiddle = 39, MouseRight = 40
|
MouseLeft = 38, MouseMiddle = 39, MouseRight = 40
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int buttonCodeSize;
|
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
bool isPressed(int button);
|
bool isPressed(int button);
|
||||||
|
|
Loading…
Reference in New Issue