From ea39ef6d7dbc70198e7312770abe5ffd2000c530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Mon, 29 Dec 2003 15:30:10 +0000 Subject: [PATCH] The game sets its own DEMO variable, so we might as well check that one as checking the GF_DEMO flag. (There's still one "unnecessary" reference to GF_DEMO in functions.cpp, but I plan on rewriting that function soon so I don't want to touch it right now.) svn-id: r12009 --- sword2/anims.cpp | 2 +- sword2/maketext.cpp | 2 +- sword2/resman.cpp | 2 +- sword2/sound.cpp | 2 +- sword2/sword2.cpp | 10 +++++----- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sword2/anims.cpp b/sword2/anims.cpp index fe57177af88..012fd873871 100644 --- a/sword2/anims.cpp +++ b/sword2/anims.cpp @@ -714,7 +714,7 @@ int32 Logic::fnPlaySequence(int32 *params) { MoviePlayer player(_vm); - if (_sequenceTextLines && !(_vm->_features & GF_DEMO)) + if (_sequenceTextLines && !DEMO) rv = player.play(filename, sequenceSpeechArray, leadOut); else rv = player.play(filename, NULL, leadOut); diff --git a/sword2/maketext.cpp b/sword2/maketext.cpp index 5eaaabe1ef5..1b3e84b0cd1 100644 --- a/sword2/maketext.cpp +++ b/sword2/maketext.cpp @@ -576,7 +576,7 @@ void Sword2Engine::initialiseFontResourceFlags(void) { // Get the text line - skip the 2 chars containing the wavId - if (_features & GF_DEMO) + if (DEMO) textLine = fetchTextLine(textFile, 451) + 2; else textLine = fetchTextLine(textFile, 54) + 2; diff --git a/sword2/resman.cpp b/sword2/resman.cpp index 1826f88285a..9724bac46b7 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -431,7 +431,7 @@ uint8 *ResourceManager::openResource(uint32 res, bool dump) { // playing a demo, then we're in trouble if the file // can't be found! - if ((_vm->_features & GF_DEMO) || (_cdTab[parent_res_file] & LOCAL_PERM)) + if (DEMO || (_cdTab[parent_res_file] & LOCAL_PERM)) error("Could not find '%s'", _resourceFiles[parent_res_file]); getCd(_cdTab[parent_res_file] & 3); diff --git a/sword2/sound.cpp b/sword2/sound.cpp index d621b236edb..22061969d6b 100644 --- a/sword2/sound.cpp +++ b/sword2/sound.cpp @@ -361,7 +361,7 @@ int32 Logic::fnPlayMusic(int32 *params) { // add the appropriate file extension & play it - if (_vm->_features & GF_DEMO) { + if (DEMO) { // The demo I found didn't come with any music file, but you // could use the music from the first CD of the complete game, // I suppose... diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index 239ca551dd6..b9e1443911a 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -247,10 +247,10 @@ int32 Sword2Engine::initialiseGame(void) { initFxQueue(); // all demos (not just web) - if (_features & GF_DEMO) { - // set script variable + if (_features & GF_DEMO) DEMO = 1; - } + else + DEMO = 0; return 0; } @@ -366,7 +366,7 @@ void Sword2Engine::go() { pauseGame(); break; case 'c': - if (!(_features & GF_DEMO)) + if (!DEMO) _logic->fnPlayCredits(NULL); break; #ifdef _SWORD2_DEBUG @@ -420,7 +420,7 @@ void Sword2Engine::startGame(void) { debug(5, "startGame() STARTING:"); // all demos not just web - if (_features & GF_DEMO) + if (DEMO) screen_manager_id = 19; // DOCKS SECTION START else screen_manager_id = 949; // INTRO & PARIS START