Better draw level sorting when draw levels are equal
This commit is contained in:
parent
7343355564
commit
14f2a3ad5d
1 changed files with 6 additions and 3 deletions
|
@ -1965,9 +1965,12 @@ local int DrawLevelCompare(const void* v1, const void* v2) {
|
|||
drawlevel2 = c2->Type->DrawLevel;
|
||||
}
|
||||
if (drawlevel1 == drawlevel2) {
|
||||
return c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth - c2->X ?
|
||||
c1->Y * MaxMapWidth + c1->X - c2->Y * MaxMapWidth - c2->X :
|
||||
c1->Slot - c2->Slot;
|
||||
/*return (c1->Y) * MaxMapWidth + (c1->X) - (c2->Y) * MaxMapWidth - (c2->X) ?
|
||||
(c1->Y) * MaxMapWidth + (c1->X) - (c2->Y) * MaxMapWidth - (c2->X) :
|
||||
c1->Slot - c2->Slot; //*/ //Previous code, will be removed if new one is ok.
|
||||
return (c1->Y*TileSizeY+c1->IY) - (c2->Y*TileSizeY + c2->IY) ?
|
||||
(c1->Y*TileSizeY+c1->IY) - (c2->Y*TileSizeY + c2->IY) :
|
||||
c1->Slot - c2->Slot; //*/
|
||||
} else {
|
||||
return drawlevel1 <= drawlevel2 ? -1 : 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue