MOHAWK: Allow disabling compilation of Myst

This commit is contained in:
Matthew Hoops 2011-03-28 15:20:30 -04:00
parent 344369c294
commit e5811cd6c3
14 changed files with 125 additions and 52 deletions

3
configure vendored
View File

@ -95,7 +95,8 @@ add_engine lastexpress "The Last Express" no
add_engine lure "Lure of the Temptress" yes add_engine lure "Lure of the Temptress" yes
add_engine m4 "M4/MADS" no add_engine m4 "M4/MADS" no
add_engine made "MADE" yes 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 parallaction "Parallaction" yes
add_engine queen "Flight of the Amazon Queen" yes add_engine queen "Flight of the Amazon Queen" yes
add_engine saga "SAGA" yes "ihnm saga2" add_engine saga "SAGA" yes "ihnm saga2"

View File

@ -97,6 +97,10 @@ endif
ifdef ENABLE_MOHAWK ifdef ENABLE_MOHAWK
DEFINES += -DENABLE_MOHAWK=$(ENABLE_MOHAWK) DEFINES += -DENABLE_MOHAWK=$(ENABLE_MOHAWK)
MODULES += engines/mohawk MODULES += engines/mohawk
ifdef ENABLE_MYST
DEFINES += -DENABLE_MYST
endif
endif endif
ifdef ENABLE_PARALLACTION ifdef ENABLE_PARALLACTION

View File

