Revert an awful stupidity I committed in r3700.

git-svn-id: https://svn.eduke32.com/eduke32@3703 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-04-22 10:35:48 +00:00
parent 086ef3f901
commit b9b8e01e32

View file

@ -9200,17 +9200,21 @@ killsprite:
pos.x = (float)globalposx; pos.x = (float)globalposx;
pos.y = (float)globalposy; pos.y = (float)globalposy;
while (maskwallcnt--) // CAUTION: maskwallcnt and spritesortcnt may be zero!
// Writing e.g. "while (maskwallcnt--)" is wrong!
while (maskwallcnt)
{ {
_point2d dot, dot2, middle; _point2d dot, dot2, middle;
// PLAG: sorting stuff // PLAG: sorting stuff
_equation maskeq, p1eq, p2eq; _equation maskeq, p1eq, p2eq;
const int32_t w = (getrendermode()==REND_POLYMER) ? const int32_t w = (getrendermode()==REND_POLYMER) ?
maskwall[maskwallcnt] : thewall[maskwall[maskwallcnt]]; maskwall[maskwallcnt-1] : thewall[maskwall[maskwallcnt-1]];
const int32_t otherside_spr_first = (getrendermode() == REND_CLASSIC); const int32_t otherside_spr_first = (getrendermode() == REND_CLASSIC);
maskwallcnt--;
dot.x = (float)wall[w].x; dot.x = (float)wall[w].x;
dot.y = (float)wall[w].y; dot.y = (float)wall[w].y;
dot2.x = (float)wall[wall[w].point2].x; dot2.x = (float)wall[wall[w].point2].x;
@ -9228,8 +9232,9 @@ killsprite:
} }
i = spritesortcnt; i = spritesortcnt;
while (i--) while (i)
{ {
i--;
if (tspriteptr[i] != NULL) if (tspriteptr[i] != NULL)
{ {
_point2d spr; _point2d spr;
@ -9251,8 +9256,9 @@ killsprite:
drawmaskwall(maskwallcnt); drawmaskwall(maskwallcnt);
} }
while (spritesortcnt--) while (spritesortcnt)
{ {
spritesortcnt--;
if (tspriteptr[spritesortcnt] != NULL) if (tspriteptr[spritesortcnt] != NULL)
drawsprite(spritesortcnt); drawsprite(spritesortcnt);
} }