[Scummvm-git-logs] scummvm master -> 2fd785c12c85a9e7c946da33dad2c25c249f1933

alxpnv a04198622 at gmail.com
Mon Aug 30 12:49:20 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2fd785c12c ASYLUM: add support for Sanitarium Demo


Commit: 2fd785c12c85a9e7c946da33dad2c25c249f1933
    https://github.com/scummvm/scummvm/commit/2fd785c12c85a9e7c946da33dad2c25c249f1933
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-08-30T15:50:15+03:00

Commit Message:
ASYLUM: add support for Sanitarium Demo

Changed paths:
    engines/asylum/asylum.cpp
    engines/asylum/puzzles/vcr.cpp
    engines/asylum/resources/actor.cpp
    engines/asylum/resources/encounters.cpp
    engines/asylum/resources/encounters.h
    engines/asylum/resources/object.cpp
    engines/asylum/resources/script.cpp
    engines/asylum/resources/worldstats.cpp
    engines/asylum/respack.cpp
    engines/asylum/respack.h
    engines/asylum/system/sound.cpp
    engines/asylum/system/speech.cpp
    engines/asylum/views/scene.cpp
    engines/asylum/views/video.cpp


diff --git a/engines/asylum/asylum.cpp b/engines/asylum/asylum.cpp
index 9d3b0ccaae..ee628dcfa6 100644
--- a/engines/asylum/asylum.cpp
+++ b/engines/asylum/asylum.cpp
@@ -119,7 +119,7 @@ Common::Error AsylumEngine::run() {
 	setDebugger(_console);
 
 	// Create resource manager
-	_resource  = new ResourceManager();
+	_resource  = new ResourceManager(this);
 	_resource->setCdNumber(1);
 
 	// Create all game classes
@@ -137,10 +137,15 @@ Common::Error AsylumEngine::run() {
 
 	// Create main menu
 	_menu  = new Menu(this);
-	_handler = _menu;
-
-	// Load config
-	Config.read();
+	if (checkGameVersion("Demo")) {
+		_video->play(0, NULL);
+		restart();
+	} else {
+		_handler = _menu;
+
+		// Load config
+		Config.read();
+	}
 
 	// Setup mixer
 	syncSoundSettings();
@@ -174,7 +179,8 @@ void AsylumEngine::startGame(ResourcePackId sceneId, StartGameType type) {
 		error("[AsylumEngine::startGame] Subsystems not initialized properly!");
 
 	// Load the default mouse cursor
-	_cursor->set(MAKE_RESOURCE(kResourcePackSound, 14), 0, kCursorAnimationNone);
+	if (!checkGameVersion("Demo"))
+		_cursor->set(MAKE_RESOURCE(kResourcePackSound, 14), 0, kCursorAnimationNone);
 	_cursor->hide();
 
 	// Clear the graphic list
@@ -298,13 +304,13 @@ void AsylumEngine::playIntro() {
 	if (!_introPlayed) {
 		_cursor->hide();
 		_cursor->setForceHide(true);
-		if (!Config.showIntro) {
+		if (!Config.showIntro && !checkGameVersion("Demo")) {
 			if (_scene->worldstats()->chapter == kChapter1)
 				_sound->playMusic(MAKE_RESOURCE(kResourcePackMusic, _scene->worldstats()->musicCurrentResourceIndex));
 		} else {
 			_sound->playMusic(kResourceNone, 0);
 
-			_video->play(1, _menu);
+			_video->play(1, checkGameVersion("Demo") ? NULL : _menu);
 
 			if (_scene->worldstats()->musicCurrentResourceIndex != kMusicStopped)
 				_sound->playMusic(MAKE_RESOURCE(kResourcePackMusic, _scene->worldstats()->musicCurrentResourceIndex));
@@ -316,10 +322,10 @@ void AsylumEngine::playIntro() {
 
 			// Play the intro speech: it is played after the intro video over a black background,
 			// and the game is "locked" until the speech is completed.
-			ResourceId introSpeech = MAKE_RESOURCE(kResourcePackSound, 7);
+			ResourceId introSpeech = MAKE_RESOURCE(checkGameVersion("Demo") ? kResourcePackShared : kResourcePackSound, 7);
 			_sound->playSound(introSpeech);
 
-			int8 skip = 0;
+			bool skip = false;
 			do {
 				// Poll events (this ensures we don't freeze the screen)
 				Common::Event ev;
@@ -468,7 +474,7 @@ void AsylumEngine::processDelayedEvents() {
 // Message handlers
 //////////////////////////////////////////////////////////////////////////
 void AsylumEngine::switchEventHandler(EventHandler *handler) {
-	if (handler == NULL)
+	if (handler == NULL && !checkGameVersion("Demo"))
 		warning("[AsylumEngine::switchMessageHandler] NULL handler parameter (shouldn't happen outside of debug commands)!");
 
 	// De-init previous handler
diff --git a/engines/asylum/puzzles/vcr.cpp b/engines/asylum/puzzles/vcr.cpp
index 6b90b89a3b..840a8703dd 100644
--- a/engines/asylum/puzzles/vcr.cpp
+++ b/engines/asylum/puzzles/vcr.cpp
@@ -353,8 +353,9 @@ void PuzzleVCR::updateScreen(const AsylumEvent &) {
 		// setupPalette();
 		getScreen()->setupPalette(NULL, 0, 0);
 
-		getScreen()->setPalette(MAKE_RESOURCE(kResourcePackTowerCells, 28));
-		getScreen()->setGammaLevel(MAKE_RESOURCE(kResourcePackTowerCells, 28));
+		int paletteId = _vm->checkGameVersion("Demo") ? 20 : 28;
+		getScreen()->setPalette(MAKE_RESOURCE(kResourcePackTowerCells, paletteId));
+		getScreen()->setGammaLevel(MAKE_RESOURCE(kResourcePackTowerCells, paletteId));
 	} else {
 		getScreen()->drawGraphicsInQueue();
 	}
diff --git a/engines/asylum/resources/actor.cpp b/engines/asylum/resources/actor.cpp
index 2797ccbfcd..e21bc1badf 100644
--- a/engines/asylum/resources/actor.cpp
+++ b/engines/asylum/resources/actor.cpp
@@ -171,6 +171,9 @@ void Actor::load(Common::SeekableReadStream *stream) {
 	for (int32 i = 0; i < 20; i++)
 		_distancesNSEO[i] = stream->readSint32LE();
 
+	if (_vm->checkGameVersion("Demo"))
+		return;
+
 	_actionIdx2           = stream->readSint32LE();
 	_field_924            = stream->readSint32LE();
 	_lastScreenUpdate     = stream->readUint32LE();
diff --git a/engines/asylum/resources/encounters.cpp b/engines/asylum/resources/encounters.cpp
index 3064bccd30..b79b0b5add 100644
--- a/engines/asylum/resources/encounters.cpp
+++ b/engines/asylum/resources/encounters.cpp
@@ -101,6 +101,7 @@ Encounter::Encounter(AsylumEngine *engine) : _vm(engine),
 	_data_455BF0 = 0;
 	_data_455BF4 = 0;
 	_keywordStartIndex = 0;
+	_keywordsOffset = _vm->checkGameVersion("Demo") ? 204 : 3681;
 
 	load();
 }
@@ -213,6 +214,13 @@ void Encounter::initPortraits() {
 	if (_portrait2.resourceId == kResourceInvalid && getWorld()->chapter == kChapter1)
 		_portrait2.resourceId = getWorld()->graphicResourceIds[36];
 
+	if (_vm->checkGameVersion("Demo")) {
+		if (_index == 1)
+			_portrait2.resourceId = getWorld()->graphicResourceIds[35];
+		else
+			_portrait2.resourceId = getWorld()->graphicResourceIds[34];
+	}
+
 	if (_portrait2.resourceId == kResourceInvalid)
 		error("[Encounter::initPortraits] No portrait 2 for this encounter!");
 
@@ -585,7 +593,7 @@ int32 Encounter::getKeywordIndex() {
 			int32 x = _drawingStructs[0].point1.y + 145 * (counter % 3) + _point.x + _portrait1.rect.width() + 15;
 			int32 y = 16 * (counter / 3) + _point.y + 5;
 
-			if (mousePos.x >= x && mousePos.x <= (x + getText()->getWidth(MAKE_RESOURCE(kResourcePackText, 3681 + (_item->keywords[index] & KEYWORD_MASK))))
+			if (mousePos.x >= x && mousePos.x <= (x + getText()->getWidth(MAKE_RESOURCE(kResourcePackText, _keywordsOffset + (_item->keywords[index] & KEYWORD_MASK))))
 			 && mousePos.y >= y && mousePos.y <= (y + 16))
 				return index;
 
@@ -605,7 +613,7 @@ void Encounter::choose(int32 index) {
 		_value1 = (_item->keywords[index] & KEYWORD_MASK);
 		setVariable(1, _value1);
 
-		if (strcmp("Goodbye", getText()->get(MAKE_RESOURCE(kResourcePackText, 3681 + _value1))))
+		if (strcmp("Goodbye", getText()->get(MAKE_RESOURCE(kResourcePackText, _keywordsOffset + _value1))))
 			if (_index != 79)
 				BYTE1(_item->keywords[index]) |= kKeywordOptionsDisabled;
 
@@ -710,7 +718,7 @@ void Encounter::resetSpeech(int16 keywordIndex, int16 a2) {
 	_data_455BCC = false;
 	_data_455B3C = 1;
 
-	if (keywordIndex) {
+	if (keywordIndex || _vm->checkGameVersion("Demo")) {
 		getSpeech()->setTextResourceId(keywordIndex + a2);
 		setupSpeechText();
 	}
@@ -798,7 +806,7 @@ void Encounter::setupSpeech(ResourceId textResourceId, ResourceId fontResourceId
 	}
 
 	_data_455BE0 = true;
-	_soundResourceId = MAKE_RESOURCE(kResourcePackSharedSound, textResourceId - _speechResourceId);
+	_soundResourceId = MAKE_RESOURCE(kResourcePackSharedSound, textResourceId - _speechResourceId + _vm->checkGameVersion("Demo"));
 	//_soundResourceId = MAKE_RESOURCE(kResourcePackSpeech, textResourceId - _speechResourceId); // todo replace with speech (this is being override by the actor speechs)
 	//getSpeech()->setSoundResourceId(MAKE_RESOURCE(kResourcePackSpeech, textResourceId - _speechResourceId)); 
 }
@@ -1113,10 +1121,10 @@ void Encounter::drawDialogOptions() {
 			                     _point.y + (int16)(16 * (counter / 3)));
 
 			if (getKeywordIndex() == keywordIndex)
-				getScreen()->fillRect(coords.x - 1, coords.y + 5, getText()->getWidth(MAKE_RESOURCE(kResourcePackText, 3681 + (keyword & KEYWORD_MASK))) + 2, 18, 0);
+				getScreen()->fillRect(coords.x - 1, coords.y + 5, getText()->getWidth(MAKE_RESOURCE(kResourcePackText, _keywordsOffset + (keyword & KEYWORD_MASK))) + 2, 18, 0);
 
 			getText()->setPosition(coords);
-			getText()->draw(MAKE_RESOURCE(kResourcePackText, 3681 + (keyword & KEYWORD_MASK)));
+			getText()->draw(MAKE_RESOURCE(kResourcePackText, _keywordsOffset + (keyword & KEYWORD_MASK)));
 
 			++counter;
 			_data_455B14 = i;
diff --git a/engines/asylum/resources/encounters.h b/engines/asylum/resources/encounters.h
index b4742025d4..d146c050b6 100644
--- a/engines/asylum/resources/encounters.h
+++ b/engines/asylum/resources/encounters.h
@@ -193,6 +193,7 @@ private:
 	int16 _data_455BF0;
 	uint32 _data_455BF4;
 	uint32 _keywordStartIndex;
+	uint32 _keywordsOffset;
 
 	EventHandler *_previousEventHandler;
 
diff --git a/engines/asylum/resources/object.cpp b/engines/asylum/resources/object.cpp
index 85b964af14..b97f96a02d 100644
--- a/engines/asylum/resources/object.cpp
+++ b/engines/asylum/resources/object.cpp
@@ -115,6 +115,10 @@ void Object::load(Common::SeekableReadStream *stream) {
 		_randomResourceIds[i] = (ResourceId)stream->readSint32LE();
 
 	_soundResourceId = (ResourceId)stream->readSint32LE();
+
+	if (_vm->checkGameVersion("Demo"))
+		return;
+
 	_field_6A4       = (ActorDirection)stream->readSint32LE();
 }
 
diff --git a/engines/asylum/resources/script.cpp b/engines/asylum/resources/script.cpp
index 62e54e1805..2e83e0468c 100644
--- a/engines/asylum/resources/script.cpp
+++ b/engines/asylum/resources/script.cpp
@@ -251,9 +251,13 @@ void ScriptManager::load(Common::SeekableReadStream *stream) {
 #endif
 		}
 
-		script.field_1BAC = stream->readSint32LE();
-		script.field_1BB0 = stream->readSint32LE();
-		script.counter    = stream->readSint32LE();
+		if (_vm->checkGameVersion("Demo")) {
+			stream->seek(2 * 4, SEEK_CUR);
+		} else {
+			script.field_1BAC = stream->readSint32LE();
+			script.field_1BB0 = stream->readSint32LE();
+			script.counter    = stream->readSint32LE();
+		}
 
 		_scripts.push_back(script);
 	}
@@ -618,6 +622,11 @@ END_OPCODE
 IMPLEMENT_OPCODE(SetActorPosition)
 	Actor *actor = getScene()->getActor(cmd->param1);
 
+	if (_vm->checkGameVersion("Demo") && cmd->param2 == 150 && cmd->param3 == 337) {
+		actor->setPosition(151, 332, (ActorDirection)cmd->param4, (uint32)cmd->param5);
+		return;
+	}
+
 	actor->setPosition((int16)cmd->param2, (int16)cmd->param3, (ActorDirection)cmd->param4, (uint32)cmd->param5);
 END_OPCODE
 
@@ -1025,6 +1034,12 @@ END_OPCODE
 //////////////////////////////////////////////////////////////////////////
 // Opcode 0x2D
 IMPLEMENT_OPCODE(PlayMovie)
+	if (_vm->checkGameVersion("Demo") && cmd->param1 == 4) {
+		Engine::quitGame();
+		_done = true;
+		return;
+	}
+
 	if (getSharedData()->getMatteBarHeight() < 170) {
 		_processNextEntry = true;
 
@@ -2048,6 +2063,9 @@ void ScriptManager::enableObject(ScriptEntry *cmd, ObjectTransparency type) {
 void ScriptManager::setActionFlag(ScriptEntry *cmd, ActionType flag) {
 	switch (cmd->param2) {
 	default:
+		if (!getWorld()->getObjectById((ObjectId)cmd->param1))
+			return;
+
 		getWorld()->getObjectById((ObjectId)cmd->param1)->actionType |= flag;
 		break;
 
@@ -2064,6 +2082,9 @@ void ScriptManager::setActionFlag(ScriptEntry *cmd, ActionType flag) {
 void ScriptManager::clearActionFlag(ScriptEntry *cmd, ActionType flag) {
 	switch (cmd->param2) {
 	default:
+		if (!getWorld()->getObjectById((ObjectId)cmd->param1))
+			return;
+
 		getWorld()->getObjectById((ObjectId)cmd->param1)->actionType &= ~flag;
 		break;
 
diff --git a/engines/asylum/resources/worldstats.cpp b/engines/asylum/resources/worldstats.cpp
index fc97ab5dd7..1a19d10dcd 100644
--- a/engines/asylum/resources/worldstats.cpp
+++ b/engines/asylum/resources/worldstats.cpp
@@ -143,7 +143,7 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 	uint32 numActions   = stream->readUint32LE();
 	uint32 numObjects   = stream->readUint32LE();
 
-	for (int32 c = 0; c < 7; c++)
+	for (int32 c = 0; c < 7 + _vm->checkGameVersion("Demo"); c++)
 		coordinates[c] = (int16)stream->readSint32LE();
 
 	uint32 numActors = stream->readUint32LE();
@@ -174,6 +174,12 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 	for (int32 s = 0; s < ARRAYSIZE(soundResourceIds); s++)
 		soundResourceIds[s] = (ResourceId)stream->readSint32LE();
 
+	if (_vm->checkGameVersion("Demo")) {
+		stream->readSint32LE();
+		stream->readSint32LE();
+		goto load_objects;
+	}
+
 	for (int32 s = 0; s < ARRAYSIZE(ambientSounds); s++) {
 		ambientSounds[s].field_0  = stream->readSint32LE();
 		ambientSounds[s].flags    = stream->readSint32LE();
@@ -196,6 +202,7 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 	musicResourceIndex        = stream->readSint32LE();
 	musicStatusExt            = stream->readSint32LE();
 
+load_objects:
 	//////////////////////////////////////////////////////////////////////////
 	// Read Objects
 	for (uint32 a = 0; a < numObjects; a++) {
@@ -205,7 +212,10 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 		objects.push_back(object);
 	}
 
-	stream->seek((OBJECTS_MAX_COUNT - numObjects) * OBJECTS_SIZE, SEEK_CUR);
+	if (_vm->checkGameVersion("Demo"))
+		stream->seek(0x1C93A, SEEK_SET);
+	else
+		stream->seek((OBJECTS_MAX_COUNT - numObjects) * OBJECTS_SIZE, SEEK_CUR);
 
 	//////////////////////////////////////////////////////////////////////////
 	// Read Actors
@@ -216,6 +226,11 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 		actors.push_back(actor);
 	}
 
+	if (_vm->checkGameVersion("Demo")) {
+		stream->seek(0x1D2AA, SEEK_SET);
+		goto load_inventory;
+	}
+
 	stream->seek((ACTORS_MAX_COUNT - numActors) * ACTORS_SIZE, SEEK_CUR);
 
 	//////////////////////////////////////////////////////////////////////////
@@ -230,6 +245,7 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 	numScripts  = stream->readUint32LE();
 	numPolygons = stream->readUint32LE();
 
+load_inventory:
 	// Load inventory resources
 	for (uint32 i = 0; i < ARRAYSIZE(inventoryIconsActive); i++)
 		inventoryIconsActive[i] = (ResourceId)stream->readSint32LE();
@@ -240,6 +256,9 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 	for (uint32 i = 0; i < ARRAYSIZE(inventoryCursorsBlinking); i++)
 		inventoryCursorsBlinking[i] = (ResourceId)stream->readSint32LE();
 
+	if (_vm->checkGameVersion("Demo"))
+		stream->seek(0x1A60A, SEEK_SET);
+
 	//////////////////////////////////////////////////////////////////////////
 	// Read actions
 	for (uint32 a = 0; a < numActions; a++) {
@@ -249,6 +268,9 @@ void WorldStats::load(Common::SeekableReadStream *stream) {
 		actions.push_back(action);
 	}
 
+	if (_vm->checkGameVersion("Demo"))
+		return;
+
 	stream->seek((ACTIONS_MAX_COUNT - numActions) * ACTIONS_SIZE, SEEK_CUR);
 
 	field_E848C = stream->readSint32LE();
diff --git a/engines/asylum/respack.cpp b/engines/asylum/respack.cpp
index 023ca9ad62..22c3bb1c1e 100644
--- a/engines/asylum/respack.cpp
+++ b/engines/asylum/respack.cpp
@@ -48,7 +48,7 @@ const struct {
 // ResourceManager
 //////////////////////////////////////////////////////////////////////////
 
-ResourceManager::ResourceManager() : _cdNumber(-1), _musicPackId(kResourcePackInvalid) {
+ResourceManager::ResourceManager(AsylumEngine *vm) : _cdNumber(-1), _musicPackId(kResourcePackInvalid), _vm(vm) {
 }
 
 ResourceManager::~ResourceManager() {
@@ -76,9 +76,18 @@ ResourceEntry *ResourceManager::get(ResourceId id) {
 		ResourcePack *pack;
 
 		if (isMusicPack) {
-			pack = new ResourcePack(Common::String::format("mus.%03d", _musicPackId));
+			if (_vm->checkGameVersion("Demo"))
+				pack = new ResourcePack("res.002");
+			else
+				pack = new ResourcePack(Common::String::format("mus.%03d", _musicPackId));
 		} else {
 			if (packId == kResourcePackSharedSound) {
+				if (_vm->checkGameVersion("Demo")) {
+					pack = new ResourcePack("res.004");
+					cache->setVal(packId, pack);
+					return cache->getVal(packId)->get(index);
+				}
+
 				if (_cdNumber == -1)
 					error("[ResourceManager::get] Cd number has not been set!");
 
diff --git a/engines/asylum/respack.h b/engines/asylum/respack.h
index cc9036b852..832c7b4e25 100644
--- a/engines/asylum/respack.h
+++ b/engines/asylum/respack.h
@@ -27,6 +27,7 @@
 #include "common/file.h"
 #include "common/hashmap.h"
 
+#include "asylum/asylum.h"
 #include "asylum/shared.h"
 
 namespace Asylum {
@@ -71,7 +72,7 @@ private:
 
 class ResourceManager {
 public:
-	ResourceManager();
+	ResourceManager(AsylumEngine *vm);
 	~ResourceManager();
 
 	/**
@@ -114,6 +115,7 @@ private:
 
 	int            _cdNumber;
 	ResourcePackId _musicPackId;
+	AsylumEngine  *_vm;
 };
 
 } // end of namespace Asylum
diff --git a/engines/asylum/system/sound.cpp b/engines/asylum/system/sound.cpp
index 9cc3c53206..f60c53c76d 100644
--- a/engines/asylum/system/sound.cpp
+++ b/engines/asylum/system/sound.cpp
@@ -59,6 +59,9 @@ void Sound::playSound(ResourceId resourceId, bool looping, int32 volume, int32 p
 	if (volume <= -10000)
 		return;
 
+	if (_vm->checkGameVersion("Demo") && RESOURCE_PACK(resourceId) == kResourcePackSound)
+		resourceId = MAKE_RESOURCE(kResourcePackShared, RESOURCE_INDEX(resourceId));
+
 	SoundQueueItem *item = getItem(resourceId);
 	if (item) {
 		// Duplicate the queue entry
diff --git a/engines/asylum/system/speech.cpp b/engines/asylum/system/speech.cpp
index 7bc0f55b66..a4bd898875 100644
--- a/engines/asylum/system/speech.cpp
+++ b/engines/asylum/system/speech.cpp
@@ -186,9 +186,14 @@ ResourceId Speech::playPlayer(int32 index) {
 			textResourceIndex -= 9;
 		}
 
-		ResourceId soundResourceId = MAKE_RESOURCE(kResourcePackSpeech, soundResourceIndex);
-
-		return play(soundResourceId, MAKE_RESOURCE(kResourcePackText, textResourceIndex + 83));
+		ResourceId soundResourceId;
+		if (_vm->checkGameVersion("Demo")) {
+			soundResourceId = MAKE_RESOURCE(kResourcePackSharedSound, soundResourceIndex + 21);
+			return play(soundResourceId, MAKE_RESOURCE(kResourcePackText, textResourceIndex + 20));
+		} else {
+			soundResourceId = MAKE_RESOURCE(kResourcePackSpeech, soundResourceIndex);
+			return play(soundResourceId, MAKE_RESOURCE(kResourcePackText, textResourceIndex + 83));
+		}
 		}
 
 	case kActorSarah:
diff --git a/engines/asylum/views/scene.cpp b/engines/asylum/views/scene.cpp
index 821152570d..3a76a24ed1 100644
--- a/engines/asylum/views/scene.cpp
+++ b/engines/asylum/views/scene.cpp
@@ -271,8 +271,14 @@ void Scene::load(ResourcePackId packId) {
 	_ws = new WorldStats(_vm);
 	_ws->load(fd);
 
+	if (_vm->checkGameVersion("Demo"))
+		fd->seek(0x1D72E, SEEK_SET);
+
 	_polygons = new Polygons(fd);
 
+	if (_vm->checkGameVersion("Demo"))
+		fd->seek(3 * 4, SEEK_CUR);
+
 	ScriptManager *script = getScript();
 	script->resetAll();
 	script->load(fd);
@@ -416,11 +422,13 @@ bool Scene::action(AsylumAction a) {
 		break;
 
 	case kAsylumActionQuickLoad:
-		getSaveLoad()->quickLoad();
+		if (!_vm->checkGameVersion("Demo"))
+			getSaveLoad()->quickLoad();
 		break;
 
 	case kAsylumActionQuickSave:
-		getSaveLoad()->quickSave();
+		if (!_vm->checkGameVersion("Demo"))
+			getSaveLoad()->quickSave();
 		break;
 
 	case kAsylumActionSwitchToSarah:
@@ -464,7 +472,8 @@ bool Scene::key(const AsylumEvent &evt) {
 			if (getCursor()->isHidden())
 				break;
 
-			_vm->switchEventHandler(_vm->menu());
+			if (!_vm->checkGameVersion("Demo"))
+				_vm->switchEventHandler(_vm->menu());
 		}
 		break;
 
@@ -2357,7 +2366,7 @@ void Scene::changePlayerUpdate(ActorIndex index) {
 // Scene drawing
 //////////////////////////////////////////////////////////////////////////
 void Scene::preload() {
-	if (!Config.showSceneLoading)
+	if (!Config.showSceneLoading || _vm->checkGameVersion("Demo"))
 		return;
 
 	SceneTitle *title = new SceneTitle(_vm);
diff --git a/engines/asylum/views/video.cpp b/engines/asylum/views/video.cpp
index d41962d82f..b75d680e99 100644
--- a/engines/asylum/views/video.cpp
+++ b/engines/asylum/views/video.cpp
@@ -73,14 +73,16 @@ bool VideoPlayer::handleEvent(const AsylumEvent &evt) {
 		break;
 
 	case EVENT_ASYLUM_INIT:
-		_previousFont = getText()->loadFont(MAKE_RESOURCE(kResourcePackShared, 57));
+		if (!_vm->checkGameVersion("Demo"))
+			_previousFont = getText()->loadFont(MAKE_RESOURCE(kResourcePackShared, 57));
 		_subtitleCounter = 0;
 		_subtitleIndex = -1;
 		break;
 
 	case EVENT_ASYLUM_DEINIT:
 		getScreen()->clear();
-		getText()->loadFont(_previousFont);
+		if (!_vm->checkGameVersion("Demo"))
+			getText()->loadFont(_previousFont);
 		break;
 
 	case EVENT_ASYLUM_SUBTITLE: {




More information about the Scummvm-git-logs mailing list