@ -622,6 +622,8 @@ void MohawkBitmap::drawRLE8(Graphics::Surface *surface, bool isLE) {
} }
} }
#ifdef ENABLE_MYST
////////////////////////////////////////// //////////////////////////////////////////
// Myst Bitmap Decoder // Myst Bitmap Decoder
////////////////////////////////////////// //////////////////////////////////////////
@ -721,6 +723,8 @@ MohawkSurface *MystBitmap::decodeImage(Common::SeekableReadStream* stream) {
return new MohawkSurface(surface, palData); return new MohawkSurface(surface, palData);
} }
#endif
MohawkSurface *LivingBooksBitmap_v1::decodeImage(Common::SeekableReadStream *stream) { MohawkSurface *LivingBooksBitmap_v1::decodeImage(Common::SeekableReadStream *stream) {
Common::SeekableSubReadStreamEndian *endianStream = (Common::SeekableSubReadStreamEndian *)stream; Common::SeekableSubReadStreamEndian *endianStream = (Common::SeekableSubReadStreamEndian *)stream;

View File

@ -144,6 +144,8 @@ private:
void handleRivenSubcommandStream(byte count, byte *&dst); void handleRivenSubcommandStream(byte count, byte *&dst);
}; };
#ifdef ENABLE_MYST
// Myst uses a different image format than that of other Mohawk games. // Myst uses a different image format than that of other Mohawk games.
// It essentially uses a Windows bitmap with the LZ encoding from the // It essentially uses a Windows bitmap with the LZ encoding from the
// Mohawk Bitmap format. // Mohawk Bitmap format.
@ -181,6 +183,8 @@ private:
} _info; } _info;
}; };
#endif
class LivingBooksBitmap_v1 : public MohawkBitmap { class LivingBooksBitmap_v1 : public MohawkBitmap {
public: public:
LivingBooksBitmap_v1() : MohawkBitmap() {} LivingBooksBitmap_v1() : MohawkBitmap() {}

View File

@ -24,9 +24,6 @@
*/ */
#include "mohawk/console.h" #include "mohawk/console.h"
#include "mohawk/myst.h"
#include "mohawk/myst_areas.h"
#include "mohawk/myst_scripts.h"
#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"
@ -35,8 +32,16 @@
#include "mohawk/sound.h" #include "mohawk/sound.h"
#include "mohawk/video.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 { namespace Mohawk {
#ifdef ENABLE_MYST
MystConsole::MystConsole(MohawkEngine_Myst *vm) : GUI::Debugger(), _vm(vm) { MystConsole::MystConsole(MohawkEngine_Myst *vm) : GUI::Debugger(), _vm(vm) {
DCmd_Register("changeCard", WRAP_METHOD(MystConsole, Cmd_ChangeCard)); DCmd_Register("changeCard", WRAP_METHOD(MystConsole, Cmd_ChangeCard));
DCmd_Register("curCard", WRAP_METHOD(MystConsole, Cmd_CurCard)); DCmd_Register("curCard", WRAP_METHOD(MystConsole, Cmd_CurCard));
@ -307,6 +312,8 @@ bool MystConsole::Cmd_Resources(int argc, const char **argv) {
return true; return true;
} }
#endif // ENABLE_MYST
RivenConsole::RivenConsole(MohawkEngine_Riven *vm) : GUI::Debugger(), _vm(vm) { RivenConsole::RivenConsole(MohawkEngine_Riven *vm) : GUI::Debugger(), _vm(vm) {
DCmd_Register("changeCard", WRAP_METHOD(RivenConsole, Cmd_ChangeCard)); DCmd_Register("changeCard", WRAP_METHOD(RivenConsole, Cmd_ChangeCard));
DCmd_Register("curCard", WRAP_METHOD(RivenConsole, Cmd_CurCard)); DCmd_Register("curCard", WRAP_METHOD(RivenConsole, Cmd_CurCard));

View File

@ -30,11 +30,13 @@
namespace Mohawk { namespace Mohawk {
class MohawkEngine_Myst;
class MohawkEngine_Riven; class MohawkEngine_Riven;
class MohawkEngine_LivingBooks; class MohawkEngine_LivingBooks;
class MohawkEngine_CSTime; class MohawkEngine_CSTime;
#ifdef ENABLE_MYST
class MohawkEngine_Myst;
class MystConsole : public GUI::Debugger { class MystConsole : public GUI::Debugger {
public: public:
MystConsole(MohawkEngine_Myst *vm); MystConsole(MohawkEngine_Myst *vm);
@ -58,6 +60,7 @@ private:
bool Cmd_Cache(int argc, const char **argv); bool Cmd_Cache(int argc, const char **argv);
bool Cmd_Resources(int argc, const char **argv); bool Cmd_Resources(int argc, const char **argv);
}; };
#endif
class RivenConsole : public GUI::Debugger { class RivenConsole : public GUI::Debugger {
public: public:

View File

@ -23,11 +23,9 @@
* *
*/ */
#include "mohawk/bitmap.h"
#include "mohawk/cursors.h" #include "mohawk/cursors.h"
#include "mohawk/mohawk.h"
#include "mohawk/resource.h" #include "mohawk/resource.h"
#include "mohawk/graphics.h"
#include "mohawk/myst.h"
#include "common/macresman.h" #include "common/macresman.h"
#include "common/system.h" #include "common/system.h"
@ -36,6 +34,11 @@
#include "graphics/cursorman.h" #include "graphics/cursorman.h"
#include "graphics/wincursor.h" #include "graphics/wincursor.h"
#ifdef ENABLE_MYST
#include "mohawk/bitmap.h"
#include "mohawk/myst.h"
#endif
namespace Mohawk { namespace Mohawk {
static const byte s_bwPalette[] = { static const byte s_bwPalette[] = {
@ -115,6 +118,8 @@ void DefaultCursorManager::setCursor(uint16 id) {
setMacXorCursor(_vm->getResource(_tag, id)); setMacXorCursor(_vm->getResource(_tag, id));
} }
#ifdef ENABLE_MYST
MystCursorManager::MystCursorManager(MohawkEngine_Myst *vm) : _vm(vm) { MystCursorManager::MystCursorManager(MohawkEngine_Myst *vm) : _vm(vm) {
_bmpDecoder = new MystBitmap(); _bmpDecoder = new MystBitmap();
} }
@ -159,6 +164,8 @@ void MystCursorManager::setDefaultCursor() {
setCursor(kDefaultMystCursor); setCursor(kDefaultMystCursor);
} }
#endif
NECursorManager::NECursorManager(const Common::String &appName) { NECursorManager::NECursorManager(const Common::String &appName) {
_exe = new Common::NEResources(); _exe = new Common::NEResources();

View File

@ -40,25 +40,6 @@ namespace Common {
namespace Mohawk { 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 { enum {
kRivenOpenHandCursor = 2003, kRivenOpenHandCursor = 2003,
kRivenClosedHandCursor = 2004, kRivenClosedHandCursor = 2004,
@ -69,8 +50,6 @@ enum {
class MohawkArchive; class MohawkArchive;
class MohawkEngine; class MohawkEngine;
class MohawkEngine_Myst;
class MystBitmap;
class CursorManager { class CursorManager {
public: public:
@ -103,6 +82,30 @@ private:
uint32 _tag; 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 // The cursor manager for Myst
// Uses WDIB + CLRC resources // Uses WDIB + CLRC resources
class MystCursorManager : public CursorManager { class MystCursorManager : public CursorManager {
@ -121,6 +124,8 @@ private:
MystBitmap *_bmpDecoder; MystBitmap *_bmpDecoder;
}; };
#endif // ENABLE_MYST
// The cursor manager for NE EXE's // The cursor manager for NE EXE's
class NECursorManager : public CursorManager { class NECursorManager : public CursorManager {
public: public:

View File

@ -30,11 +30,14 @@
#include "common/file.h" #include "common/file.h"
#include "common/savefile.h" #include "common/savefile.h"
#include "mohawk/myst.h"
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/livingbooks.h" #include "mohawk/livingbooks.h"
#include "mohawk/cstime.h" #include "mohawk/cstime.h"
#ifdef ENABLE_MYST
#include "mohawk/myst.h"
#endif
namespace Mohawk { namespace Mohawk {
struct MohawkGameDescription { struct MohawkGameDescription {
@ -78,6 +81,8 @@ bool MohawkEngine::hasFeature(EngineFeature f) const {
(f == kSupportsRTL); (f == kSupportsRTL);
} }
#ifdef ENABLE_MYST
bool MohawkEngine_Myst::hasFeature(EngineFeature f) const { bool MohawkEngine_Myst::hasFeature(EngineFeature f) const {
return return
MohawkEngine::hasFeature(f) MohawkEngine::hasFeature(f)
@ -85,6 +90,8 @@ bool MohawkEngine_Myst::hasFeature(EngineFeature f) const {
|| (f == kSupportsSavingDuringRuntime); || (f == kSupportsSavingDuringRuntime);
} }
#endif
bool MohawkEngine_Riven::hasFeature(EngineFeature f) const { bool MohawkEngine_Riven::hasFeature(EngineFeature f) const {
return return
MohawkEngine::hasFeature(f) MohawkEngine::hasFeature(f)
@ -229,8 +236,13 @@ bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa
switch (gd->gameType) { switch (gd->gameType) {
case Mohawk::GType_MYST: case Mohawk::GType_MYST:
case Mohawk::GType_MAKINGOF: case Mohawk::GType_MAKINGOF:
#ifdef ENABLE_MYST
*engine = new Mohawk::MohawkEngine_Myst(syst, gd); *engine = new Mohawk::MohawkEngine_Myst(syst, gd);
break; break;
#else
warning("Myst support not compiled in");
return false;
#endif
case Mohawk::GType_RIVEN: case Mohawk::GType_RIVEN:
*engine = new Mohawk::MohawkEngine_Riven(syst, gd); *engine = new Mohawk::MohawkEngine_Riven(syst, gd);
break; break;
@ -251,10 +263,10 @@ bool MohawkMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa
case Mohawk::GType_TREEHOUSE: case Mohawk::GType_TREEHOUSE:
case Mohawk::GType_1STDEGREE: case Mohawk::GType_1STDEGREE:
case Mohawk::GType_CSUSA: case Mohawk::GType_CSUSA:
error ("Unsupported Mohawk Engine"); error("Unsupported Mohawk Engine");
break; break;
default: default:
error ("Unknown Mohawk Engine"); error("Unknown Mohawk Engine");
} }
} }

View File

@ -24,7 +24,6 @@
*/ */
#include "mohawk/mohawk.h" #include "mohawk/mohawk.h"
#include "mohawk/myst.h"
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/dialogs.h" #include "mohawk/dialogs.h"
@ -32,6 +31,10 @@
#include "common/savefile.h" #include "common/savefile.h"
#include "common/translation.h" #include "common/translation.h"
#ifdef ENABLE_MYST
#include "mohawk/myst.h"
#endif
namespace Mohawk { namespace Mohawk {
// This used to have GUI::Dialog("MohawkDummyDialog"), but that doesn't work with the gui branch merge :P (Sorry, Tanoku!) // 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' kWaterCmd = 'WATR'
}; };
#ifdef ENABLE_MYST
MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog("", 120, 120, 360, 200), _vm(vm) { 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); _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); _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) { 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); _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); _waterEffectCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~W~ater Effect Enabled"), 0, kWaterCmd);

View File

@ -38,7 +38,6 @@
namespace Mohawk { namespace Mohawk {
class MohawkEngine; class MohawkEngine;
class MohawkEngine_Myst;
class MohawkEngine_Riven; class MohawkEngine_Riven;
class InfoDialog : public GUI::Dialog { class InfoDialog : public GUI::Dialog {
@ -71,6 +70,10 @@ public:
virtual void handleKeyDown(Common::KeyState state); virtual void handleKeyDown(Common::KeyState state);
}; };
#ifdef ENABLE_MYST
class MohawkEngine_Myst;
class MystOptionsDialog : public GUI::OptionsDialog { class MystOptionsDialog : public GUI::OptionsDialog {
public: public:
MystOptionsDialog(MohawkEngine_Myst *vm); MystOptionsDialog(MohawkEngine_Myst *vm);
@ -84,6 +87,8 @@ private:
GUI::CheckboxWidget *_transitionsCheckbox; GUI::CheckboxWidget *_transitionsCheckbox;
}; };
#endif
class RivenOptionsDialog : public GUI::OptionsDialog { class RivenOptionsDialog : public GUI::OptionsDialog {
public: public:
RivenOptionsDialog(MohawkEngine_Riven *vm); RivenOptionsDialog(MohawkEngine_Riven *vm);

View File

@ -25,17 +25,20 @@
#include "mohawk/resource.h" #include "mohawk/resource.h"
#include "mohawk/graphics.h" #include "mohawk/graphics.h"
#include "mohawk/myst.h"
#include "mohawk/riven.h" #include "mohawk/riven.h"
#include "mohawk/livingbooks.h" #include "mohawk/livingbooks.h"
#include "mohawk/cstime.h" #include "mohawk/cstime.h"
#include "common/substream.h" #include "common/substream.h"
#include "engines/util.h" #include "engines/util.h"
#include "graphics/jpeg.h"
#include "graphics/primitives.h" #include "graphics/primitives.h"
#include "gui/message.h" #include "gui/message.h"
#ifdef ENABLE_MYST
#include "mohawk/myst.h"
#include "graphics/jpeg.h"
#endif
namespace Mohawk { namespace Mohawk {
MohawkSurface::MohawkSurface() : _surface(0), _palette(0) { MohawkSurface::MohawkSurface() : _surface(0), _palette(0) {
@ -253,6 +256,8 @@ void GraphicsManager::addImageToCache(uint16 id, MohawkSurface *surface) {
_cache[id] = surface; _cache[id] = surface;
} }
#ifdef ENABLE_MYST
MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) {
_bmpDecoder = new MystBitmap(); _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); _backBuffer->drawLine(p1.x, p1.y, p2.x, p2.y, color);
} }
#endif
RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm) { RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm) {
_bitmapDecoder = new MohawkBitmap(); _bitmapDecoder = new MohawkBitmap();

View File

@ -33,26 +33,16 @@
#include "graphics/pict.h" #include "graphics/pict.h"
namespace Graphics { namespace Graphics {
class JPEG;
class JPEG;
} }
namespace Mohawk { namespace Mohawk {
class MohawkEngine; class MohawkEngine;
class MohawkEngine_Myst;
class MohawkEngine_Riven; class MohawkEngine_Riven;
class MohawkEngine_LivingBooks; class MohawkEngine_LivingBooks;
class MohawkEngine_CSTime; class MohawkEngine_CSTime;
class MohawkBitmap; class MohawkBitmap;
class MystBitmap;
enum RectState{
kRectEnabled,
kRectDisabled,
kRectUnreachable
};
class MohawkSurface { class MohawkSurface {
public: public:
@ -118,6 +108,17 @@ private:
Common::HashMap<uint16, Common::Array<MohawkSurface*> > _subImageCache; Common::HashMap<uint16, Common::Array<MohawkSurface*> > _subImageCache;
}; };
#ifdef ENABLE_MYST
class MystBitmap;
class MohawkEngine_Myst;
enum RectState {
kRectEnabled,
kRectDisabled,
kRectUnreachable
};
class MystGraphics : public GraphicsManager { class MystGraphics : public GraphicsManager {
public: public:
MystGraphics(MohawkEngine_Myst*); MystGraphics(MohawkEngine_Myst*);
@ -162,6 +163,8 @@ private:
Common::Rect _viewport; Common::Rect _viewport;
}; };
#endif
struct SFXERecord { struct SFXERecord {
// Record values // Record values
uint16 frameCount; uint16 frameCount;

View File

@ -16,12 +16,7 @@ MODULE_OBJS = \
livingbooks.o \ livingbooks.o \
livingbooks_code.o \ livingbooks_code.o \
mohawk.o \ mohawk.o \
myst.o \
myst_areas.o \
myst_scripts.o \
myst_state.o \
resource.o \ resource.o \
resource_cache.o \
riven.o \ riven.o \
riven_external.o \ riven_external.o \
riven_saveload.o \ riven_saveload.o \
@ -30,6 +25,14 @@ MODULE_OBJS = \
sound.o \ sound.o \
video.o \ video.o \
view.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/channelwood.o \
myst_stacks/credits.o \ myst_stacks/credits.o \
myst_stacks/demo.o \ myst_stacks/demo.o \
@ -42,6 +45,7 @@ MODULE_OBJS = \
myst_stacks/selenitic.o \ myst_stacks/selenitic.o \
myst_stacks/slides.o \ myst_stacks/slides.o \
myst_stacks/stoneship.o myst_stacks/stoneship.o
endif
# This module can be built as a plugin # This module can be built as a plugin
ifeq ($(ENABLE_MOHAWK), DYNAMIC_PLUGIN) ifeq ($(ENABLE_MOHAWK), DYNAMIC_PLUGIN)