diff options
Diffstat (limited to 'engines/mohawk/myst_scripts.cpp')
-rw-r--r-- | engines/mohawk/myst_scripts.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 04e7c5a9b7..596180ddb2 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -31,7 +31,6 @@ #include "common/system.h" #include "common/memstream.h" #include "common/textconsole.h" -#include "gui/message.h" namespace Mohawk { @@ -685,9 +684,14 @@ void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, uint16 arg // Used on Channelwood Card 3225 with argc = 8 i.e. Conditional Sound List debugC(kDebugScript, "Opcode %d: Process Sound Block", op); - Common::MemoryReadStream stream = Common::MemoryReadStream((const byte *) argv, argc * sizeof(uint16)); + Common::MemoryWriteStreamDynamic writeStream = Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES); + for (uint i = 0; i < argc; i++) { + writeStream.writeUint16LE(argv[i]); + } + + Common::MemoryReadStream readStream = Common::MemoryReadStream(writeStream.getData(), writeStream.size()); - MystSoundBlock soundBlock = _vm->readSoundBlock(&stream); + MystSoundBlock soundBlock = _vm->readSoundBlock(&readStream); _vm->applySoundBlock(soundBlock); } |