- SW: floatified PLAYER::si

This commit is contained in:
Christoph Oelckers 2022-08-30 21:32:49 +02:00
parent 94e198f9a9
commit 634db656e7
2 changed files with 11 additions and 12 deletions

View file

@ -338,9 +338,8 @@ void DoShadows(tspriteArray& tsprites, tspritetype* tsp, int viewz, int camang)
else else
{ {
// Alter the shadow's position so that it appears behind the sprite itself. // Alter the shadow's position so that it appears behind the sprite itself.
int look = getangle(tSpr->int_pos().X - Player[screenpeek].si.X, tSpr->int_pos().Y - Player[screenpeek].si.Y); auto look = VecToAngle(tSpr->pos.XY() - Player[screenpeek].si.XY());
tSpr->add_int_x(bcos(look, -9)); tSpr->pos.XY() += look.ToVector() * 2;
tSpr->add_int_y(bsin(look, -9));
} }
// Check for voxel items and use a round generic pic if so // Check for voxel items and use a round generic pic if so
@ -752,13 +751,13 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE)) if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))
tsp->cstat |= (CSTAT_SPRITE_TRANSLUCENT); tsp->cstat |= (CSTAT_SPRITE_TRANSLUCENT);
vec3_t pos; DVector3 pos;
if (pp->Flags & (PF_CLIMBING)) if (pp->Flags & (PF_CLIMBING))
{ {
// move sprite forward some so he looks like he's // move sprite forward some so he looks like he's
// climbing // climbing
pos.X = pp->si.X + MOVEx(128 + 80, tsp->int_ang()); pos.X = pp->si.X + MOVEx(128 + 80, tsp->angle);
pos.Y = pp->si.Y + MOVEy(128 + 80, tsp->int_ang()); pos.Y = pp->si.Y + MOVEy(128 + 80, tsp->angle);
} }
else else
{ {
@ -766,8 +765,8 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
pos.Y = pp->si.Y; pos.Y = pp->si.Y;
} }
pos.Z = tsp->int_pos().Z + pp->si.Z; pos.Z = tsp->pos.Z + pp->si.Z;
tsp->set_int_pos(pos); tsp->pos = pos;
tsp->set_int_ang(pp->siang); tsp->set_int_ang(pp->siang);
//continue; //continue;
} }
@ -1412,9 +1411,9 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
updatesectorz(tx, ty, tz, &tsect); updatesectorz(tx, ty, tz, &tsect);
} }
pp->si.X = tx; pp->si.X = tx * inttoworld;
pp->si.Y = ty; pp->si.Y = ty * inttoworld;
pp->si.Z = tz - pp->int_ppos().Z; pp->si.Z = tz * zinttoworld - pp->pos.Z;
pp->siang = tang.Buildang(); pp->siang = tang.Buildang();
QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang); QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang);

View file

@ -654,7 +654,7 @@ struct PLAYER
sectortype* hi_sectp, *lo_sectp; sectortype* hi_sectp, *lo_sectp;
int circle_camera_dist; int circle_camera_dist;
vec3_t si; // save player interp position for PlayerSprite DVector3 si; // save player interp position for PlayerSprite
int16_t siang; int16_t siang;
vec2_t vect, ovect, slide_vect; vec2_t vect, ovect, slide_vect;