From 1f81f61cf9c6dffe5918f293627f7b8fa34be1cd Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 10 May 2015 19:14:55 +0200 Subject: SHERLOCK: Add some code for the interactive demo (still crashing) --- engines/sherlock/detection.cpp | 7 +++++++ engines/sherlock/detection_tables.h | 1 + engines/sherlock/map.cpp | 3 ++- engines/sherlock/scalpel/scalpel.cpp | 10 +++++++++- engines/sherlock/scene.cpp | 10 ++++++---- 5 files changed, 25 insertions(+), 6 deletions(-) (limited to 'engines/sherlock') diff --git a/engines/sherlock/detection.cpp b/engines/sherlock/detection.cpp index c38580af41..78ab33bfd0 100644 --- a/engines/sherlock/detection.cpp +++ b/engines/sherlock/detection.cpp @@ -122,6 +122,13 @@ bool Sherlock::SherlockEngine::hasFeature(EngineFeature f) const { (f == kSupportsSavingDuringRuntime); } +/** + * Returns whether the version is a demo + */ +bool Sherlock::SherlockEngine::getIsDemo() const { + return _gameDescription->desc.flags & ADGF_DEMO; +} + /** * Return a list of savegames */ diff --git a/engines/sherlock/detection_tables.h b/engines/sherlock/detection_tables.h index 260869660e..975b7323ec 100644 --- a/engines/sherlock/detection_tables.h +++ b/engines/sherlock/detection_tables.h @@ -84,6 +84,7 @@ static const SherlockGameDescription gameDescriptions[] = { { // Case of the Rose Tattoo - English CD + // Provided by dreammaster { "rosetattoo", "CD", diff --git a/engines/sherlock/map.cpp b/engines/sherlock/map.cpp index ef262aabd3..e178dece0c 100644 --- a/engines/sherlock/map.cpp +++ b/engines/sherlock/map.cpp @@ -69,7 +69,8 @@ Map::Map(SherlockEngine *vm): _vm(vm), _topLine(SHERLOCK_SCREEN_WIDTH, 12) { for (int idx = 0; idx < MAX_HOLMES_SEQUENCE; ++idx) Common::fill(&_sequences[idx][0], &_sequences[idx][MAX_FRAME], 0); - loadData(); + if (!_vm->getIsDemo()) + loadData(); } /** diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index 0b7a9be278..8dc75c034f 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -215,9 +215,11 @@ void ScalpelEngine::initialize() { _flags[3] = true; // Turn on Alley _flags[39] = true; // Turn on Baker Street + if (!getIsDemo()) { // Load the map co-ordinates for each scene and sequence data _map->loadPoints(NUM_PLACES, &MAP_X[0], &MAP_Y[0], &MAP_TRANSLATE[0]); _map->loadSequences(3, &MAP_SEQUENCES[0][0]); + } // Load the inventory loadInventory(); @@ -226,13 +228,19 @@ void ScalpelEngine::initialize() { _talk->setSequences(&TALK_SEQUENCES[0][0], &STILL_SEQUENCES[0][0], MAX_PEOPLE); // Starting scene - _scene->_goToScene = 4; + if (getIsDemo()) + _scene->_goToScene = 3; + else + _scene->_goToScene = 4; } /** * Show the opening sequence */ void ScalpelEngine::showOpening() { + if (getIsDemo()) + return; + if (!showCityCutscene()) return; if (!showAlleyCutscene()) diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index 0893afe4c4..ca9f19582c 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -457,10 +457,12 @@ bool Scene::loadScene(const Common::String &filename) { _walkedInScene = false; saves._justLoaded = false; - // Reset the previous map location and position on overhead map - map._oldCharPoint = _currentScene; - map._overPos.x = map[_currentScene].x * 100 - 600; - map._overPos.y = map[_currentScene].y * 100 + 900; + if (!_vm->getIsDemo()) { + // Reset the previous map location and position on overhead map + map._oldCharPoint = _currentScene; + map._overPos.x = map[_currentScene].x * 100 - 600; + map._overPos.y = map[_currentScene].y * 100 + 900; + } events.clearEvents(); return flag; -- cgit v1.2.3