Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/axlogic.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace AXLogic {
AlienWriterModifier::AlienWriterModifier() {
}
AlienWriterModifier::~AlienWriterModifier() {
}
bool AlienWriterModifier::load(const PlugInModifierLoaderContext &context, const Data::AXLogic::AlienWriterModifier &data) {
return true;
}
bool AlienWriterModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState AlienWriterModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void AlienWriterModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void AlienWriterModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> AlienWriterModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new AlienWriterModifier(*this));
}
const char *AlienWriterModifier::getDefaultName() const {
return "AlienWriter Modifier"; // ???
}
AXLogicPlugIn::AXLogicPlugIn()
: _alienWriterModifierFactory(this) {
}
AXLogicPlugIn::~AXLogicPlugIn() {
}
void AXLogicPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
registrar->registerPlugInModifier("AlienWriter", &_alienWriterModifierFactory);
}
} // End of namespace AXLogic
namespace PlugIns {
Common::SharedPtr<PlugIn> createAXLogic() {
return Common::SharedPtr<PlugIn>(new AXLogic::AXLogicPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,71 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_AXLOGIC_H
#define MTROPOLIS_PLUGIN_AXLOGIC_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/axlogic_data.h"
namespace MTropolis {
namespace AXLogic {
class AlienWriterModifier : public Modifier {
public:
AlienWriterModifier();
~AlienWriterModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::AXLogic::AlienWriterModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "AlienWriter Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class AXLogicPlugIn : public MTropolis::PlugIn {
public:
AXLogicPlugIn();
~AXLogicPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<AlienWriterModifier, Data::AXLogic::AlienWriterModifier> _alienWriterModifierFactory;
};
} // End of namespace AXLogic
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,43 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/axlogic_data.h"
namespace MTropolis {
namespace Data {
namespace AXLogic {
DataReadErrorCode AlienWriterModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the AlienWriter modifier is not implemented.");
return kDataReadErrorNone;
}
} // End of namespace AXLogic
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,69 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_AXLOGIC_DATA_H
#define MTROPOLIS_PLUGIN_AXLOGIC_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace AXLogic {
// Known AXLogic custom modifiers:
//
// * Quicktime Kit:
// - AXImagePlayer
// - AXQTVRMessenger
// - AXQTVRNavigator
// - PenguinPatch (???)
//
// * AlienLogic Kit: New scripting system as an alternative to Miniscript
// - AXList
// - AlienMathLib
// - AlienMiscLib
// - AlienObject
// - AlienStringLib
// - AlienWriter
// - CodeExecuterACod
// - CodeExecuterBase
// - RuntimeExecute
// - XCodeLibraryStnd
//
// For mTropolis 1.1, the implementation of AlienLogic
// may be spread across multiple plugins
// But with the same modifiers
struct AlienWriterModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace AXLogic
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,122 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/ftts.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace FTTS {
MotionModifier::MotionModifier() {
}
MotionModifier::~MotionModifier() {
}
bool MotionModifier::load(const PlugInModifierLoaderContext &context, const Data::FTTS::MotionModifier &data) {
return true;
}
bool MotionModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState MotionModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void MotionModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void MotionModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> MotionModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new MotionModifier(*this));
}
const char *MotionModifier::getDefaultName() const {
return "Motion Modifier"; // ???
}
SparkleModifier::SparkleModifier() {
}
SparkleModifier::~SparkleModifier() {
}
bool SparkleModifier::load(const PlugInModifierLoaderContext &context, const Data::FTTS::SparkleModifier &data) {
return true;
}
bool SparkleModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState SparkleModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void SparkleModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void SparkleModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> SparkleModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new SparkleModifier(*this));
}
const char *SparkleModifier::getDefaultName() const {
return "Sparkle Modifier"; // ???
}
FTTSPlugIn::FTTSPlugIn()
: _motionModifierFactory(this)
, _sparkleModifierFactory(this) {
}
FTTSPlugIn::~FTTSPlugIn() {
}
void FTTSPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
registrar->registerPlugInModifier("Motion", &_motionModifierFactory);
registrar->registerPlugInModifier("Sparkle", &_sparkleModifierFactory);
}
} // End of namespace FTTS
namespace PlugIns {
Common::SharedPtr<PlugIn> createFTTS() {
return Common::SharedPtr<PlugIn>(new FTTS::FTTSPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,94 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_FTTS_H
#define MTROPOLIS_PLUGIN_FTTS_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/ftts_data.h"
namespace MTropolis {
namespace FTTS {
class MotionModifier : public Modifier {
public:
MotionModifier();
~MotionModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::FTTS::MotionModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Motion Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class SparkleModifier : public Modifier {
public:
SparkleModifier();
~SparkleModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::FTTS::SparkleModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Sparkle Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class FTTSPlugIn : public MTropolis::PlugIn {
public:
FTTSPlugIn();
~FTTSPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<MotionModifier, Data::FTTS::MotionModifier> _motionModifierFactory;
PlugInModifierFactory<SparkleModifier, Data::FTTS::SparkleModifier> _sparkleModifierFactory;
};
} // End of namespace FTTS
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,63 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/ftts_data.h"
namespace MTropolis {
namespace Data {
namespace FTTS {
DataReadErrorCode MotionModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Point.load(reader) || !unknown4Bool.load(reader) || !unknown5Point.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Int.load(reader) || !unknown7Float.load(reader) || !unknown8Int.load(reader) || !unknown9Event.load(reader) || !unknown10Label.load(reader))
return kDataReadErrorReadFailed;
if (!unknown11Null.load(reader) || !unknown12Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode SparkleModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Int.load(reader) || !unknown4Int.load(reader) || !unknown5Int.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Int.load(reader) || !unknown7Int.load(reader) || !unknown8Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
} // End of namespace FTTS
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,74 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_FTTS_DATA_H
#define MTROPOLIS_PLUGIN_FTTS_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace FTTS {
// Known Fairy Tale: A True Story - Activity Center custom modifiers:
// - Motion
// - Sparkle
struct MotionModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Point;
PlugInTypeTaggedValue unknown4Bool;
PlugInTypeTaggedValue unknown5Point;
PlugInTypeTaggedValue unknown6Int;
PlugInTypeTaggedValue unknown7Float;
PlugInTypeTaggedValue unknown8Int;
PlugInTypeTaggedValue unknown9Event;
PlugInTypeTaggedValue unknown10Label;
PlugInTypeTaggedValue unknown11Null;
PlugInTypeTaggedValue unknown12Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct SparkleModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Int;
PlugInTypeTaggedValue unknown4Int;
PlugInTypeTaggedValue unknown5Int;
PlugInTypeTaggedValue unknown6Int;
PlugInTypeTaggedValue unknown7Int;
PlugInTypeTaggedValue unknown8Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace FTTS
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,387 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/hoologic.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace Hoologic {
BitmapVariableModifier::BitmapVariableModifier() {
}
BitmapVariableModifier::~BitmapVariableModifier() {
}
bool BitmapVariableModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::BitmapVariableModifier &data) {
return true;
}
bool BitmapVariableModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState BitmapVariableModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void BitmapVariableModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void BitmapVariableModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> BitmapVariableModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new BitmapVariableModifier(*this));
}
const char *BitmapVariableModifier::getDefaultName() const {
return "Bitmap Variable Modifier"; // ???
}
CaptureBitmapModifier::CaptureBitmapModifier() {
}
CaptureBitmapModifier::~CaptureBitmapModifier() {
}
bool CaptureBitmapModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::CaptureBitmapModifier &data) {
return true;
}
bool CaptureBitmapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState CaptureBitmapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void CaptureBitmapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void CaptureBitmapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> CaptureBitmapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new CaptureBitmapModifier(*this));
}
const char *CaptureBitmapModifier::getDefaultName() const {
return "Capture Bitmap Modifier"; // ???
}
ImportBitmapModifier::ImportBitmapModifier() {
}
ImportBitmapModifier::~ImportBitmapModifier() {
}
bool ImportBitmapModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::ImportBitmapModifier &data) {
return true;
}
bool ImportBitmapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState ImportBitmapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void ImportBitmapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void ImportBitmapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> ImportBitmapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new ImportBitmapModifier(*this));
}
const char *ImportBitmapModifier::getDefaultName() const {
return "Import Bitmap Modifier"; // ???
}
DisplayBitmapModifier::DisplayBitmapModifier() {
}
DisplayBitmapModifier::~DisplayBitmapModifier() {
}
bool DisplayBitmapModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::DisplayBitmapModifier &data) {
return true;
}
bool DisplayBitmapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState DisplayBitmapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void DisplayBitmapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void DisplayBitmapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> DisplayBitmapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new DisplayBitmapModifier(*this));
}
const char *DisplayBitmapModifier::getDefaultName() const {
return "Display Bitmap Modifier"; // ???
}
ScaleBitmapModifier::ScaleBitmapModifier() {
}
ScaleBitmapModifier::~ScaleBitmapModifier() {
}
bool ScaleBitmapModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::ScaleBitmapModifier &data) {
return true;
}
bool ScaleBitmapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState ScaleBitmapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void ScaleBitmapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void ScaleBitmapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> ScaleBitmapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new ScaleBitmapModifier(*this));
}
const char *ScaleBitmapModifier::getDefaultName() const {
return "Scale Bitmap Modifier"; // ???
}
SaveBitmapModifier::SaveBitmapModifier() {
}
SaveBitmapModifier::~SaveBitmapModifier() {
}
bool SaveBitmapModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::SaveBitmapModifier &data) {
return true;
}
bool SaveBitmapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState SaveBitmapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void SaveBitmapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void SaveBitmapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> SaveBitmapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new SaveBitmapModifier(*this));
}
const char *SaveBitmapModifier::getDefaultName() const {
return "Save Bitmap Modifier"; // ???
}
PrintBitmapModifier::PrintBitmapModifier() {
}
PrintBitmapModifier::~PrintBitmapModifier() {
}
bool PrintBitmapModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::PrintBitmapModifier &data) {
return true;
}
bool PrintBitmapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState PrintBitmapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void PrintBitmapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void PrintBitmapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> PrintBitmapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new PrintBitmapModifier(*this));
}
const char *PrintBitmapModifier::getDefaultName() const {
return "Print Bitmap Modifier"; // ???
}
PainterModifier::PainterModifier() {
}
PainterModifier::~PainterModifier() {
}
bool PainterModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::PainterModifier &data) {
return true;
}
bool PainterModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState PainterModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void PainterModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void PainterModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> PainterModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new PainterModifier(*this));
}
const char *PainterModifier::getDefaultName() const {
return "Painter Modifier"; // ???
}
KeyStateModifier::KeyStateModifier() {
}
KeyStateModifier::~KeyStateModifier() {
}
bool KeyStateModifier::load(const PlugInModifierLoaderContext &context, const Data::Hoologic::KeyStateModifier &data) {
return true;
}
bool KeyStateModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState KeyStateModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void KeyStateModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void KeyStateModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> KeyStateModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new KeyStateModifier(*this));
}
const char *KeyStateModifier::getDefaultName() const {
return "KeyState Modifier"; // ???
}
HoologicPlugIn::HoologicPlugIn()
: _bitmapVariableModifierFactory(this)
, _captureBitmapModifierFactory(this)
, _importBitmapModifierFactory(this)
, _displayBitmapModifierFactory(this)
, _scaleBitmapModifierFactory(this)
, _saveBitmapModifierFactory(this)
, _printBitmapModifierFactory(this)
, _painterModifierFactory(this)
, _keyStateModifierFactory(this)
{
}
HoologicPlugIn::~HoologicPlugIn() {
}
void HoologicPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
//Bitmap plugin
registrar->registerPlugInModifier("hlBitmapVariable", &_bitmapVariableModifierFactory);
registrar->registerPlugInModifier("hlCaptureBitmap", &_captureBitmapModifierFactory);
registrar->registerPlugInModifier("hlImportBitmap", &_importBitmapModifierFactory);
registrar->registerPlugInModifier("hlDisplayBitmap", &_displayBitmapModifierFactory);
registrar->registerPlugInModifier("hlScaleBitmap", &_scaleBitmapModifierFactory);
registrar->registerPlugInModifier("hlSaveBitmap", &_saveBitmapModifierFactory);
registrar->registerPlugInModifier("hlPrintBitmap", &_printBitmapModifierFactory);
//Painter plugin
registrar->registerPlugInModifier("hlPainter", &_painterModifierFactory);
//KeyState plugin
registrar->registerPlugInModifier("hlKeyState", &_keyStateModifierFactory);
}
} // End of namespace Hoologic
namespace PlugIns {
Common::SharedPtr<PlugIn> createHoologic() {
return Common::SharedPtr<PlugIn>(new Hoologic::HoologicPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,255 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_HOOLOGIC_H
#define MTROPOLIS_PLUGIN_HOOLOGIC_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/hoologic_data.h"
namespace MTropolis {
namespace Hoologic {
class BitmapVariableModifier : public Modifier {
public:
BitmapVariableModifier();
~BitmapVariableModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::BitmapVariableModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "BitmapVariable Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class CaptureBitmapModifier : public Modifier {
public:
CaptureBitmapModifier();
~CaptureBitmapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::CaptureBitmapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "CaptureBitmap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class ImportBitmapModifier : public Modifier {
public:
ImportBitmapModifier();
~ImportBitmapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::ImportBitmapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "ImportBitmap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class DisplayBitmapModifier : public Modifier {
public:
DisplayBitmapModifier();
~DisplayBitmapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::DisplayBitmapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "DisplayBitmap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class ScaleBitmapModifier : public Modifier {
public:
ScaleBitmapModifier();
~ScaleBitmapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::ScaleBitmapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "ScaleBitmap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class SaveBitmapModifier : public Modifier {
public:
SaveBitmapModifier();
~SaveBitmapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::SaveBitmapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "SaveBitmap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class PrintBitmapModifier : public Modifier {
public:
PrintBitmapModifier();
~PrintBitmapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::PrintBitmapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "PrintBitmap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class PainterModifier : public Modifier {
public:
PainterModifier();
~PainterModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::PainterModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Painter Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class KeyStateModifier : public Modifier {
public:
KeyStateModifier();
~KeyStateModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Hoologic::KeyStateModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "KeyState Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class HoologicPlugIn : public MTropolis::PlugIn {
public:
HoologicPlugIn();
~HoologicPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<BitmapVariableModifier, Data::Hoologic::BitmapVariableModifier> _bitmapVariableModifierFactory;
PlugInModifierFactory<CaptureBitmapModifier, Data::Hoologic::CaptureBitmapModifier> _captureBitmapModifierFactory;
PlugInModifierFactory<ImportBitmapModifier, Data::Hoologic::ImportBitmapModifier> _importBitmapModifierFactory;
PlugInModifierFactory<DisplayBitmapModifier, Data::Hoologic::DisplayBitmapModifier> _displayBitmapModifierFactory;
PlugInModifierFactory<ScaleBitmapModifier, Data::Hoologic::ScaleBitmapModifier> _scaleBitmapModifierFactory;
PlugInModifierFactory<SaveBitmapModifier, Data::Hoologic::SaveBitmapModifier> _saveBitmapModifierFactory;
PlugInModifierFactory<PrintBitmapModifier, Data::Hoologic::PrintBitmapModifier> _printBitmapModifierFactory;
PlugInModifierFactory<PainterModifier, Data::Hoologic::PainterModifier> _painterModifierFactory;
PlugInModifierFactory<KeyStateModifier, Data::Hoologic::KeyStateModifier> _keyStateModifierFactory;
};
} // End of namespace FTTS
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,124 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/hoologic_data.h"
namespace MTropolis {
namespace Data {
namespace Hoologic {
DataReadErrorCode BitmapVariableModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
//Seemingly no data to load
return kDataReadErrorNone;
}
DataReadErrorCode CaptureBitmapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2VarRef.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode ImportBitmapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Bool.load(reader) || !unknown3Bool.load(reader) || !unknown4VarRef.load(reader) || !unknown5VarRef.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode DisplayBitmapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2VarRef.load(reader) || !unknown3VarRef.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode ScaleBitmapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2VarRef.load(reader) || !unknown3IncomingData.load(reader) || !unknown4Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode SaveBitmapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2VarRef.load(reader) || !unknown3Bool.load(reader) || !unknown4Bool.load(reader) || !unknown5VarRef.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode PrintBitmapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2VarRef.load(reader) || !unknown3Bool.load(reader) || !unknown4Bool.load(reader) || !unknown5Int.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Int.load(reader) || !unknown7Null.load(reader) || !unknown8Null.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode PainterModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the Painter modifier is not implemented.");
return kDataReadErrorNone;
}
DataReadErrorCode KeyStateModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
//Seemingly no data to load
return kDataReadErrorNone;
}
} // End of namespace Hoologic
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,131 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_HOOLOGIC_DATA_H
#define MTROPOLIS_PLUGIN_HOOLOGIC_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace Hoologic {
// Known Hoologic custom modifiers:
// * Bitmap Suite
// - hlBitmapVariable: variable storing a bitmap
// - hlCaptureBitmap: captures a screen image into a bitmap
// - hlPrintBitmap: print a bitmap
// - hlSaveBitmap: saves a bitmap as a PICT/BMP file
// - hlImportBitmap: load a bitmap from a PICT/BMP file
// - hlDisplayBitmap: display a bitmap
// - hlScaleBitmap: scale a bitmap
//
// * Painter Plugin
// - hlPainter: Creates painting effects and interaction by blending several pictures together
//
// * KeyState Plugin
// - hlKeyState: State of keyboard keys, and if modifier keys (CTRL, SHIFT, ...) are used?
//
// * AppleScript Suite
// - ???
struct BitmapVariableModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct CaptureBitmapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2VarRef;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct ImportBitmapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Bool;
PlugInTypeTaggedValue unknown3Bool;
PlugInTypeTaggedValue unknown4VarRef;
PlugInTypeTaggedValue unknown5VarRef;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct DisplayBitmapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2VarRef;
PlugInTypeTaggedValue unknown3VarRef;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct ScaleBitmapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2VarRef;
PlugInTypeTaggedValue unknown3IncomingData;
PlugInTypeTaggedValue unknown4Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct SaveBitmapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2VarRef;
PlugInTypeTaggedValue unknown3Bool;
PlugInTypeTaggedValue unknown4Bool;
PlugInTypeTaggedValue unknown5VarRef;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct PrintBitmapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2VarRef;
PlugInTypeTaggedValue unknown3Bool;
PlugInTypeTaggedValue unknown4Bool;
PlugInTypeTaggedValue unknown5Int;
PlugInTypeTaggedValue unknown6Int;
PlugInTypeTaggedValue unknown7Null;
PlugInTypeTaggedValue unknown8Null;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct PainterModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct KeyStateModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace Hoologic
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,85 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/kw.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace KW {
StrUtilModifier::StrUtilModifier() {
}
StrUtilModifier::~StrUtilModifier() {
}
bool StrUtilModifier::load(const PlugInModifierLoaderContext &context, const Data::KW::StrUtilModifier &data) {
return true;
}
bool StrUtilModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState StrUtilModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void StrUtilModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void StrUtilModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> StrUtilModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new StrUtilModifier(*this));
}
const char *StrUtilModifier::getDefaultName() const {
return "StrUtil Modifier"; // ???
}
KnowWonderPlugIn::KnowWonderPlugIn()
: _strUtilModifierFactory(this) {
}
KnowWonderPlugIn::~KnowWonderPlugIn() {
}
void KnowWonderPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
registrar->registerPlugInModifier("StrUtil", &_strUtilModifierFactory);
}
} // End of namespace KW
namespace PlugIns {
Common::SharedPtr<PlugIn> createKnowWonder() {
return Common::SharedPtr<PlugIn>(new KW::KnowWonderPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,71 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_KW_H
#define MTROPOLIS_PLUGIN_KW_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/kw_data.h"
namespace MTropolis {
namespace KW {
class StrUtilModifier : public Modifier {
public:
StrUtilModifier();
~StrUtilModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::KW::StrUtilModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "StrUtil Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class KnowWonderPlugIn : public MTropolis::PlugIn {
public:
KnowWonderPlugIn();
~KnowWonderPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<StrUtilModifier, Data::KW::StrUtilModifier> _strUtilModifierFactory;
};
} // End of namespace KW
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,43 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/kw_data.h"
namespace MTropolis {
namespace Data {
namespace KW {
DataReadErrorCode StrUtilModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
// Seemingly no data to load
return kDataReadErrorNone;
}
} // End of namespace KW
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,51 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_KW_DATA_H
#define MTROPOLIS_PLUGIN_KW_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace KW {
//
// Known KnowWonder custom modifiers:
// - IdxIter
// - StrUtil
// - TicTacToe
struct StrUtilModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace KW
} // End of namespace Data
} // End of namespace MTropolis
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,151 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MIDI_H
#define MTROPOLIS_PLUGIN_MIDI_H
#include "mtropolis/modifier_factory.h"
#include "mtropolis/modifiers.h"
#include "mtropolis/plugin/midi_data.h"
#include "mtropolis/runtime.h"
class MidiDriver;
namespace MTropolis {
class Runtime;
namespace Midi {
class MidiPlugIn;
class MidiFilePlayer;
class MidiNotePlayer;
class MultiMidiPlayer;
class MidiCombinerSource;
class MidiModifier : public Modifier {
public:
MidiModifier();
~MidiModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Midi::MidiModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttributeIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib, const DynamicValue &index) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "MIDI Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
struct MuteTrackProxyInterface {
static MiniscriptInstructionOutcome write(MiniscriptThread *thread, const DynamicValue &dest, void *objectRef, uintptr ptrOrOffset);
static MiniscriptInstructionOutcome refAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib);
static MiniscriptInstructionOutcome refAttribIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib, const DynamicValue &index);
};
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
MiniscriptInstructionOutcome scriptSetVolume(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetNoteVelocity(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetNoteDuration(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetNoteNum(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetLoop(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetPlayNote(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetTempo(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetMuteTrack(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetMuteTrackIndexed(MiniscriptThread *thread, size_t trackIndex, bool muted);
uint getBoostedVolume(Runtime *runtime) const;
void playSingleNote();
void stopSingleNote();
struct FilePart {
bool loop;
bool overrideTempo;
double tempo;
double fadeIn;
double fadeOut;
};
struct SingleNotePart {
uint8 channel;
uint8 note;
uint8 velocity;
uint8 program;
double duration;
};
union ModeSpecificUnion {
FilePart file;
SingleNotePart singleNote;
};
enum Mode {
kModeFile,
kModeSingleNote,
};
Event _executeWhen;
Event _terminateWhen;
Mode _mode;
ModeSpecificUnion _modeSpecific;
uint8 _volume; // We need this always available because scripts will try to set it and then read it even in single note mode
Common::SharedPtr<Data::Midi::MidiModifier::EmbeddedFile> _embeddedFile;
uint16 _mutedTracks;
MidiPlugIn *_plugIn;
MidiFilePlayer *_filePlayer;
MidiNotePlayer *_notePlayer;
};
class MidiPlugIn : public MTropolis::PlugIn {
public:
explicit MidiPlugIn(bool useDynamicMidi);
~MidiPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
MultiMidiPlayer *getMidi() const;
private:
PlugInModifierFactory<MidiModifier, Data::Midi::MidiModifier> _midiModifierFactory;
Common::SharedPtr<MultiMidiPlayer> _midi;
};
} // End of namespace Midi
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,73 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/midi.h"
#include "mtropolis/plugin/midi_data.h"
namespace MTropolis {
namespace Data {
namespace Midi {
MidiModifier::MidiModifier() : embeddedFlag(0) {
memset(&this->modeSpecific, 0, sizeof(this->modeSpecific));
}
DataReadErrorCode MidiModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1 && prefix.plugInRevision != 2)
return kDataReadErrorUnsupportedRevision;
if (!executeWhen.load(reader) || !terminateWhen.load(reader) || !reader.readU8(embeddedFlag))
return kDataReadErrorReadFailed;
if (embeddedFlag) {
if (!reader.readU8(modeSpecific.embedded.hasFile))
return kDataReadErrorReadFailed;
if (modeSpecific.embedded.hasFile) {
embeddedFile = Common::SharedPtr<EmbeddedFile>(new EmbeddedFile());
uint8 bigEndianLength[4];
if (!reader.readBytes(bigEndianLength))
return kDataReadErrorReadFailed;
uint32 length = (bigEndianLength[0] << 24) + (bigEndianLength[1] << 16) + (bigEndianLength[2] << 8) + bigEndianLength[3];
embeddedFile->contents.resize(length);
if (length > 0 && !reader.read(&embeddedFile->contents[0], length))
return kDataReadErrorReadFailed;
}
if (!reader.readU8(modeSpecific.embedded.loop) || !reader.readU8(modeSpecific.embedded.overrideTempo) || !reader.readU8(modeSpecific.embedded.volume) || !embeddedTempo.load(reader) || !embeddedFadeIn.load(reader) || !embeddedFadeOut.load(reader))
return kDataReadErrorReadFailed;
} else {
if (!reader.readU8(modeSpecific.singleNote.channel) || !reader.readU8(modeSpecific.singleNote.note) || !reader.readU8(modeSpecific.singleNote.velocity) || !reader.readU8(modeSpecific.singleNote.program) || !singleNoteDuration.load(reader))
return kDataReadErrorReadFailed;
}
return kDataReadErrorNone;
}
} // End of namespace Midi
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,82 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MIDI_DATA_H
#define MTROPOLIS_PLUGIN_MIDI_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace Midi {
struct MidiModifier : public PlugInModifierData {
struct EmbeddedFile {
Common::Array<uint8> contents;
};
struct EmbeddedPart {
uint8 hasFile;
uint8 loop;
uint8 overrideTempo;
uint8 volume;
};
struct SingleNotePart {
uint8 channel;
uint8 note;
uint8 velocity;
uint8 program;
};
union ModeSpecificUnion {
EmbeddedPart embedded;
SingleNotePart singleNote;
};
MidiModifier();
PlugInTypeTaggedValue executeWhen;
PlugInTypeTaggedValue terminateWhen;
uint8 embeddedFlag;
ModeSpecificUnion modeSpecific;
PlugInTypeTaggedValue embeddedTempo; // Float
PlugInTypeTaggedValue embeddedFadeIn; // Float
PlugInTypeTaggedValue embeddedFadeOut; // Float
PlugInTypeTaggedValue singleNoteDuration; // Float
Common::SharedPtr<EmbeddedFile> embeddedFile;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace Midi
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,86 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/mline.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace MLine {
MLineLauncherModifier::MLineLauncherModifier() {
}
MLineLauncherModifier::~MLineLauncherModifier() {
}
bool MLineLauncherModifier::load(const PlugInModifierLoaderContext &context, const Data::MLine::MLineLauncherModifier &data) {
return true;
}
bool MLineLauncherModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState MLineLauncherModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void MLineLauncherModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void MLineLauncherModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> MLineLauncherModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new MLineLauncherModifier(*this));
}
const char *MLineLauncherModifier::getDefaultName() const {
return "mLine Launcher Modifier"; // ???
}
MLinePlugIn::MLinePlugIn()
: _mlineLauncherModifierFactory(this) {
}
MLinePlugIn::~MLinePlugIn() {
}
void MLinePlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
//URLaunch plugin by mLine
registrar->registerPlugInModifier("mLine_launcher", &_mlineLauncherModifierFactory);
}
} // End of namespace MLine
namespace PlugIns {
Common::SharedPtr<PlugIn> createMLine() {
return Common::SharedPtr<PlugIn>(new MLine::MLinePlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,71 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MLINE_H
#define MTROPOLIS_PLUGIN_MLINE_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/mline_data.h"
namespace MTropolis {
namespace MLine {
class MLineLauncherModifier : public Modifier {
public:
MLineLauncherModifier();
~MLineLauncherModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::MLine::MLineLauncherModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "mLine Launcher Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class MLinePlugIn : public MTropolis::PlugIn {
public:
MLinePlugIn();
~MLinePlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<MLineLauncherModifier, Data::MLine::MLineLauncherModifier> _mlineLauncherModifierFactory;
};
} // End of namespace MLine
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,50 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/mline_data.h"
namespace MTropolis {
namespace Data {
namespace MLine {
DataReadErrorCode MLineLauncherModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1String.load(reader) || !unknown2String.load(reader) || !unknown3String.load(reader) || !unknown4Int.load(reader) || !unknown5Int.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Bool.load(reader) || !unknown7Event.load(reader) || !unknown8Bool.load(reader) || !unknown9Bool.load(reader) || !unknown10Bool.load(reader))
return kDataReadErrorReadFailed;
if (!unknown11Bool.load(reader) || !unknown12Bool.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
} // End of namespace MLine
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,64 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MLINE_DATA_H
#define MTROPOLIS_PLUGIN_MLINE_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace MLine {
// Known mLine custom modifiers:
// * Launchme
// - URLLaunch: Launch/Open external files and applications
//
// * Database
// - Database (???)
struct MLineLauncherModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1String;
PlugInTypeTaggedValue unknown2String;
PlugInTypeTaggedValue unknown3String;
PlugInTypeTaggedValue unknown4Int;
PlugInTypeTaggedValue unknown5Int;
PlugInTypeTaggedValue unknown6Bool;
PlugInTypeTaggedValue unknown7Event;
PlugInTypeTaggedValue unknown8Bool;
PlugInTypeTaggedValue unknown9Bool;
PlugInTypeTaggedValue unknown10Bool;
PlugInTypeTaggedValue unknown11Bool;
PlugInTypeTaggedValue unknown12Bool;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace MLine
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,605 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common/file.h"
#include "common/random.h"
#include "mtropolis/plugin/mti.h"
#include "mtropolis/plugins.h"
#include "mtropolis/miniscript.h"
#include "video/mpegps_decoder.h"
#include "graphics/managed_surface.h"
#include "common/file.h"
namespace MTropolis {
namespace MTI {
/*
Board layout:
Layer 0:
0 1 2 3 4 5 6 7 8 9 10 11 12
+-----+-----+-----+-----+-----+-----+
0 + 0 | 1 | 2 | 3 | 4 | 5 |
1 +-----+-----+-----+-----+-----+-----+
2 +-----+ 7 | 8 | 9 | 10 +-----+-----+
3 | 6 +-----+-----+-----+-----+ 11 | 12 |
4 +-----+ 13 | 14 | 15 | 16 +-----+-----+
5 +-----+-----+-----+-----+-----+-----+
6 + 17 | 18 | 19 | 20 | 21 | 22 |
+-----+-----+-----+-----+-----+-----+
Layer 1:
0 1 2 3 4 5 6 7 8 9 10 11 12
0
1 +-----+-----+
2 | 23 | 24 |
3 +-----+-----+
4 | 25 | 26 |
5 +-----+-----+
6
Layer 2:
0 1 2 3 4 5 6 7 8 9 10 11 12
0
1
2 +-----+
3 | 27 |
4 +-----+
5
6
*/
ShanghaiModifier::TileCoordinate ShanghaiModifier::_tileCoordinates[ShanghaiModifier::kNumTiles] = {
{0, 0, 0},
{2, 0, 0},
{4, 0, 0},
{6, 0, 0},
{8, 0, 0},
{10, 0, 0},
{0, 3, 0},
{2, 2, 0},
{4, 2, 0},
{6, 2, 0},
{8, 2, 0},
{10, 3, 0},
{12, 3, 0},
{2, 4, 0},
{4, 4, 0},
{6, 4, 0},
{8, 4, 0},
{0, 6, 0},
{2, 6, 0},
{4, 6, 0},
{6, 6, 0},
{8, 6, 0},
{10, 6, 0},
{4, 2, 0},
{6, 2, 0},
{4, 4, 1},
{6, 4, 1},
{5, 3, 2},
};
ShanghaiModifier::ShanghaiModifier() {
for (uint x = 0; x < kBoardSizeX; x++)
for (uint y = 0; y < kBoardSizeY; y++)
for (uint z = 0; z < kBoardSizeZ; z++)
_tileAtCoordinate[x][y][z] = -1;
for (uint i = 0; i < kNumTiles; i++) {
const TileCoordinate &coord = _tileCoordinates[i];
assert(coord.x < kBoardSizeX);
assert(coord.y < kBoardSizeY);
assert(coord.z < kBoardSizeZ);
_tileAtCoordinate[coord.x][coord.y][coord.z] = i;
}
}
ShanghaiModifier::~ShanghaiModifier() {
}
bool ShanghaiModifier::respondsToEvent(const Event &evt) const {
if (_resetTileSetWhen.respondsTo(evt))
return true;
return false;
}
VThreadState ShanghaiModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
if (_resetTileSetWhen.respondsTo(msg->getEvent())) {
uint tileFaces[kNumTiles];
resetTiles(*runtime->getRandom(), tileFaces);
Modifier *varMod = this->_tileSetRef.resolution.lock().get();
if (varMod == nullptr || !varMod->isVariable()) {
warning("Shanghai reset var ref was unavailable");
return kVThreadError;
}
VariableModifier *var = static_cast<VariableModifier *>(varMod);
Common::SharedPtr<DynamicList> list(new DynamicList());
for (uint i = 0; i < kNumTiles; i++) {
DynamicValue tileValue;
tileValue.setInt(tileFaces[i]);
list->setAtIndex(i, tileValue);
}
DynamicValue listValue;
listValue.setList(list);
MiniscriptThread thread(runtime, nullptr, nullptr, nullptr, this);
var->varSetValue(&thread, listValue);
return kVThreadReturn;
}
return kVThreadReturn;
}
void ShanghaiModifier::disable(Runtime *runtime) {
}
bool ShanghaiModifier::load(const PlugInModifierLoaderContext &context, const Data::MTI::ShanghaiModifier &data) {
if (data.resetWhen.type != Data::PlugInTypeTaggedValue::kEvent)
return false;
if (!_resetTileSetWhen.load(data.resetWhen.value.asEvent))
return false;
if (data.tileSetVar.type != Data::PlugInTypeTaggedValue::kVariableReference)
return false;
_tileSetRef = VarReference(data.tileSetVar.value.asVarRefGUID, "");
return true;
}
void ShanghaiModifier::linkInternalReferences(ObjectLinkingScope *scope) {
_tileSetRef.linkInternalReferences(scope);
}
void ShanghaiModifier::visitInternalReferences(IStructuralReferenceVisitor *visitor) {
_tileSetRef.visitInternalReferences(visitor);
}
void ShanghaiModifier::resetTiles(Common::RandomSource &rng, uint (&tileFaces)[kNumTiles]) const {
uint possibleFaces[kNumFaces];
uint numPossibleFaces = kNumFaces;
for (uint i = 0; i < kNumFaces; i++)
possibleFaces[i] = i + 1;
uint facesToInsert[kNumTiles / 2];
uint numFacesToInsert = kNumTiles / 2;
// Pick random faces, each one gets inserted twice
for (uint i = 0; i < kNumTiles / 4u; i++) {
uint faceToInsert = selectAndRemoveOne(rng, possibleFaces, numPossibleFaces);
facesToInsert[i * 2 + 0] = faceToInsert;
facesToInsert[i * 2 + 1] = faceToInsert;
}
// We build the board by adding all tiles and then randomly picking 2 exposed tiles and
// assigning them a matching pair. A pair is only valid if the resulting board state has
// valid moves.
BoardState_t boardState = emptyBoardState();
for (uint i = 0; i < kNumTiles; i++)
boardState = boardState | boardStateBit(i);
for (uint pair = 0; pair < kNumTiles / 2u; pair++) {
uint exposedTiles[kNumTiles];
uint numExposedTiles = 0;
for (uint i = 0; i < kNumTiles; i++) {
if (boardState & boardStateBit(i)) {
if (tileIsExposed(boardState, i))
exposedTiles[numExposedTiles++] = i;
}
}
uint firstExposedTile = selectAndRemoveOne(rng, exposedTiles, numExposedTiles);
BoardState_t withFirstRemoved = boardState ^ boardStateBit(firstExposedTile);
uint secondExposedTile = selectAndRemoveOne(rng, exposedTiles, numExposedTiles);
BoardState_t withBothRemoved = withFirstRemoved ^ boardStateBit(secondExposedTile);
if (numExposedTiles > 0) {
// If this isn't the last move, validate that this won't result in a stuck board state (e.g. only one tile exposed)
// If it would result in such a state, pick a different move.
for (;;) {
if (boardStateHasValidMove(withBothRemoved))
break;
if (numExposedTiles == 0) {
error("Shanghai board creation failed, board state was %x, removed %u to produce board state %x", static_cast<uint>(boardState), firstExposedTile, static_cast<uint>(withFirstRemoved));
break;
}
secondExposedTile = selectAndRemoveOne(rng, exposedTiles, numExposedTiles);
withBothRemoved = withFirstRemoved ^ boardStateBit(secondExposedTile);
}
}
boardState = withBothRemoved;
uint faceToInsert = selectAndRemoveOne(rng, facesToInsert, numFacesToInsert);
tileFaces[firstExposedTile] = faceToInsert;
tileFaces[secondExposedTile] = faceToInsert;
debug(2, "Shanghai randomizer: Move %u is %u + %u", pair, firstExposedTile, secondExposedTile);
}
}
uint ShanghaiModifier::selectAndRemoveOne(Common::RandomSource &rng, uint *valuesList, uint &listSize) {
if (listSize == 0) {
error("Internal error: selectAndRemoveOne ran out of values");
return 0;
}
if (listSize == 1) {
listSize = 0;
return valuesList[0];
}
uint selectedIndex = rng.getRandomNumber(listSize - 1);
uint selectedValue = valuesList[selectedIndex];
valuesList[selectedIndex] = valuesList[listSize - 1];
listSize--;
return selectedValue;
}
bool ShanghaiModifier::boardStateHasValidMove(BoardState_t boardState) const {
uint numExposedTiles = 0;
for (uint i = 0; i < kNumTiles; i++) {
if (boardState & boardStateBit(i)) {
if (tileIsExposed(boardState, i)) {
numExposedTiles++;
if (numExposedTiles == 2)
return true;
}
}
}
return false;
}
bool ShanghaiModifier::tileIsExposed(BoardState_t boardState, uint tile) const {
uint tileX = _tileCoordinates[tile].x;
uint tileY = _tileCoordinates[tile].y;
uint tileZ = _tileCoordinates[tile].z;
uint blockMinY = tileY;
uint blockMaxY = tileY;
if (blockMinY > 0)
blockMinY--;
if (blockMaxY < kBoardSizeY - 1u)
blockMaxY++;
bool blockedOnLeft = false;
if (tileX >= 2) {
// Check for left-side blocks
for (uint y = blockMinY; y <= blockMaxY; y++) {
if (tileExistsAtCoordinate(boardState, tileX - 2, y, tileZ)) {
blockedOnLeft = true;
break;
}
}
}
if (blockedOnLeft) {
bool blockedOnRight = false;
// Check for right-side blocks
if (tileX < kBoardSizeX - 2u) {
for (uint y = blockMinY; y <= blockMaxY; y++) {
if (tileExistsAtCoordinate(boardState, tileX + 2, y, tileZ)) {
blockedOnRight = true;
break;
}
}
}
// Tile is blocked on left and right
if (blockedOnRight)
return false;
}
// Check upper blocks
uint blockMinX = tileX;
uint blockMaxX = tileX;
if (blockMinX > 0)
blockMinX--;
if (blockMaxX < kBoardSizeX - 1u)
blockMaxX++;
for (uint z = tileZ + 1; z < kBoardSizeZ; z++) {
for (uint x = blockMinX; x <= blockMaxX; x++) {
for (uint y = blockMinY; y <= blockMaxY; y++) {
if (tileExistsAtCoordinate(boardState, x, y, z))
return false;
}
}
}
return true;
}
bool ShanghaiModifier::tileExistsAtCoordinate(BoardState_t boardState, uint x, uint y, uint z) const {
assert(x < kBoardSizeX);
assert(y < kBoardSizeY);
assert(z < kBoardSizeZ);
int8 tile = _tileAtCoordinate[x][y][z];
if (tile < 0)
return false;
if (boardState & boardStateBit(static_cast<uint>(tile)))
return true;
return false;
}
ShanghaiModifier::BoardState_t ShanghaiModifier::boardStateBit(uint bit) {
return static_cast<BoardState_t>(1) << bit;
}
ShanghaiModifier::BoardState_t ShanghaiModifier::emptyBoardState() {
return 0;
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void ShanghaiModifier::debugInspect(IDebugInspectionReport *report) const {
}
#endif
Common::SharedPtr<Modifier> ShanghaiModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new ShanghaiModifier(*this));
}
const char *ShanghaiModifier::getDefaultName() const {
return "Shanghai Modifier"; // ???
}
class MPEGVideoPlayer : public IPostEffect, public IPlayMediaSignalReceiver {
public:
explicit MPEGVideoPlayer(Runtime *runtime, const Common::SharedPtr<Video::VideoDecoder> &videoDecoder, IMPEGVideoCompletionNotifier *completionNotifier);
~MPEGVideoPlayer();
static Common::SharedPtr<MPEGVideoPlayer> createForVideoID(Runtime *runtime, int videoID, IMPEGVideoCompletionNotifier *completionNotifier);
void playMedia(Runtime *runtime, Project *project) override;
void renderPostEffect(Graphics::ManagedSurface &surface) const override;
private:
Runtime *_runtime;
Project *_project;
IMPEGVideoCompletionNotifier *_completionNotifier;
const Graphics::Surface *_displayingSurface;
Common::SharedPtr<Video::VideoDecoder> _decoder;
Common::SharedPtr<PlayMediaSignaller> _playMediaReceiver;
bool _finished;
};
MPEGVideoPlayer::MPEGVideoPlayer(Runtime *runtime, const Common::SharedPtr<Video::VideoDecoder> &videoDecoder, IMPEGVideoCompletionNotifier *completionNotifier)
: _runtime(runtime), _project(nullptr), _decoder(videoDecoder), _finished(false), _displayingSurface(nullptr), _completionNotifier(completionNotifier) {
_project = runtime->getProject();
runtime->addPostEffect(this);
_playMediaReceiver = _project->notifyOnPlayMedia(this);
}
MPEGVideoPlayer::~MPEGVideoPlayer() {
_playMediaReceiver->removeReceiver(this);
_runtime->removePostEffect(this);
}
Common::SharedPtr<MPEGVideoPlayer> MPEGVideoPlayer::createForVideoID(Runtime *runtime, int videoID, IMPEGVideoCompletionNotifier *completionNotifier) {
#ifdef USE_MPEG2
Common::String videoPath = Common::String::format("video/%i.vob", videoID);
Common::SharedPtr<Video::VideoDecoder> decoder(new Video::MPEGPSDecoder());
if (!decoder->loadFile(Common::Path(videoPath)))
return nullptr;
decoder->start();
return Common::SharedPtr<MPEGVideoPlayer>(new MPEGVideoPlayer(runtime, decoder, completionNotifier));
#else
return nullptr;
#endif
}
void MPEGVideoPlayer::playMedia(Runtime *runtime, Project *project) {
if (_finished)
return;
while (_decoder->getTimeToNextFrame() == 0) {
const Graphics::Surface *newFrame = _decoder->decodeNextFrame();
if (newFrame) {
_displayingSurface = newFrame;
_runtime->setSceneGraphDirty();
} else {
_finished = true;
_displayingSurface = nullptr;
_completionNotifier->onVideoCompleted();
break;
}
}
}
void MPEGVideoPlayer::renderPostEffect(Graphics::ManagedSurface &surface) const {
if (_displayingSurface) {
const Graphics::Surface *surf = _displayingSurface;
Graphics::ManagedSurface *mainWindowSurf = _runtime->getMainWindow().lock()->getSurface().get();
int32 topLeftX = (mainWindowSurf->w - surf->w) / 2;
int32 topLeftY = (mainWindowSurf->h - surf->h) / 2;
Common::Rect fullVideoRect(topLeftX, topLeftY, topLeftX + surf->w, topLeftY + surf->h);
Common::Rect clippedVideoRect = fullVideoRect;
clippedVideoRect.clip(Common::Rect(0, 0, mainWindowSurf->w, mainWindowSurf->h));
Common::Rect videoSrcRect(0, 0, surf->w, surf->h);
videoSrcRect.left += clippedVideoRect.left - fullVideoRect.left;
videoSrcRect.right += clippedVideoRect.right - fullVideoRect.right;
videoSrcRect.top += clippedVideoRect.top - fullVideoRect.top;
videoSrcRect.bottom += clippedVideoRect.bottom - fullVideoRect.bottom;
mainWindowSurf->blitFrom(*surf, videoSrcRect, clippedVideoRect);
}
}
SampleModifier::SampleModifier() : _videoNumber(0), _runtime(nullptr), _isPlaying(false) {
}
SampleModifier::~SampleModifier() {
stopPlaying();
}
bool SampleModifier::respondsToEvent(const Event &evt) const {
return _executeWhen.respondsTo(evt);
}
VThreadState SampleModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
if (_executeWhen.respondsTo(msg->getEvent())) {
_runtime = runtime;
stopPlaying();
_vidPlayer.reset();
_vidPlayer = MPEGVideoPlayer::createForVideoID(runtime, _videoNumber, this);
if (_vidPlayer) {
runtime->addMouseBlocker();
runtime->getMainWindow().lock()->setMouseVisible(false);
runtime->setSceneGraphDirty();
_keySignaller = _runtime->getProject()->notifyOnKeyboardEvent(this);
_isPlaying = true;
} else {
warning("Attempted to play MPEG video %i but player setup failed", static_cast<int>(_videoNumber));
}
return kVThreadReturn;
}
return kVThreadReturn;
}
void SampleModifier::disable(Runtime *runtime) {
stopPlaying();
_vidPlayer.reset();
}
bool SampleModifier::load(const PlugInModifierLoaderContext &context, const Data::MTI::SampleModifier &data) {
if (data.executeWhen.type != Data::PlugInTypeTaggedValue::kEvent)
return false;
if (data.videoNumber.type != Data::PlugInTypeTaggedValue::kInteger)
return false;
_videoNumber = data.videoNumber.value.asInt;
if (!_executeWhen.load(data.executeWhen.value.asEvent))
return false;
return true;
}
void SampleModifier::onVideoCompleted() {
stopPlaying();
}
void SampleModifier::onKeyboardEvent(Runtime *runtime, const KeyboardInputEvent &keyEvt) {
if (keyEvt.getKeyEventType() == Common::EVENT_KEYDOWN && keyEvt.getKeyState().keycode == Common::KEYCODE_SPACE) {
_vidPlayer.reset();
stopPlaying();
}
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void SampleModifier::debugInspect(IDebugInspectionReport *report) const {
}
#endif
Common::SharedPtr<Modifier> SampleModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new SampleModifier(*this));
}
const char *SampleModifier::getDefaultName() const {
return "Sample Modifier";
}
void SampleModifier::stopPlaying() {
if (_isPlaying) {
_runtime->removeMouseBlocker();
_runtime->getMainWindow().lock()->setMouseVisible(true);
_keySignaller->removeReceiver(this);
_isPlaying = false;
}
}
MTIPlugIn::MTIPlugIn()
: _shanghaiModifierFactory(this), _sampleModifierFactory(this) {
}
void MTIPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
registrar->registerPlugInModifier("Shanghai", &_shanghaiModifierFactory);
registrar->registerPlugInModifier("Sample", &_sampleModifierFactory);
}
} // namespace MTI
namespace PlugIns {
Common::SharedPtr<PlugIn> createMTI() {
return Common::SharedPtr<PlugIn>(new MTI::MTIPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,154 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MTI_H
#define MTROPOLIS_PLUGIN_MTI_H
#include "mtropolis/modifier_factory.h"
#include "mtropolis/modifiers.h"
#include "mtropolis/plugin/mti_data.h"
#include "mtropolis/runtime.h"
namespace Common {
class RandomSource;
} // End of namespace Common
namespace MTropolis {
namespace MTI {
class MTIPlugIn;
class ShanghaiModifier : public Modifier {
public:
ShanghaiModifier();
~ShanghaiModifier();
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
bool load(const PlugInModifierLoaderContext &context, const Data::MTI::ShanghaiModifier &data);
void linkInternalReferences(ObjectLinkingScope *scope) override;
void visitInternalReferences(IStructuralReferenceVisitor *visitor) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
const char *debugGetTypeName() const override { return "Shanghai Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
static const uint kNumTiles = 28;
static const uint kNumFaces = 26;
typedef uint32 BoardState_t;
static const uint kBoardSizeX = 13;
static const uint kBoardSizeY = 7;
static const uint kBoardSizeZ = 3;
struct TileCoordinate {
uint x;
uint y;
uint z;
};
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
void resetTiles(Common::RandomSource &rng, uint (&tileFaces)[kNumTiles]) const;
static uint selectAndRemoveOne(Common::RandomSource &rng, uint *valuesList, uint &listSize);
bool boardStateHasValidMove(BoardState_t boardState) const;
bool tileIsExposed(BoardState_t boardState, uint tile) const;
bool tileExistsAtCoordinate(BoardState_t boardState, uint x, uint y, uint z) const;
static BoardState_t boardStateBit(uint bit);
static BoardState_t emptyBoardState();
Event _resetTileSetWhen;
VarReference _tileSetRef;
static TileCoordinate _tileCoordinates[kNumTiles];
int8 _tileAtCoordinate[kBoardSizeX][kBoardSizeY][kBoardSizeZ];
};
class MPEGVideoPlayer;
class IMPEGVideoCompletionNotifier : IInterfaceBase {
public:
virtual void onVideoCompleted() = 0;
};
class SampleModifier : public Modifier, public IMPEGVideoCompletionNotifier, public IKeyboardEventReceiver {
public:
SampleModifier();
~SampleModifier();
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
bool load(const PlugInModifierLoaderContext &context, const Data::MTI::SampleModifier &data);
void onVideoCompleted() override;
void onKeyboardEvent(Runtime *runtime, const KeyboardInputEvent &keyEvt) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Sample Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
void stopPlaying();
Event _executeWhen;
int32 _videoNumber;
Common::SharedPtr<MPEGVideoPlayer> _vidPlayer;
Common::SharedPtr<KeyboardEventSignaller> _keySignaller;
Runtime *_runtime;
bool _isPlaying;
};
class MTIPlugIn : public MTropolis::PlugIn {
public:
MTIPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<ShanghaiModifier, Data::MTI::ShanghaiModifier> _shanghaiModifierFactory;
PlugInModifierFactory<SampleModifier, Data::MTI::SampleModifier> _sampleModifierFactory;
};
} // End of namespace MTI
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,54 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/mti_data.h"
namespace MTropolis {
namespace Data {
namespace MTI {
DataReadErrorCode ShanghaiModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!resetWhen.load(reader) || !tileSetVar.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode SampleModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!executeWhen.load(reader) || !videoNumber.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
} // End of namespace MTI
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,58 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MTI_DATA_H
#define MTROPOLIS_PLUGIN_MTI_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace MTI {
// Known Muppet Treasure Island custom modifiers:
// Shanghai - Shanghai minigame tile randomizer
struct ShanghaiModifier : public PlugInModifierData {
PlugInTypeTaggedValue resetWhen; // Reset When
PlugInTypeTaggedValue tileSetVar; // VarRef
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct SampleModifier : public PlugInModifierData {
PlugInTypeTaggedValue executeWhen;
PlugInTypeTaggedValue videoNumber;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace MTI
} // End of namespace Data
} // End of namespace MTropolis
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,315 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_OBSIDIAN_H
#define MTROPOLIS_PLUGIN_OBSIDIAN_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/obsidian_data.h"
namespace MTropolis {
namespace Obsidian {
class ObsidianPlugIn;
class WordGameData;
class MovementModifier : public Modifier {
public:
MovementModifier();
~MovementModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::MovementModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Movement Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
void triggerMove(Runtime *runtime);
Common::Point _dest;
bool _type;
double _rate;
int32 _frequency;
Event _enableWhen;
Event _disableWhen;
Event _triggerEvent;
Common::Point _moveStartPoint;
uint64 _moveStartTime;
Common::SharedPtr<ScheduledEvent> _moveEvent;
Runtime *_runtime;
};
class RectShiftModifier : public Modifier, public IPostEffect {
public:
RectShiftModifier();
~RectShiftModifier();
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::RectShiftModifier &data);
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
void renderPostEffect(Graphics::ManagedSurface &surface) const override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Rect Shift Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Event _enableWhen;
Event _disableWhen;
int32 _direction;
Runtime *_runtime;
bool _isActive;
};
class TextWorkModifier : public Modifier {
public:
TextWorkModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::TextWorkModifier &data);
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
void disable(Runtime *runtime) override {}
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "TextWork Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
MiniscriptInstructionOutcome scriptSetFirstWord(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetLastWord(MiniscriptThread *thread, const DynamicValue &value);
Common::String _string;
Common::String _token;
// These appear to be 1-based?
int32 _firstChar;
int32 _lastChar;
};
class DictionaryModifier : public Modifier {
public:
DictionaryModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::DictionaryModifier &data);
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
void disable(Runtime *runtime) override {}
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Dictionary Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
void resolveStringIndex();
MiniscriptInstructionOutcome scriptSetString(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetIndex(MiniscriptThread *thread, const DynamicValue &value);
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Common::String _str;
const ObsidianPlugIn *_plugIn;
int32 _index;
bool _isIndexResolved;
};
class WordMixerModifier : public Modifier {
public:
WordMixerModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::WordMixerModifier &data);
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
void disable(Runtime *runtime) override {}
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "WordMixer Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
MiniscriptInstructionOutcome scriptSetInput(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetSearch(MiniscriptThread *thread, const DynamicValue &value);
Common::String _input;
Common::String _output;
int _matches;
int _result;
const ObsidianPlugIn *_plugIn;
};
class XorModModifier : public Modifier {
public:
XorModModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::XorModModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Xor Mod Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Event _enableWhen;
Event _disableWhen;
int32 _shapeID;
};
class XorCheckModifier : public Modifier {
public:
XorCheckModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Obsidian::XorCheckModifier &data);
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
void disable(Runtime *runtime) override {}
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Xor Check Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
MiniscriptInstructionOutcome scriptSetCheckNow(MiniscriptThread *thread, const DynamicValue &value);
static void recursiveFindXorElements(Structural *structural, Common::Array<VisualElement *> &elements);
static bool sliceRectX(const Common::Rect &rect, int32 x, Common::Array<Common::Rect> &outSlices);
static bool sliceRectY(const Common::Rect &rect, int32 y, Common::Array<Common::Rect> &outSlices);
bool _allClear;
};
class ObsidianPlugIn : public MTropolis::PlugIn {
public:
ObsidianPlugIn(const Common::SharedPtr<WordGameData> &wgData);
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
const Common::SharedPtr<WordGameData> &getWordGameData() const;
private:
PlugInModifierFactory<MovementModifier, Data::Obsidian::MovementModifier> _movementModifierFactory;
PlugInModifierFactory<RectShiftModifier, Data::Obsidian::RectShiftModifier> _rectShiftModifierFactory;
PlugInModifierFactory<TextWorkModifier, Data::Obsidian::TextWorkModifier> _textWorkModifierFactory;
PlugInModifierFactory<WordMixerModifier, Data::Obsidian::WordMixerModifier> _wordMixerModifierFactory;
PlugInModifierFactory<DictionaryModifier, Data::Obsidian::DictionaryModifier> _dictionaryModifierFactory;
PlugInModifierFactory<XorModModifier, Data::Obsidian::XorModModifier> _xorModModifierFactory;
PlugInModifierFactory<XorCheckModifier, Data::Obsidian::XorCheckModifier> _xorCheckModifierFactory;
Common::SharedPtr<WordGameData> _wgData;
};
struct WordGameLoadBucket {
uint32 startAddress;
uint32 endAddress;
};
class WordGameData {
public:
struct WordBucket {
WordBucket();
Common::Array<char> _chars;
Common::Array<uint16> _wordIndexes;
uint32 _spacing;
};
struct SortedWord {
SortedWord();
const char *_chars;
uint _length;
};
bool load(Common::SeekableReadStream *stream, const WordGameLoadBucket *buckets, uint numBuckets, uint alignment, bool backwards);
const Common::Array<WordBucket> &getWordBuckets() const;
const Common::Array<SortedWord> &getSortedWords() const;
private:
Common::Array<WordBucket> _buckets;
Common::Array<SortedWord> _sortedWords;
};
} // End of namespace Obsidian
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,114 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/obsidian_data.h"
namespace MTropolis {
namespace Data {
namespace Obsidian {
DataReadErrorCode MovementModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!enableWhen.load(reader)
|| !disableWhen.load(reader)
|| !dest.load(reader)
|| !type.load(reader)
|| !unknown5Point.load(reader)
|| !unknown6Int.load(reader)
|| !rate.load(reader)
|| !frequency.load(reader)
|| !triggerEvent.load(reader)
|| !unknown10Label.load(reader)
|| !unknown11Null.load(reader)
|| !unknown12Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode RectShiftModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!enableWhen.load(reader) || !disableWhen.load(reader) || !direction.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode TextWorkModifier::load(PlugIn& plugIn, const PlugInModifier& prefix, DataReader& reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
return kDataReadErrorNone;
}
DataReadErrorCode WordMixerModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
// Looks like this contains matches, but don't really need them...
if (!reader.skip(prefix.subObjectSize))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode DictionaryModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!str.load(reader) || !index.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode XorModModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!enableWhen.load(reader) || !disableWhen.load(reader) || !shapeID.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode XorCheckModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
} // End of namespace Obsidian
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,110 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_OBSIDIAN_DATA_H
#define MTROPOLIS_PLUGIN_OBSIDIAN_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace Obsidian {
// Known Obsidian custom modifiers:
// Movement - Heat/water effects, "fly" behavior (?)
// rectshift - Heat/water/star effects (?)
// xorCheck - Inspiration realm canvas puzzle
// xorMod - Inspiration realm canvas puzzle
// WordMixer - Bureau realm WordMixer terminal
// Dictionary - Bureau realm file cabinet dictionary
// TextWork - Text manipulation operations
struct MovementModifier : public PlugInModifierData {
PlugInTypeTaggedValue enableWhen; // Event
PlugInTypeTaggedValue disableWhen; // Event
PlugInTypeTaggedValue dest; // Point
PlugInTypeTaggedValue type; // Bool, seems to always be "false"
PlugInTypeTaggedValue unknown5Point; // Point, always (0,0)
PlugInTypeTaggedValue unknown6Int; // Int, always 5
PlugInTypeTaggedValue rate; // Float
PlugInTypeTaggedValue frequency; // Int
PlugInTypeTaggedValue triggerEvent;
PlugInTypeTaggedValue unknown10Label; // Label, always (5,108) which doesn't seem to correspond to anything
PlugInTypeTaggedValue unknown11Null; // Null, possibly message payload
PlugInTypeTaggedValue unknown12Int; // Int, always 3, possibly message flags
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct RectShiftModifier : public PlugInModifierData {
PlugInTypeTaggedValue enableWhen; // Event, enable when
PlugInTypeTaggedValue disableWhen; // Event, disable when
PlugInTypeTaggedValue direction; // Int, 4 = horizontal, 1 = vertical
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct TextWorkModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct DictionaryModifier : public PlugInModifierData {
PlugInTypeTaggedValue str;
PlugInTypeTaggedValue index;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct WordMixerModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct XorModModifier : public PlugInModifierData {
PlugInTypeTaggedValue enableWhen; // Probably "enable when"
PlugInTypeTaggedValue disableWhen; // Probably "disable when"
PlugInTypeTaggedValue shapeID;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct XorCheckModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event; // Probably "enable when"
PlugInTypeTaggedValue unknown2Event; // Probably "disable when"
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace Obsidian
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,159 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/pierian.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace Pierian {
FlattenModifier::FlattenModifier() {
}
FlattenModifier::~FlattenModifier() {
}
bool FlattenModifier::load(const PlugInModifierLoaderContext &context, const Data::Pierian::FlattenModifier &data) {
return true;
}
bool FlattenModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState FlattenModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void FlattenModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void FlattenModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> FlattenModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new FlattenModifier(*this));
}
const char *FlattenModifier::getDefaultName() const {
return "Flatten Modifier"; // ???
}
SaveFileModifier::SaveFileModifier() {
}
SaveFileModifier::~SaveFileModifier() {
}
bool SaveFileModifier::load(const PlugInModifierLoaderContext &context, const Data::Pierian::SaveFileModifier &data) {
return true;
}
bool SaveFileModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState SaveFileModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void SaveFileModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void SaveFileModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> SaveFileModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new SaveFileModifier(*this));
}
const char *SaveFileModifier::getDefaultName() const {
return "mLine Launcher Modifier"; // ???
}
WasteModifier::WasteModifier() {
}
WasteModifier::~WasteModifier() {
}
bool WasteModifier::load(const PlugInModifierLoaderContext &context, const Data::Pierian::WasteModifier &data) {
return true;
}
bool WasteModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState WasteModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void WasteModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void WasteModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> WasteModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new WasteModifier(*this));
}
const char *WasteModifier::getDefaultName() const {
return "mLine Launcher Modifier"; // ???
}
PierianPlugIn::PierianPlugIn()
: _flattenModifierFactory(this)
, _saveFileModifierFactory(this)
, _wasteModifierFactory(this) {
}
PierianPlugIn::~PierianPlugIn() {
}
void PierianPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
registrar->registerPlugInModifier("FlattenMod", &_flattenModifierFactory);
registrar->registerPlugInModifier("SaveFileMod", &_saveFileModifierFactory);
registrar->registerPlugInModifier("WasteMod", &_wasteModifierFactory);
}
} // End of namespace Pierian
namespace PlugIns {
Common::SharedPtr<PlugIn> createPierian() {
return Common::SharedPtr<PlugIn>(new Pierian::PierianPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,117 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_PIERIAN_H
#define MTROPOLIS_PLUGIN_PIERIAN_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/pierian_data.h"
namespace MTropolis {
namespace Pierian {
class FlattenModifier : public Modifier {
public:
FlattenModifier();
~FlattenModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Pierian::FlattenModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Flatten Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class SaveFileModifier : public Modifier {
public:
SaveFileModifier();
~SaveFileModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Pierian::SaveFileModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "SaveFile Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class WasteModifier : public Modifier {
public:
WasteModifier();
~WasteModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Pierian::WasteModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Waste Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class PierianPlugIn : public MTropolis::PlugIn {
public:
PierianPlugIn();
~PierianPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<FlattenModifier, Data::Pierian::FlattenModifier> _flattenModifierFactory;
PlugInModifierFactory<SaveFileModifier, Data::Pierian::SaveFileModifier> _saveFileModifierFactory;
PlugInModifierFactory<WasteModifier, Data::Pierian::WasteModifier> _wasteModifierFactory;
};
} // End of namespace Pierian
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,61 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/pierian_data.h"
namespace MTropolis {
namespace Data {
namespace Pierian {
DataReadErrorCode FlattenModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the Flatten modifier is not implemented.");
return kDataReadErrorNone;
}
DataReadErrorCode SaveFileModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the SaveFile modifier is not implemented.");
return kDataReadErrorNone;
}
DataReadErrorCode WasteModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the Waste modifier is not implemented.");
return kDataReadErrorNone;
}
} // End of namespace Pierian
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,65 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_PIERIAN_DATA_H
#define MTROPOLIS_PLUGIN_PIERIAN_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace Pierian {
// Known Pierian Spring custom modifiers:
// * FlattenMod
// * SaveFileMod
// * WasteMod: A wrapper around the "TE Edit Control" text editor widget
//
struct WasteModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct SaveFileModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct FlattenModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace Pierian
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,85 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/rwc.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace RWC {
ThighBlasterModifier::ThighBlasterModifier() {
}
ThighBlasterModifier::~ThighBlasterModifier() {
}
bool ThighBlasterModifier::load(const PlugInModifierLoaderContext &context, const Data::RWC::ThighBlasterModifier &data) {
return true;
}
bool ThighBlasterModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState ThighBlasterModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void ThighBlasterModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void ThighBlasterModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> ThighBlasterModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new ThighBlasterModifier(*this));
}
const char *ThighBlasterModifier::getDefaultName() const {
return "ThighBlaster Modifier"; // ???
}
RWCPlugIn::RWCPlugIn()
: _thighBlasterModifierFactory(this) {
}
RWCPlugIn::~RWCPlugIn() {
}
void RWCPlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
registrar->registerPlugInModifier("ThighBlaster", &_thighBlasterModifierFactory);
}
} // End of namespace RWC
namespace PlugIns {
Common::SharedPtr<PlugIn> createRWC() {
return Common::SharedPtr<PlugIn>(new RWC::RWCPlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,71 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_RWC_H
#define MTROPOLIS_PLUGIN_RWC_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/rwc_data.h"
namespace MTropolis {
namespace RWC {
class ThighBlasterModifier : public Modifier {
public:
ThighBlasterModifier();
~ThighBlasterModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::RWC::ThighBlasterModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "ThighBlaster Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class RWCPlugIn : public MTropolis::PlugIn {
public:
RWCPlugIn();
~RWCPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<ThighBlasterModifier, Data::RWC::ThighBlasterModifier> _thighBlasterModifierFactory;
};
} // End of namespace RWC
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,44 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/rwc_data.h"
namespace MTropolis {
namespace Data {
namespace RWC {
DataReadErrorCode ThighBlasterModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
} // End of namespace RWC
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,52 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_MLINE_DATA_H
#define MTROPOLIS_PLUGIN_MLINE_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace RWC {
// Known Real Wild Child! Australian Rock Music 1950s-90s custom modifiers:
// - Invalidate
// - Ripple
// - Spraycan
// - ThighBlaster
struct ThighBlasterModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace RWC
} // End of namespace Data
} // End of namespace MTropolis
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,502 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_STANDARD_H
#define MTROPOLIS_PLUGIN_STANDARD_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/standard_data.h"
namespace MTropolis {
class Runtime;
namespace Standard {
class StandardPlugIn;
class CursorModifier : public Modifier {
public:
CursorModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::CursorModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Cursor Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Event _applyWhen;
Event _removeWhen;
uint32 _cursorID;
};
// This appears to be basically a duplicate of scene transition modifier, except unlike that,
// its parameters are controllable via script, and the duration scaling appears to be different
// (probably 600000 max rate instead of 6000000)
class STransCtModifier : public Modifier {
public:
static const int32 kMaxDuration = 600000;
STransCtModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::STransCtModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "STransCt Scene Transition Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
MiniscriptInstructionOutcome scriptSetRate(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetSteps(MiniscriptThread *thread, const DynamicValue &value);
Event _enableWhen;
Event _disableWhen;
int32 _transitionType;
int32 _transitionDirection;
int32 _steps;
int32 _duration;
bool _fullScreen;
};
class MediaCueMessengerModifier : public Modifier, public IMediaCueModifier {
public:
MediaCueMessengerModifier();
~MediaCueMessengerModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::MediaCueMessengerModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
Modifier *getMediaCueModifier() override;
Common::WeakPtr<Modifier> getMediaCueTriggerSource() const override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Media Cue Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
#endif
private:
enum CueSourceType {
kCueSourceInteger,
kCueSourceIntegerRange,
kCueSourceVariableReference,
kCueSourceLabel,
kCueSourceString,
kCueSourceInvalid = -1,
};
union CueSourceUnion {
CueSourceUnion();
~CueSourceUnion();
int32 asInt;
IntRange asIntRange;
uint32 asVarRefGUID;
Label asLabel;
uint64 asUnset;
Common::String asString;
template<class T, T (CueSourceUnion::*TMember)>
void construct(const T &value);
template<class T, T(CueSourceUnion::*TMember)>
void destruct();
};
MediaCueMessengerModifier(const MediaCueMessengerModifier &other);
void destructCueSource();
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
void linkInternalReferences(ObjectLinkingScope *scope) override;
void visitInternalReferences(IStructuralReferenceVisitor *visitor) override;
CueSourceType _cueSourceType;
CueSourceUnion _cueSource;
Common::WeakPtr<Modifier> _cueSourceModifier;
Event _enableWhen;
Event _disableWhen;
MediaCueState _mediaCue;
bool _isActive;
};
class ObjectReferenceVariableModifier : public VariableModifier {
public:
ObjectReferenceVariableModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::ObjectReferenceVariableModifier &data);
bool varSetValue(MiniscriptThread *thread, const DynamicValue &value) override;
void varGetValue(DynamicValue &dest) const override;
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Object Reference Variable Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
struct ObjectWriteInterface {
static MiniscriptInstructionOutcome write(MiniscriptThread *thread, const DynamicValue &dest, void *objectRef, uintptr ptrOrOffset);
static MiniscriptInstructionOutcome refAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib);
static MiniscriptInstructionOutcome refAttribIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib, const DynamicValue &index);
};
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
MiniscriptInstructionOutcome scriptSetPath(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptSetObject(MiniscriptThread *thread, const DynamicValue &value);
MiniscriptInstructionOutcome scriptObjectRefAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, const Common::String &attrib);
MiniscriptInstructionOutcome scriptObjectRefAttribIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, const Common::String &attrib, const DynamicValue &index);
void resolve(Runtime *runtime);
void resolveRelativePath(Runtime *runtime, RuntimeObject *obj, const Common::String &path, size_t startPos);
void resolveAbsolutePath(Runtime *runtime);
static bool computeObjectPath(RuntimeObject *obj, Common::String &outPath);
static RuntimeObject *getObjectParent(RuntimeObject *obj);
Event _setToSourceParentWhen;
};
class ObjectReferenceVariableStorage : public VariableStorage {
public:
friend class ObjectReferenceVariableModifier;
ObjectReferenceVariableStorage();
Common::SharedPtr<ModifierSaveLoad> getSaveLoad(Runtime *runtime) override;
Common::SharedPtr<VariableStorage> clone() const override;
private:
class SaveLoad : public ModifierSaveLoad {
public:
explicit SaveLoad(ObjectReferenceVariableStorage *storage);
private:
void commitLoad() const override;
void saveInternal(Common::WriteStream *stream) const override;
bool loadInternal(Common::ReadStream *stream, uint32 saveFileVersion) override;
ObjectReferenceVariableStorage *_storage;
Common::String _objectPath;
};
Common::String _fullPath;
Common::String _objectPath;
mutable ObjectReference _object;
};
class ListVariableStorage : public VariableStorage {
public:
friend class ListVariableModifier;
ListVariableStorage();
Common::SharedPtr<ModifierSaveLoad> getSaveLoad(Runtime *runtime) override;
Common::SharedPtr<VariableStorage> clone() const override;
private:
class SaveLoad : public ModifierSaveLoad {
public:
explicit SaveLoad(ListVariableStorage *storage);
private:
void commitLoad() const override;
void saveInternal(Common::WriteStream *stream) const override;
bool loadInternal(Common::ReadStream *stream, uint32 saveFileVersion) override;
static void recursiveWriteList(DynamicList *list, Common::WriteStream *stream);
static Common::SharedPtr<DynamicList> recursiveReadList(Common::ReadStream *stream);
ListVariableStorage *_storage;
Common::SharedPtr<DynamicList> _list;
};
Common::SharedPtr<DynamicList> _list;
DynamicValueTypes::DynamicValueType _preferredContentType;
};
class ListVariableModifier : public VariableModifier {
public:
ListVariableModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::ListVariableModifier &data);
bool varSetValue(MiniscriptThread *thread, const DynamicValue &value) override;
void varGetValue(DynamicValue &dest) const override;
bool isListVariable() const override;
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
bool readAttributeIndexed(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib, const DynamicValue &index) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &writeProxy, const Common::String &attrib) override;
MiniscriptInstructionOutcome writeRefAttributeIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &writeProxy, const Common::String &attrib, const DynamicValue &index) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "List Variable Modifier"; }
SupportStatus debugGetSupportStatus() const override { return kSupportStatusDone; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
MiniscriptInstructionOutcome scriptSetCount(MiniscriptThread *thread, const DynamicValue &value);
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class SysInfoModifier : public Modifier {
public:
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::SysInfoModifier &data);
bool readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) override;
void disable(Runtime *runtime) override {}
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "System Info Modifier"; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
struct StandardPlugInHacks {
StandardPlugInHacks();
// If list mod values are illegible, just ignore them and flag it as garbled.
// Necessary to load object 00788ab9 (olL437Check) in Obsidian, which is supposed to be a list of
// 4 lists that are 3-size each, in the persistent data, but actually contains 4 identical values
// that appear to be garbage.
bool allowGarbledListModData;
};
class PanningModifier : public Modifier {
public:
PanningModifier();
~PanningModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::PanningModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Panning Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class FadeModifier : public Modifier {
public:
FadeModifier();
~FadeModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::FadeModifier &data);
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Fade Modifier"; }
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class PrintModifier : public Modifier {
public:
PrintModifier();
~PrintModifier();
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
MiniscriptInstructionOutcome writeRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &writeProxy, const Common::String &attrib) override;
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::PrintModifier &data);
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Print Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Event _executeWhen;
Common::String _filePath;
};
class NavigateModifier : public Modifier {
public:
NavigateModifier();
~NavigateModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::NavigateModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Navigate Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class OpenTitleModifier : public Modifier {
public:
OpenTitleModifier();
~OpenTitleModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::OpenTitleModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Open Title Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Event _executeWhen;
Common::String _pathOrUrl;
bool _addToReturnList;
};
class OpenAppModifier : public Modifier {
public:
OpenAppModifier();
~OpenAppModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::OpenAppModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Open App Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
Event _executeWhen;
Common::String _pathOrUrl;
bool _addToReturnList;
};
class StandardPlugIn : public MTropolis::PlugIn {
public:
StandardPlugIn();
~StandardPlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
const StandardPlugInHacks &getHacks() const;
StandardPlugInHacks &getHacks();
private:
PlugInModifierFactory<CursorModifier, Data::Standard::CursorModifier> _cursorModifierFactory;
PlugInModifierFactory<STransCtModifier, Data::Standard::STransCtModifier> _sTransCtModifierFactory;
PlugInModifierFactory<MediaCueMessengerModifier, Data::Standard::MediaCueMessengerModifier> _mediaCueModifierFactory;
PlugInModifierFactory<ObjectReferenceVariableModifier, Data::Standard::ObjectReferenceVariableModifier> _objRefVarModifierFactory;
PlugInModifierFactory<ListVariableModifier, Data::Standard::ListVariableModifier> _listVarModifierFactory;
PlugInModifierFactory<SysInfoModifier, Data::Standard::SysInfoModifier> _sysInfoModifierFactory;
PlugInModifierFactory<PanningModifier, Data::Standard::PanningModifier> _panningModifierFactory;
PlugInModifierFactory<FadeModifier, Data::Standard::FadeModifier> _fadeModifierFactory;
PlugInModifierFactory<PrintModifier, Data::Standard::PrintModifier> _printModifierFactory;
PlugInModifierFactory<NavigateModifier, Data::Standard::NavigateModifier> _navigateModifierFactory;
PlugInModifierFactory<OpenTitleModifier, Data::Standard::OpenTitleModifier> _openTitleModifierFactory;
PlugInModifierFactory<OpenAppModifier, Data::Standard::OpenAppModifier> _openAppModifierFactory;
StandardPlugInHacks _hacks;
};
} // End of namespace Standard
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,248 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/standard_data.h"
#include "mtropolis/plugin/standard.h"
namespace MTropolis {
namespace Data {
namespace Standard {
CursorModifier::CursorModifier() : haveRemoveWhen(false) {
}
DataReadErrorCode CursorModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0 && prefix.plugInRevision != 1 && prefix.plugInRevision != 2)
return kDataReadErrorUnsupportedRevision;
if (!applyWhen.load(reader))
return kDataReadErrorReadFailed;
if (prefix.plugInRevision >= 1) {
if (!removeWhen.load(reader))
return kDataReadErrorReadFailed;
haveRemoveWhen = true;
} else {
removeWhen.type = PlugInTypeTaggedValue::kNull;
haveRemoveWhen = false;
}
if (!cursorIDAsLabel.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode STransCtModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!enableWhen.load(reader) || !disableWhen.load(reader) || !transitionType.load(reader) ||
!transitionDirection.load(reader) || !unknown1.load(reader) || !steps.load(reader) ||
!duration.load(reader) || !fullScreen.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
MediaCueMessengerModifier::MediaCueMessengerModifier()
: unknown1(0), destination(0), unknown2(0) {
}
DataReadErrorCode MediaCueMessengerModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!enableWhen.load(reader) || !disableWhen.load(reader) || !sendEvent.load(reader)
|| !nonStandardMessageFlags.load(reader) || !reader.readU16(unknown1) || !reader.readU32(destination)
|| !reader.readU32(unknown2) || !with.load(reader) || !executeAt.load(reader)
|| !triggerTiming.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode ObjectReferenceVariableModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0 && prefix.plugInRevision != 2)
return kDataReadErrorUnsupportedRevision;
if (!setToSourceParentWhen.load(reader))
return kDataReadErrorReadFailed;
if (prefix.plugInRevision == 0) {
unknown1.type = Data::PlugInTypeTaggedValue::kNull;
if (!objectPath.load(reader))
return kDataReadErrorReadFailed;
} else {
if (!unknown1.load(reader))
return kDataReadErrorReadFailed;
bool hasNoPath = (unknown1.type == Data::PlugInTypeTaggedValue::kInteger && unknown1.value.asInt == 0);
if (hasNoPath)
objectPath.type = Data::PlugInTypeTaggedValue::kNull;
else if (!objectPath.load(reader))
return kDataReadErrorReadFailed;
}
return kDataReadErrorNone;
}
ListVariableModifier::ListVariableModifier() : unknown1(0), contentsType(0), unknown2{0, 0, 0, 0},
havePersistentData(false), numValues(0), values(nullptr), persistentValuesGarbled(false) {
}
ListVariableModifier::~ListVariableModifier() {
if (values)
delete[] values;
}
DataReadErrorCode ListVariableModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision < 1 || prefix.plugInRevision > 3)
return kDataReadErrorUnsupportedRevision;
int64 privateDataPos = reader.tell();
if (!reader.readU16(unknown1) || !reader.readU32(contentsType) || !reader.readBytes(unknown2))
return kDataReadErrorReadFailed;
persistentValuesGarbled = false;
if (prefix.plugInRevision == 1 || prefix.plugInRevision == 3) {
if (prefix.plugInRevision == 1) {
havePersistentData = true;
} else if (prefix.plugInRevision == 3) {
PlugInTypeTaggedValue persistentFlag;
if (!persistentFlag.load(reader) || persistentFlag.type != PlugInTypeTaggedValue::kBoolean)
return kDataReadErrorReadFailed;
havePersistentData = (persistentFlag.value.asBoolean != 0);
}
if (havePersistentData) {
PlugInTypeTaggedValue numValuesVar;
if (!numValuesVar.load(reader) || numValuesVar.type != PlugInTypeTaggedValue::kInteger || numValuesVar.value.asInt < 0)
return kDataReadErrorReadFailed;
numValues = static_cast<uint32>(numValuesVar.value.asInt);
values = new PlugInTypeTaggedValue[numValues];
for (size_t i = 0; i < numValues; i++) {
if (!values[i].load(reader)) {
if (static_cast<const MTropolis::Standard::StandardPlugIn &>(plugIn).getHacks().allowGarbledListModData) {
persistentValuesGarbled = true;
if (!reader.seek(privateDataPos + prefix.subObjectSize))
return kDataReadErrorReadFailed;
break;
} else {
return kDataReadErrorReadFailed;
}
}
}
} else {
numValues = 0;
values = nullptr;
}
} else {
havePersistentData = false;
numValues = 0;
values = nullptr;
}
return kDataReadErrorNone;
}
DataReadErrorCode PanningModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 3)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Int.load(reader) || !unknown4Int.load(reader) || !unknown5Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode SysInfoModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
return kDataReadErrorNone;
}
DataReadErrorCode FadeModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Int.load(reader) || !unknown4Int.load(reader) || !unknown5Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode PrintModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!executeWhen.load(reader) || !unknown1Bool.load(reader) || !unknown2Bool.load(reader) ||
!unknown3Bool.load(reader) || !filePath.load(reader) || !unknown4Bool.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode NavigateModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the Navigate modifier is not implemented.");
return kDataReadErrorNone;
}
DataReadErrorCode OpenTitleModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!executeWhen.load(reader) || !pathOrUrl.load(reader) || !addToReturnList.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode OpenAppModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Null.load(reader) || !unknown2Null.load(reader) || !unknown3Event.load(reader) || !unknown4String.load(reader))
return kDataReadErrorReadFailed;
if (!unknown5Integer.load(reader) || !unknown6Integer.load(reader) || !unknown7Bool.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
} // End of namespace Standard
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,200 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_STANDARD_DATA_H
#define MTROPOLIS_PLUGIN_STANDARD_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace Standard {
struct CursorModifier : public PlugInModifierData {
CursorModifier();
bool haveRemoveWhen;
PlugInTypeTaggedValue applyWhen;
PlugInTypeTaggedValue removeWhen;
PlugInTypeTaggedValue cursorIDAsLabel;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct STransCtModifier : public PlugInModifierData {
PlugInTypeTaggedValue enableWhen; // Event
PlugInTypeTaggedValue disableWhen; // Event
PlugInTypeTaggedValue transitionType; // int
PlugInTypeTaggedValue transitionDirection; // int
PlugInTypeTaggedValue unknown1; // int, seems to always be 1
PlugInTypeTaggedValue steps; // int, seems to always be 32
PlugInTypeTaggedValue duration; // int, always observed as 60000
PlugInTypeTaggedValue fullScreen; // bool
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct MediaCueMessengerModifier : public PlugInModifierData {
enum MessageFlags {
kMessageFlagImmediate = 0x1,
kMessageFlagCascade = 0x2,
kMessageFlagRelay = 0x4,
};
enum TriggerTiming {
kTriggerTimingStart = 0,
kTriggerTimingDuring = 1,
kTriggerTimingEnd = 2,
};
MediaCueMessengerModifier();
PlugInTypeTaggedValue enableWhen;
PlugInTypeTaggedValue disableWhen;
PlugInTypeTaggedValue sendEvent;
PlugInTypeTaggedValue nonStandardMessageFlags; // int type, non-standard
uint16 unknown1;
uint32 destination;
uint32 unknown2;
PlugInTypeTaggedValue with;
PlugInTypeTaggedValue executeAt; // May validly be a label, variable, integer, or integer range
PlugInTypeTaggedValue triggerTiming; // int type
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct ObjectReferenceVariableModifier : public PlugInModifierData {
PlugInTypeTaggedValue setToSourceParentWhen;
PlugInTypeTaggedValue unknown1;
PlugInTypeTaggedValue objectPath;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct ListVariableModifier : public PlugInModifierData {
enum ContentsType {
kContentsTypeInteger = 1,
kContentsTypePoint = 2,
kContentsTypeRange = 3,
kContentsTypeFloat = 4,
kContentsTypeString = 5,
kContentsTypeObject = 6,
kContentsTypeVector = 8,
kContentsTypeBoolean = 9,
};
ListVariableModifier();
~ListVariableModifier();
uint16 unknown1;
uint32 contentsType;
uint8 unknown2[4];
bool havePersistentData;
uint32 numValues;
PlugInTypeTaggedValue *values;
bool persistentValuesGarbled;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct SysInfoModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct PanningModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event; // Probably "Enable When"
PlugInTypeTaggedValue unknown2Event; // Probably "Disable When"
PlugInTypeTaggedValue unknown3Int; // Int
PlugInTypeTaggedValue unknown4Int; // Int
PlugInTypeTaggedValue unknown5Int; // Int
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct FadeModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event; // Probably "Enable When"
PlugInTypeTaggedValue unknown2Event; // Probably "Disable When"
PlugInTypeTaggedValue unknown3Int; // Int
PlugInTypeTaggedValue unknown4Int; // Int
PlugInTypeTaggedValue unknown5Int; // Int
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct PrintModifier : public PlugInModifierData {
PlugInTypeTaggedValue executeWhen;
PlugInTypeTaggedValue unknown1Bool;
PlugInTypeTaggedValue unknown2Bool;
PlugInTypeTaggedValue unknown3Bool;
PlugInTypeTaggedValue filePath;
PlugInTypeTaggedValue unknown4Bool;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct NavigateModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct OpenTitleModifier : public PlugInModifierData {
PlugInTypeTaggedValue executeWhen;
PlugInTypeTaggedValue pathOrUrl;
PlugInTypeTaggedValue addToReturnList;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct OpenAppModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Null;
PlugInTypeTaggedValue unknown2Null;
PlugInTypeTaggedValue unknown3Event;
PlugInTypeTaggedValue unknown4String;
PlugInTypeTaggedValue unknown5Integer;
PlugInTypeTaggedValue unknown6Integer;
PlugInTypeTaggedValue unknown7Bool;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace Standard
} // End of namespace Data
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,542 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/thereware.h"
#include "mtropolis/plugins.h"
namespace MTropolis {
namespace Thereware {
RotatorModifier::RotatorModifier() {
}
RotatorModifier::~RotatorModifier() {
}
bool RotatorModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::RotatorModifier &data) {
return true;
}
bool RotatorModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState RotatorModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void RotatorModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void RotatorModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> RotatorModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new RotatorModifier(*this));
}
const char *RotatorModifier::getDefaultName() const {
return "Rotator Modifier"; // ???
}
TrackerModifier::TrackerModifier() {
}
TrackerModifier::~TrackerModifier() {
}
bool TrackerModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::TrackerModifier &data) {
return true;
}
bool TrackerModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState TrackerModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void TrackerModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void TrackerModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> TrackerModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new TrackerModifier(*this));
}
const char *TrackerModifier::getDefaultName() const {
return "Tracker Modifier"; // ???
}
DoubleClickModifier::DoubleClickModifier() {
}
DoubleClickModifier::~DoubleClickModifier() {
}
bool DoubleClickModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::DoubleClickModifier &data) {
return true;
}
bool DoubleClickModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState DoubleClickModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void DoubleClickModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void DoubleClickModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> DoubleClickModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new DoubleClickModifier(*this));
}
const char *DoubleClickModifier::getDefaultName() const {
return "DoubleClick Modifier"; // ???
}
MouseTrapModifier::MouseTrapModifier() {
}
MouseTrapModifier::~MouseTrapModifier() {
}
bool MouseTrapModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::MouseTrapModifier &data) {
return true;
}
bool MouseTrapModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState MouseTrapModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void MouseTrapModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void MouseTrapModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> MouseTrapModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new MouseTrapModifier(*this));
}
const char *MouseTrapModifier::getDefaultName() const {
return "MouseTrap Modifier"; // ???
}
WrapAroundModifier::WrapAroundModifier() {
}
WrapAroundModifier::~WrapAroundModifier() {
}
bool WrapAroundModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::WrapAroundModifier &data) {
return true;
}
bool WrapAroundModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState WrapAroundModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void WrapAroundModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void WrapAroundModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> WrapAroundModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new WrapAroundModifier(*this));
}
const char *WrapAroundModifier::getDefaultName() const {
return "WrapAround Modifier"; // ???
}
EasyScrollerModifier::EasyScrollerModifier() {
}
EasyScrollerModifier::~EasyScrollerModifier() {
}
bool EasyScrollerModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::EasyScrollerModifier &data) {
return true;
}
bool EasyScrollerModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState EasyScrollerModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void EasyScrollerModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void EasyScrollerModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> EasyScrollerModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new EasyScrollerModifier(*this));
}
const char *EasyScrollerModifier::getDefaultName() const {
return "EasyScroller Modifier"; // ???
}
GoThereModifier::GoThereModifier() {
}
GoThereModifier::~GoThereModifier() {
}
bool GoThereModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::GoThereModifier &data) {
return true;
}
bool GoThereModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState GoThereModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void GoThereModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void GoThereModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> GoThereModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new GoThereModifier(*this));
}
const char *GoThereModifier::getDefaultName() const {
return "GoThere Modifier"; // ???
}
RandomizerModifier::RandomizerModifier() {
}
RandomizerModifier::~RandomizerModifier() {
}
bool RandomizerModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::RandomizerModifier &data) {
return true;
}
bool RandomizerModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState RandomizerModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void RandomizerModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void RandomizerModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> RandomizerModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new RandomizerModifier(*this));
}
const char *RandomizerModifier::getDefaultName() const {
return "Randomizer Modifier"; // ???
}
TimeLoopModifier::TimeLoopModifier() {
}
TimeLoopModifier::~TimeLoopModifier() {
}
bool TimeLoopModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::TimeLoopModifier &data) {
return true;
}
bool TimeLoopModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState TimeLoopModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void TimeLoopModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void TimeLoopModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> TimeLoopModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new TimeLoopModifier(*this));
}
const char *TimeLoopModifier::getDefaultName() const {
return "TimeLoop Modifier"; // ???
}
ConductorModifier::ConductorModifier() {
}
ConductorModifier::~ConductorModifier() {
}
bool ConductorModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::ConductorModifier &data) {
return true;
}
bool ConductorModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState ConductorModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void ConductorModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void ConductorModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> ConductorModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new ConductorModifier(*this));
}
const char *ConductorModifier::getDefaultName() const {
return "Conductor Modifier"; // ???
}
AlphaMaticModifier::AlphaMaticModifier() {
}
AlphaMaticModifier::~AlphaMaticModifier() {
}
bool AlphaMaticModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::AlphaMaticModifier &data) {
return true;
}
bool AlphaMaticModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState AlphaMaticModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void AlphaMaticModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void AlphaMaticModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> AlphaMaticModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new AlphaMaticModifier(*this));
}
const char *AlphaMaticModifier::getDefaultName() const {
return "AlphaMatic Modifier"; // ???
}
HotTextModifier::HotTextModifier() {
}
HotTextModifier::~HotTextModifier() {
}
bool HotTextModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::HotTextModifier &data) {
return true;
}
bool HotTextModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState HotTextModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void HotTextModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void HotTextModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> HotTextModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new HotTextModifier(*this));
}
const char *HotTextModifier::getDefaultName() const {
return "HotText Modifier"; // ???
}
KeyScrollModifier::KeyScrollModifier() {
}
KeyScrollModifier::~KeyScrollModifier() {
}
bool KeyScrollModifier::load(const PlugInModifierLoaderContext &context, const Data::Thereware::KeyScrollModifier &data) {
return true;
}
bool KeyScrollModifier::respondsToEvent(const Event &evt) const {
return false;
}
VThreadState KeyScrollModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
return kVThreadReturn;
}
void KeyScrollModifier::disable(Runtime *runtime) {
}
#ifdef MTROPOLIS_DEBUG_ENABLE
void KeyScrollModifier::debugInspect(IDebugInspectionReport *report) const {
Modifier::debugInspect(report);
}
#endif
Common::SharedPtr<Modifier> KeyScrollModifier::shallowClone() const {
return Common::SharedPtr<Modifier>(new KeyScrollModifier(*this));
}
const char *KeyScrollModifier::getDefaultName() const {
return "KeyScroll Modifier"; // ???
}
TherewarePlugIn::TherewarePlugIn()
: _conductorModifierFactory(this)
, _alphaMaticModifierFactory(this)
, _rotatorModifierFactory(this)
, _trackerModifierFactory(this)
, _doubleClickModifierFactory(this)
, _mouseTrapModifierFactory(this)
, _wrapAroundModifierFactory(this)
, _easyScrollerModifierFactory(this)
, _goThereModifierFactory(this)
, _randomizerModifierFactory(this)
, _timeLoopModifierFactory(this)
, _hotTextModifierFactory(this)
, _keyScrollModifierFactory(this) {
}
TherewarePlugIn::~TherewarePlugIn() {
}
void TherewarePlugIn::registerModifiers(IPlugInModifierRegistrar *registrar) const {
//Alpha Kit
registrar->registerPlugInModifier("AlphaMatic", &_alphaMaticModifierFactory);
//Rotator Kit
registrar->registerPlugInModifier("Rotator", &_rotatorModifierFactory);
registrar->registerPlugInModifier("Tracker", &_trackerModifierFactory);
//Mercury Kit
registrar->registerPlugInModifier("DoubleClick", &_doubleClickModifierFactory);
registrar->registerPlugInModifier("MouseTrap", &_mouseTrapModifierFactory);
registrar->registerPlugInModifier("TimeLoop", &_timeLoopModifierFactory);
//WrapAround Kit
registrar->registerPlugInModifier("WrapAround", &_wrapAroundModifierFactory);
registrar->registerPlugInModifier("EasyScroller", &_easyScrollerModifierFactory);
//FixIt Kit
registrar->registerPlugInModifier("GoThere", &_goThereModifierFactory);
//Quick Kit
registrar->registerPlugInModifier("Randomizer", &_randomizerModifierFactory);
registrar->registerPlugInModifier("Conductor", &_conductorModifierFactory);
//HotText Kit
registrar->registerPlugInModifier("HotText", &_hotTextModifierFactory);
registrar->registerPlugInModifier("KeyScroll", &_keyScrollModifierFactory);
}
} // End of namespace Thereware
namespace PlugIns {
Common::SharedPtr<PlugIn> createThereware() {
return Common::SharedPtr<PlugIn>(new Thereware::TherewarePlugIn());
}
} // End of namespace PlugIns
} // End of namespace MTropolis

