in this section, the line DWORD result = XInputGetState( i, &state ); seems to be what actually controls the speed.
Code:
//update controllers
for (int i=0; i< 4; i++ )
{
ZeroMemory( &controllers[i], sizeof(XINPUT_STATE) );
//get the state of the controller
XINPUT_STATE state;
DWORD result = XInputGetState( i, &state );
//store state in global controllers array
if (result == 0) controllers[i] = state.Gamepad;
}
for (int i=0; i< 4; i++ )
{
ZeroMemory( &controllers[i], sizeof(XINPUT_STATE) );
//get the state of the controller
XINPUT_STATE state;
DWORD result = XInputGetState( i, &state );
//store state in global controllers array
if (result == 0) controllers[i] = state.Gamepad;
}
and if I try to completely comment out any reference to controllers at all, it will only jump to the far side in any direction, rather than scroll, unless I don't touch
XINPUT_STATE state;
--> DWORD result = XInputGetState( i, &state );
I can just set i as 0, but why if I want to get away from this, and make it so that the speed is just by using SpeedX or SpeedY.
Like I said, i did try removing the controller code all together to get this working a little better. Just can't figure out why it causes the scroller to jump from one far side of the map to the other so fast with the speed set at +=1 or -+1.
Thanks, and have a good weekend.



