aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/console.cpp11
-rw-r--r--engines/mohawk/console.h7
-rw-r--r--engines/mohawk/detection.cpp14
-rw-r--r--engines/mohawk/graphics.cpp11
-rw-r--r--engines/mohawk/graphics.h28
-rw-r--r--engines/mohawk/module.mk14
6 files changed, 62 insertions, 23 deletions
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<Common::SeekableReadStream*> 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<Common::SeekableReadStream*> frameScripts;
+
+ // Cur frame
+ uint16 curFrame;
+ uint32 lastFrameTime;
+ };
Common::Array<SFXERecord> _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