[Scummvm-git-logs] scummvm master -> fdf0c420402331e4e1b377a26d961721870e4d5e
elasota
noreply at scummvm.org
Mon Nov 21 22:23:50 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fdf0c42040 MTROPOLIS: Fixes for SPQR. Add "postponeredraws" WM attribute and allow mToon ranges to be set to a point.
Commit: fdf0c420402331e4e1b377a26d961721870e4d5e
https://github.com/scummvm/scummvm/commit/fdf0c420402331e4e1b377a26d961721870e4d5e
Author: Willem Sonke (Willem3141 at users.noreply.github.com)
Date: 2022-11-21T17:23:47-05:00
Commit Message:
MTROPOLIS: Fixes for SPQR. Add "postponeredraws" WM attribute and allow mToon ranges to be set to a point.
Changed paths:
engines/mtropolis/elements.cpp
engines/mtropolis/elements.h
engines/mtropolis/runtime.cpp
engines/mtropolis/runtime.h
diff --git a/engines/mtropolis/elements.cpp b/engines/mtropolis/elements.cpp
index cbb49f6397a..ebd7c5fcb08 100644
--- a/engines/mtropolis/elements.cpp
+++ b/engines/mtropolis/elements.cpp
@@ -1553,12 +1553,13 @@ MiniscriptInstructionOutcome MToonElement::scriptSetCel(MiniscriptThread *thread
}
MiniscriptInstructionOutcome MToonElement::scriptSetRange(MiniscriptThread *thread, const DynamicValue &value) {
- if (value.getType() != DynamicValueTypes::kIntegerRange) {
- thread->error("Invalid type for mToon range");
- return kMiniscriptInstructionOutcomeFailed;
- }
+ if (value.getType() == DynamicValueTypes::kIntegerRange)
+ return scriptSetRangeTyped(thread, value.getIntRange());
+ if (value.getType() == DynamicValueTypes::kPoint)
+ return scriptSetRangeTyped(thread, value.getPoint());
- return scriptSetRangeTyped(thread, value.getIntRange());
+ thread->error("Invalid type for mToon range");
+ return kMiniscriptInstructionOutcomeFailed;
}
MiniscriptInstructionOutcome MToonElement::scriptSetRangeStart(MiniscriptThread *thread, const DynamicValue &value) {
@@ -1636,6 +1637,11 @@ MiniscriptInstructionOutcome MToonElement::scriptSetRangeTyped(MiniscriptThread
return kMiniscriptInstructionOutcomeContinue;
}
+MiniscriptInstructionOutcome MToonElement::scriptSetRangeTyped(MiniscriptThread *thread, const Common::Point &pointRef) {
+ IntRange intRange(pointRef.x, pointRef.y);
+ return scriptSetRangeTyped(thread, intRange);
+}
+
void MToonElement::onPauseStateChanged() {
_celStartTimeMSec = _runtime->getPlayTime();
}
diff --git a/engines/mtropolis/elements.h b/engines/mtropolis/elements.h
index 0e001c73895..8b773c5960d 100644
--- a/engines/mtropolis/elements.h
+++ b/engines/mtropolis/elements.h
@@ -272,6 +272,7 @@ private:
MiniscriptInstructionOutcome scriptRangeWriteRefAttribute(MiniscriptThread *thread, DynamicValueWriteProxy &result, const Common::String &attrib);
MiniscriptInstructionOutcome scriptSetRangeTyped(MiniscriptThread *thread, const IntRange &value);
+ MiniscriptInstructionOutcome scriptSetRangeTyped(MiniscriptThread *thread, const Common::Point &value);
void onPauseStateChanged() override;
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 261c9e08188..fa35a2428f2 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -2650,7 +2650,7 @@ void MessageProperties::setValue(const DynamicValue &value) {
_value = value;
}
-WorldManagerInterface::WorldManagerInterface() : _gameMode(false), _combineRedraws(true), _opInt(0) {
+WorldManagerInterface::WorldManagerInterface() : _gameMode(false), _combineRedraws(true), _postponeRedraws(false), _opInt(0) {
}
bool WorldManagerInterface::readAttribute(MiniscriptThread *thread, DynamicValue &result, const Common::String &attrib) {
@@ -2674,6 +2674,9 @@ bool WorldManagerInterface::readAttribute(MiniscriptThread *thread, DynamicValue
} else if (attrib == "combineredraws") {
result.setBool(_combineRedraws);
return true;
+ } else if (attrib == "postponeredraws") {
+ result.setBool(_postponeRedraws);
+ return true;
}
return RuntimeObject::readAttribute(thread, result, attrib);
@@ -2698,6 +2701,9 @@ MiniscriptInstructionOutcome WorldManagerInterface::writeRefAttribute(Miniscript
} else if (attrib == "combineredraws") {
DynamicValueWriteBoolHelper::create(&_combineRedraws, result);
return kMiniscriptInstructionOutcomeContinue;
+ } else if (attrib == "postponeredraws") {
+ DynamicValueWriteBoolHelper::create(&_postponeRedraws, result);
+ return kMiniscriptInstructionOutcomeContinue;
} else if (attrib == "qtpalettehack") {
DynamicValueWriteDiscardHelper::create(result);
return kMiniscriptInstructionOutcomeContinue;
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index 83d47f115cf..355a4526090 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -2044,6 +2044,7 @@ private:
int32 _opInt;
bool _gameMode;
bool _combineRedraws;
+ bool _postponeRedraws;
};
class AssetManagerInterface : public RuntimeObject {
More information about the Scummvm-git-logs
mailing list