AGI: Make Winnie inherit from PreAgiEngine
This commit is contained in:
parent
697230709b
commit
fcd0cda9a9
7 changed files with 284 additions and 279 deletions
|
@ -317,7 +317,7 @@ bool Mickey_Console::Cmd_DrawObj(int argc, const char **argv) {
|
|||
return true;
|
||||
}
|
||||
|
||||
Winnie_Console::Winnie_Console(PreAgiEngine *vm, Winnie *winnie) : PreAGI_Console(vm) {
|
||||
Winnie_Console::Winnie_Console(WinnieEngine *winnie) : PreAGI_Console(winnie) {
|
||||
_winnie = winnie;
|
||||
|
||||
DCmd_Register("curRoom", WRAP_METHOD(Winnie_Console, Cmd_CurRoom));
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Agi {
|
|||
|
||||
class AgiEngine;
|
||||
class PreAgiEngine;
|
||||
class Winnie;
|
||||
class WinnieEngine;
|
||||
class Mickey;
|
||||
|
||||
struct AgiDebug {
|
||||
|
@ -93,11 +93,11 @@ private:
|
|||
|
||||
class Winnie_Console : public PreAGI_Console {
|
||||
public:
|
||||
Winnie_Console(PreAgiEngine *vm, Winnie *winnie);
|
||||
Winnie_Console(WinnieEngine *winnie);
|
||||
virtual ~Winnie_Console() {}
|
||||
|
||||
private:
|
||||
Winnie *_winnie;
|
||||
WinnieEngine *_winnie;
|
||||
|
||||
bool Cmd_CurRoom(int argc, const char **argv);
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "agi/agi.h"
|
||||
#include "agi/preagi.h"
|
||||
#include "agi/preagi_winnie.h"
|
||||
#include "agi/wagparser.h"
|
||||
|
||||
|
||||
|
@ -191,7 +192,10 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD
|
|||
|
||||
switch (gd->gameType) {
|
||||
case Agi::GType_PreAGI:
|
||||
*engine = new Agi::PreAgiEngine(syst, gd);
|
||||
if (gd->gameID == GID_WINNIE)
|
||||
*engine = new Agi::WinnieEngine(syst, gd);
|
||||
else
|
||||
*engine = new Agi::PreAgiEngine(syst, gd);
|
||||
break;
|
||||
case Agi::GType_V1:
|
||||
case Agi::GType_V2:
|
||||
|
|
|
@ -142,7 +142,7 @@ Common::Error PreAgiEngine::go() {
|
|||
setflag(fSoundOn, true); // enable sound
|
||||
|
||||
//
|
||||
// FIXME (Fingolfin asks): Why are Mickey, Winnie and Troll standalone classes
|
||||
// FIXME (Fingolfin asks): Why are Mickey and Troll standalone classes
|
||||
// instead of being subclasses of PreAgiEngine ?
|
||||
//
|
||||
|
||||
|
@ -156,14 +156,6 @@ Common::Error PreAgiEngine::go() {
|
|||
delete mickey;
|
||||
}
|
||||
break;
|
||||
case GID_WINNIE:
|
||||
{
|
||||
Winnie *winnie = new Winnie(this);
|
||||
winnie->init();
|
||||
winnie->run();
|
||||
delete winnie;
|
||||
}
|
||||
break;
|
||||
case GID_TROLL:
|
||||
{
|
||||
Troll *troll = new Troll(this);
|
||||
|
|
|
@ -34,7 +34,7 @@ class PreAgiEngine : public AgiBase {
|
|||
int _gameId;
|
||||
|
||||
protected:
|
||||
Common::Error go();
|
||||
virtual Common::Error go();
|
||||
void initialize();
|
||||
|
||||
public:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -281,19 +281,18 @@ struct WTP_SAVE_GAME {
|
|||
|
||||
class PreAgiEngine;
|
||||
|
||||
class Winnie {
|
||||
class WinnieEngine : public PreAgiEngine {
|
||||
public:
|
||||
Winnie(PreAgiEngine *vm);
|
||||
WinnieEngine(OSystem *syst, const AGIGameDescription *gameDesc);
|
||||
~WinnieEngine();
|
||||
|
||||
void init();
|
||||
void run();
|
||||
Common::Error go();
|
||||
|
||||
void debugCurRoom();
|
||||
|
||||
private:
|
||||
PreAgiEngine *_vm;
|
||||
|
||||
WTP_SAVE_GAME _game;
|
||||
WTP_SAVE_GAME _gameStateWinnie;
|
||||
int _room;
|
||||
int _mist;
|
||||
bool _doWind;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue