]> Dogcows Code - chaz/yoink/blobdiff - src/Hud.cc
converted tilemap scripts to lua
[chaz/yoink] / src / Hud.cc
index d5ec7bcd8ebbc7222d30c2073f8184a8d9023abc..84b7bc1964dd9e2ab8e1e539ffd90e3407d5f787 100644 (file)
@@ -33,7 +33,7 @@
 #include <iostream>
 
 
-ProgressBar::ProgressBar(const Mf::Tilemap& tilemap, Mf::Tilemap::Index index) :
+ProgressBar::ProgressBar(const Tilemap& tilemap, Tilemap::Index index) :
        progress_(0.0),
        tilemap_(tilemap)
 {
@@ -119,8 +119,8 @@ void ProgressBar::draw(Mf::Scalar alpha) const
 
 
 Hud::Hud() :
-       bar1_(Mf::Tilemap("StatusBars"), 0),
-       bar2_(Mf::Tilemap("StatusBars"), 2),
+       bar1_(Tilemap("StatusBars"), 0),
+       bar2_(Tilemap("StatusBars"), 2),
        font_("Font")
 {
        resize(800, 600);
@@ -129,10 +129,10 @@ Hud::Hud() :
 
 void Hud::resize(int width, int height)
 {
-       cml::matrix_orthographic_RH( projection_, 
-                       0.0f
-                       Mf::Scalar(width), 0.0f, Mf::Scalar(height),
-                       1.0f, -1.0f, cml::z_clip_neg_one);
+       cml::matrix_orthographic_RH(projection_, 
+                       SCALAR(0.0)
+                       Mf::Scalar(width), SCALAR(0.0), Mf::Scalar(height),
+                       SCALAR(1.0), SCALAR(-1.0), cml::z_clip_neg_one);
 
        // position the two progress bars at the top-left of the screen
        bar1_.resize(Mf::Rectangle(20, height - 51,
@@ -171,6 +171,18 @@ void Hud::draw(Mf::Scalar alpha) const
        glPopMatrix();
 }
 
+bool Hud::handleEvent(Mf::Event& event)
+{
+       switch (event.type)
+       {
+               case SDL_VIDEORESIZE:
+                       resize(event.resize.w, event.resize.h);
+                       break;
+       }
+
+       return false;
+}
+
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
This page took 0.025541 seconds and 4 git commands to generate.