diff options
-rw-r--r-- | engines/sci/graphics/screen_item32.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/sci/graphics/screen_item32.h b/engines/sci/graphics/screen_item32.h index ef29609da6..cdde2d3965 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; |