/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Benjamin Grauer co-programmer: ... */ //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ #include "hud.h" #include "state.h" using namespace std; /** * standard constructor * @todo this constructor is not jet implemented - do it */ Hud::Hud () { this->setClassID(CL_HUD, "Hud"); //this->setSize2D( this->energyWidget = NULL; this->shieldWidget = NULL; this->armorWidget = NULL; this->resX = 1; this->resY = 1; } /** * standard deconstructor */ Hud::~Hud () { // delete what has to be deleted here } void Hud::loadParams(const TiXmlElement* root) { } void Hud::setBackGround() { } void Hud::setEnergyWidget(GLGuiWidget* widget) { // decopple old widget if (this->energyWidget != NULL) { this->energyWidget->hide(); } this->energyWidget = widget; if (this->energyWidget != NULL) { this->energyWidget->show(); } this->updateResolution(); } void Hud::setShiledWidget(GLGuiWidget* widget) { } void Hud::setArmorWidget(GLGuiWidget* widget) { } void Hud::addWeaponWidget(GLGuiWidget* widget) { } void Hud::removeWeaponWidget(GLGuiWidget* widget) { } void Hud::updateResolution() { this->resX = State::resX(); this->resY = State::resY(); if (this->energyWidget != NULL) { this->energyWidget->setAbsCoor2D(.02 * this->resX, .4 * this->resY); this->energyWidget->setSize2D(.05 * this->resX, .55 * this->resY); } } void Hud::tick(float dt) { if (this->resY != State::resY() || this->resX != State::resY()) this->updateResolution(); } void Hud::draw() const { GLGuiWidget::draw(); }