From b101fd6f0324a3775a5383d1768700141757af25 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 28 Mar 2011 15:43:57 -0400 Subject: MOHAWK: Allow disabling of Riven compilation --- configure | 3 ++- engines/engines.mk | 4 ++++ engines/mohawk/console.cpp | 11 +++++++++-- engines/mohawk/console.h | 7 ++++++- engines/mohawk/detection.cpp | 14 +++++++++++++- engines/mohawk/graphics.cpp | 11 +++++++++-- engines/mohawk/graphics.h | 28 ++++++++++++++++------------ engines/mohawk/module.mk | 14 +++++++++----- 8 files changed, 68 insertions(+), 24 deletions(-) diff --git a/configure b/configure index bed4845f09..be1220cc8a 100755 --- a/configure +++ b/configure @@ -95,8 +95,9 @@ add_engine lastexpress "The Last Express" no add_engine lure "Lure of the Temptress" yes add_engine m4 "M4/MADS" no add_engine made "MADE" yes -add_engine mohawk "Mohawk" yes "myst cstime" +add_engine mohawk "Mohawk" yes "cstime myst riven" add_engine cstime "Where in Time is Carmen Sandiego?" no +add_engine riven "Riven: The Sequel to Myst" no add_engine myst "Myst" no add_engine parallaction "Parallaction" yes add_engine queen "Flight of the Amazon Queen" yes diff --git a/engines/engines.mk b/engines/engines.mk index 6e6c20dd41..414edcfc70 100644 --- a/engines/engines.mk +++ b/engines/engines.mk @@ -105,6 +105,10 @@ endif ifdef ENABLE_MYST DEFINES += -DENABLE_MYST endif + +ifdef ENABLE_RIVEN +DEFINES += -DENABLE_RIVEN +endif endif ifdef ENABLE_PARALLACTION diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 445901d800..6dce147513 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -25,8 +25,6 @@ #include "mohawk/console.h" #include "mohawk/graphics.h" -#include "mohawk/riven.h" -#include "mohawk/riven_external.h" #include "mohawk/livingbooks.h" #include "mohawk/sound.h" #include "mohawk/video.h" @@ -41,6 +39,11 @@ #include "mohawk/myst_scripts.h" #endif +#ifdef ENABLE_RIVEN +#include "mohawk/riven.h" +#include "mohawk/riven_external.h" +#endif + namespace Mohawk { #ifdef ENABLE_MYST @@ -317,6 +320,8 @@ bool MystConsole::Cmd_Resources(int argc, const char **argv) { #endif // ENABLE_MYST +#ifdef ENABLE_RIVEN + RivenConsole::RivenConsole(MohawkEngine_Riven *vm) : GUI::Debugger(), _vm(vm) { DCmd_Register("changeCard", WRAP_METHOD(RivenConsole, Cmd_ChangeCard)); DCmd_Register("curCard", WRAP_METHOD(RivenConsole, Cmd_CurCard)); @@ -653,6 +658,8 @@ bool RivenConsole::Cmd_SliderState(int argc, const char **argv) { return true; } +#endif // ENABLE_RIVEN + LivingBooksConsole::LivingBooksConsole(MohawkEngine_LivingBooks *vm) : GUI::Debugger(), _vm(vm) { DCmd_Register("playSound", WRAP_METHOD(LivingBooksConsole, Cmd_PlaySound)); DCmd_Register("stopSound", WRAP_METHOD(LivingBooksConsole, Cmd_StopSound)); diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h index 450802f508..cb0e8501cd 100644 --- a/engines/mohawk/console.h +++ b/engines/mohawk/console.h @@ -30,7 +30,6 @@ namespace Mohawk { -class MohawkEngine_Riven; class MohawkEngine_LivingBooks; #ifdef ENABLE_MYST @@ -63,6 +62,10 @@ private: #endif +#ifdef ENABLE_RIVEN + +class MohawkEngine_Riven; + class RivenConsole : public GUI::Debugger { public: RivenConsole(MohawkEngine_Riven *vm); @@ -89,6 +92,8 @@ private: bool Cmd_SliderState(int argc, const char **argv); }; +#endif + class LivingBooksConsole : public GUI::Debugger { public: LivingBooksConsole(MohawkEngine_LivingBooks *vm); diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index f44f275057..7980328093 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -30,7 +30,6 @@ #include "common/file.h" #include "common/savefile.h" -#include "mohawk/riven.h" #include "mohawk/livingbooks.h" #ifdef ENABLE_CSTIME @@ -41,6 +40,10 @@ #include "mohawk/myst.h" #endif +#ifdef ENABLE_RIVEN +#include "mohawk/riven.h" +#endif + namespace Mohawk { struct MohawkGameDescription { @@ -95,6 +98,8 @@ bool MohawkEngine_Myst::hasFeature(EngineFeature f) const { #endif +#ifdef ENABLE_RIVEN + bool MohawkEngine_Riven::hasFeature(EngineFeature f) const { return MohawkEngine::hasFeature(f) @@ -102,6 +107,8 @@ bool MohawkEngine_Riven::hasFeature(EngineFeature f) const { || (f == kSupportsSavingDuringRuntime); } +#endif + } // End of Namespace Mohawk static const PlainGameDescriptor mohawkGames[] = { @@ -247,8 +254,13 @@ bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa return false; #endif case Mohawk::GType_RIVEN: +#ifdef ENABLE_RIVEN *engine = new Mohawk::MohawkEngine_Riven(syst, gd); break; +#else + warning("Riven support not compiled in"); + return false; +#endif case Mohawk::GType_LIVINGBOOKSV1: case Mohawk::GType_LIVINGBOOKSV2: case Mohawk::GType_LIVINGBOOKSV3: diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 0df2c2605e..81d2b6f019 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -25,7 +25,6 @@ #include "mohawk/resource.h" #include "mohawk/graphics.h" -#include "mohawk/riven.h" #include "mohawk/livingbooks.h" #include "common/substream.h" @@ -42,6 +41,10 @@ #include "graphics/jpeg.h" #endif +#ifdef ENABLE_RIVEN +#include "mohawk/riven.h" +#endif + namespace Mohawk { MohawkSurface::MohawkSurface() : _surface(0), _palette(0) { @@ -626,7 +629,9 @@ void MystGraphics::drawLine(const Common::Point &p1, const Common::Point &p2, ui _backBuffer->drawLine(p1.x, p1.y, p2.x, p2.y, color); } -#endif +#endif // ENABLE_MYST + +#ifdef ENABLE_RIVEN RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm) { _bitmapDecoder = new MohawkBitmap(); @@ -1040,6 +1045,8 @@ void RivenGraphics::updateCredits() { } } +#endif // ENABLE_RIVEN + LBGraphics::LBGraphics(MohawkEngine_LivingBooks *vm, uint16 width, uint16 height) : GraphicsManager(), _vm(vm) { _bmpDecoder = _vm->isPreMohawk() ? new LivingBooksBitmap_v1() : new MohawkBitmap(); diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index 08fb4531e8..1331508421 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -39,7 +39,6 @@ namespace Graphics { namespace Mohawk { class MohawkEngine; -class MohawkEngine_Riven; class MohawkEngine_LivingBooks; class MohawkBitmap; @@ -162,19 +161,11 @@ private: Common::Rect _viewport; }; -#endif +#endif // ENABLE_MYST -struct SFXERecord { - // Record values - uint16 frameCount; - Common::Rect rect; - uint16 speed; - Common::Array frameScripts; +#ifdef ENABLE_RIVEN - // Cur frame - uint16 curFrame; - uint32 lastFrameTime; -}; +class MohawkEngine_Riven; class RivenGraphics : public GraphicsManager { public: @@ -218,6 +209,17 @@ private: MohawkBitmap *_bitmapDecoder; // Water Effects + struct SFXERecord { + // Record values + uint16 frameCount; + Common::Rect rect; + uint16 speed; + Common::Array frameScripts; + + // Cur frame + uint16 curFrame; + uint32 lastFrameTime; + }; Common::Array _waterEffects; // Transitions @@ -239,6 +241,8 @@ private: uint _creditsImage, _creditsPos; }; +#endif ENABLE_RIVEN + class LBGraphics : public GraphicsManager { public: LBGraphics(MohawkEngine_LivingBooks *vm, uint16 width, uint16 height); diff --git a/engines/mohawk/module.mk b/engines/mohawk/module.mk index de7b53e1b4..30f1d40fdb 100644 --- a/engines/mohawk/module.mk +++ b/engines/mohawk/module.mk @@ -12,11 +12,6 @@ MODULE_OBJS = \ livingbooks_code.o \ mohawk.o \ resource.o \ - riven.o \ - riven_external.o \ - riven_saveload.o \ - riven_scripts.o \ - riven_vars.o \ sound.o \ video.o \ view.o @@ -51,6 +46,15 @@ MODULE_OBJS += \ myst_stacks/stoneship.o endif +ifdef ENABLE_RIVEN +MODULE_OBJS += \ + riven.o \ + riven_external.o \ + riven_saveload.o \ + riven_scripts.o \ + riven_vars.o +endif + # This module can be built as a plugin ifeq ($(ENABLE_MOHAWK), DYNAMIC_PLUGIN) PLUGIN := 1 -- cgit v1.2.3