View File

@@ -0,0 +1,348 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_THEREWARE_H
#define MTROPOLIS_PLUGIN_THEREWARE_H
#include "mtropolis/modifiers.h"
#include "mtropolis/modifier_factory.h"
#include "mtropolis/runtime.h"
#include "mtropolis/plugin/thereware_data.h"
namespace MTropolis {
namespace Thereware {
class ConductorModifier : public Modifier {
public:
ConductorModifier();
~ConductorModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::ConductorModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Conductor Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class AlphaMaticModifier : public Modifier {
public:
AlphaMaticModifier();
~AlphaMaticModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::AlphaMaticModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "AlphaMatic Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class RotatorModifier : public Modifier {
public:
RotatorModifier();
~RotatorModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::RotatorModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Rotator Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class TrackerModifier : public Modifier {
public:
TrackerModifier();
~TrackerModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::TrackerModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Tracker Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class MouseTrapModifier : public Modifier {
public:
MouseTrapModifier();
~MouseTrapModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::MouseTrapModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "MouseTrap Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class DoubleClickModifier : public Modifier {
public:
DoubleClickModifier();
~DoubleClickModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::DoubleClickModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "DoubleClick Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class WrapAroundModifier : public Modifier {
public:
WrapAroundModifier();
~WrapAroundModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::WrapAroundModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "WrapAround Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class EasyScrollerModifier : public Modifier {
public:
EasyScrollerModifier();
~EasyScrollerModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::EasyScrollerModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "EasyScroller Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class GoThereModifier : public Modifier {
public:
GoThereModifier();
~GoThereModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::GoThereModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "GoThere Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class RandomizerModifier : public Modifier {
public:
RandomizerModifier();
~RandomizerModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::RandomizerModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "Randomizer Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class TimeLoopModifier : public Modifier {
public:
TimeLoopModifier();
~TimeLoopModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::TimeLoopModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "TimeLoop Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class HotTextModifier : public Modifier {
public:
HotTextModifier();
~HotTextModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::HotTextModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "HotText Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class KeyScrollModifier : public Modifier {
public:
KeyScrollModifier();
~KeyScrollModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Thereware::KeyScrollModifier &data);
bool respondsToEvent(const Event &evt) const override;
VThreadState consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) override;
void disable(Runtime *runtime) override;
#ifdef MTROPOLIS_DEBUG_ENABLE
const char *debugGetTypeName() const override { return "KeyScroll Modifier"; }
void debugInspect(IDebugInspectionReport *report) const override;
#endif
private:
Common::SharedPtr<Modifier> shallowClone() const override;
const char *getDefaultName() const override;
};
class TherewarePlugIn : public MTropolis::PlugIn {
public:
TherewarePlugIn();
~TherewarePlugIn();
void registerModifiers(IPlugInModifierRegistrar *registrar) const override;
private:
PlugInModifierFactory<ConductorModifier, Data::Thereware::ConductorModifier> _conductorModifierFactory;
PlugInModifierFactory<AlphaMaticModifier, Data::Thereware::AlphaMaticModifier> _alphaMaticModifierFactory;
PlugInModifierFactory<RotatorModifier, Data::Thereware::RotatorModifier> _rotatorModifierFactory;
PlugInModifierFactory<TrackerModifier, Data::Thereware::TrackerModifier> _trackerModifierFactory;
PlugInModifierFactory<DoubleClickModifier, Data::Thereware::DoubleClickModifier> _doubleClickModifierFactory;
PlugInModifierFactory<MouseTrapModifier, Data::Thereware::MouseTrapModifier> _mouseTrapModifierFactory;
PlugInModifierFactory<WrapAroundModifier, Data::Thereware::WrapAroundModifier> _wrapAroundModifierFactory;
PlugInModifierFactory<EasyScrollerModifier, Data::Thereware::EasyScrollerModifier> _easyScrollerModifierFactory;
PlugInModifierFactory<GoThereModifier, Data::Thereware::GoThereModifier> _goThereModifierFactory;
PlugInModifierFactory<RandomizerModifier, Data::Thereware::RandomizerModifier> _randomizerModifierFactory;
PlugInModifierFactory<TimeLoopModifier, Data::Thereware::TimeLoopModifier> _timeLoopModifierFactory;
PlugInModifierFactory<HotTextModifier, Data::Thereware::HotTextModifier> _hotTextModifierFactory;
PlugInModifierFactory<KeyScrollModifier, Data::Thereware::KeyScrollModifier> _keyScrollModifierFactory;
};
} // End of namespace Thereware
} // End of namespace MTropolis
#endif

View File

@@ -0,0 +1,201 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "mtropolis/plugin/thereware_data.h"
namespace MTropolis {
namespace Data {
namespace Thereware {
DataReadErrorCode RotatorModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Bool.load(reader) || !unknown4Int.load(reader) || !unknown5Float.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Bool.load(reader) || !unknown7Point.load(reader) || !unknown8Int.load(reader) || !unknown9Bool.load(reader) || !unknown10Int.load(reader))
return kDataReadErrorReadFailed;
if (!unknown11Event.load(reader) || !unknown12Label.load(reader) || !unknown13Null.load(reader) || !unknown14Int.load(reader) || !unknown15Point.load(reader))
return kDataReadErrorReadFailed;
if (!unknown16Point.load(reader) || !unknown17Point.load(reader) || !unknown18Bool.load(reader) || !unknown19Point.load(reader) || !unknown20Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode TrackerModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Label.load(reader) || !unknown4Int.load(reader) || !unknown5Int.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Label.load(reader) || !unknown7Bool.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode DoubleClickModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1UniversalTime.load(reader) || !unknown2Event.load(reader) || !unknown3Event.load(reader) || !unknown4Null.load(reader) || !unknown5Label.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Int.load(reader) || !unknown7Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode MouseTrapModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1UniversalTime.load(reader) || !unknown2Event.load(reader) || !unknown3Event.load(reader) || !unknown4Event.load(reader) || !unknown5Null.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Label.load(reader) || !unknown7Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode WrapAroundModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Point.load(reader))
return kDataReadErrorReadFailed;
if (!unknown4Int.load(reader) || !unknown5Bool.load(reader) || !unknown6Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode EasyScrollerModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Int.load(reader) || !unknown4Int.load(reader) || !unknown5Label.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Int.load(reader) || !unknown7Int.load(reader) || !unknown8Int.load(reader) || !unknown9Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode TimeLoopModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Event.load(reader) || !unknown4Null.load(reader) || !unknown5Label.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Int.load(reader) || !unknown7Int.load(reader) || !unknown8UniversalTime.load(reader) || !unknown9Bool.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode GoThereModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Event.load(reader) || !unknown2Event.load(reader) || !unknown3Point.load(reader))
return kDataReadErrorReadFailed;
if (!unknown4UniversalTime.load(reader) || !unknown5Event.load(reader) || !unknown6Label.load(reader))
return kDataReadErrorReadFailed;
if (!unknown7Null.load(reader) || !unknown8Int.load(reader) || !unknown9Int.load(reader))
return kDataReadErrorReadFailed;
if (!unknown10Bool.load(reader) || !unknown11Bool.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode RandomizerModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 0)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Int.load(reader) || !unknown2Int.load(reader) || !unknown3Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode ConductorModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
if (!unknown1Null.load(reader) || !unknown2Null.load(reader) || !unknown3Int.load(reader) || !unknown4Null.load(reader) || !unknown5Null.load(reader))
return kDataReadErrorReadFailed;
if (!unknown6Null.load(reader) || !unknown7Event.load(reader) || !unknown8Null.load(reader) || !unknown9Int.load(reader))
return kDataReadErrorReadFailed;
return kDataReadErrorNone;
}
DataReadErrorCode AlphaMaticModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 1)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the AlphaMatic modifier is not implemented.");
return kDataReadErrorNone;
}
DataReadErrorCode HotTextModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 2)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the HotText modifier is not implemented.");
return kDataReadErrorNone;
}
DataReadErrorCode KeyScrollModifier::load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) {
if (prefix.plugInRevision != 2)
return kDataReadErrorUnsupportedRevision;
error("Data structure loading for the KeyScroll modifier is not implemented.");
return kDataReadErrorNone;
}
} // End of namespace Thereware
} // End of namespace Data
} // End of namespace MTropolis

