Skip to content

Commit

Permalink
SHERLOCK: Add some code for the interactive demo (still crashing)
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed May 10, 2015
1 parent 6d11048 commit 1f81f61
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
7 changes: 7 additions & 0 deletions engines/sherlock/detection.cpp
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions engines/sherlock/detection_tables.h
Expand Up @@ -84,6 +84,7 @@ static const SherlockGameDescription gameDescriptions[] = {

{
// Case of the Rose Tattoo - English CD
// Provided by dreammaster
{
"rosetattoo",
"CD",
Expand Down
3 changes: 2 additions & 1 deletion engines/sherlock/map.cpp
Expand Up @@ -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();
}

/**
Expand Down
10 changes: 9 additions & 1 deletion engines/sherlock/scalpel/scalpel.cpp
Expand Up @@ -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();
Expand All @@ -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())
Expand Down
10 changes: 6 additions & 4 deletions engines/sherlock/scene.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 1f81f61

Please sign in to comment.