X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FHud.cc;h=28b7c3487f8fbbbd0184bf725bd164f5ae5dafa6;hp=f4134cf737fd468acee3b76acc5a3166bfc00611;hb=c78934a448d0126709fccec3d5a636b3baa87da4;hpb=76b3f4be992514a740ac03cdbdd57844142a0b4c diff --git a/src/Hud.cc b/src/Hud.cc index f4134cf..28b7c34 100644 --- a/src/Hud.cc +++ b/src/Hud.cc @@ -10,7 +10,6 @@ **************************************************************************/ #include -#include #include #include #include @@ -111,9 +110,9 @@ Hud::Hud(GameState& state) : mBar2(Mf::Texture("StatusBars"), 2), mFont("Font") { - ASSERT(Mf::video && - "no current video context from which to get dimensions"); - resize(Mf::video->getWidth(), Mf::video->getHeight()); + Mf::Video* video = Mf::Video::current(); + ASSERT(video && "a current video context should be set"); + resize(video->getWidth(), video->getHeight()); } @@ -174,7 +173,8 @@ bool Hud::handleEvent(const Mf::Event& event) if (event.key.keysym.sym == SDLK_h) { // don't want the hud anymore - Mf::core.pop(this); + parent().removeChild(this); + Mf::logWarning("okay bye bye hud"); return true; }