diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp index 0c4e66a507b..d22b0aa7d17 100644 --- a/engines/asylum/asylum.cpp +++ b/engines/asylum/asylum.cpp @@ -26,6 +26,7 @@ #include "asylum/asylum.h" #include "asylum/screen.h" +#include "asylum/resources/video.h" namespace Asylum { @@ -42,6 +43,7 @@ AsylumEngine::~AsylumEngine() { //Common::clearAllDebugChannels(); delete _screen; delete _resMgr; + delete _video; } Common::Error AsylumEngine::run() { @@ -58,6 +60,7 @@ Common::Error AsylumEngine::init() { _screen = new Screen(_system); _resMgr = new ResourceManager; + _video = new Video(this); // initializing game // TODO: save dialogue key codes into sntrm_k.txt (need to figure out why they use such thing) @@ -66,13 +69,14 @@ Common::Error AsylumEngine::init() { // TODO: setup cinematics (address 0041A880) (probably we won't need it) // TODO: init unknown game stuffs (address 0040F430) - // TODO: load smaker intro movie (0)->(mov000.smk) // TODO: if savegame exists on folder, than start NewGame() return Common::kNoError; } Common::Error AsylumEngine::go() { + // Play intro movie + _video->playVideo("mov000.smk"); showMainMenu(); diff --git a/engines/asylum/asylum.h b/engines/asylum/asylum.h index fb18e1e14e6..2b95a925d79 100644 --- a/engines/asylum/asylum.h +++ b/engines/asylum/asylum.h @@ -30,6 +30,7 @@ namespace Asylum { class Screen; class Menu; +class Video; class AsylumEngine: public Engine { public: @@ -49,6 +50,7 @@ private: ResourceManager *_resMgr; Screen *_screen; + Video *_video; void showMainMenu(); diff --git a/engines/asylum/asylum.vcproj b/engines/asylum/asylum.vcproj index 459abfad4f1..3dac3d9f50f 100644 --- a/engines/asylum/asylum.vcproj +++ b/engines/asylum/asylum.vcproj @@ -208,6 +208,14 @@ RelativePath="..\..\engines\asylum\resources\resource.h" > + + + + _mixer); + _player = new Graphics::VideoPlayer(_smkDecoder); +} + +Video::~Video() { + delete _player; + delete _smkDecoder; +} + +bool Video::playVideo(const char *filename) { + bool result = _smkDecoder->loadFile(filename); + + // TODO: hide mouse + if (result) + _player->playVideo(_stopEvents); + _smkDecoder->closeFile(); + // TODO: show mouse + + return result; +} + +} // end of namespace Asylum diff --git a/engines/asylum/resources/video.h b/engines/asylum/resources/video.h new file mode 100644 index 00000000000..6c098936733 --- /dev/null +++ b/engines/asylum/resources/video.h @@ -0,0 +1,53 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef ASYLUM_VIDEO_H_ +#define ASYLUM_VIDEO_H_ + +#include "sound/mixer.h" +#include "graphics/surface.h" +#include "graphics/video/smk_decoder.h" + +#include "common/events.h" +#include "common/system.h" +#include "common/list.h" + +#include "asylum/asylum.h" + +namespace Asylum { + +class Video { +public: + Video(AsylumEngine *vm); + virtual ~Video(); + + bool playVideo(const char *filename); + +private: + Common::List _stopEvents; + Graphics::SmackerDecoder *_smkDecoder; + Graphics::VideoPlayer *_player; + AsylumEngine *_vm; +}; // end of class Video + +} // end of namespace Asylum + +#endif