diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 39d51b479..7792e4e00 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -5537,12 +5537,16 @@ static void drawsprite_classic(int32_t snum) const int32_t spritenum = tspr->owner; const int32_t sectnum = tspr->sectnum; const sectortype *const sec = (sectnum>=0) ? §or[sectnum] : NULL; - int32_t tilenum = tspr->picnum; + int32_t tilenum; int32_t cstat = tspr->cstat; - if ((unsigned)tilenum >= MAXTILES || sec==NULL) + if ((unsigned)tspr->picnum >= MAXTILES || sec==NULL) return; + DO_TILE_ANIM(tspr->picnum, spritenum+32768); + + tilenum = tspr->picnum; + if ((cstat&48)==48) vtilenum = tilenum; // if the game wants voxels, it gets voxels else if (usevoxels && tiletovox[tilenum] != -1 @@ -5559,7 +5563,6 @@ static void drawsprite_classic(int32_t snum) { if (spritenum < 0 || tilesizx[tilenum] <= 0 || tilesizy[tilenum] <= 0) return; - DO_TILE_ANIM(tilenum, spritenum+32768); } if (tspr->xrepeat <= 0 || tspr->yrepeat <= 0) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 74fe0fd42..357513ea9 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1350,6 +1350,8 @@ void polymer_drawsprite(int32_t snum) if ((tspr->cstat & 16384) && (!depth || mirrors[depth-1].plane)) return; + DO_TILE_ANIM(tspr->picnum, tspr->owner+32768); + calc_and_apply_fog(tspr->shade, sector[tspr->sectnum].visibility, sector[tspr->sectnum].floorpal); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 1368eee07..e8929e6ba 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -4889,16 +4889,18 @@ void polymost_drawsprite(int32_t snum) tspr = tspriteptr[snum]; if (tspr->owner < 0 || tspr->picnum < 0 || tspr->picnum >= MAXTILES) return; + spritenum = tspr->owner; + + DO_TILE_ANIM(tspr->picnum, spritenum+32768); + globalpicnum = tspr->picnum; globalshade = tspr->shade; globalpal = tspr->pal; globalorientation = tspr->cstat; - spritenum = tspr->owner; if ((globalorientation&48) != 48) // only non-voxel sprites should do this { int32_t flag; - DO_TILE_ANIM(globalpicnum, spritenum+32768); flag = usehightile && h_xsize[globalpicnum]; xoff = (int32_t)tspr->xoffset; yoff = (int32_t)tspr->yoffset;