Use functions from SDL instead of libc
parent
a6374123c7
commit
f85535b4b6
|
@ -759,9 +759,9 @@ float SDL_PQfromNits(float v)
|
|||
const float m2 = 78.84375f;
|
||||
|
||||
float y = SDL_clamp(v / 10000.0f, 0.0f, 1.0f);
|
||||
float num = c1 + c2 * pow(y, m1);
|
||||
float den = 1.0f + c3 * pow(y, m1);
|
||||
return pow(num / den, m2);
|
||||
float num = c1 + c2 * SDL_powf(y, m1);
|
||||
float den = 1.0f + c3 * SDL_powf(y, m1);
|
||||
return SDL_powf(num / den, m2);
|
||||
}
|
||||
|
||||
const float *SDL_GetYCbCRtoRGBConversionMatrix(SDL_Colorspace colorspace)
|
||||
|
|
|
@ -275,7 +275,7 @@ static SDL_bool xinput2_pen_is_eraser(SDL_VideoDevice *_this, int deviceid, char
|
|||
SDL_strlcpy(dev_name, devicename, PEN_ERASER_ID_MAXLEN);
|
||||
/* lowercase device name string so we can use strstr() */
|
||||
for (k = 0; dev_name[k]; ++k) {
|
||||
dev_name[k] = tolower(dev_name[k]);
|
||||
dev_name[k] = SDL_tolower(dev_name[k]);
|
||||
}
|
||||
|
||||
return (SDL_strstr(dev_name, PEN_ERASER_NAME_TAG)) ? SDL_TRUE : SDL_FALSE;
|
||||
|
|
|
@ -158,7 +158,7 @@ static void DrawScreen(SDL_Renderer *renderer)
|
|||
SDL_RenderLine(renderer, X, Y, endx - (ydelta * last_pressure / 3.0f), endy + (xdelta * last_pressure / 3.0f));
|
||||
|
||||
/* If tilt is very small (or zero, for pens that don't have tilt), add some extra lines, rotated by the current rotation value */
|
||||
if (ALWAYS_SHOW_PRESSURE_BOX || (fabs(tilt_vec_x) < 0.2f && fabs(tilt_vec_y) < 0.2f)) {
|
||||
if (ALWAYS_SHOW_PRESSURE_BOX || (SDL_fabs(tilt_vec_x) < 0.2f && SDL_fabs(tilt_vec_y) < 0.2f)) {
|
||||
int rot;
|
||||
float pressure = last_pressure * 80.0f;
|
||||
|
||||
|
|
Loading…
Reference in New Issue