MOHAWK: Reduce header interdependencies

svn-id: r46782
This commit is contained in:
Max Horn 2009-12-30 23:02:14 +00:00
parent b0e02675e7
commit f31c452a5f
17 changed files with 49 additions and 22 deletions

View file

@ -29,6 +29,8 @@
#include "mohawk/graphics.h" #include "mohawk/graphics.h"
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/livingbooks.h" #include "mohawk/livingbooks.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
namespace Mohawk { namespace Mohawk {

View file

@ -63,15 +63,15 @@ uint16 MohawkEngine::getVersion() const {
return _gameDescription->version; return _gameDescription->version;
} }
uint8 MohawkEngine::getGameType() { uint8 MohawkEngine::getGameType() const {
return _gameDescription->gameType; return _gameDescription->gameType;
} }
Common::String MohawkEngine_LivingBooks::getBookInfoFileName() { Common::String MohawkEngine_LivingBooks::getBookInfoFileName() const {
return _gameDescription->desc.filesDescriptions[0].fileName; return _gameDescription->desc.filesDescriptions[0].fileName;
} }
Common::Language MohawkEngine::getLanguage() { Common::Language MohawkEngine::getLanguage() const {
return _gameDescription->desc.language; return _gameDescription->desc.language;
} }

View file

@ -38,6 +38,8 @@
namespace Mohawk { namespace Mohawk {
class MohawkEngine; class MohawkEngine;
class MohawkEngine_Myst;
class MohawkEngine_Riven;
class InfoDialog : public GUI::Dialog { class InfoDialog : public GUI::Dialog {
protected: protected:

View file

@ -26,6 +26,8 @@
#include "mohawk/livingbooks.h" #include "mohawk/livingbooks.h"
#include "mohawk/file.h" #include "mohawk/file.h"
#include "common/events.h"
namespace Mohawk { namespace Mohawk {
MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) { MohawkEngine_LivingBooks::MohawkEngine_LivingBooks(OSystem *syst, const MohawkGameDescription *gamedesc) : MohawkEngine(syst, gamedesc) {
@ -321,4 +323,8 @@ Common::String MohawkEngine_LivingBooks::convertWinFileName(Common::String strin
return filename; return filename;
} }
MohawkFile *MohawkEngine_LivingBooks::createMohawkFile() const {
return (getGameType() == GType_NEWLIVINGBOOKS) ? new MohawkFile() : new OldMohawkFile();
}
} // End of namespace Mohawk } // End of namespace Mohawk

View file

@ -59,7 +59,7 @@ private:
Common::ConfigFile _bookInfoFile; Common::ConfigFile _bookInfoFile;
uint16 _curPage; uint16 _curPage;
Common::String getBookInfoFileName(); Common::String getBookInfoFileName() const;
void loadBookInfo(Common::String filename); void loadBookInfo(Common::String filename);
void loadIntro(); void loadIntro();
@ -85,8 +85,8 @@ private:
Common::String getFileNameFromConfig(Common::String section, Common::String key); Common::String getFileNameFromConfig(Common::String section, Common::String key);
// Platform/Version functions // Platform/Version functions
bool isBigEndian() { return getGameType() == GType_NEWLIVINGBOOKS || getPlatform() == Common::kPlatformMacintosh; } bool isBigEndian() const { return getGameType() == GType_NEWLIVINGBOOKS || getPlatform() == Common::kPlatformMacintosh; }
MohawkFile *createMohawkFile() { return (getGameType() == GType_NEWLIVINGBOOKS) ? new MohawkFile() : new OldMohawkFile(); } MohawkFile *createMohawkFile() const;
}; };
} // End of namespace Mohawk } // End of namespace Mohawk

View file

@ -33,6 +33,11 @@
#include "base/version.h" #include "base/version.h"
#include "mohawk/mohawk.h" #include "mohawk/mohawk.h"
#include "mohawk/dialogs.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
#include "sound/mixer.h"
namespace Mohawk { namespace Mohawk {

View file

@ -27,20 +27,11 @@
#define MOHAWK_H #define MOHAWK_H
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/util.h"
#include "common/system.h"
#include "common/rect.h"
#include "common/array.h" #include "common/array.h"
#include "engines/engine.h" #include "engines/engine.h"
#include "gui/dialog.h" class OSystem;
#include "mohawk/console.h"
#include "mohawk/dialogs.h"
#include "mohawk/file.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
namespace Mohawk { namespace Mohawk {
@ -72,6 +63,8 @@ enum MohawkGameFeatures {
struct MohawkGameDescription; struct MohawkGameDescription;
class Sound; class Sound;
class PauseDialog; class PauseDialog;
class MohawkFile;
class VideoManager;
class MohawkEngine : public ::Engine { class MohawkEngine : public ::Engine {
protected: protected:
@ -87,8 +80,8 @@ public:
uint32 getFeatures() const; uint32 getFeatures() const;
uint16 getVersion() const; uint16 getVersion() const;
Common::Platform getPlatform() const; Common::Platform getPlatform() const;
uint8 getGameType(); uint8 getGameType() const;
Common::Language getLanguage(); Common::Language getLanguage() const;
bool hasFeature(EngineFeature f) const; bool hasFeature(EngineFeature f) const;
@ -105,7 +98,7 @@ protected:
void pauseEngineIntern(bool); void pauseEngineIntern(bool);
// An array holding the main Mohawk archives require by the games // An array holding the main Mohawk archives require by the games
Common::Array<MohawkFile*> _mhk; Common::Array<MohawkFile *> _mhk;
}; };
} // End of namespace Mohawk } // End of namespace Mohawk

View file

@ -29,6 +29,9 @@
#include "mohawk/myst.h" #include "mohawk/myst.h"
#include "mohawk/myst_scripts.h" #include "mohawk/myst_scripts.h"
#include "mohawk/myst_saveload.h" #include "mohawk/myst_saveload.h"
#include "mohawk/dialogs.h"
#include "mohawk/file.h"
#include "mohawk/video/video.h"
namespace Mohawk { namespace Mohawk {

View file

@ -40,6 +40,7 @@ class MystGraphics;
class MystScriptParser; class MystScriptParser;
class MystConsole; class MystConsole;
class MystSaveLoad; class MystSaveLoad;
class MystOptionsDialog;
// Engine Debug Flags // Engine Debug Flags
enum { enum {

View file

@ -26,6 +26,8 @@
#include "mohawk/myst.h" #include "mohawk/myst.h"
#include "mohawk/graphics.h" #include "mohawk/graphics.h"
#include "mohawk/myst_scripts.h" #include "mohawk/myst_scripts.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
#include "gui/message.h" #include "gui/message.h"

View file

@ -31,6 +31,8 @@
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/riven_external.h" #include "mohawk/riven_external.h"
#include "mohawk/riven_saveload.h" #include "mohawk/riven_saveload.h"
#include "mohawk/dialogs.h"
#include "mohawk/video/video.h"
namespace Mohawk { namespace Mohawk {
@ -61,6 +63,11 @@ MohawkEngine_Riven::~MohawkEngine_Riven() {
_cardData.scripts.clear(); _cardData.scripts.clear();
} }
GUI::Debugger *MohawkEngine_Riven::getDebugger() {
return _console;
}
Common::Error MohawkEngine_Riven::run() { Common::Error MohawkEngine_Riven::run() {
MohawkEngine::run(); MohawkEngine::run();

View file

@ -39,6 +39,7 @@ class RivenGraphics;
class RivenExternal; class RivenExternal;
class RivenConsole; class RivenConsole;
class RivenSaveLoad; class RivenSaveLoad;
class RivenOptionsDialog;
#define RIVEN_STACKS 8 #define RIVEN_STACKS 8
@ -110,7 +111,7 @@ public:
Card _cardData; Card _cardData;
bool _gameOver; bool _gameOver;
GUI::Debugger *getDebugger() { return _console; } GUI::Debugger *getDebugger();
bool canLoadGameStateCurrently() { return true; } bool canLoadGameStateCurrently() { return true; }
bool canSaveGameStateCurrently() { return true; } bool canSaveGameStateCurrently() { return true; }

View file

@ -26,6 +26,8 @@
#include "mohawk/graphics.h" #include "mohawk/graphics.h"
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/riven_external.h" #include "mohawk/riven_external.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
#include "common/EventRecorder.h" #include "common/EventRecorder.h"
#include "gui/message.h" #include "gui/message.h"

View file

@ -27,6 +27,8 @@
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/riven_external.h" #include "mohawk/riven_external.h"
#include "mohawk/riven_scripts.h" #include "mohawk/riven_scripts.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
#include "common/stream.h" #include "common/stream.h"
#include "graphics/cursorman.h" #include "graphics/cursorman.h"

View file

@ -35,7 +35,6 @@
#define MOHAWK_QT_PLAYER_H #define MOHAWK_QT_PLAYER_H
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/file.h"
#include "mohawk/video/video.h" #include "mohawk/video/video.h"

View file

@ -33,6 +33,8 @@
#include "mohawk/video/rpza.h" #include "mohawk/video/rpza.h"
#include "mohawk/video/smc.h" #include "mohawk/video/smc.h"
#include "common/events.h"
namespace Mohawk { namespace Mohawk {
//////////////////////////////////////////// ////////////////////////////////////////////

View file

@ -28,7 +28,7 @@
#include "common/queue.h" #include "common/queue.h"
#include "sound/audiostream.h" #include "sound/audiostream.h"
#include "sound/mixer.h" #include "sound/mixer.h" // for Audio::SoundHandle
#include "graphics/pixelformat.h" #include "graphics/pixelformat.h"
#include "graphics/video/codecs/codec.h" #include "graphics/video/codecs/codec.h"