Changeset 3860 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Apr 17, 2005, 6:20:02 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/p_node.cc
r3832 r3860 22 22 #include "p_node.h" 23 23 #include "stdincl.h" 24 #include "compiler.h" 24 25 25 26 #include "error.h" … … 61 62 *this->absCoordinate = absCoordinate; 62 63 63 __LIKELY_IF(parent != NULL)64 if (likely(parent != NULL)) 64 65 { 65 66 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor (); … … 208 209 { 209 210 210 __UNLIKELY_IF( this->bAbsCoorChanged)211 if( unlikely(this->bAbsCoorChanged)) 211 212 { 212 213 *this->absCoordinate = *this->absCoordinate + shift; … … 316 317 void PNode::addChild (PNode* pNode, int parentingMode) 317 318 { 318 __LIKELY_IF( pNode->parent != NULL)319 if( likely(pNode->parent != NULL)) 319 320 { 320 321 PRINTF(3)("PNode::addChild() - reparenting node: removing it and adding it again\n"); … … 436 437 437 438 438 __LIKELY_IF( this->mode & PNODE_MOVEMENT)439 if( likely(this->mode & PNODE_MOVEMENT)) 439 440 { 440 __UNLIKELY_IF(this->bAbsCoorChanged/*&& this->timeStamp != DataTank::timeStamp*/)441 if( unlikely(this->bAbsCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 441 442 { 442 443 /* if you have set the absolute coordinates this overrides all other changes */ 443 444 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor (); 444 445 } 445 __LIKELY_IF(this->bRelCoorChanged/*&& this->timeStamp != DataTank::timeStamp*/)446 if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 446 447 447 448 { … … 449 450 450 451 /* 451 __UNLIKELY_IF( this->parent == NULL)452 if( unlikely(this->parent == NULL)) 452 453 { 453 454 *this->absCoordinate = *this->relCoordinate; … … 460 461 if( this->mode & PNODE_LOCAL_ROTATE) 461 462 { 462 __UNLIKELY_IF( this->bAbsDirChanged/*&& this->timeStamp != DataTank::timeStamp*/)463 if( unlikely(this->bAbsDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 463 464 { 464 465 /* if you have set the absolute coordinates this overrides all other changes */ 465 466 *this->relDirection = *this->absDirection - parent->getAbsDir(); 466 467 } 467 else __LIKELY_IF( this->bRelDirChanged/*&& this->timeStamp != DataTank::timeStamp*/)468 else if( likely(this->bRelDirChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 468 469 { 469 470 /* update the current absDirection - remember * means rotation around sth.*/ … … 474 475 if( this->mode & PNODE_ROTATE_MOVEMENT) 475 476 { 476 __UNLIKELY_IF( this->bAbsCoorChanged/*&& this->timeStamp != DataTank::timeStamp*/)477 if( unlikely(this->bAbsCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 477 478 { 478 479 /* if you have set the absolute coordinates this overrides all other changes */ 479 480 *this->relCoordinate = *this->absCoordinate - parent->getAbsCoor (); 480 481 } 481 else __LIKELY_IF( this->bRelCoorChanged/*&& this->timeStamp != DataTank::timeStamp*/)482 else if( likely(this->bRelCoorChanged) /*&& this->timeStamp != DataTank::timeStamp*/) 482 483 { 483 484 /*this is bad style... must be deleted later - just for testing*/ … … 496 497 { 497 498 /* if this node has changed, make sure, that all children are updated also */ 498 __LIKELY_IF( this->bRelCoorChanged || this->bAbsCoorChanged)499 if( likely(this->bRelCoorChanged || this->bAbsCoorChanged)) 499 500 pn->parentCoorChanged (); 500 __LIKELY_IF( this->bRelDirChanged || this->bAbsDirChanged)501 if( likely(this->bRelDirChanged || this->bAbsDirChanged)) 501 502 pn->parentDirChanged (); 502 503 -
orxonox/trunk/src/lib/math/vector.cc
r3824 r3860 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 66 64 Vector Vector::operator/ (float f) const 67 65 { 68 __UNLIKELY_IF( f == 0.0)66 if( unlikely(f == 0.0)) 69 67 { 70 68 // Prevent divide by zero … … 105 103 { 106 104 float l = len(); 107 __UNLIKELY_IF(l != 1.0)105 if(unlikely(l != 1.0)) 108 106 { 109 107 return this; 110 108 } 111 else __UNLIKELY_IF(l == 0.0)109 else if(unlikely(l == 0.0)) 112 110 { 113 111 return 0; -
orxonox/trunk/src/lib/math/vector.h
r3823 r3860 10 10 11 11 #include <math.h> 12 #include " stdincl.h"12 #include "compiler.h" 13 13 //! PI the circle-constant 14 14 #define PI 3.14159265359f … … 41 41 inline void normalize() { 42 42 float l = len(); 43 __UNLIKELY_IF( l == 0.0)43 if( unlikely(l == 0.0)) 44 44 { 45 45 // Prevent divide by zero -
orxonox/trunk/src/lib/util/list.h
r3832 r3860 3 3 #define _LIST_H 4 4 5 #include "stdincl.h" 5 #include "compiler.h" 6 #ifndef NULL 7 #define NULL 0 8 #endif 6 9 7 10 //! An enum to list all the modes available when adding an object to a List … … 38 41 listElement* next; 39 42 }; 40 Uint32size;43 unsigned int size; 41 44 listElement* first; 42 45 listElement* last; … … 118 121 119 122 private: 120 Uint32size;123 unsigned int size; 121 124 listElement<T>* first; 122 125 listElement<T>* last; … … 153 156 inline void tList<T>::add(T* entity) 154 157 { 155 __UNLIKELY_IF( entity == NULL) return;158 if( unlikely(entity == NULL)) return; 156 159 listElement<T>* el = new listElement<T>; 157 160 el->prev = this->last; … … 161 164 this->last = el; 162 165 163 __UNLIKELY_IF(el->prev == NULL) this->first = el; /* if first element */166 if( unlikely(el->prev == NULL)) this->first = el; /* if first element */ 164 167 else el->prev->next = el; 165 168 this->size++; … … 174 177 while( this->currentEl != NULL) 175 178 { 176 __UNLIKELY_IF( this->currentEl->curr == entity)179 if( unlikely(this->currentEl->curr == entity)) 177 180 { 178 __UNLIKELY_IF( this->currentEl->prev == NULL) this->first = this->currentEl->next;181 if( unlikely(this->currentEl->prev == NULL)) this->first = this->currentEl->next; 179 182 else this->currentEl->prev->next = this->currentEl->next; 180 183 181 __UNLIKELY_IF( this->currentEl->next == NULL) this->last = this->currentEl->prev;184 if( unlikely(this->currentEl->next == NULL)) this->last = this->currentEl->prev; 182 185 else this->currentEl->next->prev = this->currentEl->prev; 183 186
Note: See TracChangeset
for help on using the changeset viewer.