diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index bdf951d31..a465a70bc 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -2960,12 +2960,11 @@ int32_t wallfront(int32_t l1, int32_t l2) // static inline int32_t spritewallfront(const spritetype *s, int32_t w) { - walltype *wal; - int32_t x1, y1; + const walltype *const wal = &wall[w]; + const walltype *wal2 = &wall[wal->point2]; + const int32_t x1 = wal->x, y1 = wal->y; - wal = &wall[w]; x1 = wal->x; y1 = wal->y; - wal = &wall[wal->point2]; - return (dmulscale32(wal->x-x1,s->y-y1,-(s->x-x1),wal->y-y1) >= 0); + return (dmulscale32(wal2->x-x1, s->y-y1, -(s->x-x1), wal2->y-y1) >= 0); } // @@ -9059,7 +9058,7 @@ static inline int32_t sameside(_equation *eq, _point2d *p1, _point2d *p2 // void drawmasks(void) { - int32_t i, j, k, l, modelp=0; + int32_t i, modelp=0; for (i=spritesortcnt-1; i>=0; i--) tspriteptr[i] = &tsprite[i]; @@ -9099,7 +9098,8 @@ killsprite: } { - int32_t gap, ys; + int32_t j, l, gap, ys; + gap = 1; while (gap < spritesortcnt) gap = (gap<<1)+1; for (gap>>=1; gap>0; gap>>=1) //Sort sprite list for (i=0; ix; spr.y = (float)tspriteptr[i]->y; - if (!sameside(&maskeq, &spr, &pos) && sameside(&p1eq, &middle, &spr) && sameside(&p2eq, &middle, &spr)) + if (!sameside(&maskeq, &spr, &pos) && + sameside(&p1eq, &middle, &spr) && + sameside(&p2eq, &middle, &spr) + ) { drawsprite(i); tspriteptr[i] = NULL; } } } + drawmaskwall(maskwallcnt); } - while (spritesortcnt) + while (spritesortcnt--) { - spritesortcnt--; if (tspriteptr[spritesortcnt] != NULL) drawsprite(spritesortcnt); }