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/riven.h"
#include "mohawk/livingbooks.h"
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
namespace Mohawk {

View File

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

View File

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

View File

@ -26,6 +26,8 @@
#include "mohawk/livingbooks.h"
#include "mohawk/file.h"
#include "common/events.h"
namespace Mohawk {
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;
}
MohawkFile *MohawkEngine_LivingBooks::createMohawkFile() const {
return (getGameType() == GType_NEWLIVINGBOOKS) ? new MohawkFile() : new OldMohawkFile();
}
} // End of namespace Mohawk

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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