Use builtin fabs
This commit is contained in:
parent
d534aaa834
commit
0cec4acd6b
@ -11,6 +11,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
#ifdef SWITCH
|
||||
#include <switch.h>
|
||||
#endif
|
||||
|
@ -7,7 +7,3 @@ float approxSin(float x);
|
||||
inline float clamp(float x, float min, float max) {
|
||||
return x<min ? min : x > max ? max : x;
|
||||
}
|
||||
|
||||
inline float nxfabs(float x) {
|
||||
return x < 0 ? -x : x;
|
||||
}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user