sdl 2.0.8 update

This commit is contained in:
Tim 2018-05-09 23:09:05 +10:00
parent d6f6bc65a5
commit ec8f56b3b0
894 changed files with 66879 additions and 43299 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -38,7 +38,17 @@ SDL_atan(double x)
return atan(x);
#else
return SDL_uclibc_atan(x);
#endif /* HAVE_ATAN */
#endif
}
float
SDL_atanf(float x)
{
#if defined(HAVE_ATANF)
return atanf(x);
#else
return (float)SDL_atan((double)x);
#endif
}
double
@ -48,7 +58,17 @@ SDL_atan2(double x, double y)
return atan2(x, y);
#else
return SDL_uclibc_atan2(x, y);
#endif /* HAVE_ATAN2 */
#endif
}
float
SDL_atan2f(float x, float y)
{
#if defined(HAVE_ATAN2F)
return atan2f(x, y);
#else
return (float)SDL_atan2((double)x, (double)y);
#endif
}
double
@ -71,6 +91,16 @@ SDL_acos(double val)
#endif
}
float
SDL_acosf(float val)
{
#if defined(HAVE_ACOSF)
return acosf(val);
#else
return (float)SDL_acos((double)val);
#endif
}
double
SDL_asin(double val)
{
@ -87,6 +117,16 @@ SDL_asin(double val)
#endif
}
float
SDL_asinf(float val)
{
#if defined(HAVE_ASINF)
return asinf(val);
#else
return (float)SDL_asin((double)val);
#endif
}
double
SDL_ceil(double x)
{
@ -102,6 +142,16 @@ SDL_ceil(double x)
#endif /* HAVE_CEIL */
}
float
SDL_ceilf(float x)
{
#if defined(HAVE_CEILF)
return ceilf(x);
#else
return (float)SDL_ceil((float)x);
#endif
}
double
SDL_copysign(double x, double y)
{
@ -109,11 +159,27 @@ SDL_copysign(double x, double y)
return copysign(x, y);
#elif defined(HAVE__COPYSIGN)
return _copysign(x, y);
#elif defined(__WATCOMC__) && defined(__386__)
/* this is nasty as hell, but it works.. */
unsigned int *xi = (unsigned int *) &x,
*yi = (unsigned int *) &y;
xi[1] = (yi[1] & 0x80000000) | (xi[1] & 0x7fffffff);
return x;
#else
return SDL_uclibc_copysign(x, y);
#endif /* HAVE_COPYSIGN */
}
float
SDL_copysignf(float x, float y)
{
#if defined(HAVE_COPYSIGNF)
return copysignf(x, y);
#else
return (float)SDL_copysign((double)x, (double)y);
#endif
}
double
SDL_cos(double x)
{
@ -121,7 +187,7 @@ SDL_cos(double x)
return cos(x);
#else
return SDL_uclibc_cos(x);
#endif /* HAVE_COS */
#endif
}
float
@ -141,7 +207,17 @@ SDL_fabs(double x)
return fabs(x);
#else
return SDL_uclibc_fabs(x);
#endif /* HAVE_FABS */
#endif
}
float
SDL_fabsf(float x)
{
#if defined(HAVE_FABSF)
return fabsf(x);
#else
return (float)SDL_fabs((double)x);
#endif
}
double
@ -151,7 +227,37 @@ SDL_floor(double x)
return floor(x);
#else
return SDL_uclibc_floor(x);
#endif /* HAVE_FLOOR */
#endif
}
float
SDL_floorf(float x)
{
#if defined(HAVE_FLOORF)
return floorf(x);
#else
return (float)SDL_floor((double)x);
#endif
}
double
SDL_fmod(double x, double y)
{
#if defined(HAVE_FMOD)
return fmod(x, y);
#else
return SDL_uclibc_fmod(x, y);
#endif
}
float
SDL_fmodf(float x, float y)
{
#if defined(HAVE_FMODF)
return fmodf(x, y);
#else
return (float)SDL_fmod((double)x, (double)y);
#endif
}
double
@ -161,7 +267,37 @@ SDL_log(double x)
return log(x);
#else
return SDL_uclibc_log(x);
#endif /* HAVE_LOG */
#endif
}
float
SDL_logf(float x)
{
#if defined(HAVE_LOGF)
return logf(x);
#else
return (float)SDL_log((double)x);
#endif
}
double
SDL_log10(double x)
{
#if defined(HAVE_LOG10)
return log10(x);
#else
return SDL_uclibc_log10(x);
#endif
}
float
SDL_log10f(float x)
{
#if defined(HAVE_LOG10F)
return log10f(x);
#else
return (float)SDL_log10((double)x);
#endif
}
double
@ -171,7 +307,17 @@ SDL_pow(double x, double y)
return pow(x, y);
#else
return SDL_uclibc_pow(x, y);
#endif /* HAVE_POW */
#endif
}
float
SDL_powf(float x, float y)
{
#if defined(HAVE_POWF)
return powf(x, y);
#else
return (float)SDL_pow((double)x, (double)y);
#endif
}
double
@ -181,9 +327,23 @@ SDL_scalbn(double x, int n)
return scalbn(x, n);
#elif defined(HAVE__SCALB)
return _scalb(x, n);
#elif defined(HAVE_LIBC) && defined(HAVE_FLOAT_H) && (FLT_RADIX == 2)
/* from scalbn(3): If FLT_RADIX equals 2 (which is
* usual), then scalbn() is equivalent to ldexp(3). */
return ldexp(x, n);
#else
return SDL_uclibc_scalbn(x, n);
#endif /* HAVE_SCALBN */
#endif
}
float
SDL_scalbnf(float x, int n)
{
#if defined(HAVE_SCALBNF)
return scalbnf(x, n);
#else
return (float)SDL_scalbn((double)x, n);
#endif
}
double
@ -193,7 +353,7 @@ SDL_sin(double x)
return sin(x);
#else
return SDL_uclibc_sin(x);
#endif /* HAVE_SIN */
#endif
}
float
@ -203,7 +363,7 @@ SDL_sinf(float x)
return sinf(x);
#else
return (float)SDL_sin((double)x);
#endif /* HAVE_SINF */
#endif
}
double
@ -914,8 +1074,8 @@ _allshr()
{
/* *INDENT-OFF* */
__asm {
cmp cl,40h
jae RETZERO
cmp cl,3Fh
jae RETSIGN
cmp cl,20h
jae MORE32
shrd eax,edx,cl
@ -923,13 +1083,13 @@ _allshr()
ret
MORE32:
mov eax,edx
xor edx,edx
sar edx,1Fh
and cl,1Fh
sar eax,cl
ret
RETZERO:
xor eax,eax
xor edx,edx
RETSIGN:
sar edx,1Fh
mov eax,edx
ret
}
/* *INDENT-ON* */