[Scummvm-git-logs] scummvm master -> 33cb72c3f73472af1ef0aa1646213eb38b67a927
mduggan
noreply at scummvm.org
Sat Nov 18 11:27:24 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5d54ea199b ULTIMA8: Move Crusader camera if dest is non-fast
33cb72c3f7 ULTIMA8: Refine process killing on Crusader level change
Commit: 5d54ea199ba96b794d8875a6ec873ee05aa4ae55
https://github.com/scummvm/scummvm/commit/5d54ea199ba96b794d8875a6ec873ee05aa4ae55
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-11-18T22:25:15+11:00
Commit Message:
ULTIMA8: Move Crusader camera if dest is non-fast
In Ultima 8 we move the camera if the target moves. Crusader does not have a
similar camera target because it uses the SnapProcess. To ensure the
controlled actor's destination is always "fast", move the camera once if the
controlled actor is moved somewhere non-fast.
Changed paths:
engines/ultima/ultima8/world/item.cpp
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index 5279b0a7a5a..c4ab0711361 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -225,13 +225,21 @@ void Item::move(int32 X, int32 Y, int32 Z) {
// No lerping for this move
if (no_lerping) _extendedFlags |= EXT_LERP_NOPREV;
+ //
// If the destination is not in the fast area, and we are in
// the fast area, we need to call leaveFastArea, as long as we aren't
- // being followed by the camera. We also disable lerping in such a case
+ // being followed by the camera. We also disable lerping in such a case.
+ //
+ // In Crusader, the camera does not directly track the avatar (instead
+ // it uses SnapProcess), so manually move the camera here when moving
+ // the controlled actor.
+ //
if (!dest_fast && (_flags & Item::FLG_FASTAREA)) {
_extendedFlags |= EXT_LERP_NOPREV;
if (_extendedFlags & EXT_CAMERA)
CameraProcess::GetCameraProcess()->itemMoved();
+ else if (GAME_IS_CRUSADER && this == getControlledActor() && (X || Y))
+ CameraProcess::GetCameraProcess()->moveToLocation(X, Y, Z);
else
leaveFastArea();
Commit: 33cb72c3f73472af1ef0aa1646213eb38b67a927
https://github.com/scummvm/scummvm/commit/33cb72c3f73472af1ef0aa1646213eb38b67a927
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2023-11-18T22:26:08+11:00
Commit Message:
ULTIMA8: Refine process killing on Crusader level change
Previously, commit 8a4607 killed all processes except for the current one on
Crusader level change. This was a bit too aggressive. Specifically, the
ELEVATOR usecode spawns a new process which does the level change, but then the
parent process clears the avatar stasis so it's still needed. An example
elevator like this is Mission 12's elevator which switches between maps.
To still kill redundant processes but not kill the parent "waiting" processes,
do a simple BFS up the process tree to collect the waiting processes into a
HashMap, and then only kill the ones we don't need.
This should complete the fix for bug #14680.
Changed paths:
engines/ultima/ultima8/kernel/kernel.cpp
diff --git a/engines/ultima/ultima8/kernel/kernel.cpp b/engines/ultima/ultima8/kernel/kernel.cpp
index 21d1d1e461c..a2080e507aa 100644
--- a/engines/ultima/ultima8/kernel/kernel.cpp
+++ b/engines/ultima/ultima8/kernel/kernel.cpp
@@ -352,11 +352,30 @@ void Kernel::killProcessesNotOfType(ObjId objid, uint16 processtype, bool fail)
}
void Kernel::killAllProcessesNotOfTypeExcludeCurrent(uint16 processtype, bool fail) {
+ Common::HashMap<ProcId, bool> procsToSave;
+ Common::Array<ProcId> queue;
+
+ // Create a list of all the processes and their waiting parents that we can't kill.
+ if (_runningProcess) {
+ queue.push_back(_runningProcess->_pid);
+ while (!queue.empty()) {
+ ProcId procToSave = queue.back();
+ queue.pop_back();
+ if (!procsToSave.contains(procToSave)) {
+ Process *p = getProcess(procToSave);
+ if (p) {
+ procsToSave[procToSave] = true;
+ queue.push_back(p->_waiting);
+ }
+ }
+ }
+ }
+
for (ProcessIterator it = _processes.begin(); it != _processes.end(); ++it) {
Process *p = *it;
// Don't kill the running process
- if (p == _runningProcess)
+ if (procsToSave.contains(p->_pid))
continue;
if ((p->_type != processtype) &&
More information about the Scummvm-git-logs
mailing list