ARRAYLEN
This commit is contained in:
@@ -50,7 +50,7 @@ static const DeviceButton g_keys[] =
|
||||
|
||||
static DeviceButton GetRandomKeyboardKey()
|
||||
{
|
||||
int index = RandomInt( ARRAYSIZE(g_keys) );
|
||||
int index = RandomInt( ARRAYLEN(g_keys) );
|
||||
return g_keys[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ void InputHandler_Win32_Pump::HandleInput( int iDevice, int iEvent )
|
||||
|
||||
InputDevice id = InputDevice( DEVICE_PUMP1 + iDevice );
|
||||
|
||||
for( int iButton = 0; iButton < ARRAYSIZE(bits); ++iButton )
|
||||
for( int iButton = 0; iButton < ARRAYLEN(bits); ++iButton )
|
||||
{
|
||||
DeviceInput di( id, enum_add2(JOY_BUTTON_1, iButton) );
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ static DeviceButton XSymToDeviceButton( int key )
|
||||
return ASCIIKeySyms[key & 0xFF];
|
||||
|
||||
/* 32...127: */
|
||||
if( key < int(ARRAYSIZE(ASCIIKeySyms)))
|
||||
if( key < int(ARRAYLEN(ASCIIKeySyms)))
|
||||
return ASCIIKeySyms[key];
|
||||
|
||||
/* XK_KP_0 ... XK_KP_9 to KEY_KP_C0 ... KEY_KP_C9 */
|
||||
|
||||
@@ -96,7 +96,7 @@ void InputHandler_Xbox::Update()
|
||||
XInputGetState( joysticks[i], &xis );
|
||||
|
||||
// check buttons
|
||||
for(int j = 0; j < ARRAYSIZE(buttonMasks); j++)
|
||||
for(int j = 0; j < ARRAYLEN(buttonMasks); j++)
|
||||
{
|
||||
DWORD nowPressed = xis.Gamepad.wButtons & buttonMasks[j];
|
||||
DWORD wasPressed = lastState[i].wButtons & buttonMasks[j];
|
||||
@@ -116,7 +116,7 @@ void InputHandler_Xbox::Update()
|
||||
}
|
||||
|
||||
// check analog buttons
|
||||
for(int j = 0; j < ARRAYSIZE(xis.Gamepad.bAnalogButtons); j++)
|
||||
for(int j = 0; j < ARRAYLEN(xis.Gamepad.bAnalogButtons); j++)
|
||||
{
|
||||
bool nowPressed = xis.Gamepad.bAnalogButtons[j] > XINPUT_GAMEPAD_MAX_CROSSTALK;
|
||||
bool wasPressed = lastState[i].bAnalogButtons[j] > XINPUT_GAMEPAD_MAX_CROSSTALK;
|
||||
@@ -138,7 +138,7 @@ void InputHandler_Xbox::Update()
|
||||
// check thumbsticks
|
||||
SHORT axes[] = { xis.Gamepad.sThumbLX, xis.Gamepad.sThumbLY, xis.Gamepad.sThumbRX, xis.Gamepad.sThumbRY};
|
||||
|
||||
for(int j = 0; j < ARRAYSIZE(axes); j++)
|
||||
for(int j = 0; j < ARRAYLEN(axes); j++)
|
||||
{
|
||||
if(axes[j] != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user