[Scummvm-git-logs] scummvm master -> 5ce54293a888821fe6b5424ee87c1d662f50d1b5

OMGPizzaGuy noreply at scummvm.org
Wed Feb 8 00:12:02 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:
c32b0f88da ULTIMA8: Fix rendering for transparent item drawn after only if locations are equal
5ce54293a8 ULTIMA8: Add test case for rendering issue where transparent rule should not apply


Commit: c32b0f88dabf1ba32309d8c339ed7a587557ee24
    https://github.com/scummvm/scummvm/commit/c32b0f88dabf1ba32309d8c339ed7a587557ee24
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-02-07T18:11:38-06:00

Commit Message:
ULTIMA8: Fix rendering for transparent item drawn after only if locations are equal

Changed paths:
    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 64b36ee4316..10c4b5023b1 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -428,12 +428,19 @@ inline bool SortItem::below(const SortItem &si2) const {
 	if (si1._flat != si2._flat)
 		return si1._flat > si2._flat;
 
-	// Trans always gets drawn after
-	if (si1._trans != si2._trans)
-		return si1._trans < si2._trans;
+	// Specialist handling for same location
+	if (si1._x == si2._x && si1._y == si2._y) {
+		// Trans always gets drawn after
+		if (si1._trans != si2._trans)
+			return si1._trans < si2._trans;
+	}
 
 	// Specialist z flat handling
 	if (si1._flat && si2._flat) {
+		// Trans always gets drawn after
+		if (si1._trans != si2._trans)
+			return si1._trans < si2._trans;
+
 		// Animated always gets drawn after
 		if (si1._anim != si2._anim)
 			return si1._anim < si2._anim;


Commit: 5ce54293a888821fe6b5424ee87c1d662f50d1b5
    https://github.com/scummvm/scummvm/commit/5ce54293a888821fe6b5424ee87c1d662f50d1b5
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-02-07T18:11:38-06:00

Commit Message:
ULTIMA8: Add test case for rendering issue where transparent rule should not apply

Changed paths:
    test/engines/ultima/ultima8/world/sort_item.h


diff --git a/test/engines/ultima/ultima8/world/sort_item.h b/test/engines/ultima/ultima8/world/sort_item.h
index d287ce37d41..b7361a520d4 100644
--- a/test/engines/ultima/ultima8/world/sort_item.h
+++ b/test/engines/ultima/ultima8/world/sort_item.h
@@ -220,6 +220,30 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT(!si2.below(si1));
 	}
 
+	/**
+	 * Overlapping y-flat vs non-flat items where they intersect in opposing directions
+	 * Test case for rendering issue at MainActor::teleport 41 20583 10083 48
+	 */
+	void test_y_flat_intersect_sort() {
+		Ultima::Ultima8::SortItem si1(nullptr);
+		Ultima::Ultima8::SortItem si2(nullptr);
+
+		Ultima::Ultima8::Box b1(20479, 9887, 48, 64, 128, 40);
+		si1.setBoxBounds(b1, 0, 0);
+		si1._trans = true;
+		si1._solid = true;
+		si1._land = true;
+
+		Ultima::Ultima8::Box b2(20543, 9855, 48, 96, 0, 16);
+		si2.setBoxBounds(b2, 0, 0);
+
+		TS_ASSERT(si1.overlap(si2));
+		TS_ASSERT(si2.overlap(si1));
+
+		TS_ASSERT(si1.below(si2));
+		TS_ASSERT(!si2.below(si1));
+	}
+
 	/**
 	 * Overlapping non-flat items clearly in z - avatar above candle
 	 * Test case for rendering issue at MainActor::teleport 6 7774 19876 48




More information about the Scummvm-git-logs mailing list