Commit 3a12ada9 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: this sort of type punning isn't necessary anymore

parent 0beeebf7
......@@ -2310,7 +2310,7 @@ void DoSpriteOrnament(int32_t i)
{
hitdata_t hit;
hitscan((const vec3_t *)&sprite[i],sprite[i].sectnum,
hitscan(&sprite[i].xyz,sprite[i].sectnum,
sintable[(sprite[i].ang+1536)&2047],
sintable[(sprite[i].ang+1024)&2047],
0,
......@@ -6012,7 +6012,7 @@ end_after_dragging:
daspr->x += dax;
daspr->y += day;
setspritez(daspr-sprite, (const vec3_t *)daspr);
setspritez(daspr-sprite, &daspr->xyz);
}
}
}
......
......@@ -1360,7 +1360,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
if (clipsprite_try(spr, clipMin.x, clipMin.y, clipMax.x, clipMax.y))
continue;
#endif
vec2_t p1 = *(vec2_t const *)spr;
vec2_t p1 = spr->xy;
switch (cstat & (CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ALIGNMENT_FLOOR))
{
......
......@@ -13501,7 +13501,7 @@ int32_t getceilzofslopeptr(usectorptr_t sec, int32_t dax, int32_t day)
auto const wal = (uwallptr_t)&wall[sec->wallptr];
auto const wal2 = (uwallptr_t)&wall[wal->point2];
vec2_t const w = *(vec2_t const *)wal;
vec2_t const w = wal->xy;
vec2_t const d = { wal2->x - w.x, wal2->y - w.y };
int const i = nsqrtasm(uhypsq(d.x,d.y))<<5;
......@@ -13520,7 +13520,7 @@ int32_t getflorzofslopeptr(usectorptr_t sec, int32_t dax, int32_t day)
auto const wal = (uwallptr_t)&wall[sec->wallptr];
auto const wal2 = (uwallptr_t)&wall[wal->point2];
vec2_t const w = *(vec2_t const *)wal;
vec2_t const w = wal->xy;
vec2_t const d = { wal2->x - w.x, wal2->y - w.y };
int const i = nsqrtasm(uhypsq(d.x,d.y))<<5;
......
......@@ -5006,7 +5006,7 @@ float fgetceilzofslope(usectorptr_t sec, float dax, float day)
auto const wal = (uwallptr_t)&wall[sec->wallptr];
auto const wal2 = (uwallptr_t)&wall[wal->point2];
vec2_t const w = *(vec2_t const *)wal;
vec2_t const w = wal->xy;
vec2_t const d = { wal2->x - w.x, wal2->y - w.y };
int const i = nsqrtasm(uhypsq(d.x,d.y))<<5;
......@@ -5024,7 +5024,7 @@ float fgetflorzofslope(usectorptr_t sec, float dax, float day)
auto const wal = (uwallptr_t)&wall[sec->wallptr];
auto const wal2 = (uwallptr_t)&wall[wal->point2];
vec2_t const w = *(vec2_t const *)wal;
vec2_t const w = wal->xy;
vec2_t const d = { wal2->x - w.x, wal2->y - w.y };
int const i = nsqrtasm(uhypsq(d.x,d.y))<<5;
......@@ -8865,7 +8865,8 @@ void polymost_dorotatespritemodel(int32_t sx, int32_t sy, int32_t z, int16_t a,
vec3f_t const vec2 = { fglobalposx + (gcosang * vec1.z - gsinang * vec1.x) * 2560.f,
fglobalposy + (gsinang * vec1.z + gcosang * vec1.x) * 2560.f,
fglobalposz + (vec1.y * (2560.f * 0.8f)) };
*(vec3f_t *)&tspr = vec2;
// XXX.....
*(vec3f_t *)&tspr.xyz = vec2;
tspr.xrepeat = tspr.yrepeat = 5;
}
else
......
......@@ -6221,7 +6221,7 @@ static void MaybeTrainKillPlayer(const spritetype *pSprite, int const setOPos)
pPlayer->cursectnum = pSprite->sectnum;
setsprite(pPlayer->i, (vec3_t const *)pSprite);
setsprite(pPlayer->i, &pSprite->xyz);
P_QuickKill(pPlayer);
}
}
......
......@@ -2028,7 +2028,7 @@ static void M32_MoveFX(void)
{
if ((g_sounds[s->lotag].m & SF_MSFX))
{
x = dist((spritetype *)&pos,s);
x = dist(&pos,s);
if (x < ht && !testbit(g_ambiencePlaying, i) && FX_VoiceAvailable(g_sounds[s->lotag].pr-1))
{
char om = g_sounds[s->lotag].m;
......@@ -2037,7 +2037,7 @@ static void M32_MoveFX(void)
for (j = headspritestat[0]; j >= 0; j = nextspritestat[j])
{
if (s->picnum == MUSICANDSFX && j != i && sprite[j].lotag < 999 &&
testbit(g_ambiencePlaying, j) && dist(&sprite[j],(spritetype *)&pos) > x)
testbit(g_ambiencePlaying, j) && dist(&sprite[j],&pos) > x)
{
S_StopEnvSound(sprite[j].lotag,j);
break;
......
......@@ -3927,7 +3927,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura
int16_t const sqb = getangle(sprite[pSprite->owner].x - t->x, sprite[pSprite->owner].y - t->y);
if (klabs(G_GetAngleDelta(sqa,sqb)) > 512)
if (ldist(&sprite[pSprite->owner],(spritetype const *)t) < ldist(&sprite[g_player[screenpeek].ps->i],&sprite[pSprite->owner]))
if (ldist(&sprite[pSprite->owner],t) < ldist(&sprite[g_player[screenpeek].ps->i],&sprite[pSprite->owner]))
t->xrepeat = t->yrepeat = 0;
}
continue;
......
......@@ -312,7 +312,7 @@ int A_GetFurthestAngle(int const spriteNum, int const angDiv)
for (native_t j = pSprite->ang; j < (2048 + pSprite->ang); j += angIncs)
{
vec3_t origin = *(const vec3_t *)pSprite;
vec3_t origin = pSprite->xyz;
origin.z -= ZOFFSET3;
hitscan(&origin, pSprite->sectnum, sintable[(j + 512) & 2047], sintable[j & 2047], 0, &hit, CLIPMASK1);
......
......@@ -1762,7 +1762,7 @@ badindex:
insptr++;
{
X_ERROR_INVALIDSP();
VM_DoConditional(dist((spritetype *)&pos, vm.pSprite) < Gv_GetVar(*insptr));
VM_DoConditional(dist(&pos, vm.pSprite) < Gv_GetVar(*insptr));
}
continue;
......@@ -1770,7 +1770,7 @@ badindex:
insptr++;
{
X_ERROR_INVALIDSP();
VM_DoConditional(dist((spritetype *)&pos, vm.pSprite) > Gv_GetVar(*insptr));
VM_DoConditional(dist(&pos, vm.pSprite) > Gv_GetVar(*insptr));
}
continue;
// ^^^
......
......@@ -202,7 +202,7 @@ int32_t A_GetHitscanRange(int spriteNum)
hitdata_t hitData;
SZ(spriteNum) -= zOffset;
hitscan((const vec3_t *)&sprite[spriteNum], SECT(spriteNum), sintable[(SA(spriteNum) + 512) & 2047],
hitscan(&sprite[spriteNum].xyz, SECT(spriteNum), sintable[(SA(spriteNum) + 512) & 2047],
sintable[SA(spriteNum) & 2047], 0, &hitData, CLIPMASK1);
SZ(spriteNum) += zOffset;
......
......@@ -3195,7 +3195,7 @@ int32_t A_CheckHitSprite(int spriteNum, int16_t *hitSprite)
zOffset = (39 << 8);
SZ(spriteNum) -= zOffset;
hitscan((const vec3_t *)&sprite[spriteNum], SECT(spriteNum), sintable[(SA(spriteNum) + 512) & 2047],
hitscan(&sprite[spriteNum].xyz, SECT(spriteNum), sintable[(SA(spriteNum) + 512) & 2047],
sintable[SA(spriteNum) & 2047], 0, &hitData, CLIPMASK1);
SZ(spriteNum) += zOffset;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment