small stuff, again

This commit is contained in:
AJ Kelly
2011-02-23 19:02:38 -06:00
parent 01f8ad22c7
commit 5bba255711
@@ -377,6 +377,7 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm )
}
break;
case device.MOUSE:
// Not 100% perfect (or tested much) yet. -aj
DIMOUSESTATE state;
HRESULT hr = GetDeviceState(device.Device, sizeof(state), &state);
@@ -413,19 +414,16 @@ void InputHandler_DInput::UpdatePolled( DIDevice &device, const RageTimer &tm )
case DIMOFS_Z:
neg = MOUSE_WHEELUP; pos = MOUSE_WHEELDOWN;
val = state.lZ;
float l = SCALE( int(val), -120.0f, 120.0f, 0.0f, 1.0f );
ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) );
ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) );
break;
default: LOG->MapLog( "unknown input",
"Mouse '%s' is returning an unknown mouse offset, %i",
device.m_sName.c_str(), in.ofs );
continue;
}
if( neg != DeviceButton_Invalid )
{
float l = SCALE( int(val), 0.0f, 100.0f, 0.0f, 1.0f );
ButtonPressed( DeviceInput(dev, neg, max(-l,0), tm) );
ButtonPressed( DeviceInput(dev, pos, max(+l,0), tm) );
}
break;
}
}