Skip to content

Commit

Permalink
AGOS: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed May 17, 2011
1 parent d84ae94 commit 183e018
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 48 deletions.
32 changes: 16 additions & 16 deletions engines/agos/agos.cpp
Expand Up @@ -56,8 +56,8 @@ static const GameSpecificSettings puzzlepack_settings = {
};

#ifdef ENABLE_AGOS2
AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system)
: AGOSEngine_PuzzlePack(system) {
AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_PuzzlePack(system, gd) {

_iconToggleCount = 0;
_voiceCount = 0;
Expand All @@ -67,24 +67,24 @@ AGOSEngine_DIMP::AGOSEngine_DIMP(OSystem *system)
_tSecondCount = 0;
}

AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
: AGOSEngine_Feeble(system) {
AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Feeble(system, gd) {

_oopsValid = false;
_gameTime = 0;
}
#endif

AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system)
: AGOSEngine_Simon1(system) {
AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Simon1(system, gd) {
}

AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system)
: AGOSEngine_Waxworks(system) {
AGOSEngine_Simon1::AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Waxworks(system, gd) {
}

AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system)
: AGOSEngine_Elvira2(system) {
AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Elvira2(system, gd) {

_boxCR = false;
_boxLineCount = 0;
Expand All @@ -100,16 +100,16 @@ AGOSEngine_Waxworks::AGOSEngine_Waxworks(OSystem *system)
memset(_lineCounts, 0, sizeof(_lineCounts));
}

AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system)
: AGOSEngine_Elvira1(system) {
AGOSEngine_Elvira2::AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Elvira1(system, gd) {
}

AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system)
: AGOSEngine(system) {
AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine(system, gd) {
}

AGOSEngine::AGOSEngine(OSystem *syst)
: Engine(syst), _rnd("agos") {
AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
: Engine(system), _rnd("agos"), _gameDescription(gd) {

_vcPtr = 0;
_vcGetOutOfCode = 0;
Expand Down
27 changes: 14 additions & 13 deletions engines/agos/agos.h
Expand Up @@ -176,6 +176,7 @@ class Debugger;
#endif

class AGOSEngine : public Engine {
protected:
friend class Debugger;

// Engine APIs
Expand All @@ -193,7 +194,6 @@ class AGOSEngine : public Engine {
virtual void syncSoundSettings();
virtual void pauseEngineIntern(bool pause);

public:
virtual void setupOpcodes();
uint16 _numOpcodes, _opcode;

Expand All @@ -205,8 +205,9 @@ class AGOSEngine : public Engine {

virtual void setupVideoOpcodes(VgaOpcodeProc *op);

const AGOSGameDescription *_gameDescription;
const AGOSGameDescription * const _gameDescription;

public:
virtual void setupGame();

int getGameId() const;
Expand Down Expand Up @@ -584,7 +585,7 @@ class AGOSEngine : public Engine {
byte _hebrewCharWidths[32];

public:
AGOSEngine(OSystem *syst);
AGOSEngine(OSystem *system, const AGOSGameDescription *gd);
virtual ~AGOSEngine();

byte *_curSfxFile;
Expand Down Expand Up @@ -1281,7 +1282,7 @@ class AGOSEngine_PN : public AGOSEngine {
void setupBoxes();
int readfromline();
public:
AGOSEngine_PN(OSystem *system);
AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd);
~AGOSEngine_PN();

virtual void setupGame();
Expand Down Expand Up @@ -1523,7 +1524,7 @@ class AGOSEngine_PN : public AGOSEngine {

class AGOSEngine_Elvira1 : public AGOSEngine {
public:
AGOSEngine_Elvira1(OSystem *system);
AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_Elvira1();

virtual void setupGame();
Expand Down Expand Up @@ -1604,7 +1605,7 @@ class AGOSEngine_Elvira1 : public AGOSEngine {

class AGOSEngine_Elvira2 : public AGOSEngine_Elvira1 {
public:
AGOSEngine_Elvira2(OSystem *system);
AGOSEngine_Elvira2(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_Elvira2();

virtual void setupGame();
Expand Down Expand Up @@ -1699,7 +1700,7 @@ class AGOSEngine_Elvira2 : public AGOSEngine_Elvira1 {

class AGOSEngine_Waxworks : public AGOSEngine_Elvira2 {
public:
AGOSEngine_Waxworks(OSystem *system);
AGOSEngine_Waxworks(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_Waxworks();

virtual void setupGame();
Expand Down Expand Up @@ -1766,7 +1767,7 @@ class AGOSEngine_Waxworks : public AGOSEngine_Elvira2 {

class AGOSEngine_Simon1 : public AGOSEngine_Waxworks {
public:
AGOSEngine_Simon1(OSystem *system);
AGOSEngine_Simon1(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_Simon1();

virtual void setupGame();
Expand Down Expand Up @@ -1837,7 +1838,7 @@ class AGOSEngine_Simon1 : public AGOSEngine_Waxworks {

class AGOSEngine_Simon2 : public AGOSEngine_Simon1 {
public:
AGOSEngine_Simon2(OSystem *system);
AGOSEngine_Simon2(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_Simon2();

virtual void setupGame();
Expand Down Expand Up @@ -1884,7 +1885,7 @@ class AGOSEngine_Simon2 : public AGOSEngine_Simon1 {
#ifdef ENABLE_AGOS2
class AGOSEngine_Feeble : public AGOSEngine_Simon2 {
public:
AGOSEngine_Feeble(OSystem *system);
AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd);
~AGOSEngine_Feeble();

virtual void setupGame();
Expand Down Expand Up @@ -2023,7 +2024,7 @@ class AGOSEngine_Feeble : public AGOSEngine_Simon2 {

class AGOSEngine_FeebleDemo : public AGOSEngine_Feeble {
public:
AGOSEngine_FeebleDemo(OSystem *system);
AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd);

protected:
bool _filmMenuUsed;
Expand All @@ -2044,7 +2045,7 @@ class AGOSEngine_FeebleDemo : public AGOSEngine_Feeble {

class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble {
public:
AGOSEngine_PuzzlePack(OSystem *system);
AGOSEngine_PuzzlePack(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_PuzzlePack();

virtual void setupGame();
Expand Down Expand Up @@ -2103,7 +2104,7 @@ class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble {

class AGOSEngine_DIMP : public AGOSEngine_PuzzlePack {
public:
AGOSEngine_DIMP(OSystem *system);
AGOSEngine_DIMP(OSystem *system, const AGOSGameDescription *gd);
//~AGOSEngine_DIMP();

virtual void setupOpcodes();
Expand Down
23 changes: 10 additions & 13 deletions engines/agos/detection.cpp
Expand Up @@ -148,44 +148,41 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame

switch (gd->gameType) {
case AGOS::GType_PN:
*engine = new AGOS::AGOSEngine_PN(syst);
*engine = new AGOS::AGOSEngine_PN(syst, gd);
break;
case AGOS::GType_ELVIRA1:
*engine = new AGOS::AGOSEngine_Elvira1(syst);
*engine = new AGOS::AGOSEngine_Elvira1(syst, gd);
break;
case AGOS::GType_ELVIRA2:
*engine = new AGOS::AGOSEngine_Elvira2(syst);
*engine = new AGOS::AGOSEngine_Elvira2(syst, gd);
break;
case AGOS::GType_WW:
*engine = new AGOS::AGOSEngine_Waxworks(syst);
*engine = new AGOS::AGOSEngine_Waxworks(syst, gd);
break;
case AGOS::GType_SIMON1:
*engine = new AGOS::AGOSEngine_Simon1(syst);
*engine = new AGOS::AGOSEngine_Simon1(syst, gd);
break;
case AGOS::GType_SIMON2:
*engine = new AGOS::AGOSEngine_Simon2(syst);
*engine = new AGOS::AGOSEngine_Simon2(syst, gd);
break;
#ifdef ENABLE_AGOS2
case AGOS::GType_FF:
if (gd->features & GF_DEMO)
*engine = new AGOS::AGOSEngine_FeebleDemo(syst);
*engine = new AGOS::AGOSEngine_FeebleDemo(syst, gd);
else
*engine = new AGOS::AGOSEngine_Feeble(syst);
*engine = new AGOS::AGOSEngine_Feeble(syst, gd);
break;
case AGOS::GType_PP:
if (gd->gameId == GID_DIMP)
*engine = new AGOS::AGOSEngine_DIMP(syst);
*engine = new AGOS::AGOSEngine_DIMP(syst, gd);
else
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
*engine = new AGOS::AGOSEngine_PuzzlePack(syst, gd);
break;
#endif
default:
res = false;
error("AGOS engine: unknown gameType");
}
if (res) {
((AGOS::AGOSEngine *)*engine)->_gameDescription = gd;
}

return res;
}
Expand Down
8 changes: 4 additions & 4 deletions engines/agos/feeble.cpp
Expand Up @@ -32,8 +32,8 @@

namespace AGOS {

AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system)
: AGOSEngine_Simon2(system) {
AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Simon2(system, gd) {

_interactiveVideo = 0;
_moviePlayer = 0;
Expand Down Expand Up @@ -108,8 +108,8 @@ void AGOSEngine_Feeble::stopInteractiveVideo() {
}
}

AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system)
: AGOSEngine_Feeble(system) {
AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine_Feeble(system, gd) {

_filmMenuUsed = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions engines/agos/pn.cpp
Expand Up @@ -27,8 +27,8 @@

namespace AGOS {

AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
: AGOSEngine(system) {
AGOSEngine_PN::AGOSEngine_PN(OSystem *system, const AGOSGameDescription *gd)
: AGOSEngine(system, gd) {

_stackbase = 0;
_tagOfActiveDoline = 0;
Expand Down

0 comments on commit 183e018

Please sign in to comment.