mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 00:21:35 +00:00
Fix WM_DoGetOutput for big-endian machines
- Besides being little-endian centric, this bit shifting madness was unneccessary since the values were already clamped to a 16-bit range, so all we need to do is cast them to a short.
This commit is contained in:
parent
b1405921bf
commit
ee46799d9e
1 changed files with 3 additions and 4 deletions
|
@ -3744,10 +3744,9 @@ static int WM_DoGetOutput(midi * handle, char * buffer,
|
||||||
* Write to the buffer
|
* Write to the buffer
|
||||||
* ===================
|
* ===================
|
||||||
*/
|
*/
|
||||||
(*buffer++) = left_mix & 0xff;
|
((short *)buffer)[0] = (short)left_mix;
|
||||||
(*buffer++) = ((left_mix >> 8) & 0x7f) | ((left_mix >> 24) & 0x80);
|
((short *)buffer)[1] = (short)right_mix;
|
||||||
(*buffer++) = right_mix & 0xff;
|
buffer += 4;
|
||||||
(*buffer++) = ((right_mix >> 8) & 0x7f) | ((right_mix >> 24) & 0x80);
|
|
||||||
}
|
}
|
||||||
_WM_Unlock(&mdi->lock);
|
_WM_Unlock(&mdi->lock);
|
||||||
return buffer_used;
|
return buffer_used;
|
||||||
|
|
Loading…
Reference in a new issue