mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
- removed some redundant utility functions.
This commit is contained in:
parent
8bfc6d98d4
commit
7945242fa8
2 changed files with 2 additions and 20 deletions
|
@ -534,15 +534,6 @@ inline int ClipRange(int a, int b, int c)
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float ClipRangeF(float a, float b, float c)
|
|
||||||
{
|
|
||||||
if (a < b)
|
|
||||||
return b;
|
|
||||||
if (a > c)
|
|
||||||
return c;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int interpolate(int a, int b, int c)
|
inline int interpolate(int a, int b, int c)
|
||||||
{
|
{
|
||||||
return a+mulscale16(b-a,c);
|
return a+mulscale16(b-a,c);
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include "v_draw.h"
|
#include "v_draw.h"
|
||||||
#include "s_music.h"
|
#include "s_music.h"
|
||||||
#include "cmdlib.h"
|
#include "cmdlib.h"
|
||||||
|
#include "templates.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,16 +92,6 @@ static const int16_t delta_table[] = {
|
||||||
// macro to fetch 16-bit little-endian words from a bytestream
|
// macro to fetch 16-bit little-endian words from a bytestream
|
||||||
#define LE_16(x) ((*x) | ((*(x+1)) << 8))
|
#define LE_16(x) ((*x) | ((*(x+1)) << 8))
|
||||||
|
|
||||||
static int ClipRange(int val, int min, int max)
|
|
||||||
{
|
|
||||||
if (val < min)
|
|
||||||
return min;
|
|
||||||
else if (val > max)
|
|
||||||
return max;
|
|
||||||
else
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool StreamCallbackFunc(SoundStream* stream, void* buff, int len, void* userdata)
|
static bool StreamCallbackFunc(SoundStream* stream, void* buff, int len, void* userdata)
|
||||||
{
|
{
|
||||||
InterplayDecoder* pId = (InterplayDecoder*)userdata;
|
InterplayDecoder* pId = (InterplayDecoder*)userdata;
|
||||||
|
@ -380,7 +371,7 @@ bool InterplayDecoder::RunFrame(uint64_t clock)
|
||||||
for (; i < (nSamples / 2); i++)
|
for (; i < (nSamples / 2); i++)
|
||||||
{
|
{
|
||||||
predictor[ch] += delta_table[fr.ReadUInt8()];
|
predictor[ch] += delta_table[fr.ReadUInt8()];
|
||||||
predictor[ch] = ClipRange(predictor[ch], -32768, 32768);
|
predictor[ch] = clamp(predictor[ch], -32768, 32768);
|
||||||
|
|
||||||
audio.samples[audio.nWrite++] = predictor[ch];
|
audio.samples[audio.nWrite++] = predictor[ch];
|
||||||
if (audio.nWrite >= countof(audio.samples)) audio.nWrite = 0;
|
if (audio.nWrite >= countof(audio.samples)) audio.nWrite = 0;
|
||||||
|
|
Loading…
Reference in a new issue