X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FHud.hh;h=d3675a476c85b62dcb5782256dd2856bfce9f506;hp=f386fd4b73731ec12918f260cf13b8624e706221;hb=6a5d12788f2778a26223de690d34b00ac16a6ec3;hpb=23d8f7a5fbd1eca7f46f2342c20ac5e28ae0128a diff --git a/src/Hud.hh b/src/Hud.hh index f386fd4..d3675a4 100644 --- a/src/Hud.hh +++ b/src/Hud.hh @@ -39,9 +39,12 @@ #include #include +#include "GameLayer.hh" #include "Tilemap.hh" +// TODO this stuff is still just hacked up + class ProgressBar : public Mf::Drawable { public: @@ -56,14 +59,14 @@ public: private: - Mf::Scalar progress_; + Mf::Scalar mProgress; - Mf::Vector2 vertices_[8]; - Mf::Scalar width_; + Mf::Vector2 mVertices[8]; + Mf::Scalar mWidth; - Tilemap tilemap_; - Mf::Scalar texCoords_[8]; - Mf::Scalar midCoords_[2]; + Tilemap mTilemap; + Mf::Scalar mTexCoords[8]; + Mf::Scalar mMidCoords[2]; }; @@ -74,41 +77,44 @@ class Hud : public Mf::Layer { public: - Hud(); + Hud(GameLayer::State& state); - static HudP alloc() + static HudP alloc(GameLayer::State& state) { - return HudP(new Hud); + return HudP(new Hud(state)); } void setBar1Progress(Mf::Scalar progress) { // pass through - bar1_.setProgress(progress); + mBar1.setProgress(progress); } void setBar2Progress(Mf::Scalar progress) { // pass through - bar2_.setProgress(progress); + mBar2.setProgress(progress); } void setNumber(unsigned value); void resize(int width, int height); - void draw(Mf::Scalar alpha = 0.0) const; - bool handleEvent(Mf::Event& event); + void update(Mf::Engine& engine, Mf::Scalar t, Mf::Scalar dt); + void draw(Mf::Engine& engine, Mf::Scalar alpha = 0.0) const; + bool handleEvent(Mf::Engine& engine, const Mf::Event& event); private: - ProgressBar bar1_; - ProgressBar bar2_; + GameLayer::State& mState; + + ProgressBar mBar1; + ProgressBar mBar2; - unsigned number_; - Tilemap font_; + unsigned mNumber; + Tilemap mFont; - Mf::Matrix4 projection_; + Mf::Matrix4 mProjection; };