[Scummvm-git-logs] scummvm master -> 5677fcab43acedcf704155fa3901cb11c883c0d7

OMGPizzaGuy noreply at scummvm.org
Wed Sep 20 23:26:19 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:
fea7f124bc ULTIMA8: Fix mistakes in comments
5677fcab43 ULTIMA8: Fix roof draws first rule & clarify rule on different test


Commit: fea7f124bcbb6002e13b12b1e3eaf8919367cf9e
    https://github.com/scummvm/scummvm/commit/fea7f124bcbb6002e13b12b1e3eaf8919367cf9e
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-09-20T18:26:02-05:00

Commit Message:
ULTIMA8: Fix mistakes in comments

Changed paths:
    engines/ultima/ultima8/misc/box.h
    engines/ultima/ultima8/world/item_sorter.cpp
    engines/ultima/ultima8/world/sort_item.h


diff --git a/engines/ultima/ultima8/misc/box.h b/engines/ultima/ultima8/misc/box.h
index 07f9b91ccf8..fe4fb4ed8ce 100644
--- a/engines/ultima/ultima8/misc/box.h
+++ b/engines/ultima/ultima8/misc/box.h
@@ -29,7 +29,7 @@ namespace Ultima8 {
 
 /**
  * Represents a worldspace bounding box and manipulation of those bounds.
- * The box is build from a world point and positive dimensions
+ * The box is built from a world point and positive dimensions
  * The box has reversed coordinates for x and y, meaning those dimensions are
  * subtracted from primary world point to calculate other points.
  */
diff --git a/engines/ultima/ultima8/world/item_sorter.cpp b/engines/ultima/ultima8/world/item_sorter.cpp
index 9700e975cf6..6c37a129491 100644
--- a/engines/ultima/ultima8/world/item_sorter.cpp
+++ b/engines/ultima/ultima8/world/item_sorter.cpp
@@ -275,7 +275,7 @@ void ItemSorter::AddItem(const Item *add) {
 
 void ItemSorter::CheckOcclusion() {
 	for (SortItem *it = _items; it != nullptr; it = it->_next) {
-		// Check if item is part of a 4x4 adjoined square
+		// Check if item is part of a 2x2 adjoined square
 		if (it->_occl && it->_fbigsq && it->_xAdjoin && it->_yAdjoin &&
 			it->_xAdjoin->_yAdjoin && it->_yAdjoin->_xAdjoin &&
 			it->_xAdjoin->_yAdjoin == it->_yAdjoin->_xAdjoin) {
diff --git a/engines/ultima/ultima8/world/sort_item.h b/engines/ultima/ultima8/world/sort_item.h
index af2bf05ca77..6788ff2ab88 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -93,8 +93,8 @@ struct SortItem {
 	int32   _sxBot;      // Screenspace bounding box bottom x coord (RNB x coord) ss origin
 	int32   _syBot;      // Screenspace bounding box bottom extent  (RNB y coord) ss origin
 
-	SortItem *_xAdjoin;  // Item sharing an right x edge with the left x edge - used for occlusion
-	SortItem *_yAdjoin;  // Item sharing an near y edge with the fay y edge - used for occlusion
+	SortItem *_xAdjoin;  // Item sharing a right x edge with the left x edge - used for occlusion
+	SortItem *_yAdjoin;  // Item sharing a near y edge with the far y edge - used for occlusion
 
 	bool    _fbigsq : 1;         // Needs 1 bit  0
 	bool    _flat : 1;           // Needs 1 bit  1


Commit: 5677fcab43acedcf704155fa3901cb11c883c0d7
    https://github.com/scummvm/scummvm/commit/5677fcab43acedcf704155fa3901cb11c883c0d7
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-09-20T18:26:02-05:00

Commit Message:
ULTIMA8: Fix roof draws first rule & clarify rule on different test
Additional roof test documents altered behavior from orginal game & leaves opportunity to match orginal in the future if desired

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 6788ff2ab88..b9308e60f3c 100644
--- a/engines/ultima/ultima8/world/sort_item.h
+++ b/engines/ultima/ultima8/world/sort_item.h
@@ -430,7 +430,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 && (si1._solid == si2._solid || si1._trans == si2._trans))
+	if (si1._z != si2._z && si1._solid == si2._solid)
 		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 ebca88ce183..7d5fb9deeac 100644
--- a/test/engines/ultima/ultima8/world/sort_item.h
+++ b/test/engines/ultima/ultima8/world/sort_item.h
@@ -177,6 +177,43 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT(!si2.below(si1));
 	}
 
+	/**
+	 * Bug in original game rendering order for roof pieces
+	 * Test case for rendering issue at MainActor::teleport 41 15484 13660 96
+	 */
+	void test_main_actor_roof_bug() {
+		Ultima::Ultima8::SortItem si1;
+		Ultima::Ultima8::SortItem si2;
+
+		Ultima::Ultima8::Box b1(15484, 13660, 96, 64, 64, 40);
+		si1.setBoxBounds(b1, 0, 0);
+		si1._solid = true;
+
+		Ultima::Ultima8::Box b2(15423, 13631, 104, 128, 32, 8);
+		si2.setBoxBounds(b2, 0, 0);
+		si2._occl = true;
+		si2._roof = true;
+		si2._land = true;
+
+		// This roof is below main actor
+		TS_ASSERT(!si1.below(si2));
+		TS_ASSERT(si2.below(si1));
+
+		Ultima::Ultima8::Box b3(15551, 13631, 104, 128, 32, 8);
+		si2.setBoxBounds(b2, 0, 0);
+		si2._occl = true;
+		si2._roof = true;
+		si2._land = true;
+
+		// Original Game: This roof is above main actor
+		//TS_ASSERT(si1.below(si2));
+		//TS_ASSERT(!si2.below(si1));
+
+		// Our Behavior: This roof is below main actor
+		TS_ASSERT(!si1.below(si2));
+		TS_ASSERT(si2.below(si1));
+	}
+
 	/**
 	 * Overlapping non-flat items draw transparent after
 	 * Test case for rendering issue at MainActor::teleport 41 17627 16339 48
@@ -205,7 +242,7 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
 	 * 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() {
+	void test_ignore_z_non_solid_sort() {
 		Ultima::Ultima8::SortItem si1;
 		Ultima::Ultima8::SortItem si2;
 




More information about the Scummvm-git-logs mailing list