[Scummvm-git-logs] scummvm master -> 8985f8f447a04d2a46b509fdf225cd87c00c9ba9

csnover csnover at users.noreply.github.com
Tue Oct 3 04:36:07 CEST 2017


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:
8985f8f447 SCI32: Always sort kernel-generated screen items above script-generated screen items in last-ditch sort


Commit: 8985f8f447a04d2a46b509fdf225cd87c00c9ba9
    https://github.com/scummvm/scummvm/commit/8985f8f447a04d2a46b509fdf225cd87c00c9ba9
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-10-02T21:35:21-05:00

Commit Message:
SCI32: Always sort kernel-generated screen items above script-generated screen items in last-ditch sort

Fixes Trac#10257. Fixes Trac#10261.

Changed paths:
    engines/sci/graphics/screen_item32.h


diff --git a/engines/sci/graphics/screen_item32.h b/engines/sci/graphics/screen_item32.h
index ef29609..cdde2d3 100644
--- a/engines/sci/graphics/screen_item32.h
+++ b/engines/sci/graphics/screen_item32.h
@@ -256,6 +256,16 @@ public:
 			}
 
 			if (_position.y + _z == other._position.y + other._z) {
+				// Synthetic object IDs (numeric IDs) are used for screen items
+				// generated by the kernel, like the screen items generated by
+				// plane pics. In SSCI, these synthetic IDs started at 20000 so
+				// would deterministically always sort higher than any
+				// script-generated view in SSCI at the same position and
+				// priority.
+				if (other._object.isNumber() && !_object.isNumber()) {
+					return true;
+				}
+
 				// SSCI's last resort comparison here is to compare the _object
 				// IDs, but this is wrong and randomly breaks (at least):
 				//
@@ -295,6 +305,10 @@ public:
 			}
 
 			if (_position.y + _z == other._position.y + other._z) {
+				if (_object.isNumber() && !other._object.isNumber()) {
+					return true;
+				}
+
 				// This is different than SSCI; see ScreenItem::operator< for an
 				// explanation
 				return _creationId > other._creationId;
@@ -310,6 +324,10 @@ public:
 		}
 
 		if (_priority == other._priority) {
+			if (_object.isNumber() && !other._object.isNumber()) {
+				return true;
+			}
+
 			// This is different than SSCI; see ScreenItem::operator< for an
 			// explanation
 			return _creationId > other._creationId;





More information about the Scummvm-git-logs mailing list