mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 01:07:22 +00:00
MTROPOLIS: Stub out simple motion modifier.
This commit is contained in:
parent
640391580c
commit
112c2979ca
@ -95,6 +95,7 @@ bool isModifier(DataObjectType type) {
|
||||
case kChangeSceneModifier:
|
||||
case kReturnModifier:
|
||||
case kSoundEffectModifier:
|
||||
case kSimpleMotionModifier:
|
||||
case kDragMotionModifier:
|
||||
case kPathMotionModifierV1:
|
||||
case kPathMotionModifierV2:
|
||||
@ -1427,6 +1428,24 @@ DataReadErrorCode PathMotionModifier::load(DataReader &reader) {
|
||||
return kDataReadErrorNone;
|
||||
}
|
||||
|
||||
SimpleMotionModifier::SimpleMotionModifier()
|
||||
: motionType(0), directionFlags(0), steps(0), delayMSecTimes4800(0), unknown1{0, 0, 0, 0} {
|
||||
}
|
||||
|
||||
DataReadErrorCode SimpleMotionModifier::load(DataReader &reader) {
|
||||
if (_revision != 1001)
|
||||
return kDataReadErrorUnsupportedRevision;
|
||||
|
||||
if (!modHeader.load(reader))
|
||||
return kDataReadErrorReadFailed;
|
||||
|
||||
if (!executeWhen.load(reader) || !terminateWhen.load(reader) || !reader.readU16(motionType) || !reader.readU16(directionFlags)
|
||||
|| !reader.readU16(steps) || !reader.readU32(delayMSecTimes4800) || !reader.readBytes(unknown1))
|
||||
return kDataReadErrorReadFailed;
|
||||
|
||||
return kDataReadErrorNone;
|
||||
}
|
||||
|
||||
DragMotionModifier::DragMotionModifier()
|
||||
: haveMacPart(false), haveWinPart(false), unknown1(0) {
|
||||
memset(&this->platform, 0, sizeof(this->platform));
|
||||
@ -2443,6 +2462,9 @@ DataReadErrorCode loadDataObject(const PlugInModifierRegistry ®istry, DataRea
|
||||
case DataObjectTypes::kSoundEffectModifier:
|
||||
dataObject = new SoundEffectModifier();
|
||||
break;
|
||||
case DataObjectTypes::kSimpleMotionModifier:
|
||||
dataObject = new SimpleMotionModifier();
|
||||
break;
|
||||
case DataObjectTypes::kDragMotionModifier:
|
||||
dataObject = new DragMotionModifier();
|
||||
break;
|
||||
|
@ -104,6 +104,7 @@ enum DataObjectType : uint {
|
||||
kChangeSceneModifier = 0x136,
|
||||
kReturnModifier = 0x140,
|
||||
kSoundEffectModifier = 0x1a4,
|
||||
kSimpleMotionModifier = 0x1fe,
|
||||
kDragMotionModifier = 0x208,
|
||||
kPathMotionModifierV1 = 0x21c,
|
||||
kPathMotionModifierV2 = 0x21b,
|
||||
@ -1190,6 +1191,23 @@ protected:
|
||||
DataReadErrorCode load(DataReader &reader) override;
|
||||
};
|
||||
|
||||
struct SimpleMotionModifier : public DataObject {
|
||||
SimpleMotionModifier();
|
||||
|
||||
TypicalModifierHeader modHeader;
|
||||
|
||||
Event executeWhen;
|
||||
Event terminateWhen;
|
||||
uint16 motionType;
|
||||
uint16 directionFlags;
|
||||
uint16 steps;
|
||||
uint32 delayMSecTimes4800;
|
||||
uint8 unknown1[4];
|
||||
|
||||
protected:
|
||||
DataReadErrorCode load(DataReader &reader) override;
|
||||
};
|
||||
|
||||
struct DragMotionModifier : public DataObject {
|
||||
DragMotionModifier();
|
||||
|
||||
|
@ -85,11 +85,13 @@ SIModifierFactory *getModifierFactoryForDataObjectType(const Data::DataObjectTyp
|
||||
return ModifierFactory<ChangeSceneModifier, Data::ChangeSceneModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kSoundEffectModifier:
|
||||
return ModifierFactory<SoundEffectModifier, Data::SoundEffectModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kDragMotionModifier:
|
||||
return ModifierFactory<DragMotionModifier, Data::DragMotionModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kSimpleMotionModifier:
|
||||
return ModifierFactory<SimpleMotionModifier, Data::SimpleMotionModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kPathMotionModifierV1:
|
||||
case Data::DataObjectTypes::kPathMotionModifierV2:
|
||||
return ModifierFactory<PathMotionModifier, Data::PathMotionModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kDragMotionModifier:
|
||||
return ModifierFactory<DragMotionModifier, Data::DragMotionModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kVectorMotionModifier:
|
||||
return ModifierFactory<VectorMotionModifier, Data::VectorMotionModifier>::getInstance();
|
||||
case Data::DataObjectTypes::kSceneTransitionModifier:
|
||||
|
@ -904,6 +904,57 @@ const char *PathMotionModifier::getDefaultName() const {
|
||||
return "Path Motion Modifier";
|
||||
}
|
||||
|
||||
|
||||
SimpleMotionModifier::SimpleMotionModifier() : _motionType(kMotionTypeIntoScene), _directionFlags(0), _steps(0), _delayMSecTimes4800(0) {
|
||||
}
|
||||
|
||||
bool SimpleMotionModifier::load(ModifierLoaderContext &context, const Data::SimpleMotionModifier &data) {
|
||||
if (!loadTypicalHeader(data.modHeader))
|
||||
return false;
|
||||
|
||||
if (!_executeWhen.load(data.executeWhen) || !_terminateWhen.load(data.terminateWhen))
|
||||
return false;
|
||||
|
||||
_directionFlags = data.directionFlags;
|
||||
_steps = data.steps;
|
||||
_motionType = static_cast<MotionType>(data.motionType);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimpleMotionModifier::respondsToEvent(const Event &evt) const {
|
||||
return _executeWhen.respondsTo(evt) || _terminateWhen.respondsTo(evt);
|
||||
}
|
||||
|
||||
VThreadState SimpleMotionModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
|
||||
if (_executeWhen.respondsTo(msg->getEvent())) {
|
||||
#ifdef MTROPOLIS_DEBUG_ENABLE
|
||||
if (Debugger *debugger = runtime->debugGetDebugger())
|
||||
debugger->notify(kDebugSeverityError, "Simple Motion Modifier was supposed to execute, but is not implemented");
|
||||
#endif
|
||||
return kVThreadReturn;
|
||||
}
|
||||
if (_terminateWhen.respondsTo(msg->getEvent())) {
|
||||
#ifdef MTROPOLIS_DEBUG_ENABLE
|
||||
if (Debugger *debugger = runtime->debugGetDebugger())
|
||||
debugger->notify(kDebugSeverityError, "Simple Motion Modifier was supposed to terminate, but is not implemented");
|
||||
#endif
|
||||
return kVThreadReturn;
|
||||
}
|
||||
return kVThreadReturn;
|
||||
}
|
||||
|
||||
void SimpleMotionModifier::disable(Runtime *runtime) {
|
||||
}
|
||||
|
||||
Common::SharedPtr<Modifier> SimpleMotionModifier::shallowClone() const {
|
||||
return Common::SharedPtr<Modifier>(new SimpleMotionModifier(*this));
|
||||
}
|
||||
|
||||
const char *SimpleMotionModifier::getDefaultName() const {
|
||||
return "Simple Motion Modifier";
|
||||
}
|
||||
|
||||
bool DragMotionModifier::load(ModifierLoaderContext &context, const Data::DragMotionModifier &data) {
|
||||
if (!loadTypicalHeader(data.modHeader))
|
||||
return false;
|
||||
|
@ -394,6 +394,47 @@ private:
|
||||
DynamicValue _incomingData;
|
||||
};
|
||||
|
||||
class SimpleMotionModifier : public Modifier {
|
||||
public:
|
||||
SimpleMotionModifier();
|
||||
|
||||
bool load(ModifierLoaderContext &context, const Data::SimpleMotionModifier &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 "Simple Motion Modifier"; }
|
||||
SupportStatus debugGetSupportStatus() const override { return kSupportStatusNone; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
enum MotionType {
|
||||
kMotionTypeOutOfScene = 1,
|
||||
kMotionTypeIntoScene = 2,
|
||||
kMotionTypeRandomBounce = 3,
|
||||
};
|
||||
|
||||
enum DirectionFlags {
|
||||
kDirectionFlagDown = 1,
|
||||
kDirectionFlagUp = 2,
|
||||
kDirectionFlagRight = 4,
|
||||
kDirectionFlagLeft = 8,
|
||||
};
|
||||
|
||||
Common::SharedPtr<Modifier> shallowClone() const override;
|
||||
const char *getDefaultName() const override;
|
||||
|
||||
Event _executeWhen;
|
||||
Event _terminateWhen;
|
||||
|
||||
MotionType _motionType;
|
||||
uint16 _directionFlags;
|
||||
uint16 _steps;
|
||||
uint32 _delayMSecTimes4800;
|
||||
};
|
||||
|
||||
class DragMotionModifier : public Modifier {
|
||||
public:
|
||||
bool load(ModifierLoaderContext &context, const Data::DragMotionModifier &data);
|
||||
|
@ -3110,6 +3110,9 @@ bool Structural::readAttribute(MiniscriptThread *thread, DynamicValue &result, c
|
||||
else
|
||||
result.setObject(_children[0]->getSelfReference());
|
||||
return true;
|
||||
} else if (attrib == "element") {
|
||||
result.setObject(getSelfReference());
|
||||
return true;
|
||||
}
|
||||
|
||||
// Traverse children (modifiers must be first)
|
||||
|
Loading…
x
Reference in New Issue
Block a user