Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Remove unused PlayerPosition structure.
* There were some plans around this being in use for all the various player structs in each game, but it hasn't come to be.
* Code remains in the commit history, it can come back if it's of use in the future.
  • Loading branch information
mjr4077au committed May 30, 2022
1 parent 1ac58dc commit 612dd04
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
14 changes: 0 additions & 14 deletions source/core/gameinput.cpp
Expand Up @@ -536,17 +536,3 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w,
}
return arc;
}

FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerPosition& w, PlayerPosition* def)
{
if (arc.BeginObject(keyname))
{
arc("pos", w.pos).EndObject();

if (arc.isReading())
{
w.opos = w.pos;
}
}
return arc;
}
36 changes: 0 additions & 36 deletions source/core/gameinput.h
Expand Up @@ -250,45 +250,9 @@ struct PlayerAngle
bool inputdisabled;
};

struct PlayerPosition
{
vec3_t pos, opos;

// Interpolation helpers.
void backupx() { opos.X = pos.X; }
void backupy() { opos.Y = pos.Y; }
void backupz() { opos.Z = pos.Z; }
void backuppos() { opos = pos; }

// Interpolated points.
int32_t interpolatedx(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.X, pos.X, smoothratio, scale); }
int32_t interpolatedy(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.Y, pos.Y, smoothratio, scale); }
int32_t interpolatedz(double const smoothratio, int const scale = 16) { return interpolatedvalue(opos.Z, pos.Z, smoothratio, scale); }

// Interpolated vectors.
vec2_t interpolatedvec2(double const smoothratio, int const scale = 16)
{
return
{
interpolatedx(smoothratio, scale),
interpolatedy(smoothratio, scale)
};
}
vec3_t interpolatedvec3(double const smoothratio, int const scale = 16)
{
return
{
interpolatedx(smoothratio, scale),
interpolatedy(smoothratio, scale),
interpolatedz(smoothratio, scale)
};
}
};

class FSerializer;
FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, PlayerAngle* def);
FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def);
FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerPosition& w, PlayerPosition* def);


void updateTurnHeldAmt(double const scaleAdjust);
Expand Down

0 comments on commit 612dd04

Please sign in to comment.