NagyD / SDLPoP

An open-source port of Prince of Persia, based on the disassembly of the DOS version.
GNU General Public License v3.0
1.1k stars 141 forks source link

Another fix for gate drawing bug #95

Closed Falcury closed 7 years ago

Falcury commented 8 years ago

This is another version of the fix for the gate drawing bug that occurs when multiple gates are stacked on top of each other. Calls draw_tile_anim_topright() to redraw the erased part of the gate. Luckily, the animation when the gate opens still works correctly this way.

I also tried to restore FIX_BIGPILLAR_CLIMB, but as it says in bugs.txt and in the code comments, "The current fix causes glitches you can see on bug_chomper.PNG and bug_climb.PNG". Unfortunately I couldn't find back these images, so I can't really verify that the glitches are fixed... But, this may be a possible fix...?

// seg008:1E3A
void __pascal far draw_floor_overlay() {
#ifdef FIX_BIGPILLAR_CLIMB
    if (tile_left != tiles_0_empty) {
        // Bug: When climbing up to a floor with a big pillar top behind, turned right, Kid sees through floor.
        // The bigpillar_top tile should be treated similarly to an empty tile here.
        if (!fix_bigpillar_climb || (tile_left != tiles_9_bigpillar_top)) {
            return;
        }
    }
#else
    if (tile_left != tiles_0_empty) return;
#endif
NagyD commented 8 years ago

"The current fix causes glitches you can see on bug_chomper.PNG and bug_climb.PNG". Unfortunately I couldn't find back these images, so I can't really verify that the glitches are fixed...

I never published those images, sorry about that... Here they are: bug_chomper bug_climb They're from 2014 May, when the guards did not have colors yet...

Falcury commented 8 years ago

Thank you for the screenshots! I was able to reproduce the glitches. I added a second commit with a fix for the big pillar drawing bug, where the glitches do not occur.

By the way, I noticed while testing that there is another drawing bug with chompers (in the original game): chomper_climb_bug