- Duke: - Duke: Replace FireProj position and velocity variables with vectors.

This commit is contained in:
Mitchell Richters 2021-12-30 22:04:00 +11:00
parent fd8c7bfa52
commit 8a94022f5d
3 changed files with 12 additions and 15 deletions

View file

@ -1452,19 +1452,17 @@ static bool movefireball(DDukeActor* actor)
if (trail)
{
FireProj* proj = &trail->fproj;
ball->spr.pos.X = proj->x;
ball->spr.pos.Y = proj->y;
ball->spr.pos.Z = proj->z;
ball->spr.xvel = proj->xv;
ball->spr.yvel = proj->yv;
ball->spr.zvel = proj->zv;
ball->spr.pos = proj->pos;
ball->spr.xvel = proj->vel.X;
ball->spr.yvel = proj->vel.Y;
ball->spr.zvel = proj->vel.Z;
}
}
ball->spr.yrepeat = ball->spr.xrepeat = (uint8_t)(actor->spr.xrepeat * siz);
ball->spr.cstat = actor->spr.cstat;
ball->spr.extra = 0;
ball->fproj = { ball->spr.pos.X, ball->spr.pos.Y, ball->spr.pos.Z, ball->spr.xvel, ball->spr.yvel, ball->spr.zvel };
ball->fproj = { ball->spr.pos, { ball->spr.xvel, ball->spr.yvel, ball->spr.zvel } };
ChangeActorStat(ball, STAT_PROJECTILE);
}

View file

@ -51,12 +51,12 @@ static FSerializer& Serialize(FSerializer& arc, const char* key, FireProj& p, Fi
{
if (arc.BeginObject(key))
{
arc("x", p.x)
("y", p.y)
("z", p.z)
("xv", p.xv)
("yv", p.yv)
("zv", p.zv)
arc("x", p.pos.X)
("y", p.pos.Y)
("z", p.pos.Z)
("xv", p.vel.X)
("yv", p.vel.Y)
("zv", p.vel.Z)
.EndObject();
}
return arc;

View file

@ -23,8 +23,7 @@ struct STATUSBARTYPE
struct FireProj
{
int x, y, z;
int xv, yv, zv;
vec3_t pos, vel;
};
class DDukeActor : public DCoreActor