[Scummvm-git-logs] scummvm master -> 93cdaccb9bbaaf7d8876a2efa36d258f989c4de6
elasota
noreply at scummvm.org
Tue Oct 18 02:46:02 UTC 2022
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7dab14010d MTROPOLIS: Fix shared scene modifier parsing incorrectly.
18e329463d MTROPOLIS: Fix PathMotionModifierV2 load regression.
4188d5982d MTROPOLIS: Implement shared scene modifier.
93cdaccb9b MTROPOLIS: Fix severe image rendering regression.
Commit: 7dab14010d99e3123e00352a35f5048bce3cc894
https://github.com/scummvm/scummvm/commit/7dab14010d99e3123e00352a35f5048bce3cc894
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-17T22:42:18-04:00
Commit Message:
MTROPOLIS: Fix shared scene modifier parsing incorrectly.
Changed paths:
engines/mtropolis/data.cpp
engines/mtropolis/data.h
diff --git a/engines/mtropolis/data.cpp b/engines/mtropolis/data.cpp
index df22248806b..6fec1c07d1b 100644
--- a/engines/mtropolis/data.cpp
+++ b/engines/mtropolis/data.cpp
@@ -1532,8 +1532,8 @@ DataReadErrorCode SharedSceneModifier::load(DataReader &reader) {
if (_revision != 1000)
return kDataReadErrorUnsupportedRevision;
- if (!modHeader.load(reader) || !executeWhen.load(reader)
- || !reader.readBytes(unknown1) || !reader.readU32(sectionGUID)
+ if (!modHeader.load(reader) || !reader.readBytes(unknown1)
+ || !executeWhen.load(reader) || !reader.readU32(sectionGUID)
|| !reader.readU32(subsectionGUID) || !reader.readU32(sceneGUID))
return kDataReadErrorReadFailed;
diff --git a/engines/mtropolis/data.h b/engines/mtropolis/data.h
index 9b1728c071e..5daeb035a72 100644
--- a/engines/mtropolis/data.h
+++ b/engines/mtropolis/data.h
@@ -1304,8 +1304,8 @@ struct SharedSceneModifier : public DataObject {
TypicalModifierHeader modHeader;
- Event executeWhen;
uint8 unknown1[4];
+ Event executeWhen;
uint32 sectionGUID;
uint32 subsectionGUID;
uint32 sceneGUID;
Commit: 18e329463df716142dcf2bd71cf1da36e820c06c
https://github.com/scummvm/scummvm/commit/18e329463df716142dcf2bd71cf1da36e820c06c
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-17T22:42:23-04:00
Commit Message:
MTROPOLIS: Fix PathMotionModifierV2 load regression.
Changed paths:
engines/mtropolis/data.cpp
diff --git a/engines/mtropolis/data.cpp b/engines/mtropolis/data.cpp
index 6fec1c07d1b..f26b738b2fa 100644
--- a/engines/mtropolis/data.cpp
+++ b/engines/mtropolis/data.cpp
@@ -1385,7 +1385,7 @@ bool PathMotionModifier::PointDef::load(DataReader &reader, bool haveMessageSpec
if (!point.load(reader) || !reader.readU32(frame) || !reader.readU32(frameFlags))
return false;
- if (haveMessageSpec && messageSpec.load(reader))
+ if (haveMessageSpec && !messageSpec.load(reader))
return false;
return true;
Commit: 4188d5982d763551979df4ba703c63c0898b7e93
https://github.com/scummvm/scummvm/commit/4188d5982d763551979df4ba703c63c0898b7e93
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-17T22:42:28-04:00
Commit Message:
MTROPOLIS: Implement shared scene modifier.
Changed paths:
engines/mtropolis/modifiers.cpp
engines/mtropolis/runtime.cpp
engines/mtropolis/runtime.h
diff --git a/engines/mtropolis/modifiers.cpp b/engines/mtropolis/modifiers.cpp
index 5ed7a532c50..86624f6f03c 100644
--- a/engines/mtropolis/modifiers.cpp
+++ b/engines/mtropolis/modifiers.cpp
@@ -1352,6 +1352,35 @@ bool SharedSceneModifier::respondsToEvent(const Event &evt) const {
}
VThreadState SharedSceneModifier::consumeMessage(Runtime *runtime, const Common::SharedPtr<MessageProperties> &msg) {
+ if (_executeWhen.respondsTo(msg->getEvent())) {
+ Project *project = runtime->getProject();
+ bool found = false;
+ for (const Common::SharedPtr<Structural> §ion : project->getChildren()) {
+ if (section->getStaticGUID() == _targetSectionGUID) {
+ for (const Common::SharedPtr<Structural> &subsection : section->getChildren()) {
+ if (subsection->getStaticGUID() == _targetSubsectionGUID) {
+ for (const Common::SharedPtr<Structural> &scene : subsection->getChildren()) {
+ if (scene->getStaticGUID() == _targetSceneGUID) {
+ runtime->addSceneStateTransition(HighLevelSceneTransition(scene, HighLevelSceneTransition::kTypeChangeSharedScene, false, false));
+ found = true;
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ if (!found) {
+#ifdef MTROPOLIS_DEBUG_ENABLE
+ if (Debugger *debugger = runtime->debugGetDebugger())
+ debugger->notifyFmt(kDebugSeverityError, "Failed to resolve shared scene modifier target scene");
+#endif
+ return kVThreadError;
+ }
+ }
return kVThreadReturn;
}
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index ac6968e7917..521cf7bece0 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -4702,7 +4702,28 @@ void Runtime::executeHighLevelSceneTransition(const HighLevelSceneTransition &tr
executeCompleteTransitionToScene(targetScene);
}
} break;
+ case HighLevelSceneTransition::kTypeChangeSharedScene: {
+ Common::SharedPtr<Structural> targetSharedScene = transition.scene;
+
+ if (targetSharedScene != _activeSharedScene) {
+ if (_activeSharedScene) {
+ 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(EventIDs::kParentEnabled, 0), targetSharedScene.get(), true, true);
+ queueEventAsLowLevelSceneStateTransitionAction(Event(EventIDs::kSceneStarted, 0), targetSharedScene.get(), true, true);
+
+ SceneStackEntry sharedSceneEntry;
+ sharedSceneEntry.scene = targetSharedScene;
+
+ _sceneStack[0] = sharedSceneEntry;
+ }
+ } break;
default:
+ error("Unknown high-level scene transition type");
break;
}
}
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index cf6214c07b4..73f6e22ae06 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -1293,6 +1293,7 @@ struct HighLevelSceneTransition {
enum Type {
kTypeReturn,
kTypeChangeToScene,
+ kTypeChangeSharedScene,
};
HighLevelSceneTransition(const Common::SharedPtr<Structural> &hlst_scene, Type hlst_type, bool hlst_addToDestinationScene, bool hlst_addToReturnList);
Commit: 93cdaccb9bbaaf7d8876a2efa36d258f989c4de6
https://github.com/scummvm/scummvm/commit/93cdaccb9bbaaf7d8876a2efa36d258f989c4de6
Author: elasota (ejlasota at gmail.com)
Date: 2022-10-17T22:42:32-04:00
Commit Message:
MTROPOLIS: Fix severe image rendering regression.
Changed paths:
engines/mtropolis/assets.cpp
engines/mtropolis/render.cpp
diff --git a/engines/mtropolis/assets.cpp b/engines/mtropolis/assets.cpp
index dd5f6ab36ff..3dba8f9f0c2 100644
--- a/engines/mtropolis/assets.cpp
+++ b/engines/mtropolis/assets.cpp
@@ -803,29 +803,27 @@ const Common::SharedPtr<Graphics::ManagedSurface> &CachedImage::optimize(Runtime
const Graphics::PixelFormat &renderFmt = runtime->getRenderPixelFormat();
if (renderDepth != _colorDepth) {
- size_t w = _surface->w;
- size_t h = _surface->h;
-
- if (renderDepth == kColorDepthMode16Bit && _colorDepth == kColorDepthMode32Bit) {
- _optimizedSurface.reset(new Graphics::ManagedSurface());
- _optimizedSurface->create(w, h, renderFmt);
- Render::convert32To16(*_optimizedSurface, *_surface);
-
- _colorDepth = kColorDepthMode16Bit;
- } else if (renderDepth == kColorDepthMode32Bit && _colorDepth == kColorDepthMode16Bit) {
- _optimizedSurface.reset(new Graphics::ManagedSurface());
- _optimizedSurface->create(w, h, renderFmt);
- Render::convert16To32(*_optimizedSurface, *_surface);
-
- _colorDepth = kColorDepthMode32Bit;
- } else {
- _optimizedSurface = _surface; // Can't optimize
+ if (!_optimizedSurface) {
+ size_t w = _surface->w;
+ size_t h = _surface->h;
+
+ if (renderDepth == kColorDepthMode16Bit && _colorDepth == kColorDepthMode32Bit) {
+ _optimizedSurface.reset(new Graphics::ManagedSurface());
+ _optimizedSurface->create(w, h, renderFmt);
+ Render::convert32To16(*_optimizedSurface, *_surface);
+ } else if (renderDepth == kColorDepthMode32Bit && _colorDepth == kColorDepthMode16Bit) {
+ _optimizedSurface.reset(new Graphics::ManagedSurface());
+ _optimizedSurface->create(w, h, renderFmt);
+ Render::convert16To32(*_optimizedSurface, *_surface);
+ } else {
+ return _surface; // Can't optimize
+ }
}
- } else {
- _optimizedSurface = _surface; // Doesn't need to be optimized
+
+ return _optimizedSurface;
}
- return _optimizedSurface;
+ return _surface; // Already optimal
}
ImageAsset::ImageAsset() : _colorDepth(kColorDepthMode8Bit), _filePosition(0), _size(0), _streamIndex(0), _imageFormat(kImageFormatWindows) {
diff --git a/engines/mtropolis/render.cpp b/engines/mtropolis/render.cpp
index 78190929c68..cffb1f2914f 100644
--- a/engines/mtropolis/render.cpp
+++ b/engines/mtropolis/render.cpp
@@ -577,8 +577,8 @@ void convert16To32(Graphics::ManagedSurface &destSurface, const Graphics::Manage
size_t h = srcSurface.h;
for (size_t y = 0; y < h; y++) {
- const uint32 *srcRow = static_cast<const uint32 *>(srcSurface.getBasePtr(0, y));
- uint16 *destRow = static_cast<uint16 *>(destSurface.getBasePtr(0, y));
+ const uint16 *srcRow = static_cast<const uint16 *>(srcSurface.getBasePtr(0, y));
+ uint32 *destRow = static_cast<uint32 *>(destSurface.getBasePtr(0, y));
for (size_t x = 0; x < w; x++) {
uint32 packed16 = srcRow[x];
@@ -589,7 +589,7 @@ void convert16To32(Graphics::ManagedSurface &destSurface, const Graphics::Manage
r = expand5To8(r);
g = expand5To8(g);
b = expand5To8(b);
- destRow[x] = (r << destFmt.rShift) | (g << destFmt.gShift) | (b << destFmt.bShift);
+ destRow[x] = (r << destFmt.rShift) | (g << destFmt.gShift) | (b << destFmt.bShift) | (0xffu << destFmt.aShift);
}
}
}
More information about the Scummvm-git-logs
mailing list