mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-22 10:49:05 +02:00
Fix the latent tail from the Common/Core review
Buffer::PeekAll resized the destination and then appended, so it returned twice the data with zeros in front. No callers today. The assert dialog's caption was a function-local static, so it froze at whichever kind of assert fired first in the session - a later Critical Assert would still be titled 'Debug Assert'. Made it a plain const char *. containsNoCase passed a possibly-negative char to std::toupper, which is UB for anything but EOF; non-ASCII bytes get here from ELF symbol names. ApplyDeadzoneXY's circular path lacked the deadzone >= 0.99f guard its own sibling ApplyDeadzoneAxis has one function above, so it divided by ~0.
This commit is contained in:
1 parent
49552b0881
commit
ab0fa898ae
4 files changed
+18
-4
No files matched your search
@@ -55,6 +55,13 @@ inline float ApplyDeadzoneAxis(float x, float deadzone) {
|
||||
|
||||
inline void ApplyDeadzoneXY(float x, float y, float *adjustedX, float *adjustedY, float deadzone, bool circular) {
|
||||
if (circular) {
|
||||
if (deadzone >= 0.99f) {
|
||||
// Same guard as ApplyDeadzoneAxis - without it the factor below divides by ~0.
|
||||
*adjustedX = x;
|
||||
*adjustedY = y;
|
||||
return;
|
||||
}
|
||||
|
||||
if (x == 0.0f && y == 0.0f) {
|
||||
*adjustedX = 0.0f;
|
||||
*adjustedY = 0.0f;
|
||||
|
||||
Reference in new issue
Block a user