diff options
author | Treeki <treeki@gmail.com> | 2011-03-23 21:39:58 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2011-03-23 21:39:58 +0100 |
commit | f7e7a1eea2e66ea507fc5a2b0813ec02493133a9 (patch) | |
tree | ea7fba70961c0969d0b59d5ff280662dbecd57df /src/wm_hud.cpp | |
parent | a830e87d71ffece4b0a6285d4bd0336686e7f446 (diff) | |
download | kamek-f7e7a1eea2e66ea507fc5a2b0813ec02493133a9.tar.gz kamek-f7e7a1eea2e66ea507fc5a2b0813ec02493133a9.zip |
added HUD support and some more debug stuff
Diffstat (limited to '')
-rw-r--r-- | src/wm_hud.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/wm_hud.cpp b/src/wm_hud.cpp new file mode 100644 index 0000000..670683c --- /dev/null +++ b/src/wm_hud.cpp @@ -0,0 +1,57 @@ +#include "worldmap.h" + +dWMHud_c *dWMHud_c::instance = 0; + +dWMHud_c *dWMHud_c::build() { + OSReport("Creating WM_Hud\n"); + + void *buffer = AllocFromGameHeap1(sizeof(dWMHud_c)); + dWMHud_c *c = new(buffer) dWMHud_c; + + OSReport("Created WM_Hud @ %p\n", c); + + instance = c; + return c; +} + + + +dWMHud_c::dWMHud_c() { + layoutLoaded = false; +} + + +int dWMHud_c::onCreate() { + if (!layoutLoaded) { + bool gotFile = layout.loadArc("maphud.arc", false); + if (!gotFile) + return false; + + layout.build("banner.brlyt"); + + layoutLoaded = true; + } + + return true; +} + + +int dWMHud_c::onDelete() { + return layout.free(); +} + + +int dWMHud_c::onExecute() { + layout.execAnimations(); + layout.update(); + + return true; +} + + +int dWMHud_c::onDraw() { + layout.scheduleForDrawing(); + + return true; +} + |