Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4519 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
Jun 6, 2005, 2:36:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: changed all getInstances into inline functions to save some (minor) time

Location:
orxonox/trunk/src/lib/graphics
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4458 r4519  
    4747*/
    4848GraphicsEngine* GraphicsEngine::singletonRef = NULL;
    49 
    50 /**
    51    \returns A pointer to this GraphicsEngine
    52 */
    53 GraphicsEngine* GraphicsEngine::getInstance()
    54 {
    55   if (!GraphicsEngine::singletonRef)
    56     GraphicsEngine::singletonRef = new GraphicsEngine();
    57   return GraphicsEngine::singletonRef;
    58 }
    59 
    6049
    6150/**
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r4458 r4519  
    2525{
    2626 public:
    27   static GraphicsEngine* getInstance();
    2827  virtual ~GraphicsEngine();
     28  /** \returns a Pointer to the only object of this Class */
     29  inline static GraphicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new GraphicsEngine();  return singletonRef; };
    2930
    3031  int initVideo();
  • orxonox/trunk/src/lib/graphics/light.cc

    r4471 r4519  
    251251*/
    252252LightManager* LightManager::singletonRef = NULL;
    253 
    254 
    255 /**
    256    \returns The Instance of the Lights
    257 */
    258 LightManager* LightManager::getInstance(void)
    259 {
    260   if (!singletonRef)
    261     LightManager::singletonRef = new LightManager();
    262   return singletonRef;
    263 }
    264 
    265253
    266254/**
  • orxonox/trunk/src/lib/graphics/light.h

    r4469 r4519  
    106106 public:
    107107  virtual ~LightManager(void);
    108   static LightManager* getInstance();
     108  /** \returns a Pointer to the only object of this Class */
     109  inline static LightManager* getInstance(void) { if (!singletonRef) singletonRef = new LightManager();  return singletonRef; };
    109110
    110111  // set Attributes
  • orxonox/trunk/src/lib/graphics/text_engine.cc

    r4518 r4519  
    814814
    815815/**
    816    \returns a Pointer to this Class
    817 */
    818 TextEngine* TextEngine::getInstance(void)
    819 {
    820   if (!TextEngine::singletonRef)
    821     TextEngine::singletonRef = new TextEngine();
    822   return TextEngine::singletonRef;
    823 }
    824 
    825 /**
    826816   \brief standard deconstructor
    827817
  • orxonox/trunk/src/lib/graphics/text_engine.h

    r4458 r4519  
    205205{
    206206 public:
    207   static TextEngine* getInstance(void);
    208207  virtual ~TextEngine(void);
     208  /** \returns a Pointer to the only object of this Class */
     209  inline static TextEngine* getInstance(void) { if (!singletonRef) singletonRef = new TextEngine();  return singletonRef; };
    209210
    210211  Text* createText(const char* fontFile,
Note: See TracChangeset for help on using the changeset viewer.