diff options
author | Filippos Karapetis | 2015-01-07 11:29:28 +0200 |
---|---|---|
committer | Filippos Karapetis | 2015-01-07 11:42:26 +0200 |
commit | cdbc06d0f74453584eac0611fcbe01785c6619c4 (patch) | |
tree | 0dc775884fd5b8163010856be5a35e3bdbed98a2 /engines | |
parent | 2d0e9fc74afd7578b368794a40afbc06f05c92db (diff) | |
download | scummvm-rg350-cdbc06d0f74453584eac0611fcbe01785c6619c4.tar.gz scummvm-rg350-cdbc06d0f74453584eac0611fcbe01785c6619c4.tar.bz2 scummvm-rg350-cdbc06d0f74453584eac0611fcbe01785c6619c4.zip |
ZVISION: Use a common function for loading game animations
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/scripting/actions.cpp | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp index e41ac90c20..4474a8801a 100644 --- a/engines/zvision/scripting/actions.cpp +++ b/engines/zvision/scripting/actions.cpp @@ -21,12 +21,11 @@ */ #include "common/scummsys.h" +#include "video/video_decoder.h" #include "zvision/zvision.h" #include "zvision/scripting/script_manager.h" #include "zvision/graphics/render_manager.h" -#include "zvision/sound/zork_raw.h" -#include "zvision/video/zork_avi_decoder.h" #include "zvision/file/save_manager.h" #include "zvision/scripting/actions.h" #include "zvision/scripting/menu.h" @@ -45,10 +44,6 @@ #include "zvision/graphics/effects/wave.h" #include "zvision/graphics/cursors/cursor_manager.h" -#include "common/file.h" - -#include "audio/decoders/wave.h" - namespace ZVision { ////////////////////////////////////////////////////////////////////////////// @@ -915,35 +910,33 @@ ActionStreamVideo::ActionStreamVideo(ZVision *engine, int32 slotkey, const Commo } bool ActionStreamVideo::execute() { - ZorkAVIDecoder decoder; - Common::File *_file = _engine->getSearchManager()->openFile(_fileName); + Video::VideoDecoder *decoder; + Common::Rect destRect = Common::Rect(_x1, _y1, _x2 + 1, _y2 + 1); - if (_file) { - if (!decoder.loadStream(_file)) { - return true; - } + Common::String subname = _fileName; + subname.setChar('s', subname.size() - 3); + subname.setChar('u', subname.size() - 2); + subname.setChar('b', subname.size() - 1); - _engine->getCursorManager()->showMouse(false); + if (!_engine->getSearchManager()->hasFile(_fileName)) + return true; - Common::Rect destRect = Common::Rect(_x1, _y1, _x2 + 1, _y2 + 1); + decoder = _engine->loadAnimation(_fileName); - Common::String subname = _fileName; - subname.setChar('s', subname.size() - 3); - subname.setChar('u', subname.size() - 2); - subname.setChar('b', subname.size() - 1); + _engine->getCursorManager()->showMouse(false); - Subtitle *sub = NULL; + Subtitle *sub = NULL; - if (_engine->getSearchManager()->hasFile(subname)) - sub = new Subtitle(_engine, subname); + if (_engine->getSearchManager()->hasFile(subname)) + sub = new Subtitle(_engine, subname); - _engine->playVideo(decoder, destRect, _skippable, sub); + _engine->playVideo(*decoder, destRect, _skippable, sub); + delete decoder; - _engine->getCursorManager()->showMouse(true); + _engine->getCursorManager()->showMouse(true); - if (sub) - delete sub; - } + if (sub) + delete sub; return true; } |