X Tutup
Skip to content

SWORD25: Fix display order of deathscreen#6474

Merged
bluegr merged 1 commit intoscummvm:masterfrom
rinevard:sword25-death-background-fix
Mar 10, 2025
Merged

SWORD25: Fix display order of deathscreen#6474
bluegr merged 1 commit intoscummvm:masterfrom
rinevard:sword25-death-background-fix

Conversation

@rinevard
Copy link
Contributor

@rinevard rinevard commented Mar 10, 2025

Fix death screen appearing behind save/load menu by adjusting its z-value. The issue occurs due to differences in render order between original engine and ScummVM implementation.

The original engine renders based on parent-child relationships, it renders the subtree of a node completely before moving to other nodes. while ScummVM sorts by absolute z-values (parent absolute z + child z).

Here is an example showing when the two render engine have different behaviors. If we have a render tree like this:

- root (z: 0, absZ: 0)
    - nodeA(z: 1, absz: 1)
        - nodeAchild(z: 5, absz: 6)
    - nodeB(z: 3, absz: 3)

Different display orders:
ScummVM version: root -> nodeA -> nodeB -> nodeAchild
Original version: root -> nodeA -> nodeAchild -> nodeB

View BS_RenderObject::Render in renderobject.cpp in the source code of the original engine and RenderObject::render in renderobject.cpp in the source code of ScummVM version for more details.

Fixes: https://bugs.scummvm.org/ticket/15426

before
after

Fix death screen appearing behind save/load menu by adjusting its
z-value. The issue occurs due to differences in render order between
original engine and ScummVM implementation.

The original engine renders based on parent-child relationships, it
renders the subtree of a node completely before moving to other nodes.
while ScummVM sorts by absolute z-values (parent absolute z + child z).

View `BS_RenderObject::Render` in `renderobject.cpp` in the source code
of the original engine and `RenderObject::render` in `renderobject.cpp`
in the source code of ScummVM version for more details.

Fixes: https://bugs.scummvm.org/ticket/15426
@bluegr
Copy link
Member

bluegr commented Mar 10, 2025

Nice work!

The differences in the object drawing algorithm are a result of refactoring done in commits 0a0b2f3 and e935f85.

So, this is a regression from that optimization/refactoring.

Are there any other screens affected? Or just this one?

@rinevard
Copy link
Contributor Author

I haven't found other affected screens yet.

@bluegr
Copy link
Member

bluegr commented Mar 10, 2025

Thanks your work, and for testing this! Merging

@bluegr bluegr merged commit 361ebbc into scummvm:master Mar 10, 2025
8 checks passed
@joerg-nafcom
Copy link

I haven't found other affected screens yet.

I am the reporter of the bug in question and I can confirm there aren't any other screens affected! Good job! Thank you!!!

@bluegr bluegr added the GSoC Part of a Google Summer of Code project label Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Part of a Google Summer of Code project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup