[Scummvm-git-logs] scummvm master -> 4d1ec7ff2b6a2b4d31fae316082f04a269a19ad2
OMGPizzaGuy
noreply at scummvm.org
Wed Oct 4 04:10:34 UTC 2023
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:
4d1ec7ff2b ULTIMA8: Undo sort item bounds inclusive of right screenspace edge.
Commit: 4d1ec7ff2b6a2b4d31fae316082f04a269a19ad2
https://github.com/scummvm/scummvm/commit/4d1ec7ff2b6a2b4d31fae316082f04a269a19ad2
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-10-03T23:09:48-05:00
Commit Message:
ULTIMA8: Undo sort item bounds inclusive of right screenspace edge.
This caused too many paint dependency cycles in current code.
Changed paths:
engines/ultima/ultima8/world/sort_item.h
test/engines/ultima/ultima8/world/sort_item.h
diff --git a/engines/ultima/ultima8/world/sort_item.h b/engines/ultima/ultima8/world/sort_item.h
index 854808f6c73..5e84877e3f6 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -326,8 +326,8 @@ inline bool SortItem::overlap(const SortItem &si2) const {
// 'normal' of bot right line (-2, 1) of the bounding box
const int32 dot_bot_right = -point_bot_diff[0] - point_bot_diff[1] * 2;
- const bool right_clear = _sxRight < si2._sxLeft;
- const bool left_clear = _sxLeft > si2._sxRight;
+ const bool right_clear = _sxRight <= si2._sxLeft;
+ const bool left_clear = _sxLeft >= si2._sxRight;
const bool top_left_clear = dot_top_left >= 0;
const bool top_right_clear = dot_top_right >= 0;
const bool bot_left_clear = dot_bot_left >= 0;
diff --git a/test/engines/ultima/ultima8/world/sort_item.h b/test/engines/ultima/ultima8/world/sort_item.h
index f6e4838a16c..217d8490700 100644
--- a/test/engines/ultima/ultima8/world/sort_item.h
+++ b/test/engines/ultima/ultima8/world/sort_item.h
@@ -451,8 +451,9 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
si2.setBoxBounds(b2, 0, 0);
si1._fixed = true;
- TS_ASSERT(si1.overlap(si2));
- TS_ASSERT(si2.overlap(si1));
+ // These share a one pixel edge, but we need to ignore that currently to prevent paint dependency cycles
+ TS_ASSERT(!si1.overlap(si2));
+ TS_ASSERT(!si2.overlap(si1));
TS_ASSERT(si1.below(si2));
TS_ASSERT(!si2.below(si1));
@@ -791,14 +792,15 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
b2 = Ultima::Ultima8::Box(128, -128, 0, 128, 128, 32);
si2.setBoxBounds(b2, 0, 0);
- TS_ASSERT(si1.overlap(si2));
- TS_ASSERT(si2.overlap(si1));
+ // These often share a one pixel edge, but we need to ignore that currently to prevent paint dependency cycles
+ TS_ASSERT(!si1.overlap(si2));
+ TS_ASSERT(!si2.overlap(si1));
b2 = Ultima::Ultima8::Box(-128, 128, 0, 128, 128, 32);
si2.setBoxBounds(b2, 0, 0);
- TS_ASSERT(si1.overlap(si2));
- TS_ASSERT(si2.overlap(si1));
+ TS_ASSERT(!si1.overlap(si2));
+ TS_ASSERT(!si2.overlap(si1));
// Check outside left & right bounds using non-flats
b2 = Ultima::Ultima8::Box(160, -128, 0, 128, 128, 32);
More information about the Scummvm-git-logs
mailing list