mirror of https://github.com/OpenTTD/OpenTTD
(svn r12736) -Codechange: a (small) touch of coding style in viewport.cpp.
parent
6ab158f9d9
commit
208dd15c91
|
@ -1341,17 +1341,15 @@ static void ViewportDrawTileSprites(const TileSpriteToDrawVector *tstdv)
|
|||
|
||||
static void ViewportSortParentSprites(ParentSpriteToDraw *psd[])
|
||||
{
|
||||
while (*psd != NULL) {
|
||||
for (; *psd != NULL; psd++) {
|
||||
ParentSpriteToDraw *ps = *psd;
|
||||
|
||||
if (!ps->comparison_done) {
|
||||
ParentSpriteToDraw** psd2 = psd;
|
||||
if (ps->comparison_done) continue;
|
||||
|
||||
ps->comparison_done = true;
|
||||
|
||||
while (*++psd2 != NULL) {
|
||||
for (ParentSpriteToDraw **psd2 = psd + 1; *psd2 != NULL; psd2++) {
|
||||
ParentSpriteToDraw *ps2 = *psd2;
|
||||
ParentSpriteToDraw** psd3;
|
||||
|
||||
if (ps2->comparison_done) continue;
|
||||
|
||||
|
@ -1384,7 +1382,7 @@ static void ViewportSortParentSprites(ParentSpriteToDraw *psd[])
|
|||
}
|
||||
|
||||
/* Swap the two sprites ps and ps2 using bubble-sort algorithm. */
|
||||
psd3 = psd;
|
||||
ParentSpriteToDraw **psd3 = psd;
|
||||
do {
|
||||
ParentSpriteToDraw* temp = *psd3;
|
||||
*psd3 = ps2;
|
||||
|
@ -1393,9 +1391,6 @@ static void ViewportSortParentSprites(ParentSpriteToDraw *psd[])
|
|||
psd3++;
|
||||
} while (psd3 <= psd2);
|
||||
}
|
||||
} else {
|
||||
psd++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue