Slightly ugly fix for an optimization bug.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2004-03-01 21:09:56 +00:00
parent 08de21404f
commit d2a2ac036e

View file

@ -433,6 +433,8 @@ SND_ResampleMono (sfxbuffer_t *sc, byte *data, int length, void *prev)
for (i = 0; i < outcount; i++) { for (i = 0; i < outcount; i++) {
*os++ = (*ib++ - 128) << 8; *os++ = (*ib++ - 128) << 8;
} }
} else {
goto general_Mono;
} }
} else if (inwidth == 2) { } else if (inwidth == 2) {
if (outwidth == 1) { if (outwidth == 1) {
@ -443,10 +445,12 @@ SND_ResampleMono (sfxbuffer_t *sc, byte *data, int length, void *prev)
for (i = 0; i < outcount; i++) { for (i = 0; i < outcount; i++) {
*os++ = LittleShort (*is++); *os++ = LittleShort (*is++);
} }
}
}
} else { } else {
// general case goto general_Mono;
}
}
} else { // general case
general_Mono:
if (snd_interp->int_val && stepscale < 1) { if (snd_interp->int_val && stepscale < 1) {
int j; int j;
int points = 1 / stepscale; int points = 1 / stepscale;
@ -579,6 +583,8 @@ SND_ResampleStereo (sfxbuffer_t *sc, byte *data, int length, void *prev)
os->left = (ib->left - 128) << 8; os->left = (ib->left - 128) << 8;
os->right = (ib->right - 128) << 8; os->right = (ib->right - 128) << 8;
} }
} else {
goto general_Stereo;
} }
} else if (inwidth == 2) { } else if (inwidth == 2) {
if (outwidth == 1) { if (outwidth == 1) {
@ -591,10 +597,12 @@ SND_ResampleStereo (sfxbuffer_t *sc, byte *data, int length, void *prev)
os->left = LittleShort (is->left); os->left = LittleShort (is->left);
os->right = LittleShort (is->right); os->right = LittleShort (is->right);
} }
}
}
} else { } else {
// general case goto general_Stereo;
}
}
} else { // general case
general_Stereo:
if (snd_interp->int_val && stepscale < 1) { if (snd_interp->int_val && stepscale < 1) {
int j; int j;
int points = 1 / stepscale; int points = 1 / stepscale;