From 1f9f01c5714930e96eb7713c74fe826fe85d1457 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 May 2015 21:34:35 -0400 Subject: [PATCH] SHERLOCK: Implement cmdNextSong --- engines/sherlock/talk.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 3e3fccee304d..22e77fb869d1 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -2051,7 +2051,24 @@ TattooTalk::TattooTalk(SherlockEngine *vm) : Talk(vm) { } OpcodeReturn TattooTalk::cmdMouseOnOff(const byte *&str) { error("TODO: script opcode"); } -OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) { error("TODO: script opcode"); } + +OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) { + Sound &sound = *_vm->_sound; + + // Get the name of the next song to play + ++str; + sound._nextSongName = ""; + for (int idx = 0; idx < 8; ++idx) { + if (str[idx] != '~') + sound._nextSongName += str[idx]; + else + break; + } + str += 7; + + return RET_SUCCESS; +} + OpcodeReturn TattooTalk::cmdNPCLabelGoto(const byte *&str) { error("TODO: script opcode"); } OpcodeReturn TattooTalk::cmdNPCLabelIfFlagGoto(const byte *&str) { error("TODO: script opcode"); } OpcodeReturn TattooTalk::cmdNPCLabelSet(const byte *&str) { error("TODO: script opcode"); }