mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
reorder vissprites, so that objects with higher map indices appear in front (#1165)
* fix stable vissprites sorting * add comment
This commit is contained in:
parent
6aed7bf13b
commit
7202ffa754
@ -917,10 +917,12 @@ static void msort(vissprite_t **s, vissprite_t **t, int n)
|
||||
for (i = 1; i < n; i++)
|
||||
{
|
||||
vissprite_t *temp = s[i];
|
||||
if (s[i-1]->scale < temp->scale)
|
||||
// [FG] change '<' to '<=' here and below, so that vissprites with the same scale
|
||||
// are reordered, so that the object with the higher map index appears in front
|
||||
if (s[i-1]->scale <= temp->scale)
|
||||
{
|
||||
int j = i;
|
||||
while ((s[j] = s[j-1])->scale < temp->scale && --j);
|
||||
while ((s[j] = s[j-1])->scale <= temp->scale && --j);
|
||||
s[j] = temp;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user