From a6db2fb281fb5842be2d8fc0621922e70ad9668c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Mar 2015 17:50:10 -0400 Subject: SHERLOCK: Further game setup --- engines/sherlock/room.cpp | 2 ++ engines/sherlock/room.h | 1 + engines/sherlock/scalpel/scalpel.cpp | 8 ++++++-- engines/sherlock/scalpel/scalpel.h | 4 ++-- engines/sherlock/sherlock.cpp | 2 -- engines/sherlock/sherlock.h | 7 ++----- engines/sherlock/tattoo/tattoo.cpp | 7 ------- engines/sherlock/tattoo/tattoo.h | 2 -- 8 files changed, 13 insertions(+), 20 deletions(-) (limited to 'engines/sherlock') diff --git a/engines/sherlock/room.cpp b/engines/sherlock/room.cpp index 246a316562..9926899953 100644 --- a/engines/sherlock/room.cpp +++ b/engines/sherlock/room.cpp @@ -27,6 +27,8 @@ namespace Sherlock { Rooms::Rooms() { for (int roomNum = 0; roomNum < ROOMS_COUNT; ++roomNum) Common::fill(&_stats[roomNum][0], &_stats[roomNum][9], false); + + _goToRoom = -1; } } // End of namespace Sherlock diff --git a/engines/sherlock/room.h b/engines/sherlock/room.h index 46755c1a10..75800b623a 100644 --- a/engines/sherlock/room.h +++ b/engines/sherlock/room.h @@ -93,6 +93,7 @@ class Rooms { public: bool _stats[ROOMS_COUNT][9]; bool _savedStats[ROOMS_COUNT][9]; + int _goToRoom; public: Rooms(); }; diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index 11b78946f9..bd8c96f253 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -27,14 +27,18 @@ namespace Sherlock { namespace Scalpel { /** - * Initialises game flags + * Game initialization */ -void ScalpelEngine::initFlags() { +void ScalpelEngine::initialize() { _flags.resize(100 * 8); _flags[3] = true; // Turn on Alley _flags[39] = true; // Turn on Baker Street + + // Starting room + _rooms->_goToRoom = 4; } + } // End of namespace Scalpel } // End of namespace Scalpel diff --git a/engines/sherlock/scalpel/scalpel.h b/engines/sherlock/scalpel/scalpel.h index e9f9aa05a2..9001c20456 100644 --- a/engines/sherlock/scalpel/scalpel.h +++ b/engines/sherlock/scalpel/scalpel.h @@ -30,12 +30,12 @@ namespace Sherlock { namespace Scalpel { class ScalpelEngine : public SherlockEngine { +protected: + virtual void initialize(); public: ScalpelEngine(OSystem *syst, const SherlockGameDescription *gameDesc) : SherlockEngine(syst, gameDesc) {} virtual ~ScalpelEngine() {} - - virtual void initFlags(); }; } // End of namespace Scalpel diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp index 0d55e0ba8d..13731e2fd8 100644 --- a/engines/sherlock/sherlock.cpp +++ b/engines/sherlock/sherlock.cpp @@ -69,8 +69,6 @@ void SherlockEngine::initialize() { _rooms = new Rooms(); _screen = new Screen(this); _talk = new Talk(); - - initFlags(); } Common::Error SherlockEngine::run() { diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h index 4c5f86dd09..172c940c34 100644 --- a/engines/sherlock/sherlock.h +++ b/engines/sherlock/sherlock.h @@ -60,9 +60,8 @@ class Resource; class SherlockEngine : public Engine { private: - bool detectGame(); - - void initialize(); +protected: + virtual void initialize(); public: const SherlockGameDescription *_gameDescription; Journal *_journal; @@ -77,8 +76,6 @@ public: virtual Common::Error run(); - virtual void initFlags() = 0; - int getGameType() const; uint32 getGameID() const; uint32 getGameFeatures() const; diff --git a/engines/sherlock/tattoo/tattoo.cpp b/engines/sherlock/tattoo/tattoo.cpp index bed6edb3d4..57ca5c6e29 100644 --- a/engines/sherlock/tattoo/tattoo.cpp +++ b/engines/sherlock/tattoo/tattoo.cpp @@ -26,13 +26,6 @@ namespace Sherlock { namespace Tattoo { -/** - * Initialises game flags - */ -void TattooEngine::initFlags() { - _flags.resize(100 * 8); -} - } // End of namespace Tattoo } // End of namespace Scalpel diff --git a/engines/sherlock/tattoo/tattoo.h b/engines/sherlock/tattoo/tattoo.h index e2977983f1..f06fa1532d 100644 --- a/engines/sherlock/tattoo/tattoo.h +++ b/engines/sherlock/tattoo/tattoo.h @@ -34,8 +34,6 @@ public: TattooEngine(OSystem *syst, const SherlockGameDescription *gameDesc) : SherlockEngine(syst, gameDesc) {} virtual ~TattooEngine() {} - - virtual void initFlags(); }; } // End of namespace Tattoo -- cgit v1.2.3