mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-14 06:43:27 +00:00
fix stupid bug and linear interpolation sounds OK but not amazing, as expected
This commit is contained in:
parent
ed345c7d25
commit
b8b5a7ed1c
1 changed files with 2 additions and 3 deletions
|
@ -47,7 +47,6 @@ ResampleSfx
|
|||
static void ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte *data)
|
||||
{
|
||||
int incount, outcount;
|
||||
int srcsample;
|
||||
float stepscale, samplefrac;
|
||||
int i;
|
||||
int sample;
|
||||
|
@ -90,8 +89,8 @@ static void ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte *data)
|
|||
int srcsample1 = CLAMP(0, floor(samplefrac), incount - 1);
|
||||
int srcsample2 = CLAMP(0, ceil(samplefrac), incount - 1);
|
||||
|
||||
float srcsample1weight = samplefrac - floor(samplefrac);
|
||||
float srcsample2weight = 1 - srcsample1weight;
|
||||
float srcsample2weight = samplefrac - floor(samplefrac);
|
||||
float srcsample1weight = 1 - srcsample2weight;
|
||||
|
||||
sample = (srcsample1weight * getsample(data, inwidth, srcsample1))
|
||||
+ (srcsample2weight * getsample(data, inwidth, srcsample2));
|
||||
|
|
Loading…
Reference in a new issue