1
0
Fork 0
forked from fte/fteqw

Endian fix for ROQ sound output.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1192 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Mark Olsen 2005-08-03 18:07:58 +00:00
parent 2db51b6604
commit d8ab904c22

View file

@ -588,8 +588,7 @@ int i, snd_left, snd_right;
for(i = 0; i < chunk_size; i++)
{
snd_left += ri->snd_sqr_arr[(unsigned)fgetc(fp)];
ri->audio[i * 2] = snd_left & 0xff;
ri->audio[i * 2 + 1] = (snd_left & 0xff00) >> 8;
*(unsigned short *)&ri->audio[i * 2] = snd_left;
}
ri->aud_pos = ftell(fp);
return chunk_size;
@ -604,10 +603,8 @@ int i, snd_left, snd_right;
{
snd_left += ri->snd_sqr_arr[(unsigned)fgetc(fp)];
snd_right += ri->snd_sqr_arr[(unsigned)fgetc(fp)];
ri->audio[i * 2] = snd_left & 0xff;
ri->audio[i * 2 + 1] = (snd_left & 0xff00) >> 8;
ri->audio[i * 2 + 2] = snd_right & 0xff;
ri->audio[i * 2 + 3] = (snd_right & 0xff00) >> 8;
*(unsigned short *)&ri->audio[i * 2] = snd_left;
*(unsigned short *)&ri->audio[i * 2 + 2] = snd_right;
}
ri->aud_pos = ftell(fp);
return chunk_size/2;