Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6437 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 8, 2006, 1:12:38 PM (19 years ago)
Author:
bensch
Message:

trunk: added HUD definition and removed user_control

Location:
trunk/src
Files:
2 deleted
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/defs/class_id.h

    r6426 r6437  
    195195  CL_EVENT                      =    0x00000501,
    196196  CL_KEY_MAPPER                 =    0x00000502,
    197   CL_USER_CONTROL               =    0x00000511,
    198197  CL_CROSSHAIR                  =    0x00000512,
    199198
    200199  CL_WEAPON_MANAGER             =    0x00000503,
     200  CL_HUD                        =    0x00000520,
    201201
    202202  // Physics stuff (range from 0x00000600 to 0x000007ff)
  • trunk/src/util/Makefile.am

    r6142 r6437  
    88                        loading/factory.cc \
    99                        state.cc \
    10                         user_control.cc \
     10                        hud.cc \
    1111                        animation/animation3d.cc \
    1212                        animation/animation.cc \
     
    2323                        object_manager.h \
    2424                        state.h \
    25                         user_control.h \
     25                        hud.h \
    2626                        animation/animation3d.h \
    2727                        animation/animation.h \
  • trunk/src/util/hud.cc

    r6436 r6437  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "hud.h"
    1919
    2020using namespace std;
     
    2525 * @todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27Hud::Hud ()
    2828{
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
     29   this->setClassID(CL_HUD, "Hud");
    3030
    31    /* If you make a new class, what is most probably the case when you write this file
    32       don't forget to:
    33        1. Add the new file new_class.cc to the ./src/Makefile.am
    34        2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS
    35 
    36       Advanced Topics:
    37       - if you want to let your object be managed via the ObjectManager make sure to read
    38         the object_manager.h header comments. You will use this most certanly only if you
    39         make many objects of your class, like a weapon bullet.
    40    */
    4131}
    4232
     
    4535 * standard deconstructor
    4636*/
    47 ProtoClass::~ProtoClass ()
     37Hud::~Hud ()
    4838{
    4939  // delete what has to be deleted here
  • trunk/src/util/hud.h

    r6436 r6437  
    11/*!
    2  * @file proto_class.h
    3  * @brief Definition of ...
     2 * @file hud.h
     3 * @brief Definition of the ingame HUD.
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
     6#ifndef _HUD_H
     7#define _HUD_H
    88
    9 #include "base_object.h"
     9#include "element_2d.h"
     10#include <list>
    1011
    1112// FORWARD DECLARATION
     13#include "glgui_widget.h"
    1214
    1315
    1416
    15 //! A class for ...
    16 class ProtoClass : public BaseObject {
     17//! A class that renders a HUD.
     18class Hud : private GLGuiWidget {
    1719
    1820 public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
     21  Hud();
     22  virtual ~Hud();
     23
     24  void setBackGround();
     25  void setEnergyWidget(GLGuiWidget* widget);
     26  void setShiledWidget(GLGuiWidget* widget);
     27  void setArmorWidget(GLGuiWidget* widget);
     28
     29  void addWeaponWidget(GLGuiWidget* widget);
     30  void removeWeaponWidget(GLGuiWidget* widget);
    2131
    2232
    2333 private:
     34   unsigned int             resX;          //!< The X-Resolution needed for resizing the Hud.
     35   unsigned int             resY;          //!< The Y-Resolution needed for resizing the Hud.
    2436
     37   GLGuiWidget*             energyWidget;
     38   GLGuiWidget*             shieldWidget;
     39   GLGuiWidget*             armorWidget;
     40
     41   std::list<GLGuiWidget*>  weaponsWidgets; //!< WeaponWidgets will be displayed one after another
    2542};
    2643
    27 #endif /* _PROTO_CLASS_H */
     44#endif /* _HUD_H */
Note: See TracChangeset for help on using the changeset viewer.