[Scummvm-git-logs] scummvm master -> 65b725c12a32913929c5b2099bb72e744465dac3

OMGPizzaGuy noreply at scummvm.org
Sat Jan 28 14:09:18 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:
65b725c12a ULTIMA8: Add sprite rule to sort item listLessThan to fix rendering bug


Commit: 65b725c12a32913929c5b2099bb72e744465dac3
    https://github.com/scummvm/scummvm/commit/65b725c12a32913929c5b2099bb72e744465dac3
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-01-28T08:08:13-06:00

Commit Message:
ULTIMA8: Add sprite rule to sort item listLessThan to fix rendering bug

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 f4fe9366dbc..06a77c35e92 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -235,8 +235,12 @@ struct SortItem {
 	// Comparison for the sorted lists
 	inline bool listLessThan(const SortItem &si2) const {
 		const SortItem &si1 = *this;
+		if (si1._sprite != si2._sprite)
+			return si1._sprite < si2._sprite;
+
 		if (si1._z != si2._z)
 			return si1._z < si2._z;
+
 		return si1._flat > si2._flat;
 	}
 
diff --git a/test/engines/ultima/ultima8/world/sort_item.h b/test/engines/ultima/ultima8/world/sort_item.h
index e475eb3d3ec..715478955cc 100644
--- a/test/engines/ultima/ultima8/world/sort_item.h
+++ b/test/engines/ultima/ultima8/world/sort_item.h
@@ -64,10 +64,14 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
 		Ultima::Ultima8::SortItem si1(nullptr);
 		Ultima::Ultima8::SortItem si2(nullptr);
 
-		Ultima::Ultima8::Box b1(0, 0, 10, 10, 10, 10);
-		Ultima::Ultima8::Box b2(0, 0, 0, 10, 10, 10);
+		Ultima::Ultima8::Box b1(59454, 49246, 80, 32, 160, 16);
+		Ultima::Ultima8::Box b2(59440, 49144, 63, 32, 32, 63);
 		si1.setBoxBounds(b1, 0, 0);
 		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));
 
@@ -218,7 +222,7 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
 	}
 
 	/**
-	 * Overlapping non-flat items - rule not yet known
+	 * Overlapping non-flat items - animated vs occluding
 	 * Test case for rendering issue at MainActor::teleport 3 20747 2227 0
 	 * This looks like a possible rendering test easter egg in the original game
 	 */




More information about the Scummvm-git-logs mailing list