Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOZ minish cap - link vanishes when walking up / down stairs #108

Open
ITotalJustice opened this issue Jan 15, 2023 · 3 comments
Open

LOZ minish cap - link vanishes when walking up / down stairs #108

ITotalJustice opened this issue Jan 15, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ITotalJustice
Copy link
Owner

this seems to be a priority issue. normally bg2 is prio 2 and link is either prio 2 or higher.

Screenshot_20230115_215416

when walking down stairs, bg2 remains the same however it seems the the priority of the object is changed, causing link the vanish.

image

by disabling bg2, we can see that link is still there.

image

@ITotalJustice ITotalJustice added the bug Something isn't working label Jan 15, 2023
@ITotalJustice
Copy link
Owner Author

i fixed the issue, not sure if this is correct however because i figured it out by trial and error. i cannot find any documentation for this either...

the issue

object priority is set whenever a opaque pixel is drawn to the screen. this prevents further objects to be drawn to that pixel if their priority is >=.

the fix

it seems that the priority is always set for non-window objects, regardless of the pixel being opaque or not. furthermore, an opaque object will always overwrite a transparent object, regardless of priority.

this means that the check

if (line.priority[x] <= obj.priority) { continue }

becomes

if (line.priority[x] >= obj.priority && line.is_opaque[x] ) { continue }

and as for setting the priority

if (obj.opaque) { line.priority[x] = obj.priority; }

becomes

if (obj.priority < line.priority[x]) { line.priority[x] = obj.priority; }  

NOTE: i don't think the priority is set if the object is a window, although i may be wrong.

@ITotalJustice
Copy link
Owner Author

the above fix seems to break emerald intro

screen_record-2023-10-10_11.26.55.mp4

@ITotalJustice
Copy link
Owner Author

fixed it, i didn't properly impl "an opaque object will always overwrite a transparent object, regardless of priority." part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant