diff options
author | Filippos Karapetis | 2014-04-27 21:17:11 +0300 |
---|---|---|
committer | Filippos Karapetis | 2014-04-27 21:20:02 +0300 |
commit | 9c30f3e0734271a2a259c1dc75202cef88f370f3 (patch) | |
tree | d729815a75252d4f4c528cd96fa6dda82a8c0131 | |
parent | 16bbc100ddf15da2c321bf54cf1f66f580dcdc93 (diff) | |
download | scummvm-rg350-9c30f3e0734271a2a259c1dc75202cef88f370f3.tar.gz scummvm-rg350-9c30f3e0734271a2a259c1dc75202cef88f370f3.tar.bz2 scummvm-rg350-9c30f3e0734271a2a259c1dc75202cef88f370f3.zip |
MADS: Hook up the new skeleton scene logic for Phantom and Dragonsphere
Also, add a HACK to stub out the sprite refresh code for these games,
as sprites aren't loaded yet
-rw-r--r-- | engines/mads/scene.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 9217be6d5d..545ee03fd0 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -24,7 +24,9 @@ #include "mads/scene.h" #include "mads/compression.h" #include "mads/mads.h" +#include "mads/dragonsphere/dragonsphere_scenes.h" #include "mads/nebular/nebular_scenes.h" +#include "mads/phantom/phantom_scenes.h" namespace MADS { @@ -113,8 +115,14 @@ void Scene::loadSceneLogic() { case GType_RexNebular: _sceneLogic = Nebular::SceneFactory::createScene(_vm); break; + case GType_Dragonsphere: + _sceneLogic = Dragonsphere::SceneFactory::createScene(_vm); + break; + case GType_Phantom: + _sceneLogic = Phantom::SceneFactory::createScene(_vm); + break; default: - error("Unknown game"); + error("Scene logic: Unknown game"); } } @@ -185,6 +193,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) { void Scene::loadHotspots() { File f(Resources::formatName(RESPREFIX_RM, _currentSceneId, ".HH")); MadsPack madsPack(&f); + bool isV2 = (_vm->getGameID() != GType_RexNebular); Common::SeekableReadStream *stream = madsPack.getItemStream(0); int count = stream->readUint16LE(); @@ -193,7 +202,7 @@ void Scene::loadHotspots() { stream = madsPack.getItemStream(1); _hotspots.clear(); for (int i = 0; i < count; ++i) - _hotspots.push_back(Hotspot(*stream)); + _hotspots.push_back(Hotspot(*stream, isV2)); delete stream; f.close(); @@ -467,6 +476,19 @@ void Scene::drawElements(ScreenTransition transitionType, bool surfaceFlag) { // Copy background for the dirty areas to the screen _dirtyAreas.copy(&_backgroundSurface, &_vm->_screen, _posAdjust); + // TODO: Remove this HACK when sprites are implemented for V2 games + if (_vm->getGameID() != GType_RexNebular) { + if (transitionType) { + // Fading in the screen + _vm->_screen.transition(transitionType, surfaceFlag); + _vm->_sound->startQueuedCommands(); + } else { + // Copy dirty areas to the screen + _dirtyAreas.copyToScreen(_vm->_screen._offset); + } + return; + } + // Handle dirty areas for foreground objects _spriteSlots.setDirtyAreas(); _textDisplay.setDirtyAreas2(); |