More changes similar to the previous commit

git-svn-id: https://svn.eduke32.com/eduke32@5795 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-06-21 00:33:45 +00:00
parent dd1d02a0e7
commit 0562de125f
9 changed files with 56 additions and 58 deletions

View file

@ -1178,7 +1178,7 @@ FORCE_INLINE void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_
// Is <wal> a red wall in a safe fashion, i.e. only if consistency invariant // Is <wal> a red wall in a safe fashion, i.e. only if consistency invariant
// ".nextsector >= 0 iff .nextwall >= 0" holds. // ".nextsector >= 0 iff .nextwall >= 0" holds.
FORCE_INLINE int32_t redwallp(const walltype *wal) FORCE_INLINE int32_t redwallp(const twalltype *wal)
{ {
return (wal->nextwall >= 0 && wal->nextsector >= 0); return (wal->nextwall >= 0 && wal->nextsector >= 0);
} }

View file

@ -99,7 +99,7 @@ void G_ClearCameraView(DukePlayer_t *ps)
} }
// Manhattan distance between wall-point and sprite. // Manhattan distance between wall-point and sprite.
static inline int32_t G_WallSpriteDist(const twalltype *wal, const spritetype *spr) static inline int32_t G_WallSpriteDist(const twalltype * const wal, const tspritetype * const spr)
{ {
return klabs(wal->x - spr->x) + klabs(wal->y - spr->y); return klabs(wal->x - spr->x) + klabs(wal->y - spr->y);
} }
@ -107,7 +107,7 @@ static inline int32_t G_WallSpriteDist(const twalltype *wal, const spritetype *s
void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, int32_t hp4) void A_RadiusDamage(int32_t i, int32_t r, int32_t hp1, int32_t hp2, int32_t hp3, int32_t hp4)
{ {
int32_t d, q, stati; int32_t d, q, stati;
const spritetype *const s = &sprite[i]; tspritetype const *const s = (tspritetype *)&sprite[i];
static const int32_t statlist[] = { static const int32_t statlist[] = {
STAT_DEFAULT, STAT_ACTOR, STAT_STANDABLE, STAT_DEFAULT, STAT_ACTOR, STAT_STANDABLE,
@ -205,12 +205,12 @@ SKIPWALLCHECK:
if (s->picnum != SHRINKSPARK || (sj->cstat&257)) if (s->picnum != SHRINKSPARK || (sj->cstat&257))
if (dist(s, sj) < r) if (dist(s, sj) < r)
{ {
if (A_CheckEnemySprite(sj) && !cansee(sj->x, sj->y,sj->z+q, sj->sectnum, s->x, s->y, s->z+q, s->sectnum)) if (A_CheckEnemySprite((tspritetype *)sj) && !cansee(sj->x, sj->y,sj->z+q, sj->sectnum, s->x, s->y, s->z+q, s->sectnum))
goto BOLT; goto BOLT;
A_DamageObject(j, i); A_DamageObject(j, i);
} }
} }
else if (sj->extra >= 0 && sj != s && (sj->picnum == TRIPBOMB || A_CheckEnemySprite(sj) || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL || (sj->cstat&257) || sj->picnum == DUKELYINGDEAD)) else if (sj->extra >= 0 && (tspritetype *)sj != s && (sj->picnum == TRIPBOMB || A_CheckEnemySprite((tspritetype *)sj) || sj->picnum == QUEBALL || sj->picnum == STRIPEBALL || (sj->cstat&257) || sj->picnum == DUKELYINGDEAD))
{ {
if (s->picnum == SHRINKSPARK && sj->picnum != SHARK && (j == s->owner || sj->xrepeat < 24)) if (s->picnum == SHRINKSPARK && sj->picnum != SHARK && (j == s->owner || sj->xrepeat < 24))
{ {
@ -401,7 +401,7 @@ static int32_t A_CheckNeedZUpdate(int32_t spritenum, int32_t changez, int32_t *d
int32_t A_MoveSpriteClipdist(int32_t spritenum, const vec3_t *change, uint32_t cliptype, int32_t clipdist) int32_t A_MoveSpriteClipdist(int32_t spritenum, const vec3_t *change, uint32_t cliptype, int32_t clipdist)
{ {
spritetype *const spr = &sprite[spritenum]; spritetype *const spr = &sprite[spritenum];
const int32_t badguy = A_CheckEnemySprite(spr); const int32_t badguy = A_CheckEnemySprite((tspritetype *)spr);
const int32_t oldx = spr->x, oldy = spr->y; const int32_t oldx = spr->x, oldy = spr->y;
if (spr->statnum == STAT_MISC || (badguy && spr->xrepeat < 4)) if (spr->statnum == STAT_MISC || (badguy && spr->xrepeat < 4))
@ -641,7 +641,7 @@ void A_DoGuts(int32_t sp, int32_t gtype, int32_t n)
int32_t gutz,floorz; int32_t gutz,floorz;
int32_t i,a,j,sx = 32,sy = 32; int32_t i,a,j,sx = 32,sy = 32;
const spritetype *const s = &sprite[sp]; tspritetype const * const s = (tspritetype *)&sprite[sp];
if (A_CheckEnemySprite(s) && s->xrepeat < 16) if (A_CheckEnemySprite(s) && s->xrepeat < 16)
sx = sy = 8; sx = sy = 8;
@ -673,7 +673,7 @@ void A_DoGutsDir(int32_t sp, int32_t gtype, int32_t n)
{ {
int32_t gutz,floorz; int32_t gutz,floorz;
int32_t i,a,j,sx = 32,sy = 32; int32_t i,a,j,sx = 32,sy = 32;
const spritetype *const s = &sprite[sp]; tspritetype const * const s = (tspritetype *)&sprite[sp];
if (A_CheckEnemySprite(s) && s->xrepeat < 16) if (A_CheckEnemySprite(s) && s->xrepeat < 16)
sx = sy = 8; sx = sy = 8;
@ -876,7 +876,7 @@ ACTOR_STATIC void G_MoveZombieActors(void)
actor[i].timetosleep++; actor[i].timetosleep++;
if (actor[i].timetosleep >= (x>>8)) if (actor[i].timetosleep >= (x>>8))
{ {
if (A_CheckEnemySprite(s)) if (A_CheckEnemySprite((tspritetype *)s))
{ {
const int32_t px = g_player[p].ps->opos.x+64-(krand()&127); const int32_t px = g_player[p].ps->opos.x+64-(krand()&127);
const int32_t py = g_player[p].ps->opos.y+64-(krand()&127); const int32_t py = g_player[p].ps->opos.y+64-(krand()&127);
@ -947,7 +947,7 @@ ACTOR_STATIC void G_MoveZombieActors(void)
} }
} }
if (A_CheckEnemySprite(s) && A_CheckSpriteFlags(i,SFLAG_NOSHADE) == 0) if (A_CheckEnemySprite((tspritetype *)s) && A_CheckSpriteFlags(i,SFLAG_NOSHADE) == 0)
{ {
if (sector[s->sectnum].ceilingstat&1) if (sector[s->sectnum].ceilingstat&1)
s->shade = sector[s->sectnum].ceilingshade; s->shade = sector[s->sectnum].ceilingshade;
@ -3064,7 +3064,7 @@ ACTOR_STATIC void G_MoveWeapons(void)
j &= (MAXSPRITES-1); j &= (MAXSPRITES-1);
if (s->picnum == FREEZEBLAST && sprite[j].pal == 1) if (s->picnum == FREEZEBLAST && sprite[j].pal == 1)
if (A_CheckEnemySprite(&sprite[j]) || sprite[j].picnum == APLAYER) if (A_CheckEnemySprite((tspritetype *)&sprite[j]) || sprite[j].picnum == APLAYER)
{ {
j = A_Spawn(i, TRANSPORTERSTAR); j = A_Spawn(i, TRANSPORTERSTAR);
sprite[j].pal = 1; sprite[j].pal = 1;
@ -4913,7 +4913,7 @@ DETONATEB:
goto BOLT; goto BOLT;
} }
if (!g_netServer && ud.multimode < 2 && A_CheckEnemySprite(s)) if (!g_netServer && ud.multimode < 2 && A_CheckEnemySprite((tspritetype *)s))
{ {
if (g_noEnemies == 1) if (g_noEnemies == 1)
{ {
@ -5598,7 +5598,7 @@ static void MaybeTrainKillEnemies(int32_t i, int32_t numguts)
{ {
const int32_t nextj = nextspritesect[j]; const int32_t nextj = nextspritesect[j];
if (sprite[j].extra >= 0 && sprite[j].statnum == STAT_ACTOR && A_CheckEnemySprite(&sprite[j])) if (sprite[j].extra >= 0 && sprite[j].statnum == STAT_ACTOR && A_CheckEnemySprite((tspritetype *)&sprite[j]))
{ {
int16_t k = sprite[j].sectnum; int16_t k = sprite[j].sectnum;
@ -6564,7 +6564,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
{ {
for (SPRITES_OF(STAT_ACTOR, k)) for (SPRITES_OF(STAT_ACTOR, k))
{ {
if (sprite[k].extra > 0 && A_CheckEnemySprite(&sprite[k]) if (sprite[k].extra > 0 && A_CheckEnemySprite((tspritetype *)&sprite[k])
&& clipinsidebox((vec2_t *)&sprite[k], j, 256) == 1) && clipinsidebox((vec2_t *)&sprite[k], j, 256) == 1)
goto BOLT; goto BOLT;
} }
@ -7756,7 +7756,7 @@ BOLT:
if (s->lotag == SE_29_WAVES) if (s->lotag == SE_29_WAVES)
{ {
sectortype *const sc = &sector[s->sectnum]; tsectortype const *const sc = (tsectortype *)&sector[s->sectnum];
if (sc->wallnum == 4) if (sc->wallnum == 4)
{ {

View file

@ -347,7 +347,7 @@ ACTOR_INLINE_HEADER int32_t A_MoveSprite(int32_t spritenum, const vec3_t *change
EXTERN_INLINE_HEADER int32_t G_CheckForSpaceCeiling(int32_t sectnum); EXTERN_INLINE_HEADER int32_t G_CheckForSpaceCeiling(int32_t sectnum);
EXTERN_INLINE_HEADER int32_t G_CheckForSpaceFloor(int32_t sectnum); EXTERN_INLINE_HEADER int32_t G_CheckForSpaceFloor(int32_t sectnum);
EXTERN_INLINE_HEADER int32_t A_CheckEnemySprite(const spritetype *s); EXTERN_INLINE_HEADER int32_t A_CheckEnemySprite(tspritetype const * const s);
#ifdef __cplusplus #ifdef __cplusplus
} }
@ -392,7 +392,7 @@ EXTERN_INLINE int32_t G_CheckForSpaceFloor(int32_t sectnum)
(sector[sectnum].floorpicnum==MOONSKY1 || sector[sectnum].floorpicnum==BIGORBIT1)); (sector[sectnum].floorpicnum==MOONSKY1 || sector[sectnum].floorpicnum==BIGORBIT1));
} }
EXTERN_INLINE int32_t A_CheckEnemySprite(const spritetype *s) EXTERN_INLINE int32_t A_CheckEnemySprite(tspritetype const * const s)
{ {
return A_CheckEnemyTile(s->picnum); return A_CheckEnemyTile(s->picnum);
} }

View file

@ -1633,7 +1633,7 @@ int32_t A_Spawn(int32_t j, int32_t pn)
{ {
sp->xrepeat = 48; sp->xrepeat = 48;
sp->yrepeat = 64; sp->yrepeat = 64;
if (sprite[j].statnum == STAT_PLAYER || A_CheckEnemySprite(&sprite[j])) if (sprite[j].statnum == STAT_PLAYER || A_CheckEnemySprite((tspritetype *)&sprite[j]))
sp->z -= (32<<8); sp->z -= (32<<8);
} }
} }
@ -3576,7 +3576,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo
continue; continue;
default: default:
// NOTE: wall-aligned sprites will never take on ceiling/floor shade... // NOTE: wall-aligned sprites will never take on ceiling/floor shade...
if ((t->cstat&16) || (A_CheckEnemySprite((const spritetype *)t) && if ((t->cstat&16) || (A_CheckEnemySprite((tspritetype *)t) &&
(unsigned)t->owner < MAXSPRITES && sprite[t->owner].extra > 0) || t->statnum == STAT_PLAYER) (unsigned)t->owner < MAXSPRITES && sprite[t->owner].extra > 0) || t->statnum == STAT_PLAYER)
continue; continue;
} }
@ -4126,14 +4126,14 @@ skip:
// player has nightvision on. We should pass stuff like "from which player is this view // player has nightvision on. We should pass stuff like "from which player is this view
// supposed to be" as parameters ("drawing context") instead of relying on globals. // supposed to be" as parameters ("drawing context") instead of relying on globals.
if (g_player[screenpeek].ps->inv_amount[GET_HEATS] > 0 && g_player[screenpeek].ps->heat_on && if (g_player[screenpeek].ps->inv_amount[GET_HEATS] > 0 && g_player[screenpeek].ps->heat_on &&
(A_CheckEnemySprite((const spritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_NVG) || s->picnum == APLAYER || s->statnum == STAT_DUMMYPLAYER)) (A_CheckEnemySprite((tspritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_NVG) || s->picnum == APLAYER || s->statnum == STAT_DUMMYPLAYER))
{ {
t->pal = 6; t->pal = 6;
t->shade = 0; t->shade = 0;
} }
// Fake floor shadow, implemented by inserting a new tsprite. // Fake floor shadow, implemented by inserting a new tsprite.
if (s->statnum == STAT_DUMMYPLAYER || A_CheckEnemySprite((const spritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0)) if (s->statnum == STAT_DUMMYPLAYER || A_CheckEnemySprite((tspritetype *)s) || A_CheckSpriteFlags(t->owner,SFLAG_SHADOW) || (s->picnum == APLAYER && s->owner >= 0))
if (t->statnum != TSPR_TEMP && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE && s->picnum != HOTMEAT) if (t->statnum != TSPR_TEMP && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE && s->picnum != HOTMEAT)
{ {
if (actor[i].dispicnum < 0) if (actor[i].dispicnum < 0)

View file

@ -260,7 +260,7 @@ static int32_t VM_CheckSquished(void)
P_DoQuote(QUOTE_SQUISHED, vm.g_pp); P_DoQuote(QUOTE_SQUISHED, vm.g_pp);
if (A_CheckEnemySprite(vm.g_sp)) if (A_CheckEnemySprite((tspritetype *)vm.g_sp))
vm.g_sp->xvel = 0; vm.g_sp->xvel = 0;
if (EDUKE32_PREDICT_FALSE(vm.g_sp->pal == 1)) // frozen if (EDUKE32_PREDICT_FALSE(vm.g_sp->pal == 1)) // frozen
@ -290,7 +290,7 @@ int32_t A_Dodge(spritetype *s)
const int32_t mxvect = sintable[(s->ang+512)&2047]; const int32_t mxvect = sintable[(s->ang+512)&2047];
const int32_t myvect = sintable[s->ang&2047]; const int32_t myvect = sintable[s->ang&2047];
if (A_CheckEnemySprite(s) && s->extra <= 0) // hack if (A_CheckEnemySprite((tspritetype *)s) && s->extra <= 0) // hack
return 0; return 0;
for (int32_t i=headspritestat[STAT_PROJECTILE]; i>=0; i=nextspritestat[i]) //weapons list for (int32_t i=headspritestat[STAT_PROJECTILE]; i>=0; i=nextspritestat[i]) //weapons list
@ -417,13 +417,13 @@ void A_GetZLimits(int32_t iActor)
if ((florhit&49152) == 49152 && (sprite[florhit&(MAXSPRITES-1)].cstat&48) == 0) if ((florhit&49152) == 49152 && (sprite[florhit&(MAXSPRITES-1)].cstat&48) == 0)
{ {
const spritetype *hitspr = &sprite[florhit&(MAXSPRITES-1)]; tspritetype const * const hitspr = (tspritetype *)&sprite[florhit&(MAXSPRITES-1)];
florhit &= (MAXSPRITES-1); florhit &= (MAXSPRITES-1);
// If a non-projectile would fall onto non-frozen enemy OR an enemy onto a player... // If a non-projectile would fall onto non-frozen enemy OR an enemy onto a player...
if ((A_CheckEnemySprite(hitspr) && hitspr->pal != 1 && s->statnum != STAT_PROJECTILE) if ((A_CheckEnemySprite(hitspr) && hitspr->pal != 1 && s->statnum != STAT_PROJECTILE)
|| (hitspr->picnum == APLAYER && A_CheckEnemySprite(s))) || (hitspr->picnum == APLAYER && A_CheckEnemySprite((tspritetype *)s)))
{ {
actor[iActor].flags |= SFLAG_NOFLOORSHADOW; // No shadows on actors actor[iActor].flags |= SFLAG_NOFLOORSHADOW; // No shadows on actors
s->xvel = -256; // SLIDE_ABOVE_ENEMY s->xvel = -256; // SLIDE_ABOVE_ENEMY
@ -528,7 +528,7 @@ GAMEEXEC_STATIC void VM_AlterAng(int32_t movflags)
vm.g_sp->zvel += ((actor[vm.g_i].mv.vvel<<4) - vm.g_sp->zvel)/5; vm.g_sp->zvel += ((actor[vm.g_i].mv.vvel<<4) - vm.g_sp->zvel)/5;
#endif #endif
if (A_CheckEnemySprite(vm.g_sp) && vm.g_sp->extra <= 0) // hack if (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->extra <= 0) // hack
return; return;
if (movflags&seekplayer) if (movflags&seekplayer)
@ -653,7 +653,7 @@ GAMEEXEC_STATIC void VM_Move(void)
// XXX: Does it break anything? Where are movflags with all bits set created? // XXX: Does it break anything? Where are movflags with all bits set created?
const uint16_t *movflagsptr = &AC_MOVFLAGS(vm.g_sp, &actor[vm.g_i]); const uint16_t *movflagsptr = &AC_MOVFLAGS(vm.g_sp, &actor[vm.g_i]);
const int32_t movflags = /*(*movflagsptr==-1) ? 0 :*/ *movflagsptr; const int32_t movflags = /*(*movflagsptr==-1) ? 0 :*/ *movflagsptr;
const int32_t deadflag = (A_CheckEnemySprite(vm.g_sp) && vm.g_sp->extra <= 0); const int32_t deadflag = (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->extra <= 0);
AC_COUNT(vm.g_t)++; AC_COUNT(vm.g_t)++;
@ -721,7 +721,7 @@ dead:
if (vm.g_sp->xvel > -6 && vm.g_sp->xvel < 6) if (vm.g_sp->xvel > -6 && vm.g_sp->xvel < 6)
vm.g_sp->xvel = 0; vm.g_sp->xvel = 0;
int badguyp = A_CheckEnemySprite(vm.g_sp); int badguyp = A_CheckEnemySprite((tspritetype *)vm.g_sp);
if (vm.g_sp->xvel || vm.g_sp->zvel) if (vm.g_sp->xvel || vm.g_sp->zvel)
{ {
@ -983,7 +983,7 @@ static void VM_Fall(int32_t g_i, spritetype *g_sp)
// Preliminary new z position of the actor. // Preliminary new z position of the actor.
int32_t z = actor[g_i].floorz - ZOFFSET; int32_t z = actor[g_i].floorz - ZOFFSET;
if (A_CheckEnemySprite(g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0)) if (A_CheckEnemySprite((tspritetype *)g_sp) || (g_sp->picnum == APLAYER && g_sp->owner >= 0))
{ {
if (g_sp->zvel > 3084 && g_sp->extra <= 1) if (g_sp->zvel > 3084 && g_sp->extra <= 1)
{ {
@ -1292,7 +1292,7 @@ skip_check:
int32_t sclip = 768, angdif = 16; int32_t sclip = 768, angdif = 16;
if (A_CheckEnemySprite(vm.g_sp) && vm.g_sp->xrepeat > 56) if (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->xrepeat > 56)
{ {
sclip = 3084; sclip = 3084;
angdif = 48; angdif = 48;
@ -1413,7 +1413,7 @@ skip_check:
AC_COUNT(vm.g_t) = AC_ACTION_COUNT(vm.g_t) = AC_CURFRAME(vm.g_t) = 0; AC_COUNT(vm.g_t) = AC_ACTION_COUNT(vm.g_t) = AC_CURFRAME(vm.g_t) = 0;
if (!A_CheckEnemySprite(vm.g_sp) || vm.g_sp->extra > 0) // hack if (!A_CheckEnemySprite((tspritetype *)vm.g_sp) || vm.g_sp->extra > 0) // hack
if (vm.g_sp->hitag&random_angle) if (vm.g_sp->hitag&random_angle)
vm.g_sp->ang = krand()&2047; vm.g_sp->ang = krand()&2047;
continue; continue;
@ -1813,7 +1813,7 @@ skip_check:
AC_COUNT(vm.g_t) = 0; AC_COUNT(vm.g_t) = 0;
AC_MOVE_ID(vm.g_t) = *insptr++; AC_MOVE_ID(vm.g_t) = *insptr++;
vm.g_sp->hitag = *insptr++; vm.g_sp->hitag = *insptr++;
if (A_CheckEnemySprite(vm.g_sp) && vm.g_sp->extra <= 0) // hack if (A_CheckEnemySprite((tspritetype *)vm.g_sp) && vm.g_sp->extra <= 0) // hack
continue; continue;
if (vm.g_sp->hitag&random_angle) if (vm.g_sp->hitag&random_angle)
vm.g_sp->ang = krand()&2047; vm.g_sp->ang = krand()&2047;
@ -3725,7 +3725,7 @@ nullquote:
continue; continue;
case CON_IFRESPAWN: case CON_IFRESPAWN:
if (A_CheckEnemySprite(vm.g_sp)) VM_CONDITIONAL(ud.respawn_monsters) if (A_CheckEnemySprite((tspritetype *)vm.g_sp)) VM_CONDITIONAL(ud.respawn_monsters)
else if (A_CheckInventorySprite(vm.g_sp)) VM_CONDITIONAL(ud.respawn_inventory) else if (A_CheckInventorySprite(vm.g_sp)) VM_CONDITIONAL(ud.respawn_inventory)
else VM_CONDITIONAL(ud.respawn_items) else VM_CONDITIONAL(ud.respawn_items)
continue; continue;
@ -5701,7 +5701,7 @@ void A_Execute(int32_t iActor, int32_t iPlayer, int32_t lDist)
if (EDUKE32_PREDICT_FALSE((unsigned)vm.g_sp->sectnum >= MAXSECTORS)) if (EDUKE32_PREDICT_FALSE((unsigned)vm.g_sp->sectnum >= MAXSECTORS))
{ {
if (A_CheckEnemySprite(vm.g_sp)) if (A_CheckEnemySprite((tspritetype *)vm.g_sp))
vm.g_pp->actors_killed++; vm.g_pp->actors_killed++;
A_DeleteSprite(vm.g_i); A_DeleteSprite(vm.g_i);
@ -5798,7 +5798,7 @@ void A_Execute(int32_t iActor, int32_t iPlayer, int32_t lDist)
return; return;
} }
if (A_CheckEnemySprite(vm.g_sp)) if (A_CheckEnemySprite((tspritetype *)vm.g_sp))
{ {
if (vm.g_sp->xrepeat > 60 || (ud.respawn_monsters == 1 && vm.g_sp->extra <= 0)) if (vm.g_sp->xrepeat > 60 || (ud.respawn_monsters == 1 && vm.g_sp->extra <= 0))
return; return;

View file

@ -258,9 +258,9 @@ static int32_t A_FindTargetSprite(const spritetype *s, int32_t aang, int32_t atw
break; break;
for (i=headspritestat[aimstats[k]]; i >= 0; i=nextspritestat[i]) for (i=headspritestat[aimstats[k]]; i >= 0; i=nextspritestat[i])
if (sprite[i].xrepeat > 0 && sprite[i].extra >= 0 && (sprite[i].cstat&(257+32768)) == 257) if (sprite[i].xrepeat > 0 && sprite[i].extra >= 0 && (sprite[i].cstat&(257+32768)) == 257)
if (A_CheckEnemySprite(&sprite[i]) || k < 2) if (A_CheckEnemySprite((tspritetype *)&sprite[i]) || k < 2)
{ {
if (A_CheckEnemySprite(&sprite[i]) || PN == APLAYER || PN == SHARK) if (A_CheckEnemySprite((tspritetype *)&sprite[i]) || PN == APLAYER || PN == SHARK)
{ {
if (PN == APLAYER && s->picnum == APLAYER && s != &sprite[i] && if (PN == APLAYER && s->picnum == APLAYER && s != &sprite[i] &&
// ud.ffire == 0 && // ud.ffire == 0 &&
@ -602,7 +602,7 @@ static int32_t SectorContainsSE13(int32_t sectnum)
// (in that case walltype *hitwal may be stale) // (in that case walltype *hitwal may be stale)
static inline void HandleHitWall(hitdata_t *hit) static inline void HandleHitWall(hitdata_t *hit)
{ {
const walltype *const hitwal = &wall[hit->wall]; twalltype const * const hitwal = (twalltype *)&wall[hit->wall];
if ((hitwal->cstat&2) && redwallp(hitwal)) if ((hitwal->cstat&2) && redwallp(hitwal))
if (hit->pos.z >= sector[hitwal->nextsector].floorz) if (hit->pos.z >= sector[hitwal->nextsector].floorz)
@ -692,7 +692,7 @@ static int32_t P_PostFireHitscan(int32_t p, int32_t k, hitdata_t *hit, int32_t i
} }
else if (hit->wall >= 0) else if (hit->wall >= 0)
{ {
const walltype *const hitwal = &wall[hit->wall]; twalltype const * const hitwal = (twalltype *)&wall[hit->wall];
Proj_MaybeSpawn(k, spawnatimpacttile, hit); Proj_MaybeSpawn(k, spawnatimpacttile, hit);
@ -797,12 +797,10 @@ static int32_t A_PostFireHitscan(const hitdata_t *hit, int32_t i, int32_t atwith
static int32_t Proj_CheckBlood(const vec3_t *srcvect, const hitdata_t *hit, static int32_t Proj_CheckBlood(const vec3_t *srcvect, const hitdata_t *hit,
int32_t projrange, int32_t minzdiff) int32_t projrange, int32_t minzdiff)
{ {
const walltype * hitwal;
if (hit->wall < 0 || hit->sect < 0) if (hit->wall < 0 || hit->sect < 0)
return 0; return 0;
hitwal = &wall[hit->wall]; twalltype const * const hitwal = (twalltype *)&wall[hit->wall];
if (FindDistance2D(srcvect->x-hit->pos.x, srcvect->y-hit->pos.y) < projrange) if (FindDistance2D(srcvect->x-hit->pos.x, srcvect->y-hit->pos.y) < projrange)
if (hitwal->overpicnum != BIGFORCE && (hitwal->cstat&16) == 0) if (hitwal->overpicnum != BIGFORCE && (hitwal->cstat&16) == 0)
@ -980,7 +978,7 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa,
l = safeldist(g_player[j].ps->i, s); l = safeldist(g_player[j].ps->i, s);
zvel = tabledivide32_noinline((g_player[j].ps->opos.z - srcvect->z)*vel, l); zvel = tabledivide32_noinline((g_player[j].ps->opos.z - srcvect->z)*vel, l);
if (A_CheckEnemySprite(s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart)) if (A_CheckEnemySprite((tspritetype *)s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart))
sa = s->ang + (krand() & 31) - 16; sa = s->ang + (krand() & 31) - 16;
} }
} }
@ -1069,7 +1067,7 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa,
if (Proj_CheckBlood(srcvect, &hit, proj->range, if (Proj_CheckBlood(srcvect, &hit, proj->range,
mulscale3(proj->yrepeat, tilesiz[proj->decal].y) << 8)) mulscale3(proj->yrepeat, tilesiz[proj->decal].y) << 8))
{ {
const walltype *const hitwal = &wall[hit.wall]; const twalltype *const hitwal = (twalltype *)&wall[hit.wall];
if (FindDistance2D(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) > if (FindDistance2D(hitwal->x - wall[hitwal->point2].x, hitwal->y - wall[hitwal->point2].y) >
(mulscale3(proj->xrepeat + 8, tilesiz[proj->decal].x))) (mulscale3(proj->xrepeat + 8, tilesiz[proj->decal].x)))
@ -1164,7 +1162,7 @@ static int32_t A_ShootHardcoded(int32_t i, int32_t atwith, int16_t sa, vec3_t sr
{ {
if (Proj_CheckBlood(&srcvect, &hit, 1024, 16<<8)) if (Proj_CheckBlood(&srcvect, &hit, 1024, 16<<8))
{ {
const walltype *const hitwal = &wall[hit.wall]; const twalltype *const hitwal = (twalltype *)&wall[hit.wall];
if (SectorContainsSE13(hitwal->nextsector)) if (SectorContainsSE13(hitwal->nextsector))
return -1; return -1;
@ -1388,7 +1386,7 @@ static int32_t A_ShootHardcoded(int32_t i, int32_t atwith, int16_t sa, vec3_t sr
l = safeldist(g_player[j].ps->i, s); l = safeldist(g_player[j].ps->i, s);
zvel = tabledivide32_noinline((g_player[j].ps->opos.z - srcvect.z)*vel, l); zvel = tabledivide32_noinline((g_player[j].ps->opos.z - srcvect.z)*vel, l);
if (A_CheckEnemySprite(s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart)) if (A_CheckEnemySprite((tspritetype *)s) && (AC_MOVFLAGS(s, &actor[i]) & face_player_smart))
sa = s->ang+(krand()&31)-16; sa = s->ang+(krand()&31)-16;
} }
@ -1638,7 +1636,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
{ {
srcvect.z -= (7<<8); srcvect.z -= (7<<8);
if (A_CheckEnemySprite(s) && PN != COMMANDER) if (A_CheckEnemySprite((tspritetype *)s) && PN != COMMANDER)
{ {
srcvect.x += (sintable[(sa+1024+96)&2047]>>7); srcvect.x += (sintable[(sa+1024+96)&2047]>>7);
srcvect.y += (sintable[(sa+512+96)&2047]>>7); srcvect.y += (sintable[(sa+512+96)&2047]>>7);
@ -4589,7 +4587,7 @@ void P_ProcessInput(int32_t snum)
p->sbs = j; p->sbs = j;
} }
} }
else if (A_CheckEnemySprite(&sprite[j]) && sprite[j].xrepeat > 24 && klabs(s->z-sprite[j].z) < (84<<8)) else if (A_CheckEnemySprite((tspritetype *)&sprite[j]) && sprite[j].xrepeat > 24 && klabs(s->z-sprite[j].z) < (84<<8))
{ {
// TX: I think this is what makes the player slide off enemies... might // TX: I think this is what makes the player slide off enemies... might
// be a good sprite flag to add later. // be a good sprite flag to add later.
@ -5569,7 +5567,7 @@ HORIZONLY:
break; break;
} }
default: default:
if (A_CheckEnemySprite(&sprite[p->actorsqu])) if (A_CheckEnemySprite((tspritetype *)&sprite[p->actorsqu]))
p->actors_killed++; p->actors_killed++;
A_DeleteSprite(p->actorsqu); A_DeleteSprite(p->actorsqu);
break; break;

View file

@ -71,7 +71,7 @@ static void G_CacheSpriteNum(int32_t i)
char maxc; char maxc;
int32_t j; int32_t j;
if (ud.monsters_off && A_CheckEnemySprite(&sprite[i])) return; if (ud.monsters_off && A_CheckEnemySprite((tspritetype *)&sprite[i])) return;
maxc = 1; maxc = 1;

View file

@ -315,7 +315,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
int32_t xvect, yvect, xvect2, yvect2; int32_t xvect, yvect, xvect2, yvect2;
int16_t p; int16_t p;
char col; char col;
walltype *wal, *wal2; twalltype *wal, *wal2;
spritetype *spr; spritetype *spr;
int32_t tmpydim = (xdim*5)/8; int32_t tmpydim = (xdim*5)/8;
@ -340,7 +340,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
z1 = sector[i].ceilingz; z1 = sector[i].ceilingz;
z2 = sector[i].floorz; z2 = sector[i].floorz;
for (j=startwall, wal=&wall[startwall]; j<endwall; j++, wal++) for (j=startwall, wal=(twalltype *)&wall[startwall]; j<endwall; j++, wal++)
{ {
k = wal->nextwall; k = wal->nextwall;
if (k < 0) continue; if (k < 0) continue;
@ -361,7 +361,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
x1 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); x1 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11);
y1 = dmulscale16(oy, xvect2, ox, yvect2)+(ydim<<11); y1 = dmulscale16(oy, xvect2, ox, yvect2)+(ydim<<11);
wal2 = &wall[wal->point2]; wal2 = (twalltype *)&wall[wal->point2];
ox = wal2->x-cposx; ox = wal2->x-cposx;
oy = wal2->y-cposy; oy = wal2->y-cposy;
x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11);
@ -529,7 +529,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
endwall = sector[i].wallptr + sector[i].wallnum; endwall = sector[i].wallptr + sector[i].wallnum;
k = -1; k = -1;
for (j=startwall, wal=&wall[startwall]; j<endwall; j++, wal++) for (j=startwall, wal=(twalltype *)&wall[startwall]; j<endwall; j++, wal++)
{ {
if (wal->nextwall >= 0) continue; if (wal->nextwall >= 0) continue;
@ -550,7 +550,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16
} }
k = wal->point2; k = wal->point2;
wal2 = &wall[k]; wal2 = (twalltype *)&wall[k];
ox = wal2->x-cposx; ox = wal2->x-cposx;
oy = wal2->y-cposy; oy = wal2->y-cposy;
x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11);

View file

@ -2260,7 +2260,7 @@ void A_DamageObject(int32_t i,int32_t sn)
if ((sprite[sn].picnum == FREEZEBLAST || sprite[sn].owner != i) && sprite[i].statnum != STAT_PROJECTILE) if ((sprite[sn].picnum == FREEZEBLAST || sprite[sn].owner != i) && sprite[i].statnum != STAT_PROJECTILE)
{ {
if (A_CheckEnemySprite(&sprite[i]) == 1) if (A_CheckEnemySprite((tspritetype *)&sprite[i]) == 1)
{ {
if (sprite[sn].picnum == RPG) if (sprite[sn].picnum == RPG)
sprite[sn].extra <<= 1; sprite[sn].extra <<= 1;
@ -2877,7 +2877,7 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp)
hitdata_t hit; hitdata_t hit;
int32_t zoff = 0; int32_t zoff = 0;
if (A_CheckEnemySprite(&sprite[i])) if (A_CheckEnemySprite((tspritetype *) &sprite[i]))
zoff = (42<<8); zoff = (42<<8);
else if (PN == APLAYER) else if (PN == APLAYER)
zoff = (39<<8); zoff = (39<<8);
@ -2892,7 +2892,7 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp)
if (hitsp) if (hitsp)
*hitsp = hit.sprite; *hitsp = hit.sprite;
if (hit.wall >= 0 && (wall[hit.wall].cstat&16) && A_CheckEnemySprite(&sprite[i])) if (hit.wall >= 0 && (wall[hit.wall].cstat&16) && A_CheckEnemySprite((tspritetype *) &sprite[i]))
return 1<<30; return 1<<30;
return FindDistance2D(hit.pos.x-SX,hit.pos.y-SY); return FindDistance2D(hit.pos.x-SX,hit.pos.y-SY);