Don't unnecessarily expose internal constant

This commit is contained in:
Jonas Kulla 2014-05-26 16:54:54 +02:00
parent ad63c962c6
commit 5ba40369cc
2 changed files with 4 additions and 6 deletions

View File

@ -31,7 +31,7 @@
#include <vector>
#include <string.h>
const int Input::buttonCodeSize = 24;
#define BUTTON_CODE_COUNT 24
struct ButtonState
{
@ -285,7 +285,7 @@ struct InputPrivate
/* Collective binding array */
std::vector<Binding*> bindings;
ButtonState stateArray[Input::buttonCodeSize*2];
ButtonState stateArray[BUTTON_CODE_COUNT*2];
ButtonState *states;
ButtonState *statesOld;
@ -312,7 +312,7 @@ struct InputPrivate
initMsBindings();
states = stateArray;
statesOld = stateArray + Input::buttonCodeSize;
statesOld = stateArray + BUTTON_CODE_COUNT;
/* Clear buffers */
clearBuffer();
@ -359,7 +359,7 @@ struct InputPrivate
void clearBuffer()
{
const size_t size = sizeof(ButtonState) * Input::buttonCodeSize;
const size_t size = sizeof(ButtonState) * BUTTON_CODE_COUNT;
memset(states, 0, size);
}

View File

@ -45,8 +45,6 @@ public:
MouseLeft = 38, MouseMiddle = 39, MouseRight = 40
};
static const int buttonCodeSize;
void update();
bool isPressed(int button);