Open ITotalJustice opened 1 year ago
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...
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 >=.
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.
the above fix seems to break emerald intro
https://github.com/ITotalJustice/notorious_beeg/assets/47043333/57ec5544-e2a1-47e3-b427-90f69471b199
fixed it, i didn't properly impl "an opaque object will always overwrite a transparent object, regardless of priority." part
this seems to be a priority issue. normally bg2 is prio 2 and link is either prio 2 or higher.
when walking down stairs, bg2 remains the same however it seems the the priority of the object is changed, causing link the vanish.
by disabling bg2, we can see that link is still there.