[Scummvm-git-logs] scummvm master -> 35efd2e8fd056218ca8fe5a2b0a9efcb09507c41
mduggan
noreply at scummvm.org
Sun Mar 20 02:04:06 UTC 2022
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:
d33720e950 ULTIMA8: Avoid warnings spamming for missing shapes
35efd2e8fd ULTIMA8: Fix remote viewing during "camera moves with player" option.
Commit: d33720e9503719814b576910b3f842c6ddbf8adf
https://github.com/scummvm/scummvm/commit/d33720e9503719814b576910b3f842c6ddbf8adf
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2022-03-20T10:13:56+09:00
Commit Message:
ULTIMA8: Avoid warnings spamming for missing shapes
In No Regret, there are some areas with a certain invalid shape. Avoid spamming
the log with warnings on every frame in this case.
Also correct variable naming - frame is a local not a member.
Changed paths:
engines/ultima/ultima8/world/item_sorter.cpp
diff --git a/engines/ultima/ultima8/world/item_sorter.cpp b/engines/ultima/ultima8/world/item_sorter.cpp
index 0ebb9ec1bd2..3ca6d3371bb 100644
--- a/engines/ultima/ultima8/world/item_sorter.cpp
+++ b/engines/ultima/ultima8/world/item_sorter.cpp
@@ -100,9 +100,16 @@ void ItemSorter::AddItem(int32 x, int32 y, int32 z, uint32 shapeNum, uint32 fram
si->_shape = _shapes->getShape(shapeNum);
si->_shapeNum = shapeNum;
si->_frame = frame_num;
- const ShapeFrame *_frame = si->_shape ? si->_shape->getFrame(si->_frame) : nullptr;
- if (!_frame) {
- perr << "Invalid shape: " << si->_shapeNum << "," << si->_frame << Std::endl;
+ const ShapeFrame *frame = si->_shape ? si->_shape->getFrame(si->_frame) : nullptr;
+ if (!frame) {
+ // Keep the last shape we skipped so we don't spam the warnings too much
+ static uint32 last_invalid_shape = 0;
+ static uint32 last_invalid_frame = 0;
+ if (si->_shapeNum != last_invalid_shape || si->_frame != last_invalid_frame) {
+ warning("Skipping invalid shape in sorter: %d,%d", si->_shapeNum, si->_frame);
+ last_invalid_frame = si->_frame;
+ last_invalid_shape = si->_shapeNum;
+ }
return;
}
@@ -138,13 +145,13 @@ void ItemSorter::AddItem(int32 x, int32 y, int32 z, uint32 shapeNum, uint32 fram
si->_syBot = si->_x / 8 + si->_y / 8 - si->_z - _camSy;
// Real Screenspace coords
- si->_sx = si->_sxBot - _frame->_xoff; // Left
- si->_sy = si->_syBot - _frame->_yoff; // Top
- si->_sx2 = si->_sx + _frame->_width; // Right
- si->_sy2 = si->_sy + _frame->_height; // Bottom
+ si->_sx = si->_sxBot - frame->_xoff; // Left
+ si->_sy = si->_syBot - frame->_yoff; // Top
+ si->_sx2 = si->_sx + frame->_width; // Right
+ si->_sy2 = si->_sy + frame->_height; // Bottom
// Do Clipping here
- int16 clipped = _surf->CheckClipped(Rect(si->_sx, si->_sy, si->_sx + _frame->_width, si->_sy + _frame->_height));
+ int16 clipped = _surf->CheckClipped(Rect(si->_sx, si->_sy, si->_sx + frame->_width, si->_sy + frame->_height));
if (clipped < 0)
// Clipped away entirely - don't add to the list.
return;
Commit: 35efd2e8fd056218ca8fe5a2b0a9efcb09507c41
https://github.com/scummvm/scummvm/commit/35efd2e8fd056218ca8fe5a2b0a9efcb09507c41
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2022-03-20T11:02:32+09:00
Commit Message:
ULTIMA8: Fix remote viewing during "camera moves with player" option.
The engine code would move the camera to the remote viewing location, but the
snap process pulled it back to the player. Fix by disabling snap-to-player if
the avatar is in stasis.
This fixes #13360
Changed paths:
engines/ultima/ultima8/world/snap_process.cpp
diff --git a/engines/ultima/ultima8/world/snap_process.cpp b/engines/ultima/ultima8/world/snap_process.cpp
index 41ce4027a18..cd1fc0232cd 100644
--- a/engines/ultima/ultima8/world/snap_process.cpp
+++ b/engines/ultima/ultima8/world/snap_process.cpp
@@ -25,6 +25,7 @@
#include "ultima/ultima8/world/get_object.h"
#include "ultima/ultima8/world/actors/actor.h"
#include "ultima/ultima8/world/camera_process.h"
+#include "ultima/ultima8/ultima8.h"
namespace Ultima {
namespace Ultima8 {
@@ -46,7 +47,12 @@ SnapProcess::~SnapProcess() {
void SnapProcess::run() {
bool snap_to_player = ConfMan.getBool("camera_on_player");
- if (snap_to_player) {
+ bool in_stasis = Ultima8Engine::get_instance()->isAvatarInStasis();
+
+ // For cut scenes and remote cameras (when in stasis),
+ // we should snap to the right egg - not to the player.
+ // Snapping to player resumes once stasis is done.
+ if (snap_to_player && !in_stasis) {
const Actor *controlled = getControlledActor();
if (controlled) {
int32 x, y, z;
More information about the Scummvm-git-logs
mailing list