A couple of meaning-preserving rewrites of picanm[]-touching code.

git-svn-id: https://svn.eduke32.com/eduke32@3204 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-11-17 19:46:37 +00:00
parent dd424fac70
commit 6abb63670c
2 changed files with 56 additions and 58 deletions

View file

@ -10893,6 +10893,7 @@ int32_t krecip(int32_t num)
void spriteheightofs(int16_t i, int32_t *height, int32_t *zofs, int32_t alsotileyofs) void spriteheightofs(int16_t i, int32_t *height, int32_t *zofs, int32_t alsotileyofs)
{ {
int32_t hei, flooraligned=((sprite[i].cstat&48)==32); int32_t hei, flooraligned=((sprite[i].cstat&48)==32);
int32_t picnum = sprite[i].picnum;
if (zofs) if (zofs)
*zofs = 0; *zofs = 0;
@ -10904,16 +10905,17 @@ void spriteheightofs(int16_t i, int32_t *height, int32_t *zofs, int32_t alsotile
return; return;
} }
hei = (tilesizy[sprite[i].picnum]*sprite[i].yrepeat)<<2; hei = (tilesizy[picnum]*sprite[i].yrepeat)<<2;
if (zofs) if (zofs)
{ {
if (sprite[i].cstat&128) if (sprite[i].cstat&128)
*zofs = hei>>1; *zofs = hei>>1;
if (alsotileyofs && (unsigned)sprite[i].picnum < MAXTILES) if (alsotileyofs)
if (picanm[sprite[i].picnum].yofs) if (picanm[picnum].yofs)
*zofs -= picanm[sprite[i].picnum].yofs*sprite[i].yrepeat<<2; *zofs -= picanm[picnum].yofs*sprite[i].yrepeat<<2;
} }
*height = hei; *height = hei;
} }
@ -12558,7 +12560,8 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum,
clipsectcnt = 0; clipsectnum = 1; clipsectcnt = 0; clipsectnum = 1;
do do
{ {
/*Push FACE sprites #if 0
// Push FACE sprites
for(i=headspritesect[clipsectorlist[clipsectcnt]];i>=0;i=nextspritesect[i]) for(i=headspritesect[clipsectorlist[clipsectcnt]];i>=0;i=nextspritesect[i])
{ {
spr = &sprite[i]; spr = &sprite[i];
@ -12590,8 +12593,8 @@ int32_t pushmove(vec3_t *vect, int16_t *sectnum,
updatesector(vect->x,vect->y,sectnum); updatesector(vect->x,vect->y,sectnum);
} }
} }
}*/ }
#endif
sec = &sector[clipsectorlist[clipsectcnt]]; sec = &sector[clipsectorlist[clipsectcnt]];
if (dir > 0) if (dir > 0)
startwall = sec->wallptr, endwall = startwall + sec->wallnum; startwall = sec->wallptr, endwall = startwall + sec->wallnum;

View file

@ -47,16 +47,15 @@ static int32_t g_precacheCount;
extern int32_t g_levelTextTime; extern int32_t g_levelTextTime;
static void tloadtile(int32_t tilenume, int32_t type) static void flag_precache(int32_t tile, int32_t type)
{ {
if (picanm[tilenume].num < 1) if (!(gotpic[tile>>3] & pow2char[tile&7]))
{ g_precacheCount++;
if (!(gotpic[tilenume>>3] & pow2char[tilenume&7])) g_precacheCount++; gotpic[tile>>3] |= pow2char[tile&7];
gotpic[tilenume>>3] |= pow2char[tilenume&7]; precachehightile[type][tile>>3] |= pow2char[tile&7];
precachehightile[(uint8_t)type][tilenume>>3] |= pow2char[tilenume&7];
return;
} }
static void tloadtile(int32_t tilenume, int32_t type)
{ {
int32_t i,j; int32_t i,j;
@ -70,13 +69,9 @@ static void tloadtile(int32_t tilenume, int32_t type)
i = tilenume; i = tilenume;
j = tilenume + picanm[tilenume].num; j = tilenume + picanm[tilenume].num;
} }
for (; i<=j; i++) for (; i<=j; i++)
{ flag_precache(i, type);
if (!(gotpic[i>>3] & pow2char[i&7])) g_precacheCount++;
gotpic[i>>3] |= pow2char[i&7];
precachehightile[(uint8_t)type][i>>3] |= pow2char[i&7];
}
}
} }
static void G_CacheSpriteNum(int32_t i) static void G_CacheSpriteNum(int32_t i)