mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Fix the toggle touch controls input (properly this time)
This commit is contained in:
1 parent
f546dc3835
commit
d6d2c24e24
6 files changed
+60
-18
No files matched your search
@@ -124,6 +124,16 @@ void ProcessTilt(bool landscape, float calibrationAngle, float x, float y, float
|
||||
|
||||
Lin::Vec3 down = Lin::Vec3(x, y, z).normalized();
|
||||
|
||||
if (my_isnanorinf(down.x) || my_isnanorinf(down.y) || my_isnanorinf(down.z)) {
|
||||
// Invalid data - ignore.
|
||||
static int count = 0;
|
||||
if (count < 20) {
|
||||
WARN_LOG(Log::System, "Bad accelerometer data: %f %f %f (will stop logging after 20)", x, y, z);
|
||||
}
|
||||
count++;
|
||||
return;
|
||||
}
|
||||
|
||||
float angleAroundX = atan2(down.z, down.y);
|
||||
g_currentYAngle = angleAroundX; // TODO: Should smooth this out over time a bit.
|
||||
float yAngle = angleAroundX - calibrationAngle;
|
||||
|
||||
Reference in new issue
Block a user