X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2FHud.hh;h=2262b062983ae1d8faedc89bdc0cdcda21aaa270;hb=e973a129b5b83b628ba3f09e8c95682fc74080cd;hp=59f0631a964dcf391de2aff2bdfbf45ffaf976a2;hpb=a31d65a998121df0651c57bfb68782e2a07d2e2f;p=chaz%2Fyoink diff --git a/src/Hud.hh b/src/Hud.hh index 59f0631..2262b06 100644 --- a/src/Hud.hh +++ b/src/Hud.hh @@ -38,8 +38,9 @@ #include #include #include +#include -#include "Tilemap.hh" +#include "GameState.hh" // TODO this stuff is still just hacked up @@ -48,7 +49,7 @@ class ProgressBar : public Mf::Drawable { public: - ProgressBar(const Tilemap& tilemap, Tilemap::Index index); + ProgressBar(const Mf::Texture& tilemap, Mf::Texture::TileIndex index); void resize(const Mf::Rectangle& rect); @@ -63,7 +64,7 @@ private: Mf::Vector2 mVertices[8]; Mf::Scalar mWidth; - Tilemap mTilemap; + Mf::Texture mTilemap; Mf::Scalar mTexCoords[8]; Mf::Scalar mMidCoords[2]; }; @@ -76,11 +77,11 @@ class Hud : public Mf::Layer { public: - Hud(); + Hud(GameState& state); - static HudP alloc() + static HudP alloc(GameState& state) { - return HudP(new Hud); + return HudP(new Hud(state)); } void setBar1Progress(Mf::Scalar progress) @@ -99,16 +100,19 @@ public: void resize(int width, int height); + void update(Mf::Scalar t, Mf::Scalar dt); void draw(Mf::Scalar alpha = 0.0) const; - bool handleEvent(Mf::Event& event); + bool handleEvent(const Mf::Event& event); private: + GameState& mState; + ProgressBar mBar1; ProgressBar mBar2; unsigned mNumber; - Tilemap mFont; + Mf::Texture mFont; Mf::Matrix4 mProjection; };