]> Dogcows Code - chaz/yoink/blobdiff - src/Hud.hh
library class revamped as manager, goodbye tilemap
[chaz/yoink] / src / Hud.hh
index 59f0631a964dcf391de2aff2bdfbf45ffaf976a2..2262b062983ae1d8faedc89bdc0cdcda21aaa270 100644 (file)
@@ -38,8 +38,9 @@
 #include <Moof/Layer.hh>
 #include <Moof/Math.hh>
 #include <Moof/Rectangle.hh>
+#include <Moof/Texture.hh>
 
-#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;
 };
This page took 0.019515 seconds and 4 git commands to generate.