]> git.localhorst.tv Git - blank.git/blobdiff - src/client/NetworkedInput.hpp
cleanup of sdl event to string functions
[blank.git] / src / client / NetworkedInput.hpp
index 36382b93225632d1b4056af8d3e9639f6b162d74..3a61d90910e785ec67ce7628ca8e1b1faabf7e8e 100644 (file)
@@ -20,7 +20,8 @@ class NetworkedInput
 public:
        explicit NetworkedInput(World &, Player &, Client &);
 
-       void Update(int dt);
+       bool UpdateImportant() const noexcept;
+       void Update(Entity &, float dt) override;
        void PushPlayerUpdate(int dt);
        void MergePlayerCorrection(std::uint16_t, const EntityState &);
 
@@ -36,14 +37,17 @@ private:
 
        struct PlayerHistory {
                EntityState state;
-               glm::vec3 tgt_vel;
-               int delta_t;
+               glm::vec3 movement;
+               float delta_t;
                std::uint16_t packet;
-               PlayerHistory(EntityState s, const glm::vec3 &tv, int dt, std::uint16_t p)
-               : state(s), tgt_vel(tv), delta_t(dt), packet(p) { }
+               PlayerHistory(EntityState s, const glm::vec3 &mv, float dt, std::uint16_t p)
+               : state(s), movement(mv), delta_t(dt), packet(p) { }
        };
        std::list<PlayerHistory> player_hist;
 
+       glm::vec3 old_movement;
+
+       std::uint8_t old_actions;
        std::uint8_t actions;
 
 };