[Scummvm-git-logs] scummvm master -> 321e758e3a7dbadecc94ceafe2c6008839da3b58
elasota
noreply at scummvm.org
Fri Aug 5 21:34:36 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
eef75d853d MTROPOLIS: Fix uninitialized field
e07cd4b802 MTROPOLIS: Refactor some types to use unrestricted unions instead of POD types to hopefully fix some uninit field warnin
321e758e3a MTROPOLIS: Testing preparation
Commit: eef75d853d3f8dcaece205f6375de460f79f45e6
https://github.com/scummvm/scummvm/commit/eef75d853d3f8dcaece205f6375de460f79f45e6
Author: elasota (ejlasota at gmail.com)
Date: 2022-08-05T17:33:58-04:00
Commit Message:
MTROPOLIS: Fix uninitialized field
Changed paths:
engines/mtropolis/assets.cpp
engines/mtropolis/assets.h
diff --git a/engines/mtropolis/assets.cpp b/engines/mtropolis/assets.cpp
index 38f10a3b5dd..dd5d1658b36 100644
--- a/engines/mtropolis/assets.cpp
+++ b/engines/mtropolis/assets.cpp
@@ -1134,6 +1134,9 @@ bool MToonMetadata::FrameRangeDef::load(AssetLoaderContext &context, const Data:
return true;
}
+TextAsset::TextAsset() : _alignment(kTextAlignmentLeft), _isBitmap(false) {
+}
+
bool TextAsset::load(AssetLoaderContext &context, const Data::TextAsset &data) {
_assetID = data.assetID;
diff --git a/engines/mtropolis/assets.h b/engines/mtropolis/assets.h
index cf1836c3bae..eb7788a4a46 100644
--- a/engines/mtropolis/assets.h
+++ b/engines/mtropolis/assets.h
@@ -293,6 +293,8 @@ private:
class TextAsset : public Asset {
public:
+ TextAsset();
+
bool load(AssetLoaderContext &context, const Data::TextAsset &data);
AssetType getAssetType() const override;
Commit: e07cd4b8028b1c9122fb1e76a21da6f612874dce
https://github.com/scummvm/scummvm/commit/e07cd4b8028b1c9122fb1e76a21da6f612874dce
Author: elasota (ejlasota at gmail.com)
Date: 2022-08-05T17:33:58-04:00
Commit Message:
MTROPOLIS: Refactor some types to use unrestricted unions instead of POD types to hopefully fix some uninit field warnings
Changed paths:
engines/mtropolis/elements.cpp
engines/mtropolis/miniscript.cpp
engines/mtropolis/modifiers.cpp
engines/mtropolis/plugin/obsidian.cpp
engines/mtropolis/plugin/standard.cpp
engines/mtropolis/plugin/standard.h
engines/mtropolis/runtime.cpp
engines/mtropolis/runtime.h
diff --git a/engines/mtropolis/elements.cpp b/engines/mtropolis/elements.cpp
index 564d25ecb5a..bcccbd60921 100644
--- a/engines/mtropolis/elements.cpp
+++ b/engines/mtropolis/elements.cpp
@@ -425,7 +425,7 @@ MovieResizeFilter::~MovieResizeFilter() {
MovieElement::MovieElement()
: _cacheBitmap(false), _alternate(false), _playEveryFrame(false), _reversed(false), _haveFiredAtLastCel(false),
_haveFiredAtFirstCel(false), _shouldPlayIfNotPaused(true), _needsReset(true), _currentPlayState(kMediaStateStopped),
- _assetID(0), _maxTimestamp(0), _timeScale(0), _currentTimestamp(0), _volume(100), _playRange(IntRange::create(0, 0)),
+ _assetID(0), _maxTimestamp(0), _timeScale(0), _currentTimestamp(0), _volume(100),
_displayFrame(nullptr), _runtime(nullptr) {
}
@@ -487,17 +487,17 @@ VThreadState MovieElement::consumeCommand(Runtime *runtime, const Common::Shared
// The reaction to the Play command should be to fire Unpaused and then fire Played.
// At First Cel is NOT fired by Play commands for some reason.
- if (Event::create(EventIDs::kPlay, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kPlay, 0).respondsTo(msg->getEvent())) {
if (_paused)
{
_paused = false;
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
}
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
}
@@ -511,16 +511,16 @@ VThreadState MovieElement::consumeCommand(Runtime *runtime, const Common::Shared
return kVThreadReturn;
}
- if (Event::create(EventIDs::kStop, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kStop, 0).respondsTo(msg->getEvent())) {
if (!_paused) {
_paused = true;
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
}
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
}
@@ -578,7 +578,7 @@ void MovieElement::activate() {
_playMediaSignaller = project->notifyOnPlayMedia(this);
_maxTimestamp = qtDecoder->getDuration().convertToFramerate(qtDecoder->getTimeScale()).totalNumberOfFrames();
- _playRange = IntRange::create(0, 0);
+ _playRange = IntRange(0, 0);
_currentTimestamp = 0;
if (_name.empty())
@@ -605,7 +605,7 @@ bool MovieElement::canAutoPlay() const {
void MovieElement::queueAutoPlayEvents(Runtime *runtime, bool isAutoPlaying) {
// At First Cel event fires even if the movie isn't playing, and it fires before Played
if (_visible) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kAtFirstCel, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kAtFirstCel, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
}
@@ -762,14 +762,14 @@ void MovieElement::playMedia(Runtime *runtime, Project *project) {
if (!_loop) {
_paused = true;
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
_currentPlayState = kMediaStateStopped;
}
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kAtLastCel, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kAtLastCel, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
@@ -797,7 +797,7 @@ void MovieElement::onSegmentUnloaded(int segmentIndex) {
IntRange MovieElement::computeRealRange() const {
// The default range for movies is 0..0, which is interpreted as unset
if (_playRange.min == 0 && _playRange.max == 0)
- return IntRange::create(0, _maxTimestamp);
+ return IntRange(0, _maxTimestamp);
return _playRange;
}
@@ -863,7 +863,7 @@ MiniscriptInstructionOutcome MovieElement::scriptSetRangeStart(MiniscriptThread
if (rangeMax < asInteger)
rangeMax = asInteger;
- return scriptSetRangeTyped(thread, IntRange::create(asInteger, rangeMax));
+ return scriptSetRangeTyped(thread, IntRange(asInteger, rangeMax));
}
MiniscriptInstructionOutcome MovieElement::scriptSetRangeEnd(MiniscriptThread *thread, const DynamicValue &value) {
@@ -877,7 +877,7 @@ MiniscriptInstructionOutcome MovieElement::scriptSetRangeEnd(MiniscriptThread *t
if (rangeMin > asInteger)
rangeMin = asInteger;
- return scriptSetRangeTyped(thread, IntRange::create(rangeMin, asInteger));
+ return scriptSetRangeTyped(thread, IntRange(rangeMin, asInteger));
}
MiniscriptInstructionOutcome MovieElement::scriptRangeWriteRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib) {
@@ -1067,7 +1067,7 @@ MiniscriptInstructionOutcome ImageElement::scriptSetFlushPriority(MiniscriptThre
MToonElement::MToonElement()
: _cacheBitmap(false), _maintainRate(false), _assetID(0), _rateTimes100000(0), _flushPriority(0), _celStartTimeMSec(0),
- _isPlaying(false), _runtime(nullptr), _renderedFrame(0), _playRange(IntRange::create(1, 1)), _cel(1) {
+ _isPlaying(false), _runtime(nullptr), _renderedFrame(0), _playRange(IntRange(1, 1)), _cel(1) {
}
MToonElement::~MToonElement() {
@@ -1136,7 +1136,7 @@ MiniscriptInstructionOutcome MToonElement::writeRefAttribute(MiniscriptThread *t
}
VThreadState MToonElement::consumeCommand(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
- if (Event::create(EventIDs::kPlay, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kPlay, 0).respondsTo(msg->getEvent())) {
StartPlayingTaskData *startPlayingTaskData = runtime->getVThread().pushTask("MToonElement::startPlayingTask", this, &MToonElement::startPlayingTask);
startPlayingTaskData->runtime = runtime;
@@ -1146,7 +1146,7 @@ VThreadState MToonElement::consumeCommand(Runtime *runtime, const Common::Shared
return kVThreadReturn;
}
- if (Event::create(EventIDs::kStop, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kStop, 0).respondsTo(msg->getEvent())) {
ChangeFlagTaskData *becomeVisibleTaskData = runtime->getVThread().pushTask("MToonElement::changeVisibilityTask", static_cast<VisualElement *>(this), &MToonElement::changeVisibilityTask);
becomeVisibleTaskData->desiredFlag = false;
becomeVisibleTaskData->runtime = runtime;
@@ -1177,7 +1177,7 @@ void MToonElement::activate() {
_metadata = _cachedMToon->getMetadata();
_playMediaSignaller = project->notifyOnPlayMedia(this);
- _playRange = IntRange::create(1, _metadata->frames.size());
+ _playRange = IntRange(1, _metadata->frames.size());
if (_name.empty())
_name = project->getAssetNameByID(_assetID);
@@ -1301,13 +1301,13 @@ VThreadState MToonElement::startPlayingTask(const StartPlayingTaskData &taskData
// These send in reverse order
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kAtFirstCel, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kAtFirstCel, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
}
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
}
@@ -1319,7 +1319,7 @@ VThreadState MToonElement::stopPlayingTask(const StopPlayingTaskData &taskData)
_contentsDirty = true;
_isPlaying = false;
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
@@ -1402,11 +1402,11 @@ void MToonElement::playMedia(Runtime *runtime, Project *project) {
bool atLastCel = (targetCel == (isReversed ? minCel : maxCel)) && !(ranPastEnd && alreadyAtLastCel);
if (atFirstCel) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kAtFirstCel, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kAtFirstCel, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
} else if (atLastCel) { // These can not fire from the same frame transition (see notes)
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kAtLastCel, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kAtLastCel, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
}
@@ -1414,7 +1414,7 @@ void MToonElement::playMedia(Runtime *runtime, Project *project) {
if (ranPastEnd && !_loop) {
_paused = true;
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
}
@@ -1513,7 +1513,7 @@ MiniscriptInstructionOutcome MToonElement::scriptSetRangeTyped(MiniscriptThread
if (isInvertedRange) {
// coverity[swapped_arguments]
- _playRange = IntRange::create(intRange.max, intRange.min);
+ _playRange = IntRange(intRange.max, intRange.min);
if (_rateTimes100000 > 0)
_rateTimes100000 = -_rateTimes100000;
} else {
@@ -2004,13 +2004,13 @@ MiniscriptInstructionOutcome SoundElement::writeRefAttribute(MiniscriptThread *t
}
VThreadState SoundElement::consumeCommand(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
- if (Event::create(EventIDs::kPlay, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kPlay, 0).respondsTo(msg->getEvent())) {
StartPlayingTaskData *startPlayingTaskData = runtime->getVThread().pushTask("SoundElement::startPlayingTask", this, &SoundElement::startPlayingTask);
startPlayingTaskData->runtime = runtime;
return kVThreadReturn;
}
- if (Event::create(EventIDs::kStop, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kStop, 0).respondsTo(msg->getEvent())) {
StartPlayingTaskData *startPlayingTaskData = runtime->getVThread().pushTask("SoundElement::stopPlayingTask", this, &SoundElement::stopPlayingTask);
startPlayingTaskData->runtime = runtime;
@@ -2094,7 +2094,7 @@ void SoundElement::playMedia(Runtime *runtime, Project *project) {
// to know that the handle is still here so we can actually stop it if the element is
// destroyed, since the stream is tied to the CachedAudio.
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->queueMessage(dispatch);
@@ -2181,13 +2181,13 @@ void SoundElement::setBalance(int16 balance) {
VThreadState SoundElement::startPlayingTask(const StartPlayingTaskData &taskData) {
// Pushed in reverse order, actual order is Unpaused -> Played
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
}
if (_paused) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
@@ -2202,7 +2202,7 @@ VThreadState SoundElement::startPlayingTask(const StartPlayingTaskData &taskData
VThreadState SoundElement::stopPlayingTask(const StartPlayingTaskData &taskData) {
if (_shouldPlayIfNotPaused) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kStop, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
diff --git a/engines/mtropolis/miniscript.cpp b/engines/mtropolis/miniscript.cpp
index a0a5dcb8761..18e9f152acb 100644
--- a/engines/mtropolis/miniscript.cpp
+++ b/engines/mtropolis/miniscript.cpp
@@ -495,8 +495,8 @@ MiniscriptInstructionOutcome Set::execute(MiniscriptThread *thread) const {
MiniscriptStackValue &target = thread->getStackValueFromTop(1);
if (target.value.getType() == DynamicValueTypes::kWriteProxy) {
- const DynamicValueWriteProxyPOD &proxy = target.value.getWriteProxyPOD();
- outcome = proxy.ifc->write(thread, srcValue.value, proxy.objectRef, proxy.ptrOrOffset);
+ const DynamicValueWriteProxy &proxy = target.value.getWriteProxy();
+ outcome = proxy.pod.ifc->write(thread, srcValue.value, proxy.pod.objectRef, proxy.pod.ptrOrOffset);
if (outcome == kMiniscriptInstructionOutcomeFailed) {
thread->error("Failed to assign value to proxy");
return outcome;
@@ -602,8 +602,8 @@ MiniscriptInstructionOutcome BinaryArithInstruction::execute(MiniscriptThread *t
DynamicValue &lsDest = thread->getStackValueFromTop(1).value;
if (lsDest.getType() == DynamicValueTypes::kPoint && rs.getType() == DynamicValueTypes::kPoint) {
- Common::Point lsPoint = lsDest.getPoint().toScummVMPoint();
- Common::Point rsPoint = rs.getPoint().toScummVMPoint();
+ Common::Point lsPoint = lsDest.getPoint();
+ Common::Point rsPoint = rs.getPoint();
double resultX = 0.0;
double resultY = 0.0;
@@ -1134,7 +1134,7 @@ MiniscriptInstructionOutcome BuiltinFunc::executeRectToPolar(MiniscriptThread *t
return kMiniscriptInstructionOutcomeFailed;
}
- const Point16POD &pt = inputDynamicValue.getPoint();
+ Common::Point pt = inputDynamicValue.getPoint();
double angle = atan2(pt.y, pt.x);
double magnitude = sqrt(pt.x * pt.x + pt.y * pt.y);
@@ -1347,7 +1347,7 @@ MiniscriptInstructionOutcome RangeCreate::execute(MiniscriptThread *thread) cons
}
}
- xValDest.setIntRange(IntRange::create(coords[0], coords[1]));
+ xValDest.setIntRange(IntRange(coords[0], coords[1]));
thread->popValues(1);
@@ -1400,7 +1400,7 @@ MiniscriptInstructionOutcome GetChild::execute(MiniscriptThread *thread) const {
indexableValueSlot.value.setWriteProxy(proxy);
} else if (indexableValueSlot.value.getType() == DynamicValueTypes::kWriteProxy) {
- DynamicValueWriteProxy proxy = indexableValueSlot.value.getWriteProxyTEMP();
+ DynamicValueWriteProxy proxy = indexableValueSlot.value.getWriteProxy();
outcome = proxy.pod.ifc->refAttribIndexed(thread, proxy, proxy.pod.objectRef, proxy.pod.ptrOrOffset, attrib, indexSlot.value);
if (outcome == kMiniscriptInstructionOutcomeFailed) {
@@ -1445,7 +1445,7 @@ MiniscriptInstructionOutcome GetChild::execute(MiniscriptThread *thread) const {
indexableValueSlot.value.setWriteProxy(writeProxy);
} else if (indexableValueSlot.value.getType() == DynamicValueTypes::kWriteProxy) {
- DynamicValueWriteProxy proxy = indexableValueSlot.value.getWriteProxyTEMP();
+ DynamicValueWriteProxy proxy = indexableValueSlot.value.getWriteProxy();
outcome = proxy.pod.ifc->refAttrib(thread, proxy, proxy.pod.objectRef, proxy.pod.ptrOrOffset, attrib);
if (outcome == kMiniscriptInstructionOutcomeFailed) {
thread->error("Can't write to attribute '" + attrib + "'");
diff --git a/engines/mtropolis/modifiers.cpp b/engines/mtropolis/modifiers.cpp
index 793641c1fe9..95696154184 100644
--- a/engines/mtropolis/modifiers.cpp
+++ b/engines/mtropolis/modifiers.cpp
@@ -179,7 +179,7 @@ VThreadState BehaviorModifier::propagateTask(const PropagateTaskData &taskData)
propagateData->runtime = taskData.runtime;
}
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(taskData.eventID, 0), DynamicValue(), this->getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(taskData.eventID, 0), DynamicValue(), this->getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, _children[taskData.index].get(), true, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
@@ -640,7 +640,7 @@ PathMotionModifierV2::PointDef::PointDef() : frame(0), useFrame(false) {
}
PathMotionModifierV2::PathMotionModifierV2()
- : _executeWhen(Event::create()), _terminateWhen(Event::create()), _reverse(false), _loop(false), _alternate(false),
+ : _reverse(false), _loop(false), _alternate(false),
_startAtBeginning(false), _frameDurationTimes10Million(0) {
}
@@ -928,7 +928,7 @@ const char *VectorMotionModifier::getDefaultName() const {
void VectorMotionModifier::linkInternalReferences(ObjectLinkingScope *scope) {
if (_vec.getType() == DynamicValueTypes::kVariableReference) {
const VarReference &varRef = _vec.getVarReference();
- Common::WeakPtr<RuntimeObject> objRef = scope->resolve(varRef.guid, *varRef.source, false);
+ Common::WeakPtr<RuntimeObject> objRef = scope->resolve(varRef.guid, varRef.source, false);
RuntimeObject *obj = objRef.lock().get();
if (obj == nullptr || !obj->isModifier()) {
@@ -1005,7 +1005,7 @@ const char *SceneTransitionModifier::getDefaultName() const {
return "Scene Transition Modifier";
}
-ElementTransitionModifier::ElementTransitionModifier() : _enableWhen(Event::create()), _disableWhen(Event::create()), _rate(0), _steps(0),
+ElementTransitionModifier::ElementTransitionModifier() : _rate(0), _steps(0),
_transitionType(kTransitionTypeFade), _revealType(kRevealTypeReveal), _transitionStartTime(0), _currentStep(0) {
}
@@ -1086,14 +1086,14 @@ VThreadState ElementTransitionModifier::consumeMessage(Runtime *runtime, const C
// Pushed tasks, so these are executed in reverse order (Show -> Transition Started)
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kTransitionStarted, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kTransitionStarted, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, findStructuralOwner(), false, true, false));
runtime->sendMessageOnVThread(dispatch);
}
if (_revealType == kRevealTypeReveal)
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kElementShow, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kElementShow, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, findStructuralOwner(), false, false, true));
runtime->sendMessageOnVThread(dispatch);
}
@@ -1153,13 +1153,13 @@ void ElementTransitionModifier::continueTransition(Runtime *runtime) {
void ElementTransitionModifier::completeTransition(Runtime *runtime) {
// Pushed tasks, so these are executed in reverse order (Hide -> Transition Ended)
{
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kTransitionEnded, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kTransitionEnded, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, findStructuralOwner(), false, true, false));
runtime->sendMessageOnVThread(dispatch);
}
if (_revealType == kRevealTypeConceal) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kElementHide, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kElementHide, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, findStructuralOwner(), false, false, true));
runtime->sendMessageOnVThread(dispatch);
}
@@ -1355,9 +1355,9 @@ void TimerMessengerModifier::trigger(Runtime *runtime) {
}
BoundaryDetectionMessengerModifier::BoundaryDetectionMessengerModifier()
- : _enableWhen(Event::create()), _disableWhen(Event::create()), _exitTriggerMode(kExitTriggerExiting),
- _detectTopEdge(false), _detectBottomEdge(false), _detectLeftEdge(false), _detectRightEdge(false),
- _detectionMode(kContinuous), _runtime(nullptr), _isActive(false) {
+ : _exitTriggerMode(kExitTriggerExiting), _detectTopEdge(false), _detectBottomEdge(false),
+ _detectLeftEdge(false), _detectRightEdge(false), _detectionMode(kContinuous),
+ _runtime(nullptr), _isActive(false) {
}
BoundaryDetectionMessengerModifier::~BoundaryDetectionMessengerModifier() {
@@ -1455,9 +1455,9 @@ const char *BoundaryDetectionMessengerModifier::getDefaultName() const {
}
CollisionDetectionMessengerModifier::CollisionDetectionMessengerModifier()
- : _enableWhen(Event::create()), _disableWhen(Event::create()), _detectionMode(kDetectionModeFirstContact),
- _detectInFront(true), _detectBehind(true), _ignoreParent(true), _sendToCollidingElement(false),
- _sendToOnlyFirstCollidingElement(false), _runtime(nullptr), _isActive(false) {
+ : _detectionMode(kDetectionModeFirstContact), _detectInFront(true), _detectBehind(true),
+ _ignoreParent(true), _sendToCollidingElement(false), _sendToOnlyFirstCollidingElement(false),
+ _runtime(nullptr), _isActive(false) {
}
CollisionDetectionMessengerModifier::~CollisionDetectionMessengerModifier() {
@@ -1589,7 +1589,7 @@ KeyboardMessengerModifier::~KeyboardMessengerModifier() {
}
KeyboardMessengerModifier::KeyboardMessengerModifier()
- : _send(Event::create()), _onDown(false), _onUp(false), _onRepeat(false), _keyModControl(false), _keyModCommand(false), _keyModOption(false),
+ : _onDown(false), _onUp(false), _onRepeat(false), _keyModControl(false), _keyModCommand(false), _keyModOption(false),
_isEnabled(false), _keyCodeType(kAny), _macRomanChar(0) {
}
@@ -1641,16 +1641,16 @@ bool KeyboardMessengerModifier::load(ModifierLoaderContext &context, const Data:
}
bool KeyboardMessengerModifier::respondsToEvent(const Event &evt) const {
- if (Event::create(EventIDs::kParentEnabled, 0).respondsTo(evt) || Event::create(EventIDs::kParentDisabled, 0).respondsTo(evt))
+ if (Event(EventIDs::kParentEnabled, 0).respondsTo(evt) || Event(EventIDs::kParentDisabled, 0).respondsTo(evt))
return true;
return false;
}
VThreadState KeyboardMessengerModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
- if (Event::create(EventIDs::kParentEnabled, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kParentEnabled, 0).respondsTo(msg->getEvent())) {
_isEnabled = true;
- } else if (Event::create(EventIDs::kParentDisabled, 0).respondsTo(msg->getEvent())) {
+ } else if (Event(EventIDs::kParentDisabled, 0).respondsTo(msg->getEvent())) {
disable(runtime);
}
@@ -2450,7 +2450,7 @@ Common::SharedPtr<ModifierSaveLoad> PointVariableModifier::getSaveLoad() {
bool PointVariableModifier::varSetValue(MiniscriptThread *thread, const DynamicValue &value) {
if (value.getType() == DynamicValueTypes::kPoint)
- _value = value.getPoint().toScummVMPoint();
+ _value = value.getPoint();
else
return false;
diff --git a/engines/mtropolis/plugin/obsidian.cpp b/engines/mtropolis/plugin/obsidian.cpp
index 06d7e402342..b0158c679d0 100644
--- a/engines/mtropolis/plugin/obsidian.cpp
+++ b/engines/mtropolis/plugin/obsidian.cpp
@@ -31,7 +31,7 @@ namespace MTropolis {
namespace Obsidian {
MovementModifier::MovementModifier() : _type(false), _rate(0), _frequency(0),
- _enableWhen(Event::create()), _disableWhen(Event::create()), _triggerEvent(Event::create()), _moveStartTime(0), _runtime(nullptr) {
+ _moveStartTime(0), _runtime(nullptr) {
}
MovementModifier::~MovementModifier() {
@@ -198,7 +198,7 @@ void MovementModifier::triggerMove(Runtime *runtime) {
}
}
-RectShiftModifier::RectShiftModifier() : _enableWhen(Event::create()), _disableWhen(Event::create()), _direction(0), _runtime(nullptr), _isActive(false) {
+RectShiftModifier::RectShiftModifier() : _direction(0), _runtime(nullptr), _isActive(false) {
}
RectShiftModifier::~RectShiftModifier() {
@@ -779,7 +779,7 @@ const char *WordMixerModifier::getDefaultName() const {
return "WordMixer";
}
-XorModModifier::XorModModifier() : _enableWhen(Event::create()), _disableWhen(Event::create()), _shapeID(0) {
+XorModModifier::XorModModifier() : _shapeID(0) {
}
bool XorModModifier::load(const PlugInModifierLoaderContext &context, const Data::Obsidian::XorModModifier &data) {
diff --git a/engines/mtropolis/plugin/standard.cpp b/engines/mtropolis/plugin/standard.cpp
index d1faaf88a9b..afd0c08fa08 100644
--- a/engines/mtropolis/plugin/standard.cpp
+++ b/engines/mtropolis/plugin/standard.cpp
@@ -1564,7 +1564,7 @@ void MultiMidiPlayer::send(uint32 b) {
_driver->send(b);
}
-CursorModifier::CursorModifier() : _applyWhen(Event::create()), _removeWhen(Event::create()), _cursorID(0) {
+CursorModifier::CursorModifier() : _cursorID(0) {
}
bool CursorModifier::respondsToEvent(const Event &evt) const {
@@ -1604,8 +1604,7 @@ const char *CursorModifier::getDefaultName() const {
return "Cursor Modifier";
}
-STransCtModifier::STransCtModifier() : _enableWhen(Event::create()), _disableWhen(Event::create()),
- _transitionType(0), _transitionDirection(0), _steps(0), _duration(0), _fullScreen(false) {
+STransCtModifier::STransCtModifier() : _transitionType(0), _transitionDirection(0), _steps(0), _duration(0), _fullScreen(false) {
}
bool STransCtModifier::load(const PlugInModifierLoaderContext &context, const Data::Standard::STransCtModifier &data) {
@@ -1734,9 +1733,46 @@ MiniscriptInstructionOutcome STransCtModifier::scriptSetSteps(MiniscriptThread *
return kMiniscriptInstructionOutcomeContinue;
}
-MediaCueMessengerModifier::MediaCueMessengerModifier() : _isActive(false), _cueSourceType(kCueSourceInteger) {
+MediaCueMessengerModifier::CueSourceUnion::CueSourceUnion() : asUnset(0) {
+}
+
+MediaCueMessengerModifier::CueSourceUnion::~CueSourceUnion() {
+}
+
+template<class T, T (MediaCueMessengerModifier::CueSourceUnion::*TMember)>
+void MediaCueMessengerModifier::CueSourceUnion::construct(const T &value) {
+ T *field = &(this->*TMember);
+ new (field) T(value);
+}
+
+template<class T, T (MediaCueMessengerModifier::CueSourceUnion::*TMember)>
+void MediaCueMessengerModifier::CueSourceUnion::destruct() {
+ T *field = &(this->*TMember);
+ field->~T();
+}
+
+MediaCueMessengerModifier::MediaCueMessengerModifier() : _isActive(false), _cueSourceType(kCueSourceInvalid) {
_mediaCue.sourceModifier = this;
- memset(&this->_cueSource, 0, sizeof(this->_cueSource));
+}
+
+MediaCueMessengerModifier::~MediaCueMessengerModifier() {
+ switch (_cueSourceType) {
+ case kCueSourceInteger:
+ _cueSource.destruct<int32, &CueSourceUnion::asInt>();
+ break;
+ case kCueSourceIntegerRange:
+ _cueSource.destruct<IntRange, &CueSourceUnion::asIntRange>();
+ break;
+ case kCueSourceVariableReference:
+ _cueSource.destruct<uint32, &CueSourceUnion::asVarRefGUID>();
+ break;
+ case kCueSourceLabel:
+ _cueSource.destruct<Label, &CueSourceUnion::asLabel>();
+ break;
+ default:
+ _cueSource.destruct<uint64, &CueSourceUnion::asUnset>();
+ break;
+ }
}
bool MediaCueMessengerModifier::load(const PlugInModifierLoaderContext &context, const Data::Standard::MediaCueMessengerModifier &data) {
@@ -1904,7 +1940,7 @@ void MediaCueMessengerModifier::visitInternalReferences(IStructuralReferenceVisi
_mediaCue.send.visitInternalReferences(visitor);
}
-ObjectReferenceVariableModifier::ObjectReferenceVariableModifier() : _setToSourceParentWhen(Event::create()) {
+ObjectReferenceVariableModifier::ObjectReferenceVariableModifier() {
}
bool ObjectReferenceVariableModifier::load(const PlugInModifierLoaderContext &context, const Data::Standard::ObjectReferenceVariableModifier &data) {
@@ -2281,8 +2317,7 @@ bool ObjectReferenceVariableModifier::SaveLoad::loadInternal(Common::ReadStream
}
-MidiModifier::MidiModifier() : _executeWhen(Event::create()), _terminateWhen(Event::create()),
- _mode(kModeFile), _volume(100), _mutedTracks(0), _singleNoteChannel(0), _singleNoteNote(0),
+MidiModifier::MidiModifier() : _mode(kModeFile), _volume(100), _mutedTracks(0), _singleNoteChannel(0), _singleNoteNote(0),
_plugIn(nullptr), _filePlayer(nullptr), _notePlayer(nullptr), _runtime(nullptr) {
memset(&this->_modeSpecific, 0, sizeof(this->_modeSpecific));
diff --git a/engines/mtropolis/plugin/standard.h b/engines/mtropolis/plugin/standard.h
index feb9ff5a950..e79bfb1f86b 100644
--- a/engines/mtropolis/plugin/standard.h
+++ b/engines/mtropolis/plugin/standard.h
@@ -108,6 +108,7 @@ private:
class MediaCueMessengerModifier : public Modifier {
public:
MediaCueMessengerModifier();
+ ~MediaCueMessengerModifier();
bool load(const PlugInModifierLoaderContext &context, const Data::Standard::MediaCueMessengerModifier &data);
@@ -126,13 +127,25 @@ private:
kCueSourceIntegerRange,
kCueSourceVariableReference,
kCueSourceLabel,
+
+ kCueSourceInvalid = -1,
};
union CueSourceUnion {
+ CueSourceUnion();
+ ~CueSourceUnion();
+
int32 asInt;
IntRange asIntRange;
uint32 asVarRefGUID;
Label asLabel;
+ uint64 asUnset;
+
+ template<class T, T (CueSourceUnion::*TMember)>
+ void construct(const T &value);
+
+ template<class T, T (CueSourceUnion::*TMember)>
+ void destruct();
};
Common::SharedPtr<Modifier> shallowClone() const override;
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 795ec139cd5..cd1098c2da5 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -366,6 +366,12 @@ Common::String pointToString(const Common::Point &point) {
return Common::String::format("(%i,%i)", point.x, point.y);
}
+IntRange::IntRange() : min(0), max(0) {
+}
+
+IntRange::IntRange(int32 pmin, int32 pmax) : min(pmin), max(pmax) {
+}
+
bool IntRange::load(const Data::IntRange &range) {
max = range.max;
min = range.min;
@@ -391,6 +397,11 @@ Common::String IntRange::toString() const {
return Common::String::format("(%i thru %i)", min, max);
}
+Label::Label() : superGroupID(0), id(0) {
+}
+
+Label::Label(int32 psuperGroupID, int32 pid) : superGroupID(psuperGroupID), id(pid) {
+}
bool Label::load(const Data::Label &label) {
id = label.labelID;
@@ -407,12 +418,10 @@ bool ColorRGB8::load(const Data::ColorRGB16 &color) {
return true;
}
-ColorRGB8 ColorRGB8::create(uint8 r, uint8 g, uint8 b) {
- ColorRGB8 result;
- result.r = r;
- result.g = g;
- result.b = b;
- return result;
+ColorRGB8::ColorRGB8() : r(0), g(0), b(0) {
+}
+
+ColorRGB8::ColorRGB8(uint8 pr, uint8 pg, uint8 pb) : r(pr), g(pg), b(pb) {
}
@@ -483,10 +492,6 @@ void DynamicListDefaultSetter::defaultSet(Common::SharedPtr<DynamicList> &value)
void DynamicListDefaultSetter::defaultSet(ObjectReference &value) {
}
-Common::Point DynamicListValueConverter<Common::Point>::dereference(const Point16POD *source) {
- return source->toScummVMPoint();
-}
-
bool DynamicListValueImporter::importValue(const DynamicValue &dynValue, const int32 *&outPtr) {
if (dynValue.getType() != DynamicValueTypes::kInteger)
return false;
@@ -501,7 +506,7 @@ bool DynamicListValueImporter::importValue(const DynamicValue &dynValue, const d
return true;
}
-bool DynamicListValueImporter::importValue(const DynamicValue &dynValue, const Point16POD *&outPtr) {
+bool DynamicListValueImporter::importValue(const DynamicValue &dynValue, const Common::Point *&outPtr) {
if (dynValue.getType() != DynamicValueTypes::kPoint)
return false;
outPtr = &dynValue.getPoint();
@@ -661,7 +666,6 @@ bool DynamicListContainer<VarReference>::setAtIndex(size_t index, const DynamicV
if (_array.size() < requiredSize) {
size_t prevSize = _array.size();
_array.resize(requiredSize);
- _strings.resize(requiredSize);
for (size_t i = prevSize; i < index; i++) {
_array[i].guid = 0;
@@ -669,13 +673,11 @@ bool DynamicListContainer<VarReference>::setAtIndex(size_t index, const DynamicV
const VarReference &varRef = dynValue.getVarReference();
_array[index].guid = varRef.guid;
- _strings[index] = *varRef.source;
-
- rebuildStringPointers();
+ _array[index].source = varRef.source;
} else {
const VarReference &varRef = dynValue.getVarReference();
_array[index].guid = varRef.guid;
- _strings[index] = *varRef.source;
+ _array[index].source = varRef.source;
}
return true;
@@ -690,11 +692,10 @@ bool DynamicListContainer<VarReference>::expandToMinimumSize(size_t sz) {
if (_array.size() < sz) {
size_t prevSize = _array.size();
_array.resize(sz);
- _strings.resize(sz);
for (size_t i = prevSize; i < sz; i++) {
_array[i].guid = 0;
- _array[i].source = nullptr;
+ _array[i].source = "";
}
}
@@ -714,8 +715,6 @@ void DynamicListContainer<VarReference>::setFrom(const DynamicListContainerBase
const DynamicListContainer<VarReference> &otherTyped = static_cast<const DynamicListContainer<VarReference> &>(other);
_array = otherTyped._array;
- _strings = otherTyped._strings;
- rebuildStringPointers();
}
const void *DynamicListContainer<VarReference>::getConstArrayPtr() const {
@@ -739,15 +738,6 @@ DynamicListContainerBase *DynamicListContainer<VarReference>::clone() const {
return new DynamicListContainer<VarReference>(*this);
}
-void DynamicListContainer<VarReference>::rebuildStringPointers() {
- assert(_strings.size() == _array.size());
-
- size_t numStrings = _array.size();
- for (size_t i = 0; i < numStrings; i++) {
- _array[i].source = &_strings[i];
- }
-}
-
DynamicList::DynamicList() : _type(DynamicValueTypes::kEmpty), _container(nullptr) {
}
@@ -1147,12 +1137,36 @@ MiniscriptInstructionOutcome DynamicList::WriteProxyInterface::refAttribIndexed(
return kMiniscriptInstructionOutcomeFailed;
}
+DynamicValue::ValueUnion::ValueUnion() : asUnset(0) {
+}
+
+DynamicValue::ValueUnion::~ValueUnion() {
+}
+
+template<class T, T(DynamicValue::ValueUnion::*TMember)>
+void DynamicValue::ValueUnion::construct(const T &value) {
+ T *field = &(this->*TMember);
+ new (field) T(value);
+}
+
+template<class T, T(DynamicValue::ValueUnion::*TMember)>
+void DynamicValue::ValueUnion::construct(T &&value) {
+ T *field = &(this->*TMember);
+ new (field) T(static_cast<T&&>(value));
+}
+
+template<class T, T(DynamicValue::ValueUnion::*TMember)>
+void DynamicValue::ValueUnion::destruct() {
+ T *field = &(this->*TMember);
+ field->~T();
+}
+
DynamicValue::DynamicValue() : _type(DynamicValueTypes::kNull) {
memset(&this->_value, 0, sizeof(this->_value));
}
DynamicValue::DynamicValue(const DynamicValue &other) : _type(DynamicValueTypes::kNull) {
- initFromOther(other);
+ setFromOther(other);
}
DynamicValue::~DynamicValue() {
@@ -1160,6 +1174,8 @@ DynamicValue::~DynamicValue() {
}
bool DynamicValue::load(const Data::InternalTypeTaggedValue &data, const Common::String &varSource, const Common::String &varString) {
+ clear();
+
switch (data.type) {
case Data::InternalTypeTaggedValue::kNull:
_type = DynamicValueTypes::kNull;
@@ -1169,38 +1185,37 @@ bool DynamicValue::load(const Data::InternalTypeTaggedValue &data, const Common:
break;
case Data::InternalTypeTaggedValue::kInteger:
_type = DynamicValueTypes::kInteger;
- _value.asInt = data.value.asInteger;
+ _value.construct<int32, &ValueUnion::asInt>(data.value.asInteger);
break;
case Data::InternalTypeTaggedValue::kString:
_type = DynamicValueTypes::kString;
- _str = varString;
+ _value.construct<Common::String, &ValueUnion::asString>(varString);
break;
case Data::InternalTypeTaggedValue::kPoint:
_type = DynamicValueTypes::kPoint;
- _value.asPoint.x = data.value.asPoint.x;
- _value.asPoint.y = data.value.asPoint.y;
+ _value.construct<Common::Point, &ValueUnion::asPoint>(Common::Point(data.value.asPoint.x, data.value.asPoint.y));
break;
case Data::InternalTypeTaggedValue::kIntegerRange:
_type = DynamicValueTypes::kIntegerRange;
+ _value.construct<IntRange, &ValueUnion::asIntRange>(IntRange(0, 0));
if (!_value.asIntRange.load(data.value.asIntegerRange))
return false;
break;
case Data::InternalTypeTaggedValue::kFloat:
_type = DynamicValueTypes::kFloat;
- _value.asFloat = data.value.asFloat.toXPFloat().toDouble();
+ _value.construct<double, &ValueUnion::asFloat>(data.value.asFloat.toXPFloat().toDouble());
break;
case Data::InternalTypeTaggedValue::kBool:
_type = DynamicValueTypes::kBoolean;
- _value.asBool = (data.value.asBool != 0);
+ _value.construct<bool, &ValueUnion::asBool>(data.value.asBool != 0);
break;
case Data::InternalTypeTaggedValue::kVariableReference:
_type = DynamicValueTypes::kVariableReference;
- _value.asVarReference.guid = data.value.asVariableReference.guid;
- _value.asVarReference.source = &_str;
- _str = varSource;
+ _value.construct<VarReference, &ValueUnion::asVarReference>(VarReference(data.value.asVariableReference.guid, varSource));
break;
case Data::InternalTypeTaggedValue::kLabel:
_type = DynamicValueTypes::kLabel;
+ _value.construct<Label, &ValueUnion::asLabel>(Label());
if (!_value.asLabel.load(data.value.asLabel))
return false;
break;
@@ -1213,6 +1228,8 @@ bool DynamicValue::load(const Data::InternalTypeTaggedValue &data, const Common:
}
bool DynamicValue::load(const Data::PlugInTypeTaggedValue &data) {
+ clear();
+
switch (data.type) {
case Data::PlugInTypeTaggedValue::kNull:
_type = DynamicValueTypes::kNull;
@@ -1222,45 +1239,48 @@ bool DynamicValue::load(const Data::PlugInTypeTaggedValue &data) {
break;
case Data::PlugInTypeTaggedValue::kInteger:
_type = DynamicValueTypes::kInteger;
- _value.asInt = data.value.asInt;
+ _value.construct<int32, &ValueUnion::asInt>(data.value.asInt);
break;
case Data::PlugInTypeTaggedValue::kIntegerRange:
_type = DynamicValueTypes::kIntegerRange;
+ _value.construct<IntRange, &ValueUnion::asIntRange>(IntRange());
if (!_value.asIntRange.load(data.value.asIntRange))
return false;
break;
case Data::PlugInTypeTaggedValue::kFloat:
_type = DynamicValueTypes::kFloat;
- _value.asFloat = data.value.asFloat.toXPFloat().toDouble();
+ _value.construct<double, &ValueUnion::asFloat>(data.value.asFloat.toXPFloat().toDouble());
break;
case Data::PlugInTypeTaggedValue::kBoolean:
_type = DynamicValueTypes::kBoolean;
- _value.asBool = (data.value.asBoolean != 0);
+ _value.construct<bool, &ValueUnion::asBool>(data.value.asBoolean != 0);
break;
case Data::PlugInTypeTaggedValue::kEvent:
_type = DynamicValueTypes::kEvent;
+ _value.construct<Event, &ValueUnion::asEvent>(Event());
if (!_value.asEvent.load(data.value.asEvent))
return false;
break;
case Data::PlugInTypeTaggedValue::kLabel:
_type = DynamicValueTypes::kLabel;
+ _value.construct<Label, &ValueUnion::asLabel>(Label());
if (!_value.asLabel.load(data.value.asLabel))
return false;
break;
case Data::PlugInTypeTaggedValue::kString:
_type = DynamicValueTypes::kString;
- _str = data.str;
+ _value.construct<Common::String, &ValueUnion::asString>(data.str);
break;
case Data::PlugInTypeTaggedValue::kVariableReference:
_type = DynamicValueTypes::kVariableReference;
- _value.asVarReference.guid = data.value.asVarRefGUID;
- _value.asVarReference.source = &_str;
- _str.clear(); // Extra data doesn't seem to correlate to this
+ // Extra data doesn't seem to correlate with var source string in this case
+ _value.construct<VarReference, &ValueUnion::asVarReference>(VarReference(data.value.asVarRefGUID, ""));
break;
case Data::PlugInTypeTaggedValue::kPoint:
_type = DynamicValueTypes::kPoint;
- _value.asPoint.x = data.value.asPoint.x;
- _value.asPoint.y = data.value.asPoint.y;
+ _value.construct<Common::Point, &ValueUnion::asPoint>(Common::Point());
+ if (!data.value.asPoint.toScummVMPoint(_value.asPoint))
+ return false;
break;
default:
assert(false);
@@ -1284,7 +1304,7 @@ const double &DynamicValue::getFloat() const {
return _value.asFloat;
}
-const Point16POD &DynamicValue::getPoint() const {
+const Common::Point &DynamicValue::getPoint() const {
assert(_type == DynamicValueTypes::kPoint);
return _value.asPoint;
}
@@ -1316,7 +1336,7 @@ const VarReference &DynamicValue::getVarReference() const {
const Common::String &DynamicValue::getString() const {
assert(_type == DynamicValueTypes::kString);
- return _str;
+ return _value.asString;
}
const bool &DynamicValue::getBool() const {
@@ -1326,111 +1346,94 @@ const bool &DynamicValue::getBool() const {
const Common::SharedPtr<DynamicList> &DynamicValue::getList() const {
assert(_type == DynamicValueTypes::kList);
- return _list;
+ return _value.asList;
}
const ObjectReference &DynamicValue::getObject() const {
assert(_type == DynamicValueTypes::kObject);
- return _obj;
+ return _value.asObj;
}
-const DynamicValueWriteProxyPOD &DynamicValue::getWriteProxyPOD() const {
+const DynamicValueWriteProxy &DynamicValue::getWriteProxy() const {
assert(_type == DynamicValueTypes::kWriteProxy);
return _value.asWriteProxy;
}
-DynamicValueWriteProxy DynamicValue::getWriteProxyTEMP() const {
- assert(_type == DynamicValueTypes::kWriteProxy);
-
- DynamicValueWriteProxy proxy;
- proxy.pod = _value.asWriteProxy;
- proxy.containerList = _list;
- return proxy;
-}
-
-const Common::SharedPtr<DynamicList> &DynamicValue::getWriteProxyContainer() const {
- assert(_type == DynamicValueTypes::kWriteProxy);
- return _list;
-}
-
void DynamicValue::setInt(int32 value) {
if (_type != DynamicValueTypes::kInteger)
clear();
_type = DynamicValueTypes::kInteger;
- _value.asInt = value;
+ _value.construct<int32, &ValueUnion::asInt>(value);
}
void DynamicValue::setFloat(double value) {
if (_type != DynamicValueTypes::kFloat)
clear();
_type = DynamicValueTypes::kFloat;
- _value.asFloat = value;
+ _value.construct<double, &ValueUnion::asFloat>(value);
}
void DynamicValue::setPoint(const Common::Point &value) {
if (_type != DynamicValueTypes::kPoint)
clear();
_type = DynamicValueTypes::kPoint;
- _value.asPoint.x = value.x;
- _value.asPoint.y = value.y;
+ _value.construct<Common::Point, &ValueUnion::asPoint>(value);
}
void DynamicValue::setIntRange(const IntRange &value) {
if (_type != DynamicValueTypes::kIntegerRange)
clear();
_type = DynamicValueTypes::kIntegerRange;
- _value.asIntRange = value;
+ _value.construct<IntRange, &ValueUnion::asIntRange>(value);
}
void DynamicValue::setVector(const AngleMagVector &value) {
if (_type != DynamicValueTypes::kVector)
clear();
_type = DynamicValueTypes::kVector;
- _value.asVector = value;
+ _value.construct<AngleMagVector, &ValueUnion::asVector>(value);
}
void DynamicValue::setLabel(const Label &value) {
if (_type != DynamicValueTypes::kLabel)
clear();
_type = DynamicValueTypes::kLabel;
- _value.asLabel = value;
+ _value.construct<Label, &ValueUnion::asLabel>(value);
}
void DynamicValue::setEvent(const Event &value) {
if (_type != DynamicValueTypes::kEvent)
clear();
_type = DynamicValueTypes::kEvent;
- _value.asEvent = value;
+ _value.construct<Event, &ValueUnion::asEvent>(value);
}
void DynamicValue::setVarReference(const VarReference &value) {
if (_type != DynamicValueTypes::kVariableReference)
clear();
_type = DynamicValueTypes::kVariableReference;
- _value.asVarReference.guid = value.guid;
- _value.asVarReference.source = &_str;
- _str = *value.source;
+ _value.construct<VarReference, &ValueUnion::asVarReference>(value);
}
void DynamicValue::setString(const Common::String &value) {
if (_type != DynamicValueTypes::kString)
clear();
_type = DynamicValueTypes::kString;
- _str = value;
+ _value.construct<Common::String, &ValueUnion::asString>(value);
}
void DynamicValue::setBool(bool value) {
if (_type != DynamicValueTypes::kBoolean)
clear();
_type = DynamicValueTypes::kBoolean;
- _value.asBool = value;
+ _value.construct<bool, &ValueUnion::asBool>(value);
}
void DynamicValue::setList(const Common::SharedPtr<DynamicList> &value) {
if (_type != DynamicValueTypes::kList)
clear();
_type = DynamicValueTypes::kList;
- _list = value;
+ _value.construct<Common::SharedPtr<DynamicList>, &ValueUnion::asList>(value);
}
void DynamicValue::setWriteProxy(const DynamicValueWriteProxy &writeProxy) {
@@ -1438,8 +1441,7 @@ void DynamicValue::setWriteProxy(const DynamicValueWriteProxy &writeProxy) {
if (_type != DynamicValueTypes::kWriteProxy)
clear();
_type = DynamicValueTypes::kWriteProxy;
- _value.asWriteProxy = writeProxy.pod;
- _list = listRef;
+ _value.construct<DynamicValueWriteProxy, &ValueUnion::asWriteProxy>(writeProxy);
}
bool DynamicValue::roundToInt(int32 &outInt) const {
@@ -1477,31 +1479,15 @@ void DynamicValue::setObject(const ObjectReference &value) {
if (_type != DynamicValueTypes::kObject)
clear();
_type = DynamicValueTypes::kObject;
- _obj = value;
+ _value.construct<ObjectReference, &ValueUnion::asObj>(value);
}
void DynamicValue::setObject(const Common::WeakPtr<RuntimeObject> &value) {
setObject(ObjectReference(value));
}
-void DynamicValue::swap(DynamicValue &other) {
- internalSwap(_type, other._type);
- internalSwap(_str, other._str);
- internalSwap(_list, other._list);
- internalSwap(_obj, other._obj);
-
- ValueUnion tempValue;
- memcpy(&tempValue, &_value, sizeof(ValueUnion));
- memcpy(&_value, &other._value, sizeof(ValueUnion));
- memcpy(&other._value, &tempValue, sizeof(ValueUnion));
-}
-
DynamicValue &DynamicValue::operator=(const DynamicValue &other) {
- if (this != &other) {
- DynamicValue temp(other);
- swap(temp);
- }
-
+ setFromOther(other);
return *this;
}
@@ -1534,13 +1520,13 @@ bool DynamicValue::operator==(const DynamicValue &other) const {
case DynamicValueTypes::kIncomingData:
return true;
case DynamicValueTypes::kString:
- return _str == other._str;
+ return _value.asString == other._value.asString;
case DynamicValueTypes::kBoolean:
return _value.asBool == other._value.asBool;
case DynamicValueTypes::kList:
- return (*_list.get()) == (*other._list.get());
+ return (*_value.asList.get()) == (*_value.asList.get());
case DynamicValueTypes::kObject:
- return _obj == other._obj;
+ return _value.asObj == other._value.asObj;
default:
break;
}
@@ -1550,9 +1536,56 @@ bool DynamicValue::operator==(const DynamicValue &other) const {
}
void DynamicValue::clear() {
- _list.reset();
- _obj.reset();
- _str.clear();
+ switch (_type) {
+ case DynamicValueTypes::kNull:
+ case DynamicValueTypes::kEmpty:
+ case DynamicValueTypes::kIncomingData:
+ _value.destruct<uint64, &ValueUnion::asUnset>();
+ break;
+ case DynamicValueTypes::kInteger:
+ _value.destruct<int32, &ValueUnion::asInt>();
+ break;
+ case DynamicValueTypes::kFloat:
+ _value.destruct<double, &ValueUnion::asFloat>();
+ break;
+ case DynamicValueTypes::kPoint:
+ _value.destruct<Common::Point, &ValueUnion::asPoint>();
+ break;
+ case DynamicValueTypes::kIntegerRange:
+ _value.destruct<IntRange, &ValueUnion::asIntRange>();
+ break;
+ case DynamicValueTypes::kBoolean:
+ _value.destruct<bool, &ValueUnion::asBool>();
+ break;
+ case DynamicValueTypes::kVector:
+ _value.destruct<AngleMagVector, &ValueUnion::asVector>();
+ break;
+ case DynamicValueTypes::kLabel:
+ _value.destruct<Label, &ValueUnion::asLabel>();
+ break;
+ case DynamicValueTypes::kEvent:
+ _value.destruct<Event, &ValueUnion::asEvent>();
+ break;
+ case DynamicValueTypes::kVariableReference:
+ _value.destruct<VarReference, &ValueUnion::asVarReference>();
+ break;
+ case DynamicValueTypes::kString:
+ _value.destruct<Common::String, &ValueUnion::asString>();
+ break;
+ case DynamicValueTypes::kList:
+ _value.destruct<Common::SharedPtr<DynamicList>, &ValueUnion::asList>();
+ break;
+ case DynamicValueTypes::kObject:
+ _value.destruct<ObjectReference, &ValueUnion::asObj>();
+ break;
+ case DynamicValueTypes::kWriteProxy:
+ _value.destruct<DynamicValueWriteProxy, &ValueUnion::asWriteProxy>();
+ break;
+ default:
+ assert(false);
+ break;
+ };
+
_type = DynamicValueTypes::kNull;
}
@@ -1613,57 +1646,67 @@ bool DynamicValue::convertBoolToType(DynamicValueTypes::DynamicValueType targetT
}
}
-void DynamicValue::initFromOther(const DynamicValue &other) {
- assert(_type == DynamicValueTypes::kNull);
+void DynamicValue::setFromOther(const DynamicValue &other) {
+ if (this == &other)
+ return;
+
+ // Keep the list alive until the end of this in case the other value is contained inside of this one
+ Common::SharedPtr<DynamicList> listHolder;
+ if (_type == DynamicValueTypes::kList)
+ listHolder = _value.asList;
switch (other._type) {
case DynamicValueTypes::kNull:
- case DynamicValueTypes::kIncomingData: // FIXME: Get rid of this
+ case DynamicValueTypes::kIncomingData:
+ case DynamicValueTypes::kEmpty:
+ _type = other._type;
+ clear();
break;
case DynamicValueTypes::kInteger:
- _value.asInt = other._value.asInt;
+ setInt(other._value.asInt);
break;
case DynamicValueTypes::kFloat:
- _value.asFloat = other._value.asFloat;
+ setFloat(other._value.asFloat);
break;
case DynamicValueTypes::kPoint:
- _value.asPoint = other._value.asPoint;
+ setPoint(other._value.asPoint);
break;
case DynamicValueTypes::kIntegerRange:
- _value.asIntRange = other._value.asIntRange;
+ setIntRange(other._value.asIntRange);
break;
case DynamicValueTypes::kVector:
- _value.asVector = other._value.asVector;
+ setVector(other._value.asVector);
break;
case DynamicValueTypes::kLabel:
- _value.asLabel = other._value.asLabel;
+ setLabel(other._value.asLabel);
break;
case DynamicValueTypes::kEvent:
- _value.asEvent = other._value.asEvent;
+ setEvent(other._value.asEvent);
break;
case DynamicValueTypes::kVariableReference:
- _value.asVarReference = other._value.asVarReference;
- _str = other._str;
- _value.asVarReference.source = &_str;
+ setVarReference(other._value.asVarReference);
break;
case DynamicValueTypes::kString:
- _str = other._str;
+ setString(other._value.asString);
break;
case DynamicValueTypes::kBoolean:
- _value.asBool = other._value.asBool;
+ setBool(other._value.asBool);
break;
case DynamicValueTypes::kList:
- _list = other._list;
+ setList(other._value.asList);
break;
case DynamicValueTypes::kObject:
- _obj = other._obj;
+ setObject(other._value.asObj);
+ break;
+ case DynamicValueTypes::kWriteProxy:
+ setWriteProxy(other._value.asWriteProxy);
break;
default:
assert(false);
break;
}
- _type = other._type;
+ assert(_type == other._type);
}
MiniscriptInstructionOutcome DynamicValueWriteStringHelper::write(MiniscriptThread *thread, const DynamicValue &value, void *objectRef, uintptr ptrOrOffset) {
@@ -1697,7 +1740,7 @@ MiniscriptInstructionOutcome DynamicValueWritePointHelper::write(MiniscriptThrea
return kMiniscriptInstructionOutcomeFailed;
}
- *static_cast<Common::Point *>(objectRef) = value.getPoint().toScummVMPoint();
+ *static_cast<Common::Point *>(objectRef) = value.getPoint();
return kMiniscriptInstructionOutcomeContinue;
}
@@ -1782,7 +1825,7 @@ void DynamicValueWriteObjectHelper::create(RuntimeObject *obj, DynamicValueWrite
proxy.pod.ptrOrOffset = 0;
}
-MessengerSendSpec::MessengerSendSpec() : send(Event::create()), destination(0), _linkType(kLinkTypeNotYetLinked) {
+MessengerSendSpec::MessengerSendSpec() : destination(0), _linkType(kLinkTypeNotYetLinked) {
}
bool MessengerSendSpec::load(const Data::Event &dataEvent, uint32 dataMessageFlags, const Data::InternalTypeTaggedValue &dataLocator, const Common::String &dataWithSource, const Common::String &dataWithString, uint32 dataDestination) {
@@ -1857,7 +1900,7 @@ void MessengerSendSpec::linkInternalReferences(ObjectLinkingScope *outerScope) {
if (this->with.getType() == DynamicValueTypes::kVariableReference) {
const VarReference &varRef = this->with.getVarReference();
- Common::WeakPtr<RuntimeObject> resolution = outerScope->resolve(varRef.guid, *varRef.source, false);
+ Common::WeakPtr<RuntimeObject> resolution = outerScope->resolve(varRef.guid, varRef.source, false);
if (!resolution.expired()) {
Common::SharedPtr<RuntimeObject> obj = resolution.lock();
if (obj->isModifier())
@@ -2062,20 +2105,10 @@ bool MessengerSendSpec::isElementFilter(Structural *structural) {
return structural->isElement();
}
-Event Event::create() {
- Event evt;
- evt.eventInfo = 0;
- evt.eventType = EventIDs::kNothing;
-
- return evt;
+Event::Event() : eventType(EventIDs::kNothing), eventInfo(0) {
}
-Event Event::create(EventIDs::EventID eventType, uint32 eventInfo) {
- Event evt;
- evt.eventType = eventType;
- evt.eventInfo = eventInfo;
-
- return evt;
+Event::Event(EventIDs::EventID peventType, uint32 peventInfo) : eventType(peventType), eventInfo(peventInfo) {
}
bool Event::respondsTo(const Event &otherEvent) const {
@@ -2089,6 +2122,12 @@ bool Event::load(const Data::Event &data) {
return true;
}
+VarReference::VarReference() : guid(0) {
+}
+
+VarReference::VarReference(uint32 pguid, const Common::String &psource) : guid(pguid), source(psource) {
+}
+
bool VarReference::resolve(Structural *structuralScope, Common::WeakPtr<RuntimeObject> &outObject) const {
if (resolveContainer(structuralScope, outObject))
return true;
@@ -2129,7 +2168,7 @@ bool VarReference::resolveContainer(IModifierContainer *modifierContainer, Commo
}
bool VarReference::resolveSingleModifier(Modifier *modifier, Common::WeakPtr<RuntimeObject> &outObject) const {
- if (modifier->getStaticGUID() == guid || (source && caseInsensitiveEqual(modifier->getName(), *source))) {
+ if (modifier->getStaticGUID() == guid || (source.size() > 0 && caseInsensitiveEqual(modifier->getName(), source))) {
outObject = modifier->getSelfReference();
return true;
}
@@ -2138,6 +2177,12 @@ bool VarReference::resolveSingleModifier(Modifier *modifier, Common::WeakPtr<Run
}
+AngleMagVector::AngleMagVector() : angleDegrees(0), magnitude(0) {
+}
+
+AngleMagVector::AngleMagVector(double pangleDegrees, double pmagnitude) : angleDegrees(pangleDegrees), magnitude(pmagnitude) {
+}
+
MiniscriptInstructionOutcome AngleMagVector::refAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, const Common::String &attrib) {
if (attrib == "angle") {
DynamicValueWriteFloatHelper<double>::create(&angleDegrees, proxy);
@@ -3033,25 +3078,25 @@ void Structural::materializeDescendents(Runtime *runtime, ObjectLinkingScope *ou
}
VThreadState Structural::consumeCommand(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
- if (Event::create(EventIDs::kUnpause, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kUnpause, 0).respondsTo(msg->getEvent())) {
if (_paused) {
_paused = false;
onPauseStateChanged();
}
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
return kVThreadReturn;
}
- if (Event::create(EventIDs::kPause, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kPause, 0).respondsTo(msg->getEvent())) {
if (!_paused) {
_paused = true;
onPauseStateChanged();
}
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
@@ -3114,7 +3159,7 @@ VThreadState Structural::consumeCommand(Runtime *runtime, const Common::SharedPt
};
for (EventIDs::EventID evtID : ignoredIDs) {
- if (Event::create(evtID, 0).respondsTo(msg->getEvent()))
+ if (Event(evtID, 0).respondsTo(msg->getEvent()))
return kVThreadReturn;
}
@@ -3190,7 +3235,7 @@ MiniscriptInstructionOutcome Structural::scriptSetPaused(MiniscriptThread *threa
//
// The event does, however, need to be sent immediately.
if (!thread->getRuntime()->isAwaitingSceneTransition()) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(targetValue ? EventIDs::kPause : EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(targetValue ? EventIDs::kPause : EventIDs::kUnpause, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
thread->getRuntime()->sendMessageOnVThread(dispatch);
}
@@ -3973,7 +4018,7 @@ bool Runtime::runFrame() {
error("Project has no subsections");
}
- Common::SharedPtr<MessageProperties> psProps(new MessageProperties(Event::create(EventIDs::kProjectStarted, 0), DynamicValue(), _project->getSelfReference()));
+ Common::SharedPtr<MessageProperties> psProps(new MessageProperties(Event(EventIDs::kProjectStarted, 0), DynamicValue(), _project->getSelfReference()));
Common::SharedPtr<MessageDispatch> psDispatch(new MessageDispatch(psProps, _project.get(), false, true, false));
queueMessage(psDispatch);
@@ -4087,7 +4132,7 @@ bool Runtime::runFrame() {
for (const Common::SharedPtr<SceneTransitionHooks> &hooks : _hacks.sceneTransitionHooks)
hooks->onSceneTransitionEnded(this, _activeMainScene);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneTransitionEnded, 0), _activeMainScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneTransitionEnded, 0), _activeMainScene.get(), true, true);
continue;
}
@@ -4339,8 +4384,8 @@ void Runtime::executeCompleteTransitionToScene(const Common::SharedPtr<Structura
for (size_t i = _sceneStack.size() - 1; i > 0; i--) {
Common::SharedPtr<Structural> stackedScene = _sceneStack[i].scene;
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneEnded, 0), _activeMainScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentDisabled, 0), _activeMainScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneEnded, 0), _activeMainScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentDisabled, 0), _activeMainScene.get(), true, true);
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(_activeMainScene, LowLevelSceneStateTransitionAction::kUnload));
if (stackedScene == targetSharedScene)
@@ -4351,14 +4396,14 @@ void Runtime::executeCompleteTransitionToScene(const Common::SharedPtr<Structura
if (targetSharedScene != _activeSharedScene) {
if (_activeSharedScene) {
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneEnded, 0), _activeSharedScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentDisabled, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneEnded, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentDisabled, 0), _activeSharedScene.get(), true, true);
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(_activeSharedScene, LowLevelSceneStateTransitionAction::kUnload));
}
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(targetSharedScene, LowLevelSceneStateTransitionAction::kLoad));
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentEnabled, 0), targetSharedScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneStarted, 0), targetSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentEnabled, 0), targetSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneStarted, 0), targetSharedScene.get(), true, true);
SceneStackEntry sharedSceneEntry;
sharedSceneEntry.scene = targetSharedScene;
@@ -4368,8 +4413,8 @@ void Runtime::executeCompleteTransitionToScene(const Common::SharedPtr<Structura
{
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(targetScene, LowLevelSceneStateTransitionAction::kLoad));
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentEnabled, 0), targetScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneStarted, 0), targetScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentEnabled, 0), targetScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneStarted, 0), targetScene.get(), true, true);
SceneStackEntry sceneEntry;
sceneEntry.scene = targetScene;
@@ -4418,11 +4463,11 @@ void Runtime::executeHighLevelSceneTransition(const HighLevelSceneTransition &tr
if (sceneReturn.isAddToDestinationSceneTransition) {
// In this case we unload the active main scene and reactivate the old main
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneEnded, 0), _activeMainScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentDisabled, 0), _activeMainScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneEnded, 0), _activeMainScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentDisabled, 0), _activeMainScene.get(), true, true);
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(_activeMainScene, LowLevelSceneStateTransitionAction::kUnload));
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneReactivated, 0), sceneReturn.scene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneReactivated, 0), sceneReturn.scene.get(), true, true);
_activeMainScene = sceneReturn.scene;
@@ -4452,18 +4497,18 @@ void Runtime::executeHighLevelSceneTransition(const HighLevelSceneTransition &tr
if (_activeMainScene == targetSharedScene)
error("Transitioned into scene currently being used as a target scene, this is not supported");
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneDeactivated, 0), _activeMainScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneDeactivated, 0), _activeMainScene.get(), true, true);
if (targetSharedScene != _activeSharedScene) {
if (_activeSharedScene) {
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneEnded, 0), _activeSharedScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentDisabled, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneEnded, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentDisabled, 0), _activeSharedScene.get(), true, true);
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(_activeSharedScene, LowLevelSceneStateTransitionAction::kUnload));
}
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(targetSharedScene, LowLevelSceneStateTransitionAction::kLoad));
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentEnabled, 0), targetSharedScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneStarted, 0), targetSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentEnabled, 0), targetSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneStarted, 0), targetSharedScene.get(), true, true);
SceneStackEntry sharedSceneEntry;
sharedSceneEntry.scene = targetScene;
@@ -4484,8 +4529,8 @@ void Runtime::executeHighLevelSceneTransition(const HighLevelSceneTransition &tr
// This is probably wrong if it's already in the stack, but transitioning to already-in-stack scenes is extremely buggy in mTropolis Player anyway
if (!sceneAlreadyInStack) {
_pendingLowLevelTransitions.push_back(LowLevelSceneStateTransitionAction(targetScene, LowLevelSceneStateTransitionAction::kLoad));
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kParentEnabled, 0), targetScene.get(), true, true);
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSceneStarted, 0), targetScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kParentEnabled, 0), targetScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneStarted, 0), targetScene.get(), true, true);
SceneStackEntry sceneEntry;
sceneEntry.scene = targetScene;
@@ -4512,12 +4557,12 @@ void Runtime::executeSharedScenePostSceneChangeActions() {
const Common::Array<Common::SharedPtr<Structural> > &subsectionScenes = subsection->getChildren();
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSharedSceneSceneChanged, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSharedSceneSceneChanged, 0), _activeSharedScene.get(), true, true);
if (subsectionScenes.size() > 1) {
if (_activeMainScene == subsectionScenes[subsectionScenes.size() - 1])
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSharedSceneNoNextScene, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSharedSceneNoNextScene, 0), _activeSharedScene.get(), true, true);
if (_activeMainScene == subsectionScenes[1])
- queueEventAsLowLevelSceneStateTransitionAction(Event::create(EventIDs::kSharedSceneNoPrevScene, 0), _activeSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSharedSceneNoPrevScene, 0), _activeSharedScene.get(), true, true);
}
}
@@ -4601,7 +4646,7 @@ bool Runtime::isModifierMouseInteractive(Modifier *modifier, MouseInteractivityT
for (size_t i = 0; i < numEventIDs; i++) {
EventIDs::EventID evtID = evtIDs[i];
- if (modifier->respondsToEvent(Event::create(evtID, 0)))
+ if (modifier->respondsToEvent(Event(evtID, 0)))
return true;
}
@@ -5075,7 +5120,7 @@ VThreadState Runtime::updateMouseStateTask(const UpdateMouseStateTaskData &data)
for (size_t ri = 0; ri < messagesToSend.size(); ri++) {
const MessageToSend &msg = messagesToSend[messagesToSend.size() - 1 - ri];
- Common::SharedPtr<MessageProperties> props(new MessageProperties(Event::create(msg.eventID, 0), mousePtValue, nullptr));
+ Common::SharedPtr<MessageProperties> props(new MessageProperties(Event(msg.eventID, 0), mousePtValue, nullptr));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(props, msg.target, false, true, false));
sendMessageOnVThread(dispatch);
}
@@ -5184,7 +5229,7 @@ VThreadState Runtime::updateMousePositionTask(const UpdateMousePositionTaskData
for (size_t ri = 0; ri < messagesToSend.size(); ri++) {
const MessageToSend &msg = messagesToSend[messagesToSend.size() - 1 - ri];
- Common::SharedPtr<MessageProperties> props(new MessageProperties(Event::create(msg.eventID, 0), mousePtValue, nullptr));
+ Common::SharedPtr<MessageProperties> props(new MessageProperties(Event(msg.eventID, 0), mousePtValue, nullptr));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(props, msg.target, false, true, false));
sendMessageOnVThread(dispatch);
}
@@ -6224,7 +6269,7 @@ Project::~Project() {
}
VThreadState Project::consumeCommand(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
- if (Event::create(EventIDs::kCloseProject, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kCloseProject, 0).respondsTo(msg->getEvent())) {
runtime->closeProject();
return kVThreadReturn;
}
@@ -7078,7 +7123,7 @@ bool Element::canAutoPlay() const {
void Element::queueAutoPlayEvents(Runtime *runtime, bool isAutoPlaying) {
if (isAutoPlaying) {
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kPlay, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, false, true));
runtime->queueMessage(dispatch);
}
@@ -7139,8 +7184,8 @@ void VisualElementTransitionProperties::clearDirty() {
}
VisualElementRenderProperties::VisualElementRenderProperties()
- : _inkMode(kInkModeDefault), _shape(kShapeRect), _foreColor(ColorRGB8::create(0, 0, 0)), _backColor(ColorRGB8::create(255, 255, 255)),
- _borderColor(ColorRGB8::create(0, 0, 0)), _shadowColor(ColorRGB8::create(0, 0, 0)), _borderSize(0), _shadowSize(0), _isDirty(true) {
+ : _inkMode(kInkModeDefault), _shape(kShapeRect), _foreColor(0, 0, 0), _backColor(255, 255, 255),
+ _borderColor(0, 0, 0), _shadowColor(0, 0, 0), _borderSize(0), _shadowSize(0), _isDirty(true) {
}
VisualElementRenderProperties::InkMode VisualElementRenderProperties::getInkMode() const {
@@ -7288,26 +7333,26 @@ void VisualElement::setLayer(uint16 layer) {
}
VThreadState VisualElement::consumeCommand(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
- if (Event::create(EventIDs::kElementShow, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kElementShow, 0).respondsTo(msg->getEvent())) {
if (!_visible) {
_visible = true;
runtime->setSceneGraphDirty();
}
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kElementShow, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kElementShow, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
return kVThreadReturn;
}
- if (Event::create(EventIDs::kElementHide, 0).respondsTo(msg->getEvent())) {
+ if (Event(EventIDs::kElementHide, 0).respondsTo(msg->getEvent())) {
if (_visible) {
_visible = false;
runtime->setSceneGraphDirty();
}
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(EventIDs::kElementHide, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(EventIDs::kElementHide, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
runtime->sendMessageOnVThread(dispatch);
@@ -7678,7 +7723,7 @@ MiniscriptInstructionOutcome VisualElement::scriptSetDirect(MiniscriptThread *th
MiniscriptInstructionOutcome VisualElement::scriptSetPosition(MiniscriptThread *thread, const DynamicValue &value) {
if (value.getType() == DynamicValueTypes::kPoint) {
- Common::Point destPoint = value.getPoint().toScummVMPoint();
+ Common::Point destPoint = value.getPoint();
if (_hooks)
_hooks->onSetPosition(this, destPoint);
@@ -7734,7 +7779,7 @@ MiniscriptInstructionOutcome VisualElement::scriptSetPositionY(MiniscriptThread
MiniscriptInstructionOutcome VisualElement::scriptSetCenterPosition(MiniscriptThread *thread, const DynamicValue &value) {
if (value.getType() == DynamicValueTypes::kPoint) {
- const Common::Point destPoint = value.getPoint().toScummVMPoint();
+ const Common::Point destPoint = value.getPoint();
const Common::Point &srcPoint = getCenterPosition();
int32 xDelta = destPoint.x - srcPoint.x;
int32 yDelta = destPoint.y - srcPoint.y;
@@ -7867,7 +7912,7 @@ VThreadState VisualElement::changeVisibilityTask(const ChangeFlagTaskData &taskD
if (_visible != taskData.desiredFlag) {
_visible = taskData.desiredFlag;
- Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event::create(_visible ? EventIDs::kElementHide : EventIDs::kElementShow, 0), DynamicValue(), getSelfReference()));
+ Common::SharedPtr<MessageProperties> msgProps(new MessageProperties(Event(_visible ? EventIDs::kElementHide : EventIDs::kElementShow, 0), DynamicValue(), getSelfReference()));
Common::SharedPtr<MessageDispatch> dispatch(new MessageDispatch(msgProps, this, false, true, false));
taskData.runtime->sendMessageOnVThread(dispatch);
}
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index f4ed53d5b36..23841938e8c 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -320,6 +320,9 @@ MiniscriptInstructionOutcome pointWriteRefAttrib(Common::Point &point, Miniscrip
Common::String pointToString(const Common::Point &point);
struct IntRange {
+ IntRange();
+ IntRange(int32 pmin, int32 pmax);
+
int32 min;
int32 max;
@@ -333,18 +336,14 @@ struct IntRange {
return !((*this) == other);
}
- inline static IntRange create(int32 min, int32 max) {
- IntRange result;
- result.min = min;
- result.max = max;
- return result;
- }
-
MiniscriptInstructionOutcome refAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, const Common::String &attrib);
Common::String toString() const;
};
struct Label {
+ Label();
+ Label(int32 psuperGroupID, int32 pid);
+
uint32 superGroupID;
uint32 id;
@@ -360,12 +359,12 @@ struct Label {
};
struct Event {
+ Event();
+ Event(EventIDs::EventID peventType, uint32 peventInfo);
+
EventIDs::EventID eventType;
uint32 eventInfo;
- static Event create();
- static Event create(EventIDs::EventID eventType, uint32 eventInfo);
-
// Returns true if this event, interpreted as a filter, recognizes another event.
// Handles cases where eventInfo is ignored (hopefully).
bool respondsTo(const Event &otherEvent) const;
@@ -382,11 +381,14 @@ struct Event {
};
struct VarReference {
+ VarReference();
+ VarReference(uint32 pguid, const Common::String &psource);
+
uint32 guid;
- Common::String *source;
+ Common::String source;
inline bool operator==(const VarReference &other) const {
- return guid == other.guid && (*source) == (*other.source);
+ return guid == other.guid && source == other.source;
}
inline bool operator!=(const VarReference &other) const {
@@ -424,6 +426,8 @@ struct ObjectReference {
};
struct AngleMagVector {
+ AngleMagVector();
+
double angleDegrees; // These are stored as radians in the data but scripts treat them as degrees so it's just pointless constantly doing conversion...
double magnitude;
@@ -436,30 +440,29 @@ struct AngleMagVector {
}
inline static AngleMagVector createRadians(double angleRadians, double magnitude) {
- AngleMagVector result;
- result.angleDegrees = angleRadians * (180.0 / M_PI);
- result.magnitude = magnitude;
- return result;
+ return AngleMagVector(angleRadians * (180.0 / M_PI), magnitude);
}
inline static AngleMagVector createDegrees(double angleDegrees, double magnitude) {
- AngleMagVector result;
- result.angleDegrees = angleDegrees;
- result.magnitude = magnitude;
- return result;
+ return AngleMagVector(angleDegrees, magnitude);
}
MiniscriptInstructionOutcome refAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, const Common::String &attrib);
Common::String toString() const;
+
+private:
+ AngleMagVector(double angleDegrees, double magnitude);
};
struct ColorRGB8 {
+ ColorRGB8();
+ ColorRGB8(uint8 pr, uint8 pg, uint8 pb);
+
uint8 r;
uint8 g;
uint8 b;
bool load(const Data::ColorRGB16 &color);
- static ColorRGB8 create(uint8 r, uint8 g, uint8 b);
inline bool operator==(const ColorRGB8 &other) const {
return r == other.r && g == other.g && b == other.b;
@@ -577,17 +580,10 @@ struct DynamicListValueConverter {
static const T &dereference(const T *source) { return *source; }
};
-template<>
-struct DynamicListValueConverter<Common::Point> {
- typedef Point16POD DynamicValuePODType_t;
-
- static Common::Point dereference(const Point16POD *source);
-};
-
struct DynamicListValueImporter {
static bool importValue(const DynamicValue &dynValue, const int32 *&outPtr);
static bool importValue(const DynamicValue &dynValue, const double *&outPtr);
- static bool importValue(const DynamicValue &dynValue, const Point16POD *&outPtr);
+ static bool importValue(const DynamicValue &dynValue, const Common::Point *&outPtr);
static bool importValue(const DynamicValue &dynValue, const IntRange *&outPtr);
static bool importValue(const DynamicValue &dynValue, const bool *&outPtr);
static bool importValue(const DynamicValue &dynValue, const AngleMagVector *&outPtr);
@@ -668,7 +664,6 @@ private:
void rebuildStringPointers();
Common::Array<VarReference> _array;
- Common::Array<Common::String> _strings;
};
template<class T>
@@ -837,7 +832,7 @@ struct DynamicValue {
const int32 &getInt() const;
const double &getFloat() const;
- const Point16POD &getPoint() const;
+ const Common::Point &getPoint() const;
const IntRange &getIntRange() const;
const AngleMagVector &getVector() const;
const Label &getLabel() const;
@@ -847,9 +842,7 @@ struct DynamicValue {
const bool &getBool() const;
const Common::SharedPtr<DynamicList> &getList() const;
const ObjectReference &getObject() const;
- const DynamicValueWriteProxyPOD &getWriteProxyPOD() const;
- DynamicValueWriteProxy getWriteProxyTEMP() const;
- const Common::SharedPtr<DynamicList> &getWriteProxyContainer() const;
+ const DynamicValueWriteProxy &getWriteProxy() const;
void clear();
@@ -879,10 +872,11 @@ struct DynamicValue {
return !((*this) == other);
}
- void swap(DynamicValue &other);
-
private:
union ValueUnion {
+ ValueUnion();
+ ~ValueUnion();
+
double asFloat;
int32 asInt;
IntRange asIntRange;
@@ -890,9 +884,23 @@ private:
Label asLabel;
VarReference asVarReference;
Event asEvent;
- Point16POD asPoint;
+ Common::Point asPoint;
bool asBool;
- DynamicValueWriteProxyPOD asWriteProxy;
+ DynamicValueWriteProxy asWriteProxy;
+ Common::String asString;
+ Common::SharedPtr<DynamicList> asList;
+ ObjectReference asObj;
+
+ uint64 asUnset;
+
+ template<class T, T(ValueUnion::*TMember)>
+ void construct(const T &value);
+
+ template<class T, T(ValueUnion::*TMember)>
+ void construct(T &&value);
+
+ template<class T, T(ValueUnion::*TMember)>
+ void destruct();
};
template<class T>
@@ -906,13 +914,10 @@ private:
bool convertFloatToType(DynamicValueTypes::DynamicValueType targetType, DynamicValue &result) const;
bool convertBoolToType(DynamicValueTypes::DynamicValueType targetType, DynamicValue &result) const;
- void initFromOther(const DynamicValue &other);
+ void setFromOther(const DynamicValue &other);
DynamicValueTypes::DynamicValueType _type;
ValueUnion _value;
- Common::String _str;
- Common::SharedPtr<DynamicList> _list;
- ObjectReference _obj;
};
template<class TFloat>
Commit: 321e758e3a7dbadecc94ceafe2c6008839da3b58
https://github.com/scummvm/scummvm/commit/321e758e3a7dbadecc94ceafe2c6008839da3b58
Author: elasota (ejlasota at gmail.com)
Date: 2022-08-05T17:33:58-04:00
Commit Message:
MTROPOLIS: Testing preparation
Changed paths:
engines/mtropolis/configure.engine
engines/mtropolis/detection_tables.h
diff --git a/engines/mtropolis/configure.engine b/engines/mtropolis/configure.engine
index d27a0c44f6a..ef9a8913212 100644
--- a/engines/mtropolis/configure.engine
+++ b/engines/mtropolis/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine mtropolis "mTropolis" no "" "" "16bit highres"
+add_engine mtropolis "mTropolis" yes "" "" "16bit highres"
diff --git a/engines/mtropolis/detection_tables.h b/engines/mtropolis/detection_tables.h
index c01bfd4062c..b5c51f575ad 100644
--- a/engines/mtropolis/detection_tables.h
+++ b/engines/mtropolis/detection_tables.h
@@ -52,7 +52,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO2(GAMEOPTION_WIDESCREEN_MOD, GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS)
},
GID_OBSIDIAN,
@@ -74,7 +74,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO2(GAMEOPTION_WIDESCREEN_MOD, GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS)
},
GID_OBSIDIAN,
@@ -101,7 +101,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO2(GAMEOPTION_WIDESCREEN_MOD, GAMEOPTION_AUTO_SAVE_AT_CHECKPOINTS)
},
GID_OBSIDIAN,
@@ -128,7 +128,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::DE_DEU,
Common::kPlatformWindows,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GAMEOPTION_WIDESCREEN_MOD)
},
GID_OBSIDIAN,
@@ -154,7 +154,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO1(GAMEOPTION_WIDESCREEN_MOD)
},
GID_OBSIDIAN,
@@ -181,7 +181,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO1(GAMEOPTION_WIDESCREEN_MOD)
},
GID_OBSIDIAN,
@@ -204,7 +204,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO1(GAMEOPTION_WIDESCREEN_MOD)
},
GID_OBSIDIAN,
@@ -229,7 +229,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO0()
},
GID_OBSIDIAN,
@@ -252,7 +252,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO0()
},
GID_OBSIDIAN,
@@ -275,7 +275,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO1(GAMEOPTION_WIDESCREEN_MOD)
},
GID_OBSIDIAN,
@@ -298,7 +298,7 @@ static const MTropolisGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO | ADGF_UNSTABLE,
+ ADGF_DEMO | ADGF_TESTING,
GUIO1(GAMEOPTION_WIDESCREEN_MOD)
},
GID_OBSIDIAN,
More information about the Scummvm-git-logs
mailing list