View File

@@ -0,0 +1,249 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MTROPOLIS_PLUGIN_THEREWARE_DATA_H
#define MTROPOLIS_PLUGIN_THEREWARE_DATA_H
#include "mtropolis/data.h"
namespace MTropolis {
namespace Data {
namespace Thereware {
// Known Thereware custom modifiers:
// * Alpha Kit:
// - Alpha: Alpha channel support for graphics and mToons
// - AlphaMatic: Automatically creates alpha information on graphics
//
// * HotText Kit:
// - HotText: Hypertext and scrolling text
// - KeyScroll: Keyboard scrolling for HotText
//
// * Spinner Kit:
// - Spinner: Effect for spinning an element with depth/two-sidedness
// - TurnOver: Like spinner, but specifically for 180 degree spins
// - Flipper: reflect graphics elements around horizontal or vertical axis
// - Squish: Squishing and elasticity for images
//
// * Rotator Kit:
// - Rotator: Rotation of graphics and mToons
// - Tracker: Track mouse or elements as a rotation angle source
//
// * WrapAround Kit:
// - WrapAround: wraparound effect for graphics and mToons
// - EasyScroller: various detail controls for scrolling behavior
//
// * Quick Kit:
// - Flasher: Lets objects blink on the screen
// - Snapper: Creates an invisible grid that elements can snap onto when dragged
// - Conductor: Forward messages to all the children of an element
// - Randomizer: Use random numbers without Miniscript
//
// * Mercury Kit:
// - DoubleClick: Messages on doubleclick. Can also do the same as the Counter messenger.
// - MouseTrap: Blocks/filters messages for a certain time period.
// - RandomTimer: Allows Miniscript altercations to the Timer messenger
// Same as FlexiTimer in FixIt Kit
// - Repeater: Timer messenger that adds a certain delay before looping
// - Counter: Sends a message after a certain number of incoming messages
// - TimeLoop: Sends message a certain number of times
//
// * System Kit:
// - Platform: Indicates computer type and OS
//
// * FixIt Kit:
// - GoThere: Moves an element to an arbitrary point on the screen.
// Superceded by the Point Motion modifier in mTropolis 2.0.
// - FlexiTimer: Allows Miniscript altercations to the Timer messenger
// Same as RandomTimer in Mercury Kit
//
//
// While those Kits were available individually, for mTropolis 2.0
// they were also available as a complete bundle in a single plugin,
// the Thereware Pro Kit.
struct ConductorModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Null;
PlugInTypeTaggedValue unknown2Null;
PlugInTypeTaggedValue unknown3Int;
PlugInTypeTaggedValue unknown4Null;
PlugInTypeTaggedValue unknown5Null;
PlugInTypeTaggedValue unknown6Null;
PlugInTypeTaggedValue unknown7Event;
PlugInTypeTaggedValue unknown8Null;
PlugInTypeTaggedValue unknown9Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct AlphaMaticModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct RotatorModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Bool;
PlugInTypeTaggedValue unknown4Int;
PlugInTypeTaggedValue unknown5Float;
PlugInTypeTaggedValue unknown6Bool;
PlugInTypeTaggedValue unknown7Point;
PlugInTypeTaggedValue unknown8Int;
PlugInTypeTaggedValue unknown9Bool;
PlugInTypeTaggedValue unknown10Int;
PlugInTypeTaggedValue unknown11Event;
PlugInTypeTaggedValue unknown12Label;
PlugInTypeTaggedValue unknown13Null;
PlugInTypeTaggedValue unknown14Int;
PlugInTypeTaggedValue unknown15Point;
PlugInTypeTaggedValue unknown16Point;
PlugInTypeTaggedValue unknown17Point;
PlugInTypeTaggedValue unknown18Bool;
PlugInTypeTaggedValue unknown19Point;
PlugInTypeTaggedValue unknown20Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct TrackerModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Label;
PlugInTypeTaggedValue unknown4Int;
PlugInTypeTaggedValue unknown5Int;
PlugInTypeTaggedValue unknown6Label;
PlugInTypeTaggedValue unknown7Bool;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct DoubleClickModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1UniversalTime;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Event;
PlugInTypeTaggedValue unknown4Null;
PlugInTypeTaggedValue unknown5Label;
PlugInTypeTaggedValue unknown6Int;
PlugInTypeTaggedValue unknown7Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct MouseTrapModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1UniversalTime;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Event;
PlugInTypeTaggedValue unknown4Event;
PlugInTypeTaggedValue unknown5Null;
PlugInTypeTaggedValue unknown6Label;
PlugInTypeTaggedValue unknown7Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct WrapAroundModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Point;
PlugInTypeTaggedValue unknown4Int;
PlugInTypeTaggedValue unknown5Bool;
PlugInTypeTaggedValue unknown6Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct EasyScrollerModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Int;
PlugInTypeTaggedValue unknown4Int;
PlugInTypeTaggedValue unknown5Label;
PlugInTypeTaggedValue unknown6Int;
PlugInTypeTaggedValue unknown7Int;
PlugInTypeTaggedValue unknown8Int;
PlugInTypeTaggedValue unknown9Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct TimeLoopModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Event;
PlugInTypeTaggedValue unknown4Null;
PlugInTypeTaggedValue unknown5Label;
PlugInTypeTaggedValue unknown6Int;
PlugInTypeTaggedValue unknown7Int;
PlugInTypeTaggedValue unknown8UniversalTime;
PlugInTypeTaggedValue unknown9Bool;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct GoThereModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Event;
PlugInTypeTaggedValue unknown2Event;
PlugInTypeTaggedValue unknown3Point;
PlugInTypeTaggedValue unknown4UniversalTime;
PlugInTypeTaggedValue unknown5Event;
PlugInTypeTaggedValue unknown6Label;
PlugInTypeTaggedValue unknown7Null;
PlugInTypeTaggedValue unknown8Int;
PlugInTypeTaggedValue unknown9Int;
PlugInTypeTaggedValue unknown10Bool;
PlugInTypeTaggedValue unknown11Bool;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct RandomizerModifier : public PlugInModifierData {
PlugInTypeTaggedValue unknown1Int;
PlugInTypeTaggedValue unknown2Int;
PlugInTypeTaggedValue unknown3Int;
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct HotTextModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
struct KeyScrollModifier : public PlugInModifierData {
protected:
DataReadErrorCode load(PlugIn &plugIn, const PlugInModifier &prefix, DataReader &reader) override;
};
} // End of namespace Thereware
} // End of namespace Data
} // End of namespace MTropolis
#endif