mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Updated SDL, Bullet and OpenAL soft libs
Fixed case sensitivity problem Fixed clang compiler problem with having the class namespace used in an inline for the == operator Tweaked some theme stuff to be more consistent. Added initial test of no-pie for linux test sidestep of getTexCoord in shadergen hlsl feature so we don't assert when getting the terrain's shaderstuffs(which uses float3 instead of normal float2)
This commit is contained in:
parent
e87dc787ee
commit
f8750dd8ed
1102 changed files with 205083 additions and 62836 deletions
92
Engine/lib/openal-soft/common/alcomplex.c
Normal file
92
Engine/lib/openal-soft/common/alcomplex.c
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
|
||||
#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);
|
||||
}
|
||||
71
Engine/lib/openal-soft/common/alcomplex.h
Normal file
71
Engine/lib/openal-soft/common/alcomplex.h
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#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,6 +18,12 @@
|
|||
#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];
|
||||
|
|
@ -40,7 +46,20 @@ static inline float cbrtf(float f)
|
|||
}
|
||||
#endif
|
||||
|
||||
#define DEG2RAD(x) ((float)(x) * (F_PI/180.0f))
|
||||
#define RAD2DEG(x) ((float)(x) * (180.0f/F_PI))
|
||||
#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))
|
||||
|
||||
#endif /* AL_MATH_DEFS_H */
|
||||
|
|
|
|||
|
|
@ -428,7 +428,11 @@ void althrd_thread_detach(void)
|
|||
{
|
||||
void *ptr = altss_get(TlsDestructors.keys[i]);
|
||||
altss_dtor_t callback = (altss_dtor_t)TlsDestructors.values[i];
|
||||
if(ptr && callback) callback(ptr);
|
||||
if(ptr)
|
||||
{
|
||||
if(callback) callback(ptr);
|
||||
altss_set(TlsDestructors.keys[i], NULL);
|
||||
}
|
||||
}
|
||||
UnlockUIntMapRead(&TlsDestructors);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue