Update for float, double and unsigned char, unsigned short, short, etc. char was left alone: read why here http://msdn.microsoft.com/en-us/library/cc953fe1.aspx

This commit is contained in:
cpusci 2013-08-04 16:58:59 -05:00
parent 4c35fd37af
commit 7a8f46b19f
36 changed files with 75 additions and 75 deletions

View file

@ -896,8 +896,8 @@ bool DInputDevice::buildEvent( DWORD offset, S32 newData, S32 oldData )
// Scale to the range -1.0 to 1.0:
if ( objInfo.mMin != DIPROPRANGE_NOMIN && objInfo.mMax != DIPROPRANGE_NOMAX )
{
float range = float( objInfo.mMax - objInfo.mMin );
newEvent.fValue = float( ( 2 * newData ) - objInfo.mMax - objInfo.mMin ) / range;
F32 range = F32( objInfo.mMax - objInfo.mMin );
newEvent.fValue = F32( ( 2 * newData ) - objInfo.mMax - objInfo.mMin ) / range;
}
else
newEvent.fValue = (F32)newData;
@ -1041,7 +1041,7 @@ bool DInputDevice::buildEvent( DWORD offset, S32 newData, S32 oldData )
return true;
}
void DInputDevice::rumble(float x, float y)
void DInputDevice::rumble(F32 x, F32 y)
{
LONG rglDirection[2] = { 0, 0 };
DICONSTANTFORCE cf = { 0 };

View file

@ -117,7 +117,7 @@ class DInputDevice : public InputDevice
const char* getProductName();
// Constant Effect Force Feedback
void rumble( float x, float y );
void rumble( F32 x, F32 y );
// Console interface functions:
const char* getJoystickAxesString();

View file

@ -511,7 +511,7 @@ void DInputManager::deactivateXInput()
}
//------------------------------------------------------------------------------
bool DInputManager::rumble( const char *pDeviceName, float x, float y )
bool DInputManager::rumble( const char *pDeviceName, F32 x, F32 y )
{
// Determine the device
U32 deviceType;
@ -566,7 +566,7 @@ bool DInputManager::rumble( const char *pDeviceName, float x, float y )
}
}
void DInputManager::buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue )
void DInputManager::buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, F32 fValue )
{
InputEventInfo newEvent;
@ -597,7 +597,7 @@ inline void DInputManager::fireXInputConnectEvent( S32 controllerID, bool condit
}
}
inline void DInputManager::fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, float fValue )
inline void DInputManager::fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, F32 fValue )
{
if ( mXInputStateReset || condition )
{

View file

@ -85,9 +85,9 @@ class DInputManager : public InputManager
void unacquire( U8 deviceType, U8 deviceID );
// XInput worker functions
void buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue );
void buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, F32 fValue );
void fireXInputConnectEvent( S32 controllerID, bool condition, bool connected );
void fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, float fValue );
void fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, F32 fValue );
void fireXInputButtonEvent( S32 controllerID, bool forceFire, S32 button, InputObjectInstances objInst );
void processXInput();
@ -126,7 +126,7 @@ class DInputManager : public InputManager
// Console interface:
const char* getJoystickAxesString( U32 deviceID );
bool rumble( const char *pDeviceName, float x, float y );
bool rumble( const char *pDeviceName, F32 x, F32 y );
};
#endif // _H_WINDIRECTINPUT_