From 612dd049f972e741bfa37f2245808ad1d414ca7c Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 30 May 2022 21:33:14 +1000 Subject: [PATCH] - 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. --- source/core/gameinput.cpp | 14 -------------- source/core/gameinput.h | 36 ------------------------------------ 2 files changed, 50 deletions(-) diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index e31dc4b9889..f40292ad51f 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -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; -} diff --git a/source/core/gameinput.h b/source/core/gameinput.h index ea98563cfb7..5bcf5fc16a0 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -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);