mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Revert "Updated SDL, Bullet and OpenAL soft libs"
This reverts commit 370161cfb1.
This commit is contained in:
parent
63be684474
commit
bc77ff0833
1102 changed files with 62741 additions and 204988 deletions
|
|
@ -156,13 +156,13 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth,
|
|||
blend[3] = ( emu) * ( amu[1]) * dirfact;
|
||||
|
||||
/* Calculate the blended HRIR delays. */
|
||||
delays[0] = fastf2i(
|
||||
delays[0] = float2int(
|
||||
Hrtf->delays[idx[0]][0]*blend[0] + Hrtf->delays[idx[1]][0]*blend[1] +
|
||||
Hrtf->delays[idx[2]][0]*blend[2] + Hrtf->delays[idx[3]][0]*blend[3]
|
||||
Hrtf->delays[idx[2]][0]*blend[2] + Hrtf->delays[idx[3]][0]*blend[3] + 0.5f
|
||||
);
|
||||
delays[1] = fastf2i(
|
||||
delays[1] = float2int(
|
||||
Hrtf->delays[idx[0]][1]*blend[0] + Hrtf->delays[idx[1]][1]*blend[1] +
|
||||
Hrtf->delays[idx[2]][1]*blend[2] + Hrtf->delays[idx[3]][1]*blend[3]
|
||||
Hrtf->delays[idx[2]][1]*blend[2] + Hrtf->delays[idx[3]][1]*blend[3] + 0.5f
|
||||
);
|
||||
|
||||
/* Calculate the sample offsets for the HRIR indices. */
|
||||
|
|
@ -202,15 +202,12 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
|
|||
#define NUM_BANDS 2
|
||||
BandSplitter splitter;
|
||||
ALdouble (*tmpres)[HRIR_LENGTH][2];
|
||||
ALsizei *restrict idx;
|
||||
ALsizei idx[HRTF_AMBI_MAX_CHANNELS];
|
||||
ALsizei min_delay = HRTF_HISTORY_LENGTH;
|
||||
ALsizei max_delay = 0;
|
||||
ALfloat temps[3][HRIR_LENGTH];
|
||||
ALsizei max_length;
|
||||
ALsizei max_length = 0;
|
||||
ALsizei i, c, b;
|
||||
|
||||
idx = al_calloc(DEF_ALIGN, AmbiCount*sizeof(*idx));
|
||||
|
||||
for(c = 0;c < AmbiCount;c++)
|
||||
{
|
||||
ALuint evidx, azidx;
|
||||
|
|
@ -231,7 +228,6 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
|
|||
idx[c] = evoffset + azidx;
|
||||
|
||||
min_delay = mini(min_delay, mini(Hrtf->delays[idx[c]][0], Hrtf->delays[idx[c]][1]));
|
||||
max_delay = maxi(max_delay, maxi(Hrtf->delays[idx[c]][0], Hrtf->delays[idx[c]][1]));
|
||||
}
|
||||
|
||||
tmpres = al_calloc(16, NumChannels * sizeof(*tmpres));
|
||||
|
|
@ -246,6 +242,10 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
|
|||
|
||||
if(NUM_BANDS == 1)
|
||||
{
|
||||
max_length = maxi(max_length,
|
||||
mini(maxi(ldelay, rdelay) + Hrtf->irSize, HRIR_LENGTH)
|
||||
);
|
||||
|
||||
for(i = 0;i < NumChannels;++i)
|
||||
{
|
||||
ALdouble mult = (ALdouble)AmbiOrderHFGain[(ALsizei)sqrt(i)] * AmbiMatrix[c][i];
|
||||
|
|
@ -261,6 +261,15 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Increase the IR size by 2/3rds to account for the tail generated
|
||||
* by the band-split filter.
|
||||
*/
|
||||
const ALsizei irsize = mini(Hrtf->irSize*5/3, HRIR_LENGTH);
|
||||
|
||||
max_length = maxi(max_length,
|
||||
mini(maxi(ldelay, rdelay) + irsize, HRIR_LENGTH)
|
||||
);
|
||||
|
||||
/* Band-split left HRIR into low and high frequency responses. */
|
||||
bandsplit_clear(&splitter);
|
||||
for(i = 0;i < Hrtf->irSize;i++)
|
||||
|
|
@ -302,6 +311,9 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
|
|||
}
|
||||
}
|
||||
}
|
||||
/* Round up to the next IR size multiple. */
|
||||
max_length += MOD_IR_SIZE-1;
|
||||
max_length -= max_length%MOD_IR_SIZE;
|
||||
|
||||
for(i = 0;i < NumChannels;++i)
|
||||
{
|
||||
|
|
@ -312,27 +324,11 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N
|
|||
state->Chan[i].Coeffs[idx][1] = (ALfloat)tmpres[i][idx][1];
|
||||
}
|
||||
}
|
||||
|
||||
al_free(tmpres);
|
||||
tmpres = NULL;
|
||||
al_free(idx);
|
||||
idx = NULL;
|
||||
|
||||
if(NUM_BANDS == 1)
|
||||
max_length = mini(max_delay-min_delay + Hrtf->irSize, HRIR_LENGTH);
|
||||
else
|
||||
{
|
||||
/* Increase the IR size by 2/3rds to account for the tail generated by
|
||||
* the band-split filter.
|
||||
*/
|
||||
const ALsizei irsize = mini(Hrtf->irSize*5/3, HRIR_LENGTH);
|
||||
max_length = mini(max_delay-min_delay + irsize, HRIR_LENGTH);
|
||||
}
|
||||
/* Round up to the next IR size multiple. */
|
||||
max_length += MOD_IR_SIZE-1;
|
||||
max_length -= max_length%MOD_IR_SIZE;
|
||||
|
||||
TRACE("Skipped delay: %d, max delay: %d, new FIR length: %d\n",
|
||||
min_delay, max_delay-min_delay, max_length);
|
||||
TRACE("Skipped delay: %d, new FIR length: %d\n", min_delay, max_length);
|
||||
state->IrSize = max_length;
|
||||
#undef NUM_BANDS
|
||||
}
|
||||
|
|
@ -1034,12 +1030,12 @@ static void AddFileEntry(vector_EnumeratedHrtf *list, const_al_string filename)
|
|||
/* Check if this entry has already been added to the list. */
|
||||
#define MATCH_ENTRY(i) (loaded_entry == (i)->hrtf)
|
||||
VECTOR_FIND_IF(iter, const EnumeratedHrtf, *list, MATCH_ENTRY);
|
||||
#undef MATCH_ENTRY
|
||||
if(iter != VECTOR_END(*list))
|
||||
{
|
||||
TRACE("Skipping duplicate file entry %s\n", alstr_get_cstr(filename));
|
||||
return;
|
||||
}
|
||||
#undef MATCH_FNAME
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -1113,12 +1109,12 @@ static void AddBuiltInEntry(vector_EnumeratedHrtf *list, const_al_string filenam
|
|||
{
|
||||
#define MATCH_ENTRY(i) (loaded_entry == (i)->hrtf)
|
||||
VECTOR_FIND_IF(iter, const EnumeratedHrtf, *list, MATCH_ENTRY);
|
||||
#undef MATCH_ENTRY
|
||||
if(iter != VECTOR_END(*list))
|
||||
{
|
||||
TRACE("Skipping duplicate file entry %s\n", alstr_get_cstr(filename));
|
||||
return;
|
||||
}
|
||||
#undef MATCH_FNAME
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue