X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2FHUD.hpp;h=cbe28762727c81e90c47f973298bce545f3a6393;hb=dcd54cacda98c2c0f7cf0c7a9131fb858d8ee10a;hp=d15643f4d4476090fc98138e10bcdaeffc2cbd14;hpb=b066e776622f96e906600a0c4a08de392bd03676;p=blank.git diff --git a/src/ui/HUD.hpp b/src/ui/HUD.hpp index d15643f..cbe2876 100644 --- a/src/ui/HUD.hpp +++ b/src/ui/HUD.hpp @@ -3,10 +3,9 @@ #include "FixedText.hpp" #include "MessageBox.hpp" -#include "../model/EntityModel.hpp" -#include "../model/OutlineModel.hpp" - -#include +#include "../graphics/EntityMesh.hpp" +#include "../graphics/glm.hpp" +#include "../graphics/PrimitiveMesh.hpp" namespace blank { @@ -14,6 +13,7 @@ namespace blank { class Block; class BlockTypeRegistry; class Config; +class CongestionControl; class Environment; class Font; class Player; @@ -42,11 +42,16 @@ public: void UpdatePosition(); void UpdateOrientation(); + // net stats + void UpdateNetStats(const CongestionControl &); + // message box void PostMessage(const char *); void PostMessage(const std::string &msg) { PostMessage(msg.c_str()); } + // whether to always render message box regardless of last post + void KeepMessages(bool k) { msg_keep = k; } void Update(int dt); void Render(Viewport &) noexcept; @@ -57,13 +62,13 @@ private: const Player &player; // block focus - OutlineModel outline; + PrimitiveMesh outline; glm::mat4 outline_transform; bool outline_visible; // "inventory" - EntityModel block; - EntityModel::Buffer block_buf; + EntityMesh block; + EntityMesh::Buffer block_buf; glm::mat4 block_transform; FixedText block_label; bool block_visible; @@ -77,12 +82,19 @@ private: bool show_block; bool show_entity; + // net stats + FixedText bandwidth_text; + FixedText rtt_text; + FixedText packet_loss_text; + bool show_net; + // message box MessageBox messages; - IntervalTimer msg_timer; + CoarseTimer msg_timer; + bool msg_keep; // crosshair - OutlineModel crosshair; + PrimitiveMesh crosshair; };