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:
parent
2db51b6604
commit
d8ab904c22
1 changed files with 3 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue