scummvm/backends/PalmOS/Src/snd_stream.cpp
Eugene Sandulenko 6b4484472b Remove trailing whitespaces.
svn-id: r18604
2005-07-30 21:11:48 +00:00

29 lines
635 B
C++

#include "common/stdafx.h"
#include "palm.h"
Err sndCallback(void* UserDataP, SndStreamRef stream, void* bufferP, UInt32 *bufferSizeP) {
SoundDataType *snd = (SoundDataType *)UserDataP;
UInt32 size = *bufferSizeP;
if (snd->set && snd->size) {
UInt32 *dst = (UInt32 *)bufferP;
UInt32 *src = (UInt32 *)snd->dataP;
size = (snd->size / 16);
while (size--) {
*dst++ = READ_LE_UINT32(src++);
*dst++ = READ_LE_UINT32(src++);
*dst++ = READ_LE_UINT32(src++);
*dst++ = READ_LE_UINT32(src++);
}
snd->set = false;
} else {
snd->size = size;
MemSet(bufferP, 128, 0);
*bufferSizeP = 128;
}
return errNone;
}