mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
Revert "Updated SDL, Bullet and OpenAL soft libs"
This reverts commit 370161cfb1.
This commit is contained in:
parent
160dc00c07
commit
e7ee94428e
1102 changed files with 62741 additions and 204988 deletions
|
|
@ -1,92 +0,0 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "alcomplex.h"
|
||||
#include "math_defs.h"
|
||||
|
||||
|
||||
extern inline ALcomplex complex_add(ALcomplex a, ALcomplex b);
|
||||
extern inline ALcomplex complex_sub(ALcomplex a, ALcomplex b);
|
||||
extern inline ALcomplex complex_mult(ALcomplex a, ALcomplex b);
|
||||
|
||||
void complex_fft(ALcomplex *FFTBuffer, ALsizei FFTSize, ALdouble Sign)
|
||||
{
|
||||
ALsizei i, j, k, mask, step, step2;
|
||||
ALcomplex temp, u, w;
|
||||
ALdouble arg;
|
||||
|
||||
/* Bit-reversal permutation applied to a sequence of FFTSize items */
|
||||
for(i = 1;i < FFTSize-1;i++)
|
||||
{
|
||||
for(mask = 0x1, j = 0;mask < FFTSize;mask <<= 1)
|
||||
{
|
||||
if((i&mask) != 0)
|
||||
j++;
|
||||
j <<= 1;
|
||||
}
|
||||
j >>= 1;
|
||||
|
||||
if(i < j)
|
||||
{
|
||||
temp = FFTBuffer[i];
|
||||
FFTBuffer[i] = FFTBuffer[j];
|
||||
FFTBuffer[j] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
/* Iterative form of DanielsonLanczos lemma */
|
||||
for(i = 1, step = 2;i < FFTSize;i<<=1, step<<=1)
|
||||
{
|
||||
step2 = step >> 1;
|
||||
arg = M_PI / step2;
|
||||
|
||||
w.Real = cos(arg);
|
||||
w.Imag = sin(arg) * Sign;
|
||||
|
||||
u.Real = 1.0;
|
||||
u.Imag = 0.0;
|
||||
|
||||
for(j = 0;j < step2;j++)
|
||||
{
|
||||
for(k = j;k < FFTSize;k+=step)
|
||||
{
|
||||
temp = complex_mult(FFTBuffer[k+step2], u);
|
||||
FFTBuffer[k+step2] = complex_sub(FFTBuffer[k], temp);
|
||||
FFTBuffer[k] = complex_add(FFTBuffer[k], temp);
|
||||
}
|
||||
|
||||
u = complex_mult(u, w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void complex_hilbert(ALcomplex *Buffer, ALsizei size)
|
||||
{
|
||||
const ALdouble inverse_size = 1.0/(ALdouble)size;
|
||||
ALsizei todo, i;
|
||||
|
||||
for(i = 0;i < size;i++)
|
||||
Buffer[i].Imag = 0.0;
|
||||
|
||||
complex_fft(Buffer, size, 1.0);
|
||||
|
||||
todo = size >> 1;
|
||||
Buffer[0].Real *= inverse_size;
|
||||
Buffer[0].Imag *= inverse_size;
|
||||
for(i = 1;i < todo;i++)
|
||||
{
|
||||
Buffer[i].Real *= 2.0*inverse_size;
|
||||
Buffer[i].Imag *= 2.0*inverse_size;
|
||||
}
|
||||
Buffer[i].Real *= inverse_size;
|
||||
Buffer[i].Imag *= inverse_size;
|
||||
i++;
|
||||
|
||||
for(;i < size;i++)
|
||||
{
|
||||
Buffer[i].Real = 0.0;
|
||||
Buffer[i].Imag = 0.0;
|
||||
}
|
||||
|
||||
complex_fft(Buffer, size, -1.0);
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
#ifndef ALCOMPLEX_H
|
||||
#define ALCOMPLEX_H
|
||||
|
||||
#include "AL/al.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ALcomplex {
|
||||
ALdouble Real;
|
||||
ALdouble Imag;
|
||||
} ALcomplex;
|
||||
|
||||
/** Addition of two complex numbers. */
|
||||
inline ALcomplex complex_add(ALcomplex a, ALcomplex b)
|
||||
{
|
||||
ALcomplex result;
|
||||
|
||||
result.Real = a.Real + b.Real;
|
||||
result.Imag = a.Imag + b.Imag;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Subtraction of two complex numbers. */
|
||||
inline ALcomplex complex_sub(ALcomplex a, ALcomplex b)
|
||||
{
|
||||
ALcomplex result;
|
||||
|
||||
result.Real = a.Real - b.Real;
|
||||
result.Imag = a.Imag - b.Imag;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Multiplication of two complex numbers. */
|
||||
inline ALcomplex complex_mult(ALcomplex a, ALcomplex b)
|
||||
{
|
||||
ALcomplex result;
|
||||
|
||||
result.Real = a.Real*b.Real - a.Imag*b.Imag;
|
||||
result.Imag = a.Imag*b.Real + a.Real*b.Imag;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
|
||||
* FFT and 1 is iFFT (inverse). Fills FFTBuffer[0...FFTSize-1] with the
|
||||
* Discrete Fourier Transform (DFT) of the time domain data stored in
|
||||
* FFTBuffer[0...FFTSize-1]. FFTBuffer is an array of complex numbers, FFTSize
|
||||
* MUST BE power of two.
|
||||
*/
|
||||
void complex_fft(ALcomplex *FFTBuffer, ALsizei FFTSize, ALdouble Sign);
|
||||
|
||||
/**
|
||||
* Calculate the complex helical sequence (discrete-time analytical signal) of
|
||||
* the given input using the discrete Hilbert transform (In-place algorithm).
|
||||
* Fills Buffer[0...size-1] with the discrete-time analytical signal stored in
|
||||
* Buffer[0...size-1]. Buffer is an array of complex numbers, size MUST BE
|
||||
* power of two.
|
||||
*/
|
||||
void complex_hilbert(ALcomplex *Buffer, ALsizei size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* ALCOMPLEX_H */
|
||||
|
|
@ -18,12 +18,6 @@
|
|||
#define FLT_EPSILON (1.19209290e-07f)
|
||||
#endif
|
||||
|
||||
#define SQRT_2 1.41421356237309504880
|
||||
#define SQRT_3 1.73205080756887719318
|
||||
|
||||
#define SQRTF_2 1.41421356237309504880f
|
||||
#define SQRTF_3 1.73205080756887719318f
|
||||
|
||||
#ifndef HUGE_VALF
|
||||
static const union msvc_inf_hack {
|
||||
unsigned char b[4];
|
||||
|
|
@ -46,20 +40,7 @@ static inline float cbrtf(float f)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_COPYSIGNF
|
||||
static inline float copysignf(float x, float y)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
unsigned int u;
|
||||
} ux = { x }, uy = { y };
|
||||
ux.u &= 0x7fffffffu;
|
||||
ux.u |= (uy.u&0x80000000u);
|
||||
return ux.f;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DEG2RAD(x) ((float)(x) * (float)(M_PI/180.0))
|
||||
#define RAD2DEG(x) ((float)(x) * (float)(180.0/M_PI))
|
||||
#define DEG2RAD(x) ((float)(x) * (F_PI/180.0f))
|
||||
#define RAD2DEG(x) ((float)(x) * (180.0f/F_PI))
|
||||
|
||||
#endif /* AL_MATH_DEFS_H */
|
||||
|
|
|
|||
|
|
@ -428,11 +428,7 @@ void althrd_thread_detach(void)
|
|||
{
|
||||
void *ptr = altss_get(TlsDestructors.keys[i]);
|
||||
altss_dtor_t callback = (altss_dtor_t)TlsDestructors.values[i];
|
||||
if(ptr)
|
||||
{
|
||||
if(callback) callback(ptr);
|
||||
altss_set(TlsDestructors.keys[i], NULL);
|
||||
}
|
||||
if(ptr && callback) callback(ptr);
|
||||
}
|
||||
UnlockUIntMapRead(&TlsDestructors);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue