[Scummvm-git-logs] scummvm master -> 182e82f7f221d5945100ceb68ac643d0e77f6186
OMGPizzaGuy
noreply at scummvm.org
Sat Sep 16 16:44:38 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:
182e82f7f2 ULTIMA8: Fix paint order issue in catacombs.
Commit: 182e82f7f221d5945100ceb68ac643d0e77f6186
https://github.com/scummvm/scummvm/commit/182e82f7f221d5945100ceb68ac643d0e77f6186
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-09-16T11:44:18-05:00
Commit Message:
ULTIMA8: Fix paint order issue in catacombs.
Cobweb is a non-solid transparent flat object that should draw after objects it intersects
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 c6c7a9a1471..220d312fc33 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -414,7 +414,7 @@ inline bool SortItem::below(const SortItem &si2) const {
// If an object's base (z-bottom) is higher another's, it should be rendered after.
// This check must be on the z-bottom and not the z-top because two objects with the
// same z-position may have different heights (think of a mouse sorting vs the Avatar).
- if (si1._z != si2._z)
+ if (si1._z != si2._z && (si1._solid == si2._solid || si1._trans == si2._trans))
return si1._z < si2._z;
// Are overlapping in all 3 dimensions if we come here
diff --git a/test/engines/ultima/ultima8/world/sort_item.h b/test/engines/ultima/ultima8/world/sort_item.h
index 891e681577d..4535f5f486b 100644
--- a/test/engines/ultima/ultima8/world/sort_item.h
+++ b/test/engines/ultima/ultima8/world/sort_item.h
@@ -182,7 +182,7 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
* Test case for rendering issue at MainActor::teleport 41 17627 16339 48
* Wall with window should render after non-window wall
*/
- void test_nonflat_tranparent_sort() {
+ void test_nonflat_transparent_sort() {
Ultima::Ultima8::SortItem si1;
Ultima::Ultima8::SortItem si2;
@@ -200,6 +200,28 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
TS_ASSERT(!si2.below(si1));
}
+ /**
+ * Overlapping lower Z position transparent non-solid draw after
+ * Test case for rendering issue at MainActor::teleport 50 2316 7812 48
+ * Skeleton in niche should render before cobweb
+ */
+ void test_ignore_z_transparent_sort() {
+ Ultima::Ultima8::SortItem si1;
+ Ultima::Ultima8::SortItem si2;
+
+ Ultima::Ultima8::Box b1(2212, 7804, 64, 192, 32, 8);
+ si1.setBoxBounds(b1, 0, 0);
+ si1._solid = true;
+ si1._land = true;
+
+ Ultima::Ultima8::Box b2(2207, 7839, 48, 0, 96, 48);
+ si2.setBoxBounds(b2, 0, 0);
+ si2._trans = true;
+
+ TS_ASSERT(si1.below(si2));
+ TS_ASSERT(!si2.below(si1));
+ }
+
/**
* Overlapping y-flat vs non-flat items
* Test case for rendering issue at MainActor::teleport 41 20063 13887 48
More information about the Scummvm-git-logs
mailing list