diff options
author | Bastien Bouclet | 2017-07-30 17:30:50 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-07-30 17:42:01 +0200 |
commit | 07aaed5659e352db1ddece44e715a854159d58ec (patch) | |
tree | 03dfa6ebbfe81c60b79d7bbc55fa9295f8b2f4a9 /engines/mohawk/console.cpp | |
parent | 4fee9a492ea9db7fd3c7830e2e07b7d79808bbdc (diff) | |
download | scummvm-rg350-07aaed5659e352db1ddece44e715a854159d58ec.tar.gz scummvm-rg350-07aaed5659e352db1ddece44e715a854159d58ec.tar.bz2 scummvm-rg350-07aaed5659e352db1ddece44e715a854159d58ec.zip |
MOHAWK: Myst: Set the mixer sound type to SFX for videos
Also simplify video filename construction.
Diffstat (limited to 'engines/mohawk/console.cpp')
-rw-r--r-- | engines/mohawk/console.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 877c1acd37..f24df96b55 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -248,37 +248,27 @@ bool MystConsole::Cmd_StopSound(int argc, const char **argv) { } bool MystConsole::Cmd_PlayMovie(int argc, const char **argv) { - if (argc < 2) { - debugPrintf("Usage: playMovie <name> [<stack>] [<left> <top>]\n"); + if (argc < 3) { + debugPrintf("Usage: playMovie <name> <stack> [<left> <top>]\n"); debugPrintf("NOTE: The movie will play *once* in the background.\n"); return true; } - Common::String fileName; - if (argc == 3 || argc > 4) { - int8 stackNum = 0; - for (byte i = 1; i <= ARRAYSIZE(mystStackNames); i++) - if (!scumm_stricmp(argv[2], mystStackNames[i - 1])) { - stackNum = i; - break; - } - - if (!stackNum) { - debugPrintf("\'%s\' is not a stack name!\n", argv[2]); - return true; + Common::String fileName = argv[1]; + int8 stackNum = -1; + for (byte i = 0; i < ARRAYSIZE(mystStackNames); i++) + if (!scumm_stricmp(argv[2], mystStackNames[i])) { + stackNum = i; + break; } - fileName = _vm->wrapMovieFilename(argv[1], stackNum - 1); - } else { - fileName = argv[1]; - } - - VideoEntryPtr video = _vm->_video->playMovie(fileName); - if (!video) { - debugPrintf("Failed to open movie '%s'\n", fileName.c_str()); + if (stackNum < 0) { + debugPrintf("\'%s\' is not a stack name!\n", argv[2]); return true; } + VideoEntryPtr video = _vm->playMovie(fileName, static_cast<MystStack>(stackNum)); + if (argc == 4) { video->setX(atoi(argv[2])); video->setY(atoi(argv[3])); |