Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2007, 3:58:42 AM (16 years ago)
Author:
landauf
Message:

modified DebugLevel-hack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/DebugLevel.cc

    r561 r562  
    55namespace orxonox
    66{
    7     int DebugLevel::softDebugLevel_s;
    8 
    9 //    CreateFactory(DebugLevel);
     7    DebugLevel* DebugLevel::pointer_s = 0;
     8    bool DebugLevel::bCreatingDebugLevelObject_s = false;
    109
    1110    DebugLevel::DebugLevel()
    1211    {
    13         RegisterObject(DebugLevel);
     12        RegisterRootObject(DebugLevel);
    1413        SetConfigValue(softDebugLevel_s, 2);
    1514    }
     
    1716    int DebugLevel::getSoftDebugLevel()
    1817    {
    19         return DebugLevel::softDebugLevel_s;
     18        if (!pointer_s && !bCreatingDebugLevelObject_s)
     19        {
     20            bCreatingDebugLevelObject_s = true;
     21            pointer_s = new DebugLevel;
     22            bCreatingDebugLevelObject_s = false;
     23        }
     24
     25        if (bCreatingDebugLevelObject_s)
     26            return 4;
     27
     28        return pointer_s->softDebugLevel_s;
    2029    }
    2130}
Note: See TracChangeset for help on using the changeset viewer.