diff --git a/common/common.h b/common/common.h index 5d7bb4e..15ccd48 100644 --- a/common/common.h +++ b/common/common.h @@ -11,6 +11,7 @@ #include #include #include +#include #ifdef SWITCH #include #endif diff --git a/common/math.h b/common/math.h index 7dd9f4f..4e19ee5 100644 --- a/common/math.h +++ b/common/math.h @@ -5,9 +5,5 @@ float approxSin(float x); inline float clamp(float x, float min, float max) { - return xmax ? max : x; -} - -inline float nxfabs(float x) { - return x < 0 ? -x : x; + return x max ? max : x; } \ No newline at end of file diff --git a/common/menu.c b/common/menu.c index 30756a4..5ad0df8 100644 --- a/common/menu.c +++ b/common/menu.c @@ -219,7 +219,7 @@ void drawWave(float timer, color_t color, float height, float phase, float speed new_color = waveBlendAdd(existing_color, color, clamp(alpha, 0.0, 1.0) * 0.3); } else if (alpha < 0.3) { // anti-aliasing - alpha = nxfabs(alpha); + alpha = fabs(alpha); new_color = MakeColor(color.r * (1.0 - alpha) + existing_color.r * alpha, color.g * (1.0 - alpha) + existing_color.g * alpha, color.b * (1.0 - alpha) + existing_color.b * alpha, 255); } else { // darken closer to bottom of the waves