mirror of https://github.com/encounter/SDL.git
Fixed compile errors on various platforms
This commit is contained in:
parent
ca019dada5
commit
ad26769cd7
|
@ -563,7 +563,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joy)
|
||||||
v *= 32768 /
|
v *= 32768 /
|
||||||
((hitem.logical_maximum -
|
((hitem.logical_maximum -
|
||||||
hitem.logical_minimum + 1) / 2);
|
hitem.logical_minimum + 1) / 2);
|
||||||
if (v != joy->axes[naxe]) {
|
if (v != joy->axes[naxe].value) {
|
||||||
SDL_PrivateJoystickAxis(joy, naxe, v);
|
SDL_PrivateJoystickAxis(joy, naxe, v);
|
||||||
}
|
}
|
||||||
} else if (usage == HUG_HAT_SWITCH) {
|
} else if (usage == HUG_HAT_SWITCH) {
|
||||||
|
|
|
@ -134,6 +134,7 @@ GetHIDScaledCalibratedState(recDevice * pDevice, recElement * pElement, SInt32 m
|
||||||
const float deviceScale = max - min;
|
const float deviceScale = max - min;
|
||||||
const float readScale = pElement->maxReport - pElement->minReport;
|
const float readScale = pElement->maxReport - pElement->minReport;
|
||||||
const SInt32 value = GetHIDElementState(pDevice, pElement);
|
const SInt32 value = GetHIDElementState(pDevice, pElement);
|
||||||
|
printf("MIN/MAX = %d/%d, value = %d\n", pElement->minReport, pElement->maxReport, value);
|
||||||
if (readScale == 0) {
|
if (readScale == 0) {
|
||||||
return value; /* no scaling at all */
|
return value; /* no scaling at all */
|
||||||
}
|
}
|
||||||
|
@ -691,8 +692,9 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
|
||||||
element = device->firstAxis;
|
element = device->firstAxis;
|
||||||
i = 0;
|
i = 0;
|
||||||
while (element) {
|
while (element) {
|
||||||
|
printf("Getting axis %d ", i);
|
||||||
value = GetHIDScaledCalibratedState(device, element, -32768, 32767);
|
value = GetHIDScaledCalibratedState(device, element, -32768, 32767);
|
||||||
if (value != joystick->axes[i]) {
|
if (value != joystick->axes[i].value) {
|
||||||
SDL_PrivateJoystickAxis(joystick, i, value);
|
SDL_PrivateJoystickAxis(joystick, i, value);
|
||||||
}
|
}
|
||||||
element = element->pNext;
|
element = element->pNext;
|
||||||
|
|
|
@ -197,7 +197,7 @@ extern "C"
|
||||||
|
|
||||||
/* Generate axis motion events */
|
/* Generate axis motion events */
|
||||||
for (i = 0; i < joystick->naxes; ++i) {
|
for (i = 0; i < joystick->naxes; ++i) {
|
||||||
change = ((int32) axes[i] - joystick->axes[i]);
|
change = ((int32) axes[i] - joystick->axes[i].value);
|
||||||
if ((change > JITTER) || (change < -JITTER)) {
|
if ((change > JITTER) || (change < -JITTER)) {
|
||||||
SDL_PrivateJoystickAxis(joystick, i, axes[i]);
|
SDL_PrivateJoystickAxis(joystick, i, axes[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,7 +516,7 @@ SDL_SYS_MFIJoystickUpdate(SDL_Joystick * joystick)
|
||||||
* initializes its values to 0. We only want to make sure the
|
* initializes its values to 0. We only want to make sure the
|
||||||
* player index is up to date if the user actually moves an axis. */
|
* player index is up to date if the user actually moves an axis. */
|
||||||
if ((i != 2 && i != 5) || axes[i] != -32768) {
|
if ((i != 2 && i != 5) || axes[i] != -32768) {
|
||||||
updateplayerindex |= (joystick->axes[i] != axes[i]);
|
updateplayerindex |= (joystick->axes[i].value != axes[i]);
|
||||||
}
|
}
|
||||||
SDL_PrivateJoystickAxis(joystick, i, axes[i]);
|
SDL_PrivateJoystickAxis(joystick, i, axes[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue