diff options
author | Eugene Sandulenko | 2016-09-14 23:39:27 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-01-25 22:41:54 +0100 |
commit | ea01120013f144ba9ad61a1973907b565acb7833 (patch) | |
tree | 6a790e869409d3390a1e8d63a516bfa242fd2f7f /engines/cryo/clsoundraw.cpp | |
parent | 0dfe25149634bff3f7bcb5cc5e883bfe2fe03d1e (diff) | |
download | scummvm-rg350-ea01120013f144ba9ad61a1973907b565acb7833.tar.gz scummvm-rg350-ea01120013f144ba9ad61a1973907b565acb7833.tar.bz2 scummvm-rg350-ea01120013f144ba9ad61a1973907b565acb7833.zip |
CRYO: Refactor to avoid nested includes
Diffstat (limited to 'engines/cryo/clsoundraw.cpp')
-rw-r--r-- | engines/cryo/clsoundraw.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/engines/cryo/clsoundraw.cpp b/engines/cryo/clsoundraw.cpp new file mode 100644 index 0000000000..7058780ea8 --- /dev/null +++ b/engines/cryo/clsoundraw.cpp @@ -0,0 +1,55 @@ +#include "cryo/cryolib.h" + +namespace Cryo { + +sound_t *CLSoundRaw_New(short arg1, float rate, short sampleSize, short mode) { + sound_t *sound; + CLBeginCheck; + + sound = (sound_t *)CLMemory_Alloc(sizeof(*sound)); + if (sound) { + sound->ff_1A = arg1; + sound->rate = rate; + sound->sampleSize = sampleSize; + sound->buffer = 0; +// sound->sndHandle = CLMemory_AllocHandle(arg1 + 100); +// if(!sound->sndHandle) +// { +// __libError = -1; +// __osError = MemError(); +// CLCheckError(); +// } +// else + { + CLSound_PrepareSample(sound, mode); + CLNoError; + } + } else { + __libError = -1; + __osError = MemError(); + CLCheckError(); + } + + CLEndCheck; + return sound; +} + +void CLSoundRaw_Free(sound_t *sound) { + while (sound->locked) ; +// CLMemory_FreeHandle(sound->sndHandle); + CLMemory_Free(sound); +} + +void CLSoundRaw_AssignBuffer(sound_t *sound, void *buffer, int bufferOffs, int length) { + char *buf; + CLSound_SetLength(sound, length); + sound->length = length; + buf = bufferOffs + (char *)buffer; +// if(CLSound_GetWantsDesigned()) +// CLSound_Signed2NonSigned(buf, length); + sound->buffer = buf; +// if(sound->reversed && sound->sampleSize == 16) +// ReverseBlock16(buf, length); +} + +} // End of namespace Cryo |