SHERLOCK: Further game setup

This commit is contained in:
Paul Gilbert 2015-03-15 17:50:10 -04:00
parent eaab373a96
commit a6db2fb281
8 changed files with 13 additions and 20 deletions

View File

@ -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

View File

@ -93,6 +93,7 @@ class Rooms {
public:
bool _stats[ROOMS_COUNT][9];
bool _savedStats[ROOMS_COUNT][9];
int _goToRoom;
public:
Rooms();
};

View File

@ -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

View File

@ -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

View File

@ -69,8 +69,6 @@ void SherlockEngine::initialize() {
_rooms = new Rooms();
_screen = new Screen(this);
_talk = new Talk();
initFlags();
}
Common::Error SherlockEngine::run() {

View File

@ -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;

View File

@ -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

View File

@ -34,8 +34,6 @@ public:
TattooEngine(OSystem *syst, const SherlockGameDescription *gameDesc) :
SherlockEngine(syst, gameDesc) {}
virtual ~TattooEngine() {}
virtual void initFlags();
};
} // End of namespace Tattoo