Remove return value from axis functions in API

This commit is contained in:
Henrik Rydgård committed 2023-01-10 10:12:37 +01:00
1 parent a3a949f5e6
commit 07114c6aaf
18 files changed
+52 -72

No files matched your search

+10 -15
View File
@@ -1353,15 +1353,15 @@ bool NativeKey(const KeyInput &key) {
return retval;
}
bool NativeAxis(const AxisInput &axis) {
void NativeAxis(const AxisInput &axis) {
// VR actions
if (IsVREnabled() && !UpdateVRAxis(axis)) {
return false;
return;
}
if (!screenManager) {
// Too early.
return false;
return;
}
using namespace TiltEventProcessor;
@@ -1369,11 +1369,8 @@ bool NativeAxis(const AxisInput &axis) {
// only handle tilt events if tilt is enabled.
if (g_Config.iTiltInputType == TILT_NULL) {
// if tilt events are disabled, then run it through the usual way.
if (screenManager) {
return screenManager->axis(axis);
} else {
return false;
}
screenManager->axis(axis);
return;
}
// create the base coordinate tilt system from the calibration data.
@@ -1404,7 +1401,7 @@ bool NativeAxis(const AxisInput &axis) {
if (fabs(axis.value) < 0.8f && g_Config.iTiltOrientation == 2) // Auto tilt switch
verticalTilt = false;
else
return false; // Tilt on Z instead
return; // Tilt on Z instead
}
if (portrait) {
currentTilt.x_ = axis.value;
@@ -1426,7 +1423,7 @@ bool NativeAxis(const AxisInput &axis) {
if (fabs(axis.value) < 0.8f && g_Config.iTiltOrientation == 2) // Auto tilt switch
verticalTilt = true;
else
return false; // Tilt on X instead
return; // Tilt on X instead
}
if (portrait) {
currentTilt.x_ = -axis.value;
@@ -1442,13 +1439,12 @@ bool NativeAxis(const AxisInput &axis) {
//Don't know how to handle these. Someone should figure it out.
//Does the Ouya even have an accelerometer / gyro? I can't find any reference to these
//in the Ouya docs...
return false;
return;
default:
// Don't take over completely!
if (!screenManager)
return false;
return screenManager->axis(axis);
screenManager->axis(axis);
return;
}
//figure out the sensitivity of the tilt. (sensitivity is originally 0 - 100)
@@ -1463,7 +1459,6 @@ bool NativeAxis(const AxisInput &axis) {
Tilt trueTilt = GenTilt(baseTilt, currentTilt, g_Config.bInvertTiltX, g_Config.bInvertTiltY, g_Config.fDeadzoneRadius, xSensitivity, ySensitivity);
TranslateTiltToInput(trueTilt);
return true;
}
void NativeMessageReceived(const char *message, const char *value) {