- Duke: Replace player_struct bobposy with bobpos.Y calls.

This commit is contained in:
Mitchell Richters 2021-12-30 22:59:45 +11:00
parent 034e1fd175
commit 1e90b0bbbe
11 changed files with 20 additions and 20 deletions

View file

@ -2695,7 +2695,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE)
rotatepoint(Owner->spr.pos.vec2, ps[p].pos.vec2, (q * l), &res);
ps[p].bobpos.X += res.X - ps[p].pos.X;
ps[p].bobposy += res.Y - ps[p].pos.Y;
ps[p].bobpos.Y += res.Y - ps[p].pos.Y;
ps[p].pos.vec2 = res;
@ -2872,7 +2872,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
ps[p].pos.Y += x;
ps[p].bobpos.X += m;
ps[p].bobposy += x;
ps[p].bobpos.Y += x;
ps[p].angle.addadjustment(q);
@ -3047,7 +3047,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
}
ps[p].bobpos.X += l;
ps[p].bobposy += x;
ps[p].bobpos.Y += x;
}
if (po[p].os == actor->spr.sector())
@ -3178,7 +3178,7 @@ void handle_se02(DDukeActor* actor)
ps[p].pos.Y += x;
ps[p].bobpos.X += m;
ps[p].bobposy += x;
ps[p].bobpos.Y += x;
}
DukeSectIterator it(actor->sector());
@ -3899,7 +3899,7 @@ void handle_se17(DDukeActor* actor)
act3->ceilingz = act2->spr.sector()->ceilingz;
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y;
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].pos.Y;
ps[p].opos.Z = ps[p].pos.Z;
ps[p].truefz = act3->floorz;

View file

@ -1930,7 +1930,7 @@ void movetransports_d(void)
}
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X = Owner->spr.pos.X;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].opos.Z = ps[p].pos.Z = Owner->spr.pos.Z - gs.playerheight;
ChangeActorSect(act2, Owner->sector());

View file

@ -1602,7 +1602,7 @@ void movetransports_r(void)
}
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X = Owner->spr.pos.X;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].pos.Y = Owner->spr.pos.Y;
ps[p].opos.Z = ps[p].pos.Z = Owner->spr.pos.Z - (gs.playerheight - (4 << 8));
ChangeActorSect(act2, Owner->sector());
@ -2447,7 +2447,7 @@ void rr_specialstats()
{
ps[p].angle.ang = buildang(act2->spr.ang);
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X = act2->spr.pos.X;
ps[p].bobposy = ps[p].opos.Y = ps[p].pos.Y = act2->spr.pos.Y;
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].pos.Y = act2->spr.pos.Y;
ps[p].opos.Z = ps[p].pos.Z = act2->spr.pos.Z - (36 << 8);
auto pact = ps[p].GetActor();
ChangeActorSect(pact, act2->sector());

View file

@ -373,8 +373,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_BOBPOSY:
if (bSet) ps[iPlayer].bobposy = lValue;
else SetGameVarID(lVar2, ps[iPlayer].bobposy, sActor, sPlayer);
if (bSet) ps[iPlayer].bobpos.Y = lValue;
else SetGameVarID(lVar2, ps[iPlayer].bobpos.Y, sActor, sPlayer);
break;
case PLAYER_OPOSX:
@ -2246,7 +2246,7 @@ int ParseState::parse(void)
// I am not convinced this is even remotely smart to be executed from here..
pickrandomspot(g_p);
g_ac->spr.pos.X = ps[g_p].bobpos.X = ps[g_p].opos.X = ps[g_p].pos.X;
g_ac->spr.pos.Y = ps[g_p].bobposy = ps[g_p].opos.Y = ps[g_p].pos.Y;
g_ac->spr.pos.Y = ps[g_p].bobpos.Y = ps[g_p].opos.Y = ps[g_p].pos.Y;
g_ac->spr.pos.Z = ps[g_p].opos.Z = ps[g_p].pos.Z;
g_ac->spr.backuppos();
updatesector(ps[g_p].pos.X, ps[g_p].pos.Y, &ps[g_p].cursector);

View file

@ -772,7 +772,7 @@ void player_struct::backuppos(bool noclipping)
opos.Z = pos.Z;
bobpos.X = pos.X;
bobposy = pos.Y;
bobpos.Y = pos.Y;
opyoff = pyoff;
}
@ -1080,7 +1080,7 @@ DEFINE_FIELD_X(DukePlayer, player_struct, numloogs)
DEFINE_FIELD_X(DukePlayer, player_struct, loogcnt)
DEFINE_FIELD_X(DukePlayer, player_struct, invdisptime)
//DEFINE_FIELD_X(DukePlayer, player_struct, bobposx)
DEFINE_FIELD_X(DukePlayer, player_struct, bobposy)
//DEFINE_FIELD_X(DukePlayer, player_struct, bobposy)
//DEFINE_FIELD_X(DukePlayer, player_struct, oposx)
//DEFINE_FIELD_X(DukePlayer, player_struct, oposy)
//DEFINE_FIELD_X(DukePlayer, player_struct, oposz)

View file

@ -2848,7 +2848,7 @@ void processinput_d(int snum)
p->playerweaponsway(pact->spr.xvel);
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobpos.X) * (p->pos.X - p->bobpos.X) + (p->pos.Y - p->bobposy) * (p->pos.Y - p->bobposy)), 0, 512);
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobpos.X) * (p->pos.X - p->bobpos.X) + (p->pos.Y - p->bobpos.Y) * (p->pos.Y - p->bobpos.Y)), 0, 512);
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));

View file

@ -3563,7 +3563,7 @@ void processinput_r(int snum)
p->playerweaponsway(pact->spr.xvel);
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobpos.X) * (p->pos.X - p->bobpos.X) + (p->pos.Y - p->bobposy) * (p->pos.Y - p->bobposy)), 0, 512);
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobpos.X) * (p->pos.X - p->bobpos.X) + (p->pos.Y - p->bobpos.Y) * (p->pos.Y - p->bobpos.Y)), 0, 512);
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));

View file

@ -61,7 +61,7 @@ void pickrandomspot(int snum)
else i = snum;
p->bobpos.X = p->opos.X = p->pos.X = po[i].opos.X;
p->bobposy = p->opos.Y = p->pos.Y = po[i].opos.Y;
p->bobpos.Y = p->opos.Y = p->pos.Y = po[i].opos.Y;
p->opos.Z = p->pos.Z = po[i].opos.Z;
p->angle.oang = p->angle.ang = buildang(po[i].oa);
p->setCursector(po[i].os);
@ -626,7 +626,7 @@ void resetpspritevars(int g)
act->SetOwner(act);
ps[j].bobpos.X = ps[j].opos.X = ps[j].pos.X = act->spr.pos.X;
ps[j].bobposy = ps[j].opos.Y = ps[j].pos.Y = act->spr.pos.Y;
ps[j].bobpos.Y = ps[j].opos.Y = ps[j].pos.Y = act->spr.pos.Y;
ps[j].opos.Z = ps[j].pos.Z = act->spr.pos.Z;
act->spr.backuppos();
ps[j].angle.oang = ps[j].angle.ang = buildang(act->spr.ang);

View file

@ -122,7 +122,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
("loogcnt", w.loogcnt)
.Array("loogie", w.loogie, w.numloogs)
("bobposx", w.bobpos.X)
("bobposy", w.bobposy)
("bobposy", w.bobpos.Y)
("pyoff", w.pyoff)
("posxv", w.vel.X)
("posyv", w.vel.Y)

View file

@ -204,7 +204,7 @@ struct player_struct
// From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed.
int numloogs, loogcnt;
int invdisptime;
int bobposy, pyoff, opyoff;
int pyoff, opyoff;
int last_pissed_time, truefz, truecz;
int player_par, visibility;
int bobcounter;

View file

@ -152,7 +152,7 @@ struct DukePlayer
// From here on it is unaltered from JFDuke with the exception of a few fields that are no longer needed and were removed.
native int numloogs, loogcnt;
native int invdisptime;
native int bobposy, pyoff, opyoff;
native int pyoff, opyoff;
native int last_pissed_time, truefz, truecz;
native int player_par, visibility;
native int bobcounter;