aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-03-28 15:20:30 -0400
committerMatthew Hoops2011-03-28 22:26:23 -0400
commite5811cd6c39333cf7a51eb4943bf4ead0aff681c (patch)
tree236d057aa30fdbbf870cf337b8679e276a1fd1d8
parent344369c294e4ade7b6f72de27daf794b0d23d3e3 (diff)
downloadscummvm-rg350-e5811cd6c39333cf7a51eb4943bf4ead0aff681c.tar.gz
scummvm-rg350-e5811cd6c39333cf7a51eb4943bf4ead0aff681c.tar.bz2
scummvm-rg350-e5811cd6c39333cf7a51eb4943bf4ead0aff681c.zip
MOHAWK: Allow disabling compilation of Myst
-rwxr-xr-xconfigure3
-rw-r--r--engines/engines.mk4
-rw-r--r--engines/mohawk/bitmap.cpp4
-rw-r--r--engines/mohawk/bitmap.h4
-rw-r--r--engines/mohawk/console.cpp13
-rw-r--r--engines/mohawk/console.h5
-rw-r--r--engines/mohawk/cursors.cpp13
-rw-r--r--engines/mohawk/cursors.h47
-rw-r--r--engines/mohawk/detection.cpp18
-rw-r--r--engines/mohawk/dialogs.cpp9
-rw-r--r--engines/mohawk/dialogs.h7
-rw-r--r--engines/mohawk/graphics.cpp11
-rw-r--r--engines/mohawk/graphics.h25
-rw-r--r--engines/mohawk/module.mk14
14 files changed, 125 insertions, 52 deletions
diff --git a/configure b/configure
index 969f37c532..3a3c5e68bb 100755
--- a/configure
+++ b/configure
@@ -95,7 +95,8 @@ 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
+add_engine mohawk "Mohawk" yes "myst"
+add_engine myst "Myst" no
add_engine parallaction "Parallaction" yes
add_engine queen "Flight of the Amazon Queen" yes
add_engine saga "SAGA" yes "ihnm saga2"
diff --git a/engines/engines.mk b/engines/engines.mk
index eea4ffc0b9..c5cbf3ad28 100644
--- a/engines/engines.mk
+++ b/engines/engines.mk
@@ -97,6 +97,10 @@ endif
ifdef ENABLE_MOHAWK
DEFINES += -DENABLE_MOHAWK=$(ENABLE_MOHAWK)
MODULES += engines/mohawk
+
+ifdef ENABLE_MYST
+DEFINES += -DENABLE_MYST
+endif
endif
ifdef ENABLE_PARALLACTION
diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp
index 1a6024aa45..c8111fa91b 100644
--- a/engines/mohawk/bitmap.cpp
+++ b/engines/mohawk/bitmap.cpp
@@ -622,6 +622,8 @@ void MohawkBitmap::drawRLE8(Graphics::Surface *surface, bool isLE) {
}
}
+#ifdef ENABLE_MYST
+
//////////////////////////////////////////
// Myst Bitmap Decoder
//////////////////////////////////////////
@@ -721,6 +723,8 @@ MohawkSurface *MystBitmap::decodeImage(Common::SeekableReadStream* stream) {
return new MohawkSurface(surface, palData);
}
+#endif
+
MohawkSurface *LivingBooksBitmap_v1::decodeImage(Common::SeekableReadStream *stream) {
Common::SeekableSubReadStreamEndian *endianStream = (Common::SeekableSubReadStreamEndian *)stream;
diff --git a/engines/mohawk/bitmap.h b/engines/mohawk/bitmap.h
index 55b884a8d6..ea8a130dfc 100644
--- a/engines/mohawk/bitmap.h
+++ b/engines/mohawk/bitmap.h
@@ -144,6 +144,8 @@ private:
void handleRivenSubcommandStream(byte count, byte *&dst);
};
+#ifdef ENABLE_MYST
+
// Myst uses a different image format than that of other Mohawk games.
// It essentially uses a Windows bitmap with the LZ encoding from the
// Mohawk Bitmap format.
@@ -181,6 +183,8 @@ private:
} _info;
};
+#endif
+
class LivingBooksBitmap_v1 : public MohawkBitmap {
public:
LivingBooksBitmap_v1() : MohawkBitmap() {}
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index 8aedbc74fc..e94ab7e092 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -24,9 +24,6 @@
*/
#include "mohawk/console.h"
-#include "mohawk/myst.h"
-#include "mohawk/myst_areas.h"
-#include "mohawk/myst_scripts.h"
#include "mohawk/graphics.h"
#include "mohawk/riven.h"
#include "mohawk/riven_external.h"
@@ -35,8 +32,16 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#ifdef ENABLE_MYST
+#include "mohawk/myst.h"
+#include "mohawk/myst_areas.h"
+#include "mohawk/myst_scripts.h"
+#endif
+
namespace Mohawk {
+#ifdef ENABLE_MYST
+
MystConsole::MystConsole(MohawkEngine_Myst *vm) : GUI::Debugger(), _vm(vm) {
DCmd_Register("changeCard", WRAP_METHOD(MystConsole, Cmd_ChangeCard));
DCmd_Register("curCard", WRAP_METHOD(MystConsole, Cmd_CurCard));
@@ -307,6 +312,8 @@ bool MystConsole::Cmd_Resources(int argc, const char **argv) {
return true;
}
+#endif // ENABLE_MYST
+
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));
diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h
index b7b6b2567e..cefd0b1f4c 100644
--- a/engines/mohawk/console.h
+++ b/engines/mohawk/console.h
@@ -30,11 +30,13 @@
namespace Mohawk {
-class MohawkEngine_Myst;
class MohawkEngine_Riven;
class MohawkEngine_LivingBooks;
class MohawkEngine_CSTime;
+#ifdef ENABLE_MYST
+class MohawkEngine_Myst;
+
class MystConsole : public GUI::Debugger {
public:
MystConsole(MohawkEngine_Myst *vm);
@@ -58,6 +60,7 @@ private:
bool Cmd_Cache(int argc, const char **argv);
bool Cmd_Resources(int argc, const char **argv);
};
+#endif
class RivenConsole : public GUI::Debugger {
public:
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index 4a9fcb2ff2..9233a8497c 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -23,11 +23,9 @@
*
*/
-#include "mohawk/bitmap.h"
#include "mohawk/cursors.h"
+#include "mohawk/mohawk.h"
#include "mohawk/resource.h"
-#include "mohawk/graphics.h"
-#include "mohawk/myst.h"
#include "common/macresman.h"
#include "common/system.h"
@@ -36,6 +34,11 @@
#include "graphics/cursorman.h"
#include "graphics/wincursor.h"
+#ifdef ENABLE_MYST
+#include "mohawk/bitmap.h"
+#include "mohawk/myst.h"
+#endif
+
namespace Mohawk {
static const byte s_bwPalette[] = {
@@ -115,6 +118,8 @@ void DefaultCursorManager::setCursor(uint16 id) {
setMacXorCursor(_vm->getResource(_tag, id));
}
+#ifdef ENABLE_MYST
+
MystCursorManager::MystCursorManager(MohawkEngine_Myst *vm) : _vm(vm) {
_bmpDecoder = new MystBitmap();
}
@@ -159,6 +164,8 @@ void MystCursorManager::setDefaultCursor() {
setCursor(kDefaultMystCursor);
}
+#endif
+
NECursorManager::NECursorManager(const Common::String &appName) {
_exe = new Common::NEResources();
diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h
index e6c417948f..f8a9429689 100644
--- a/engines/mohawk/cursors.h
+++ b/engines/mohawk/cursors.h
@@ -40,25 +40,6 @@ namespace Common {
namespace Mohawk {
-// 803-805 are animated, one large bmp which is in chunks - these are NEVER USED
-// Other cursors (200, 300, 400, 500, 600, 700) are not the same in each stack
-enum {
- kDefaultMystCursor = 100, // The default hand
- kWhitePageCursor = 800, // Holding a white page
- kRedPageCursor = 801, // Holding a red page
- kBluePageCursor = 802, // Holding a blue page
- // kDroppingWhitePageAnimCursor = 803,
- // kDroppingRedPageAnimCursor = 804,
- // kDroppingBluePageAnimCursor = 805,
- kNewMatchCursor = 900, // Match that has not yet been lit
- kLitMatchCursor = 901, // Match that's burning
- kDeadMatchCursor = 902, // Match that's been extinguished
- kKeyCursor = 903, // Key in Lighthouse in Stoneship
- kRotateClockwiseCursor = 904, // Rotate gear clockwise (boiler on Myst)
- kRotateCounterClockwiseCursor = 905, // Rotate gear counter clockwise (boiler on Myst)
- kMystZipModeCursor = 999 // Zip Mode cursor
-};
-
enum {
kRivenOpenHandCursor = 2003,
kRivenClosedHandCursor = 2004,
@@ -69,8 +50,6 @@ enum {
class MohawkArchive;
class MohawkEngine;
-class MohawkEngine_Myst;
-class MystBitmap;
class CursorManager {
public:
@@ -103,6 +82,30 @@ private:
uint32 _tag;
};
+#ifdef ENABLE_MYST
+
+// 803-805 are animated, one large bmp which is in chunks - these are NEVER USED
+// Other cursors (200, 300, 400, 500, 600, 700) are not the same in each stack
+enum {
+ kDefaultMystCursor = 100, // The default hand
+ kWhitePageCursor = 800, // Holding a white page
+ kRedPageCursor = 801, // Holding a red page
+ kBluePageCursor = 802, // Holding a blue page
+ // kDroppingWhitePageAnimCursor = 803,
+ // kDroppingRedPageAnimCursor = 804,
+ // kDroppingBluePageAnimCursor = 805,
+ kNewMatchCursor = 900, // Match that has not yet been lit
+ kLitMatchCursor = 901, // Match that's burning
+ kDeadMatchCursor = 902, // Match that's been extinguished
+ kKeyCursor = 903, // Key in Lighthouse in Stoneship
+ kRotateClockwiseCursor = 904, // Rotate gear clockwise (boiler on Myst)
+ kRotateCounterClockwiseCursor = 905, // Rotate gear counter clockwise (boiler on Myst)
+ kMystZipModeCursor = 999 // Zip Mode cursor
+};
+
+class MohawkEngine_Myst;
+class MystBitmap;
+
// The cursor manager for Myst
// Uses WDIB + CLRC resources
class MystCursorManager : public CursorManager {
@@ -121,6 +124,8 @@ private:
MystBitmap *_bmpDecoder;
};
+#endif // ENABLE_MYST
+
// The cursor manager for NE EXE's
class NECursorManager : public CursorManager {
public:
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 5bd904d9bb..724eb63f6a 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -30,11 +30,14 @@
#include "common/file.h"
#include "common/savefile.h"
-#include "mohawk/myst.h"
#include "mohawk/riven.h"
#include "mohawk/livingbooks.h"
#include "mohawk/cstime.h"
+#ifdef ENABLE_MYST
+#include "mohawk/myst.h"
+#endif
+
namespace Mohawk {
struct MohawkGameDescription {
@@ -78,6 +81,8 @@ bool MohawkEngine::hasFeature(EngineFeature f) const {
(f == kSupportsRTL);
}
+#ifdef ENABLE_MYST
+
bool MohawkEngine_Myst::hasFeature(EngineFeature f) const {
return
MohawkEngine::hasFeature(f)
@@ -85,6 +90,8 @@ bool MohawkEngine_Myst::hasFeature(EngineFeature f) const {
|| (f == kSupportsSavingDuringRuntime);
}
+#endif
+
bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
return
MohawkEngine::hasFeature(f)
@@ -229,8 +236,13 @@ bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa
switch (gd->gameType) {
case Mohawk::GType_MYST:
case Mohawk::GType_MAKINGOF:
+#ifdef ENABLE_MYST
*engine = new Mohawk::MohawkEngine_Myst(syst, gd);
break;
+#else
+ warning("Myst support not compiled in");
+ return false;
+#endif
case Mohawk::GType_RIVEN:
*engine = new Mohawk::MohawkEngine_Riven(syst, gd);
break;
@@ -251,10 +263,10 @@ bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa
case Mohawk::GType_TREEHOUSE:
case Mohawk::GType_1STDEGREE:
case Mohawk::GType_CSUSA:
- error ("Unsupported Mohawk Engine");
+ error("Unsupported Mohawk Engine");
break;
default:
- error ("Unknown Mohawk Engine");
+ error("Unknown Mohawk Engine");
}
}
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index 797892a197..3fe64350b4 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -24,7 +24,6 @@
*/
#include "mohawk/mohawk.h"
-#include "mohawk/myst.h"
#include "mohawk/riven.h"
#include "mohawk/dialogs.h"
@@ -32,6 +31,10 @@
#include "common/savefile.h"
#include "common/translation.h"
+#ifdef ENABLE_MYST
+#include "mohawk/myst.h"
+#endif
+
namespace Mohawk {
// This used to have GUI::Dialog("MohawkDummyDialog"), but that doesn't work with the gui branch merge :P (Sorry, Tanoku!)
@@ -77,6 +80,8 @@ enum {
kWaterCmd = 'WATR'
};
+#ifdef ENABLE_MYST
+
MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog("", 120, 120, 360, 200), _vm(vm) {
_zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, _("~Z~ip Mode Activated"), 0, kZipCmd);
_transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd);
@@ -111,6 +116,8 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui
}
}
+#endif
+
RivenOptionsDialog::RivenOptionsDialog(MohawkEngine_Riven* vm) : GUI::OptionsDialog("", 120, 120, 360, 200), _vm(vm) {
_zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 300, 15, _("~Z~ip Mode Activated"), 0, kZipCmd);
_waterEffectCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~W~ater Effect Enabled"), 0, kWaterCmd);
diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h
index d4e3a3331b..3a1d194a1d 100644
--- a/engines/mohawk/dialogs.h
+++ b/engines/mohawk/dialogs.h
@@ -38,7 +38,6 @@
namespace Mohawk {
class MohawkEngine;
-class MohawkEngine_Myst;
class MohawkEngine_Riven;
class InfoDialog : public GUI::Dialog {
@@ -71,6 +70,10 @@ public:
virtual void handleKeyDown(Common::KeyState state);
};
+#ifdef ENABLE_MYST
+
+class MohawkEngine_Myst;
+
class MystOptionsDialog : public GUI::OptionsDialog {
public:
MystOptionsDialog(MohawkEngine_Myst *vm);
@@ -84,6 +87,8 @@ private:
GUI::CheckboxWidget *_transitionsCheckbox;
};
+#endif
+
class RivenOptionsDialog : public GUI::OptionsDialog {
public:
RivenOptionsDialog(MohawkEngine_Riven *vm);
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp
index 3166b6c431..656a6fad01 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -25,17 +25,20 @@
#include "mohawk/resource.h"
#include "mohawk/graphics.h"
-#include "mohawk/myst.h"
#include "mohawk/riven.h"
#include "mohawk/livingbooks.h"
#include "mohawk/cstime.h"
#include "common/substream.h"
#include "engines/util.h"
-#include "graphics/jpeg.h"
#include "graphics/primitives.h"
#include "gui/message.h"
+#ifdef ENABLE_MYST
+#include "mohawk/myst.h"
+#include "graphics/jpeg.h"
+#endif
+
namespace Mohawk {
MohawkSurface::MohawkSurface() : _surface(0), _palette(0) {
@@ -253,6 +256,8 @@ void GraphicsManager::addImageToCache(uint16 id, MohawkSurface *surface) {
_cache[id] = surface;
}
+#ifdef ENABLE_MYST
+
MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) {
_bmpDecoder = new MystBitmap();
@@ -618,6 +623,8 @@ void MystGraphics::drawLine(const Common::Point &p1, const Common::Point &p2, ui
_backBuffer->drawLine(p1.x, p1.y, p2.x, p2.y, color);
}
+#endif
+
RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm) {
_bitmapDecoder = new MohawkBitmap();
diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h
index fbac2f2ea1..99baa4e339 100644
--- a/engines/mohawk/graphics.h
+++ b/engines/mohawk/graphics.h
@@ -33,26 +33,16 @@
#include "graphics/pict.h"
namespace Graphics {
-
-class JPEG;
-
+ class JPEG;
}
namespace Mohawk {
class MohawkEngine;
-class MohawkEngine_Myst;
class MohawkEngine_Riven;
class MohawkEngine_LivingBooks;
class MohawkEngine_CSTime;
class MohawkBitmap;
-class MystBitmap;
-
-enum RectState{
- kRectEnabled,
- kRectDisabled,
- kRectUnreachable
-};
class MohawkSurface {
public:
@@ -118,6 +108,17 @@ private:
Common::HashMap<uint16, Common::Array<MohawkSurface*> > _subImageCache;
};
+#ifdef ENABLE_MYST
+
+class MystBitmap;
+class MohawkEngine_Myst;
+
+enum RectState {
+ kRectEnabled,
+ kRectDisabled,
+ kRectUnreachable
+};
+
class MystGraphics : public GraphicsManager {
public:
MystGraphics(MohawkEngine_Myst*);
@@ -162,6 +163,8 @@ private:
Common::Rect _viewport;
};
+#endif
+
struct SFXERecord {
// Record values
uint16 frameCount;
diff --git a/engines/mohawk/module.mk b/engines/mohawk/module.mk
index 8c4453e155..eeba2589d8 100644
--- a/engines/mohawk/module.mk
+++ b/engines/mohawk/module.mk
@@ -16,12 +16,7 @@ MODULE_OBJS = \
livingbooks.o \
livingbooks_code.o \
mohawk.o \
- myst.o \
- myst_areas.o \
- myst_scripts.o \
- myst_state.o \
resource.o \
- resource_cache.o \
riven.o \
riven_external.o \
riven_saveload.o \
@@ -30,6 +25,14 @@ MODULE_OBJS = \
sound.o \
video.o \
view.o \
+
+ifdef ENABLE_MYST
+MODULE_OBJS += \
+ myst.o \
+ myst_areas.o \
+ myst_scripts.o \
+ myst_state.o \
+ resource_cache.o \
myst_stacks/channelwood.o \
myst_stacks/credits.o \
myst_stacks/demo.o \
@@ -42,6 +45,7 @@ MODULE_OBJS = \
myst_stacks/selenitic.o \
myst_stacks/slides.o \
myst_stacks/stoneship.o
+endif
# This module can be built as a plugin
ifeq ($(ENABLE_MOHAWK), DYNAMIC_PLUGIN)