-
Notifications
You must be signed in to change notification settings - Fork 35
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
reorder vissprites, so that objects with higher map indices appear in front #1165
Conversation
What was the issue that this fixed? |
Vanilla Doom sorts vissprites for objects that are placed on the exact same spot on the map (and thus share the same There is a nice thread about this in the ZDoom forums: |
PrBoom has fixed this in the same manner as Zdoom by reversing the order in which the visplanes are added up. Is just hidden behind some rather obscure config variable. @rfomin I'm considering to do the same instead of changing the sorting algorithm itself? And I'm still considering to do this based on complevel. |
Thanks for the info 👍 |
But sprite flickering is not fixed in PrBoom+/DSDA-Doom. Test WAD: sort.zip (with software render, fire the gun, the order of the sprites will change).
The config variable is
I think we should fix sorting algorithm. Merge Sort should be stable by design. From Wikipedia:
|
DSDA will need this fix to preserve stable sorting in Vanilla order: --- a/prboom2/src/r_things.c
+++ b/prboom2/src/r_things.c
@@ -1324,7 +1324,7 @@ static void msort(vissprite_t **s, vissprite_t **t, int n)
msort(s1, t, n1);
msort(s2, t, n2);
- while ((*s1)->scale > (*s2)->scale ?
+ while ((*s1)->scale >= (*s2)->scale ?
(*d++ = *s1++, --n1) : (*d++ = *s2++, --n2));
if (n2) |
Maybe we should implement it the same way in Woof? This fix seems more logical to me. Performance looks the same. |
No description provided.