Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2009, 5:05:17 PM (16 years ago)
Author:
dafrick
Message:

Hopefully merged trunk successfully into pickup branch.

Location:
code/branches/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup

  • code/branches/pickup/src/orxonox/Radar.cc

    r5781 r5935  
    4343namespace orxonox
    4444{
    45     SetConsoleCommand(Radar, cycleNavigationFocus, true).accessLevel(AccessLevel::User);
    46     SetConsoleCommand(Radar, releaseNavigationFocus, true).accessLevel(AccessLevel::User);
    47 
    48     Radar* Radar::instance_s = 0;
    4945
    5046    Radar::Radar()
     
    5248        , objectTypeCounter_(0)
    5349    {
    54         assert(instance_s == 0);
    55         instance_s = this;
    56 
    5750        // TODO: make this mapping configurable. Maybe there's a possibility with self configured
    5851        //       configValues..
     
    7972    Radar::~Radar()
    8073    {
    81         instance_s = 0;
    8274    }
    8375
    8476    const RadarViewable* Radar::getFocus()
    8577    {
    86         return *(this->itFocus_);
     78        if (this->itFocus_)
     79            return *(this->itFocus_);
     80        else
     81            return 0;
    8782    }
    8883
     
    10196        SUPER(Radar, tick, dt);
    10297
    103         if (this->focus_ != *(this->itFocus_))
     98        if (this->itFocus_ && (this->focus_ != *(this->itFocus_)))
    10499        {
    105100            // focus object was deleted, release focus
     
    191186        }
    192187    }
    193 
    194 
    195     /*static*/ Radar& Radar::getInstance()
    196     {
    197         assert(instance_s);
    198         return *instance_s;
    199     }
    200 
    201     /*static*/ void Radar::cycleNavigationFocus()
    202     {
    203         // avoid using getInstance because of the assert().
    204         // User might call this fuction even if HUDNavigation doesn't exist.
    205         if (instance_s)
    206             instance_s->cycleFocus();
    207     }
    208 
    209     /*static*/ void Radar::releaseNavigationFocus()
    210     {
    211         // avoid using getInstance because of the assert().
    212         // User might call this fuction even if HUDNavigation doesn't exist.
    213         if (instance_s)
    214             instance_s->releaseFocus();
    215     }
    216188}
Note: See TracChangeset for help on using the changeset viewer.