diff options
Diffstat (limited to 'src/wm_hud.cpp')
-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; +} + |