mirror of https://github.com/OpenTTD/OpenTTD
(svn r14409) -Codechange: Simplify a loop and correct a comment.
parent
f2d7c48b31
commit
a370f32c15
|
@ -1333,15 +1333,12 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swap the two sprites ps and ps2 using bubble-sort algorithm. */
|
/* Move ps2 in front of ps */
|
||||||
ParentSpriteToDraw **psd3 = psd;
|
ParentSpriteToDraw *temp = ps2;
|
||||||
do {
|
for (ParentSpriteToDraw **psd3 = psd2; psd3 > psd; psd3--) {
|
||||||
ParentSpriteToDraw *temp = *psd3;
|
*psd3 = *(psd3 - 1);
|
||||||
*psd3 = ps2;
|
}
|
||||||
ps2 = temp;
|
*psd = temp;
|
||||||
|
|
||||||
psd3++;
|
|
||||||
} while (psd3 <= psd2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue