mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- Duke: Replace player_struct
bobposx
with bobpos.X
calls.
This commit is contained in:
parent
f9b728d188
commit
034e1fd175
11 changed files with 21 additions and 21 deletions
|
@ -2694,7 +2694,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE)
|
||||||
vec2_t res;
|
vec2_t res;
|
||||||
rotatepoint(Owner->spr.pos.vec2, ps[p].pos.vec2, (q * l), &res);
|
rotatepoint(Owner->spr.pos.vec2, ps[p].pos.vec2, (q * l), &res);
|
||||||
|
|
||||||
ps[p].bobposx += res.X - ps[p].pos.X;
|
ps[p].bobpos.X += res.X - ps[p].pos.X;
|
||||||
ps[p].bobposy += res.Y - ps[p].pos.Y;
|
ps[p].bobposy += res.Y - ps[p].pos.Y;
|
||||||
|
|
||||||
ps[p].pos.vec2 = res;
|
ps[p].pos.vec2 = res;
|
||||||
|
@ -2871,7 +2871,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
||||||
ps[p].pos.X += m;
|
ps[p].pos.X += m;
|
||||||
ps[p].pos.Y += x;
|
ps[p].pos.Y += x;
|
||||||
|
|
||||||
ps[p].bobposx += m;
|
ps[p].bobpos.X += m;
|
||||||
ps[p].bobposy += x;
|
ps[p].bobposy += x;
|
||||||
|
|
||||||
ps[p].angle.addadjustment(q);
|
ps[p].angle.addadjustment(q);
|
||||||
|
@ -3046,7 +3046,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
|
||||||
ps[p].opos.Y = ps[p].pos.Y;
|
ps[p].opos.Y = ps[p].pos.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps[p].bobposx += l;
|
ps[p].bobpos.X += l;
|
||||||
ps[p].bobposy += x;
|
ps[p].bobposy += x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3177,7 +3177,7 @@ void handle_se02(DDukeActor* actor)
|
||||||
ps[p].pos.X += m;
|
ps[p].pos.X += m;
|
||||||
ps[p].pos.Y += x;
|
ps[p].pos.Y += x;
|
||||||
|
|
||||||
ps[p].bobposx += m;
|
ps[p].bobpos.X += m;
|
||||||
ps[p].bobposy += x;
|
ps[p].bobposy += x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3898,7 +3898,7 @@ void handle_se17(DDukeActor* actor)
|
||||||
act3->floorz = act2->spr.sector()->floorz;
|
act3->floorz = act2->spr.sector()->floorz;
|
||||||
act3->ceilingz = act2->spr.sector()->ceilingz;
|
act3->ceilingz = act2->spr.sector()->ceilingz;
|
||||||
|
|
||||||
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X;
|
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].bobposy = ps[p].opos.Y = ps[p].pos.Y;
|
||||||
ps[p].opos.Z = ps[p].pos.Z;
|
ps[p].opos.Z = ps[p].pos.Z;
|
||||||
|
|
||||||
|
|
|
@ -1929,7 +1929,7 @@ void movetransports_d(void)
|
||||||
ps[p].transporter_hold = 13;
|
ps[p].transporter_hold = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X = Owner->spr.pos.X;
|
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].bobposy = 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;
|
ps[p].opos.Z = ps[p].pos.Z = Owner->spr.pos.Z - gs.playerheight;
|
||||||
|
|
||||||
|
|
|
@ -1601,7 +1601,7 @@ void movetransports_r(void)
|
||||||
ps[p].transporter_hold = 13;
|
ps[p].transporter_hold = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X = Owner->spr.pos.X;
|
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].bobposy = 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));
|
ps[p].opos.Z = ps[p].pos.Z = Owner->spr.pos.Z - (gs.playerheight - (4 << 8));
|
||||||
|
|
||||||
|
@ -2446,7 +2446,7 @@ void rr_specialstats()
|
||||||
if (act2->spr.picnum == RRTILE297)
|
if (act2->spr.picnum == RRTILE297)
|
||||||
{
|
{
|
||||||
ps[p].angle.ang = buildang(act2->spr.ang);
|
ps[p].angle.ang = buildang(act2->spr.ang);
|
||||||
ps[p].bobposx = ps[p].opos.X = ps[p].pos.X = act2->spr.pos.X;
|
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].bobposy = 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);
|
ps[p].opos.Z = ps[p].pos.Z = act2->spr.pos.Z - (36 << 8);
|
||||||
auto pact = ps[p].GetActor();
|
auto pact = ps[p].GetActor();
|
||||||
|
|
|
@ -368,8 +368,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_BOBPOSX:
|
case PLAYER_BOBPOSX:
|
||||||
if (bSet) ps[iPlayer].bobposx = lValue;
|
if (bSet) ps[iPlayer].bobpos.X = lValue;
|
||||||
else SetGameVarID(lVar2, ps[iPlayer].bobposx, sActor, sPlayer);
|
else SetGameVarID(lVar2, ps[iPlayer].bobpos.X, sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_BOBPOSY:
|
case PLAYER_BOBPOSY:
|
||||||
|
@ -2245,7 +2245,7 @@ int ParseState::parse(void)
|
||||||
{
|
{
|
||||||
// I am not convinced this is even remotely smart to be executed from here..
|
// I am not convinced this is even remotely smart to be executed from here..
|
||||||
pickrandomspot(g_p);
|
pickrandomspot(g_p);
|
||||||
g_ac->spr.pos.X = ps[g_p].bobposx = ps[g_p].opos.X = ps[g_p].pos.X;
|
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].bobposy = 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.pos.Z = ps[g_p].opos.Z = ps[g_p].pos.Z;
|
||||||
g_ac->spr.backuppos();
|
g_ac->spr.backuppos();
|
||||||
|
|
|
@ -771,7 +771,7 @@ void player_struct::backuppos(bool noclipping)
|
||||||
}
|
}
|
||||||
|
|
||||||
opos.Z = pos.Z;
|
opos.Z = pos.Z;
|
||||||
bobposx = pos.X;
|
bobpos.X = pos.X;
|
||||||
bobposy = pos.Y;
|
bobposy = pos.Y;
|
||||||
opyoff = pyoff;
|
opyoff = pyoff;
|
||||||
}
|
}
|
||||||
|
@ -1079,7 +1079,7 @@ DEFINE_FIELD_X(DukePlayer, player_struct, psectlotag)
|
||||||
DEFINE_FIELD_X(DukePlayer, player_struct, numloogs)
|
DEFINE_FIELD_X(DukePlayer, player_struct, numloogs)
|
||||||
DEFINE_FIELD_X(DukePlayer, player_struct, loogcnt)
|
DEFINE_FIELD_X(DukePlayer, player_struct, loogcnt)
|
||||||
DEFINE_FIELD_X(DukePlayer, player_struct, invdisptime)
|
DEFINE_FIELD_X(DukePlayer, player_struct, invdisptime)
|
||||||
DEFINE_FIELD_X(DukePlayer, player_struct, bobposx)
|
//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, oposx)
|
||||||
//DEFINE_FIELD_X(DukePlayer, player_struct, oposy)
|
//DEFINE_FIELD_X(DukePlayer, player_struct, oposy)
|
||||||
|
|
|
@ -2848,7 +2848,7 @@ void processinput_d(int snum)
|
||||||
|
|
||||||
p->playerweaponsway(pact->spr.xvel);
|
p->playerweaponsway(pact->spr.xvel);
|
||||||
|
|
||||||
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobposx) * (p->pos.X - p->bobposx) + (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->bobposy) * (p->pos.Y - p->bobposy)), 0, 512);
|
||||||
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
|
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
|
||||||
|
|
||||||
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));
|
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));
|
||||||
|
|
|
@ -3563,7 +3563,7 @@ void processinput_r(int snum)
|
||||||
|
|
||||||
p->playerweaponsway(pact->spr.xvel);
|
p->playerweaponsway(pact->spr.xvel);
|
||||||
|
|
||||||
pact->spr.xvel = clamp(ksqrt((p->pos.X - p->bobposx) * (p->pos.X - p->bobposx) + (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->bobposy) * (p->pos.Y - p->bobposy)), 0, 512);
|
||||||
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
|
if (p->on_ground) p->bobcounter += p->GetActor()->spr.xvel >> 1;
|
||||||
|
|
||||||
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));
|
p->backuppos(ud.clipping == 0 && (p->cursector->floorpicnum == MIRROR || !p->insector()));
|
||||||
|
|
|
@ -60,7 +60,7 @@ void pickrandomspot(int snum)
|
||||||
i = krand()%numplayersprites;
|
i = krand()%numplayersprites;
|
||||||
else i = snum;
|
else i = snum;
|
||||||
|
|
||||||
p->bobposx = p->opos.X = p->pos.X = po[i].opos.X;
|
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->bobposy = p->opos.Y = p->pos.Y = po[i].opos.Y;
|
||||||
p->opos.Z = p->pos.Z = po[i].opos.Z;
|
p->opos.Z = p->pos.Z = po[i].opos.Z;
|
||||||
p->angle.oang = p->angle.ang = buildang(po[i].oa);
|
p->angle.oang = p->angle.ang = buildang(po[i].oa);
|
||||||
|
@ -625,7 +625,7 @@ void resetpspritevars(int g)
|
||||||
ps[j].frag_ps = j;
|
ps[j].frag_ps = j;
|
||||||
act->SetOwner(act);
|
act->SetOwner(act);
|
||||||
|
|
||||||
ps[j].bobposx = ps[j].opos.X = ps[j].pos.X = act->spr.pos.X;
|
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].bobposy = ps[j].opos.Y = ps[j].pos.Y = act->spr.pos.Y;
|
||||||
ps[j].opos.Z = ps[j].pos.Z = act->spr.pos.Z;
|
ps[j].opos.Z = ps[j].pos.Z = act->spr.pos.Z;
|
||||||
act->spr.backuppos();
|
act->spr.backuppos();
|
||||||
|
|
|
@ -121,7 +121,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
||||||
("numloogs", w.numloogs)
|
("numloogs", w.numloogs)
|
||||||
("loogcnt", w.loogcnt)
|
("loogcnt", w.loogcnt)
|
||||||
.Array("loogie", w.loogie, w.numloogs)
|
.Array("loogie", w.loogie, w.numloogs)
|
||||||
("bobposx", w.bobposx)
|
("bobposx", w.bobpos.X)
|
||||||
("bobposy", w.bobposy)
|
("bobposy", w.bobposy)
|
||||||
("pyoff", w.pyoff)
|
("pyoff", w.pyoff)
|
||||||
("posxv", w.vel.X)
|
("posxv", w.vel.X)
|
||||||
|
|
|
@ -188,7 +188,7 @@ struct player_struct
|
||||||
PalEntry pals;
|
PalEntry pals;
|
||||||
|
|
||||||
// this was a global variable originally.
|
// this was a global variable originally.
|
||||||
vec2_t fric, exit, loogie[64];
|
vec2_t fric, exit, loogie[64], bobpos;
|
||||||
|
|
||||||
// weapon drawer variables and their interpolation counterparts.
|
// weapon drawer variables and their interpolation counterparts.
|
||||||
int weapon_sway;
|
int weapon_sway;
|
||||||
|
@ -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.
|
// 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 numloogs, loogcnt;
|
||||||
int invdisptime;
|
int invdisptime;
|
||||||
int bobposx, bobposy, pyoff, opyoff;
|
int bobposy, pyoff, opyoff;
|
||||||
int last_pissed_time, truefz, truecz;
|
int last_pissed_time, truefz, truecz;
|
||||||
int player_par, visibility;
|
int player_par, visibility;
|
||||||
int bobcounter;
|
int bobcounter;
|
||||||
|
|
|
@ -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.
|
// 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 numloogs, loogcnt;
|
||||||
native int invdisptime;
|
native int invdisptime;
|
||||||
native int bobposx, bobposy, pyoff, opyoff;
|
native int bobposy, pyoff, opyoff;
|
||||||
native int last_pissed_time, truefz, truecz;
|
native int last_pissed_time, truefz, truecz;
|
||||||
native int player_par, visibility;
|
native int player_par, visibility;
|
||||||
native int bobcounter;
|
native int bobcounter;
|
||||||
|
|
Loading…
Reference in a new issue