diff options
author | Einar Johan Trøan Sømåen | 2012-12-09 16:41:18 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-12-09 16:41:18 +0100 |
commit | 6bde2926c1834bf90865d3a112dbe29de97ca35f (patch) | |
tree | a7acdc7d704eb954bff84b4dc0812cb3bd1721bb /engines/wintermute/base | |
parent | 115e60e7cb10b271ce727f563b1dc3ff37c193a8 (diff) | |
download | scummvm-rg350-6bde2926c1834bf90865d3a112dbe29de97ca35f.tar.gz scummvm-rg350-6bde2926c1834bf90865d3a112dbe29de97ca35f.tar.bz2 scummvm-rg350-6bde2926c1834bf90865d3a112dbe29de97ca35f.zip |
WINTERMUTE: Move "GetSoundLength" to BaseGameMusic
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r-- | engines/wintermute/base/base_game_music.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/wintermute/base/base_game_music.cpp b/engines/wintermute/base/base_game_music.cpp index 0fd0961ff1..365fa6e212 100644 --- a/engines/wintermute/base/base_game_music.cpp +++ b/engines/wintermute/base/base_game_music.cpp @@ -479,6 +479,25 @@ bool BaseGameMusic::scCallMethod(ScScript *script, ScStack *stack, ScStack *this stack->pushBool(true); return STATUS_OK; + } + + ////////////////////////////////////////////////////////////////////////// + // GetSoundLength + ////////////////////////////////////////////////////////////////////////// + else if (strcmp(name, "GetSoundLength") == 0) { + stack->correctParams(1); + + int length = 0; + const char *filename = stack->pop()->getString(); + + BaseSound *sound = new BaseSound(_gameRef); + if (sound && DID_SUCCEED(sound->setSound(filename, Audio::Mixer::kMusicSoundType, true))) { + length = sound->getLength(); + delete sound; + sound = NULL; + } + stack->pushInt(length); + return STATUS_OK; } else { return STATUS_FAILED; } |