]> git.localhorst.tv Git - blank.git/blobdiff - src/net/Packet.hpp
glm backwards compatibility
[blank.git] / src / net / Packet.hpp
index 97b76c8a3416b5b83f0cfd83015a506e5becfdf4..d7da977275e810e3298808cef8ea3a1b324031c4 100644 (file)
@@ -1,11 +1,12 @@
 #ifndef BLANK_NET_PACKET_HPP_
 #define BLANK_NET_PACKET_HPP_
 
+#include "../graphics/glm.hpp"
+
 #include <cstdint>
 #include <ostream>
 #include <string>
 #include <SDL_net.h>
-#include <glm/glm.hpp>
 
 
 namespace blank {
@@ -206,6 +207,10 @@ struct Packet {
                static constexpr std::size_t MAX_LEN = MAX_PAYLOAD_LEN;
                static constexpr std::size_t MAX_DATA_LEN = MAX_LEN - 12;
 
+               static constexpr std::size_t GetSize(std::size_t data_len) noexcept {
+                       return data_len + 12;
+               }
+
                void WriteTransmissionId(std::uint32_t) noexcept;
                void ReadTransmissionId(std::uint32_t &) const noexcept;
                void WriteDataOffset(std::uint32_t) noexcept;