mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
misc. beautifying some game code...
git-svn-id: https://svn.eduke32.com/eduke32@2192 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
6b913a39aa
commit
f12bd9f13d
4 changed files with 62 additions and 69 deletions
|
@ -8061,7 +8061,7 @@ int32_t A_CheckEnemyTile(int32_t pn)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int32_t A_CheckEnemySprite(spritetype *s)
|
inline int32_t A_CheckEnemySprite(const spritetype *s)
|
||||||
{
|
{
|
||||||
return(A_CheckEnemyTile(s->picnum));
|
return(A_CheckEnemyTile(s->picnum));
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ extern projectile_t ProjectileData[MAXTILES];
|
||||||
extern projectile_t SpriteProjectile[MAXSPRITES];
|
extern projectile_t SpriteProjectile[MAXSPRITES];
|
||||||
|
|
||||||
void A_AddToDeleteQueue(int32_t i);
|
void A_AddToDeleteQueue(int32_t i);
|
||||||
int32_t A_CheckEnemySprite(spritetype *s);
|
int32_t A_CheckEnemySprite(const spritetype *s);
|
||||||
int32_t A_CheckEnemyTile(int32_t pn);
|
int32_t A_CheckEnemyTile(int32_t pn);
|
||||||
int32_t A_CheckSwitchTile(int32_t i);
|
int32_t A_CheckSwitchTile(int32_t i);
|
||||||
void A_DeleteSprite(int32_t s);
|
void A_DeleteSprite(int32_t s);
|
||||||
|
|
|
@ -6510,67 +6510,66 @@ skip:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->statnum == STAT_DUMMYPLAYER || A_CheckEnemySprite(s) || A_CheckSpriteFlags(t->owner,SPRITE_SHADOW) || (s->picnum == APLAYER && s->owner >= 0))
|
if (s->statnum == STAT_DUMMYPLAYER || A_CheckEnemySprite(s) || A_CheckSpriteFlags(t->owner,SPRITE_SHADOW) || (s->picnum == APLAYER && s->owner >= 0))
|
||||||
if (t->statnum != TSPR_TEMP && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE)
|
if (t->statnum != TSPR_TEMP && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE && s->picnum != HOTMEAT)
|
||||||
if (s->picnum != HOTMEAT)
|
{
|
||||||
|
if (actor[i].dispicnum < 0)
|
||||||
{
|
{
|
||||||
if (actor[i].dispicnum < 0)
|
actor[i].dispicnum++;
|
||||||
{
|
continue;
|
||||||
actor[i].dispicnum++;
|
}
|
||||||
continue;
|
else if (ud.shadows && spritesortcnt < (MAXSPRITESONSCREEN-2) && getrendermode() != 4)
|
||||||
}
|
{
|
||||||
else if (ud.shadows && spritesortcnt < (MAXSPRITESONSCREEN-2) && getrendermode() != 4)
|
int32_t daz,xrep,yrep;
|
||||||
{
|
|
||||||
int32_t daz,xrep,yrep;
|
|
||||||
|
|
||||||
if ((sector[sect].lotag&0xff) > 2 || s->statnum == STAT_PROJECTILE || s->statnum == 5 || s->picnum == DRONE || s->picnum == COMMANDER)
|
if ((sector[sect].lotag&0xff) > 2 || s->statnum == STAT_PROJECTILE || s->statnum == 5 || s->picnum == DRONE || s->picnum == COMMANDER)
|
||||||
daz = sector[sect].floorz;
|
daz = sector[sect].floorz;
|
||||||
else
|
else
|
||||||
daz = actor[i].floorz;
|
daz = actor[i].floorz;
|
||||||
|
|
||||||
if ((s->z-daz) < (8<<8))
|
if ((s->z-daz) < (8<<8))
|
||||||
if (g_player[screenpeek].ps->pos.z < daz)
|
if (g_player[screenpeek].ps->pos.z < daz)
|
||||||
{
|
{
|
||||||
Bmemcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
|
Bmemcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype));
|
||||||
|
|
||||||
tsprite[spritesortcnt].statnum = TSPR_TEMP;
|
tsprite[spritesortcnt].statnum = TSPR_TEMP;
|
||||||
|
|
||||||
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
|
tsprite[spritesortcnt].yrepeat = (t->yrepeat>>3);
|
||||||
if (t->yrepeat < 4) t->yrepeat = 4;
|
if (t->yrepeat < 4) t->yrepeat = 4;
|
||||||
|
|
||||||
tsprite[spritesortcnt].shade = 127;
|
tsprite[spritesortcnt].shade = 127;
|
||||||
tsprite[spritesortcnt].cstat |= 2;
|
tsprite[spritesortcnt].cstat |= 2;
|
||||||
|
|
||||||
tsprite[spritesortcnt].z = daz;
|
tsprite[spritesortcnt].z = daz;
|
||||||
xrep = tsprite[spritesortcnt].xrepeat;// - (klabs(daz-t->z)>>11);
|
xrep = tsprite[spritesortcnt].xrepeat;// - (klabs(daz-t->z)>>11);
|
||||||
tsprite[spritesortcnt].xrepeat = xrep;
|
tsprite[spritesortcnt].xrepeat = xrep;
|
||||||
tsprite[spritesortcnt].pal = 4;
|
tsprite[spritesortcnt].pal = 4;
|
||||||
|
|
||||||
yrep = tsprite[spritesortcnt].yrepeat;// - (klabs(daz-t->z)>>11);
|
yrep = tsprite[spritesortcnt].yrepeat;// - (klabs(daz-t->z)>>11);
|
||||||
tsprite[spritesortcnt].yrepeat = yrep;
|
tsprite[spritesortcnt].yrepeat = yrep;
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
if (getrendermode() >= 3 && usemodels && md_tilehasmodel(t->picnum,t->pal) >= 0)
|
if (getrendermode() >= 3 && usemodels && md_tilehasmodel(t->picnum,t->pal) >= 0)
|
||||||
{
|
{
|
||||||
tsprite[spritesortcnt].yrepeat = 0;
|
tsprite[spritesortcnt].yrepeat = 0;
|
||||||
// 512:trans reverse
|
// 512:trans reverse
|
||||||
//1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues
|
//1024:tell MD2SPRITE.C to use Z-buffer hacks to hide overdraw issues
|
||||||
tsprite[spritesortcnt].cstat |= (512+1024);
|
tsprite[spritesortcnt].cstat |= (512+1024);
|
||||||
}
|
|
||||||
else if (getrendermode() >= 3)
|
|
||||||
{
|
|
||||||
int32_t ii;
|
|
||||||
|
|
||||||
ii = getangle(tsprite[spritesortcnt].x-g_player[screenpeek].ps->pos.x,
|
|
||||||
tsprite[spritesortcnt].y-g_player[screenpeek].ps->pos.y);
|
|
||||||
|
|
||||||
tsprite[spritesortcnt].x += sintable[(ii+2560)&2047]>>9;
|
|
||||||
tsprite[spritesortcnt].y += sintable[(ii+2048)&2047]>>9;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
spritesortcnt++;
|
|
||||||
}
|
}
|
||||||
}
|
else if (getrendermode() >= 3)
|
||||||
|
{
|
||||||
|
int32_t ii;
|
||||||
|
|
||||||
|
ii = getangle(tsprite[spritesortcnt].x-g_player[screenpeek].ps->pos.x,
|
||||||
|
tsprite[spritesortcnt].y-g_player[screenpeek].ps->pos.y);
|
||||||
|
|
||||||
|
tsprite[spritesortcnt].x += sintable[(ii+2560)&2047]>>9;
|
||||||
|
tsprite[spritesortcnt].y += sintable[(ii+2048)&2047]>>9;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
spritesortcnt++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (DynamicTileMap[s->picnum])
|
switch (DynamicTileMap[s->picnum])
|
||||||
{
|
{
|
||||||
|
|
|
@ -282,13 +282,13 @@ void A_GetZLimits(int32_t iActor)
|
||||||
|
|
||||||
// if (s->statnum == STAT_PLAYER || s->statnum == STAT_STANDABLE || s->statnum == STAT_ZOMBIEACTOR || s->statnum == STAT_ACTOR || s->statnum == STAT_PROJECTILE)
|
// if (s->statnum == STAT_PLAYER || s->statnum == STAT_STANDABLE || s->statnum == STAT_ZOMBIEACTOR || s->statnum == STAT_ACTOR || s->statnum == STAT_PROJECTILE)
|
||||||
{
|
{
|
||||||
int32_t hz,lz,zr = 127L;
|
int32_t hz,lz,zr = 127;
|
||||||
int32_t cstat = s->cstat;
|
int32_t cstat = s->cstat;
|
||||||
|
|
||||||
s->cstat = 0;
|
s->cstat = 0;
|
||||||
|
|
||||||
if (s->statnum == STAT_PROJECTILE)
|
if (s->statnum == STAT_PROJECTILE)
|
||||||
zr = 4L;
|
zr = 4;
|
||||||
|
|
||||||
s->z -= ZOFFSET;
|
s->z -= ZOFFSET;
|
||||||
getzrange((vec3_t *)s,s->sectnum,&actor[iActor].ceilingz,&hz,&actor[iActor].floorz,&lz,zr,CLIPMASK0);
|
getzrange((vec3_t *)s,s->sectnum,&actor[iActor].ceilingz,&hz,&actor[iActor].floorz,&lz,zr,CLIPMASK0);
|
||||||
|
@ -298,28 +298,22 @@ void A_GetZLimits(int32_t iActor)
|
||||||
|
|
||||||
if ((lz&49152) == 49152 && (sprite[lz&(MAXSPRITES-1)].cstat&48) == 0)
|
if ((lz&49152) == 49152 && (sprite[lz&(MAXSPRITES-1)].cstat&48) == 0)
|
||||||
{
|
{
|
||||||
|
const spritetype *hitspr = &sprite[lz&(MAXSPRITES-1)];
|
||||||
|
|
||||||
lz &= (MAXSPRITES-1);
|
lz &= (MAXSPRITES-1);
|
||||||
if (A_CheckEnemySprite(&sprite[lz]) && sprite[lz].pal != 1)
|
|
||||||
{
|
if ((A_CheckEnemySprite(hitspr) && hitspr->pal != 1 && s->statnum != STAT_PROJECTILE)
|
||||||
if (s->statnum != 4)
|
|| (hitspr->picnum == APLAYER && A_CheckEnemySprite(s)))
|
||||||
{
|
|
||||||
actor[iActor].dispicnum = -4; // No shadows on actors
|
|
||||||
s->xvel = -256;
|
|
||||||
A_SetSprite(iActor,CLIPMASK0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (sprite[lz].picnum == APLAYER && A_CheckEnemySprite(s))
|
|
||||||
{
|
{
|
||||||
actor[iActor].dispicnum = -4; // No shadows on actors
|
actor[iActor].dispicnum = -4; // No shadows on actors
|
||||||
s->xvel = -256;
|
s->xvel = -256;
|
||||||
A_SetSprite(iActor,CLIPMASK0);
|
A_SetSprite(iActor,CLIPMASK0);
|
||||||
}
|
}
|
||||||
else if (s->statnum == STAT_PROJECTILE && sprite[lz].picnum == APLAYER)
|
else if (s->statnum == STAT_PROJECTILE && hitspr->picnum == APLAYER && s->owner==lz)
|
||||||
if (s->owner == lz)
|
{
|
||||||
{
|
actor[iActor].ceilingz = sector[s->sectnum].ceilingz;
|
||||||
actor[iActor].ceilingz = sector[s->sectnum].ceilingz;
|
actor[iActor].floorz = sector[s->sectnum].floorz;
|
||||||
actor[iActor].floorz = sector[s->sectnum].floorz;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue