]> git.localhorst.tv Git - blank.git/blobdiff - src/client/InteractiveState.hpp
store shapes in models rather than meshes
[blank.git] / src / client / InteractiveState.hpp
index 86757a294c10501dd28c074a28ba59410220bb59..731ed0acd82d688e3e76181b129c679a080e03f4 100644 (file)
@@ -48,7 +48,10 @@ public:
        void Update(int dt) override;
        void Render(Viewport &) override;
 
-       void MergePlayerCorrection(std::uint16_t, const EntityState &);
+       void Handle(const Packet::SpawnEntity &);
+       void Handle(const Packet::DespawnEntity &);
+       void Handle(const Packet::EntityUpdate &);
+       void Handle(const Packet::PlayerCorrection &);
        void Handle(const Packet::BlockUpdate &);
 
        void SetAudio(bool) override;
@@ -57,6 +60,13 @@ public:
        void SetDebug(bool) override;
        void Exit() override;
 
+private:
+       /// flag entity as updated by given packet
+       /// returns false if the update should be ignored
+       bool UpdateEntity(std::uint32_t id, std::uint16_t seq);
+       /// drop update information or given entity
+       void ClearEntity(std::uint32_t id);
+
 private:
        MasterState &master;
        ShapeRegistry shapes;
@@ -75,6 +85,14 @@ private:
 
        SkyBox sky;
 
+       std::vector<float> tex_map;
+
+       struct UpdateStatus {
+               std::uint16_t last_packet;
+               int last_update;
+       };
+       std::map<std::uint32_t, UpdateStatus> update_status;
+
 };
 
 }