Changeset 5935 for code/branches/pickup/src/orxonox/Radar.cc
- Timestamp:
- Oct 13, 2009, 5:05:17 PM (16 years ago)
- Location:
- code/branches/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup
- Property svn:mergeinfo changed
-
code/branches/pickup/src/orxonox/Radar.cc
r5781 r5935 43 43 namespace orxonox 44 44 { 45 SetConsoleCommand(Radar, cycleNavigationFocus, true).accessLevel(AccessLevel::User);46 SetConsoleCommand(Radar, releaseNavigationFocus, true).accessLevel(AccessLevel::User);47 48 Radar* Radar::instance_s = 0;49 45 50 46 Radar::Radar() … … 52 48 , objectTypeCounter_(0) 53 49 { 54 assert(instance_s == 0);55 instance_s = this;56 57 50 // TODO: make this mapping configurable. Maybe there's a possibility with self configured 58 51 // configValues.. … … 79 72 Radar::~Radar() 80 73 { 81 instance_s = 0;82 74 } 83 75 84 76 const RadarViewable* Radar::getFocus() 85 77 { 86 return *(this->itFocus_); 78 if (this->itFocus_) 79 return *(this->itFocus_); 80 else 81 return 0; 87 82 } 88 83 … … 101 96 SUPER(Radar, tick, dt); 102 97 103 if (this-> focus_ != *(this->itFocus_))98 if (this->itFocus_ && (this->focus_ != *(this->itFocus_))) 104 99 { 105 100 // focus object was deleted, release focus … … 191 186 } 192 187 } 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 }216 188 }
Note: See TracChangeset
for help on using the changeset viewer.