From 0562de125f11756e7c5d5f1ec268b1cc6c7448b7 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 21 Jun 2016 00:33:45 +0000 Subject: [PATCH] More changes similar to the previous commit git-svn-id: https://svn.eduke32.com/eduke32@5795 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 2 +- polymer/eduke32/source/actors.c | 28 +++++++++++++-------------- polymer/eduke32/source/actors.h | 4 ++-- polymer/eduke32/source/game.c | 8 ++++---- polymer/eduke32/source/gameexec.c | 28 +++++++++++++-------------- polymer/eduke32/source/player.c | 26 ++++++++++++------------- polymer/eduke32/source/premap.c | 2 +- polymer/eduke32/source/screens.c | 10 +++++----- polymer/eduke32/source/sector.c | 6 +++--- 9 files changed, 56 insertions(+), 58 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 6d2e871c2..0f805955c 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -1178,7 +1178,7 @@ FORCE_INLINE void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_ // Is a red wall in a safe fashion, i.e. only if consistency invariant // ".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); } diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index cf3584197..2a73b5e8b 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -99,7 +99,7 @@ void G_ClearCameraView(DukePlayer_t *ps) } // 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); } @@ -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) { int32_t d, q, stati; - const spritetype *const s = &sprite[i]; + tspritetype const *const s = (tspritetype *)&sprite[i]; static const int32_t statlist[] = { STAT_DEFAULT, STAT_ACTOR, STAT_STANDABLE, @@ -205,12 +205,12 @@ SKIPWALLCHECK: if (s->picnum != SHRINKSPARK || (sj->cstat&257)) 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; 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)) { @@ -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) { 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; 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 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) 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 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) sx = sy = 8; @@ -876,7 +876,7 @@ ACTOR_STATIC void G_MoveZombieActors(void) actor[i].timetosleep++; 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 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) s->shade = sector[s->sectnum].ceilingshade; @@ -3064,7 +3064,7 @@ ACTOR_STATIC void G_MoveWeapons(void) j &= (MAXSPRITES-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); sprite[j].pal = 1; @@ -4913,7 +4913,7 @@ DETONATEB: 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) { @@ -5598,7 +5598,7 @@ static void MaybeTrainKillEnemies(int32_t i, int32_t numguts) { 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; @@ -6564,7 +6564,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 { 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) goto BOLT; } @@ -7756,7 +7756,7 @@ BOLT: if (s->lotag == SE_29_WAVES) { - sectortype *const sc = §or[s->sectnum]; + tsectortype const *const sc = (tsectortype *)§or[s->sectnum]; if (sc->wallnum == 4) { diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index 0783c9b44..71b9fa324 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -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_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 } @@ -392,7 +392,7 @@ EXTERN_INLINE int32_t G_CheckForSpaceFloor(int32_t sectnum) (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); } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 4377c9799..3721ec726 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1633,7 +1633,7 @@ int32_t A_Spawn(int32_t j, int32_t pn) { sp->xrepeat = 48; 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); } } @@ -3576,7 +3576,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo continue; default: // 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) continue; } @@ -4126,14 +4126,14 @@ skip: // 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. 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->shade = 0; } // 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 (actor[i].dispicnum < 0) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index f50dfd84a..79943229a 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -260,7 +260,7 @@ static int32_t VM_CheckSquished(void) 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; 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 myvect = sintable[s->ang&2047]; - if (A_CheckEnemySprite(s) && s->extra <= 0) // hack + if (A_CheckEnemySprite((tspritetype *)s) && s->extra <= 0) // hack return 0; 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) { - const spritetype *hitspr = &sprite[florhit&(MAXSPRITES-1)]; + tspritetype const * const hitspr = (tspritetype *)&sprite[florhit&(MAXSPRITES-1)]; florhit &= (MAXSPRITES-1); // 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) - || (hitspr->picnum == APLAYER && A_CheckEnemySprite(s))) + || (hitspr->picnum == APLAYER && A_CheckEnemySprite((tspritetype *)s))) { actor[iActor].flags |= SFLAG_NOFLOORSHADOW; // No shadows on actors 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; #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; 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? const uint16_t *movflagsptr = &AC_MOVFLAGS(vm.g_sp, &actor[vm.g_i]); 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)++; @@ -721,7 +721,7 @@ dead: if (vm.g_sp->xvel > -6 && vm.g_sp->xvel < 6) 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) { @@ -983,7 +983,7 @@ static void VM_Fall(int32_t g_i, spritetype *g_sp) // Preliminary new z position of the actor. 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) { @@ -1292,7 +1292,7 @@ skip_check: 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; 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; - 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) vm.g_sp->ang = krand()&2047; continue; @@ -1813,7 +1813,7 @@ skip_check: AC_COUNT(vm.g_t) = 0; AC_MOVE_ID(vm.g_t) = *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; if (vm.g_sp->hitag&random_angle) vm.g_sp->ang = krand()&2047; @@ -3725,7 +3725,7 @@ nullquote: continue; 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 VM_CONDITIONAL(ud.respawn_items) 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 (A_CheckEnemySprite(vm.g_sp)) + if (A_CheckEnemySprite((tspritetype *)vm.g_sp)) vm.g_pp->actors_killed++; A_DeleteSprite(vm.g_i); @@ -5798,7 +5798,7 @@ void A_Execute(int32_t iActor, int32_t iPlayer, int32_t lDist) 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)) return; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index a5fc5b514..830025459 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -258,9 +258,9 @@ static int32_t A_FindTargetSprite(const spritetype *s, int32_t aang, int32_t atw break; 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 (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] && // ud.ffire == 0 && @@ -602,7 +602,7 @@ static int32_t SectorContainsSE13(int32_t sectnum) // (in that case walltype *hitwal may be stale) 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 (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) { - const walltype *const hitwal = &wall[hit->wall]; + twalltype const * const hitwal = (twalltype *)&wall[hit->wall]; 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, int32_t projrange, int32_t minzdiff) { - const walltype * hitwal; - if (hit->wall < 0 || hit->sect < 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 (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); 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; } } @@ -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, 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) > (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)) { - const walltype *const hitwal = &wall[hit.wall]; + const twalltype *const hitwal = (twalltype *)&wall[hit.wall]; if (SectorContainsSE13(hitwal->nextsector)) 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); 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; } @@ -1638,7 +1636,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel) { 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.y += (sintable[(sa+512+96)&2047]>>7); @@ -4589,7 +4587,7 @@ void P_ProcessInput(int32_t snum) 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 // be a good sprite flag to add later. @@ -5569,7 +5567,7 @@ HORIZONLY: break; } default: - if (A_CheckEnemySprite(&sprite[p->actorsqu])) + if (A_CheckEnemySprite((tspritetype *)&sprite[p->actorsqu])) p->actors_killed++; A_DeleteSprite(p->actorsqu); break; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 0e332284b..d961bfee9 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -71,7 +71,7 @@ static void G_CacheSpriteNum(int32_t i) char maxc; int32_t j; - if (ud.monsters_off && A_CheckEnemySprite(&sprite[i])) return; + if (ud.monsters_off && A_CheckEnemySprite((tspritetype *)&sprite[i])) return; maxc = 1; diff --git a/polymer/eduke32/source/screens.c b/polymer/eduke32/source/screens.c index 9f1f0aab1..04f542446 100644 --- a/polymer/eduke32/source/screens.c +++ b/polymer/eduke32/source/screens.c @@ -315,7 +315,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 int32_t xvect, yvect, xvect2, yvect2; int16_t p; char col; - walltype *wal, *wal2; + twalltype *wal, *wal2; spritetype *spr; 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; z2 = sector[i].floorz; - for (j=startwall, wal=&wall[startwall]; jnextwall; 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); y1 = dmulscale16(oy, xvect2, ox, yvect2)+(ydim<<11); - wal2 = &wall[wal->point2]; + wal2 = (twalltype *)&wall[wal->point2]; ox = wal2->x-cposx; oy = wal2->y-cposy; 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; k = -1; - for (j=startwall, wal=&wall[startwall]; jnextwall >= 0) continue; @@ -550,7 +550,7 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 } k = wal->point2; - wal2 = &wall[k]; + wal2 = (twalltype *)&wall[k]; ox = wal2->x-cposx; oy = wal2->y-cposy; x2 = dmulscale16(ox, xvect, -oy, yvect)+(xdim<<11); diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index c4e05f652..c0e77b7cb 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -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 (A_CheckEnemySprite(&sprite[i]) == 1) + if (A_CheckEnemySprite((tspritetype *)&sprite[i]) == 1) { if (sprite[sn].picnum == RPG) sprite[sn].extra <<= 1; @@ -2877,7 +2877,7 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp) hitdata_t hit; int32_t zoff = 0; - if (A_CheckEnemySprite(&sprite[i])) + if (A_CheckEnemySprite((tspritetype *) &sprite[i])) zoff = (42<<8); else if (PN == APLAYER) zoff = (39<<8); @@ -2892,7 +2892,7 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp) if (hitsp) *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 FindDistance2D(hit.pos.x-SX,hit.pos.y-SY);