Changeset 2815
- Timestamp:
- Mar 21, 2009, 5:56:10 PM (16 years ago)
- Location:
- code/branches/gui/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/ConfigFileManager.cc
r2759 r2815 190 190 this->bUpdated_ = true; 191 191 192 return this->entries_.insert(this->entries_.end(), (ConfigFileEntry*)(new ConfigFileEntryValue(name, fallback, bString)));192 return this->entries_.insert(this->entries_.end(), static_cast<ConfigFileEntry*>(new ConfigFileEntryValue(name, fallback, bString))); 193 193 } 194 194 … … 207 207 208 208 if (index == 0) 209 return this->entries_.insert(this->entries_.end(), (ConfigFileEntry*)(new ConfigFileEntryVectorValue(name, index, fallback, bString)));210 else 211 return this->entries_.insert(++this->getEntryIterator(name, index - 1, "", bString), (ConfigFileEntry*)(new ConfigFileEntryVectorValue(name, index, fallback, bString)));209 return this->entries_.insert(this->entries_.end(), static_cast<ConfigFileEntry*>(new ConfigFileEntryVectorValue(name, index, fallback, bString))); 210 else 211 return this->entries_.insert(++this->getEntryIterator(name, index - 1, "", bString), static_cast<ConfigFileEntry*>(new ConfigFileEntryVectorValue(name, index, fallback, bString))); 212 212 } 213 213 -
code/branches/gui/src/core/Core.cc
r2807 r2815 401 401 return; 402 402 403 #ifdef ORXONOX_PLATFORM_WINDOWS 403 404 unsigned int coreNr = limitToCPU - 1; 404 #ifdef ORXONOX_PLATFORM_WINDOWS405 405 // Get the current process core mask 406 406 DWORD procMask; -
code/branches/gui/src/core/GameState.cc
r1764 r2815 178 178 this->allChildren_[grandchild->getName()] = grandchild; 179 179 this->grandchildrenToChildren_[grandchild] = child; 180 if (this->getParent ())181 this->getParent ()->grandchildAdded(this, grandchild);180 if (this->getParentAsBase()) 181 this->getParentAsBase()->grandchildAdded(this, grandchild); 182 182 } 183 183 … … 196 196 this->allChildren_.erase(grandchild->getName()); 197 197 this->grandchildrenToChildren_.erase(grandchild); 198 if (this->getParent ())199 this->getParent ()->grandchildRemoved(grandchild);198 if (this->getParentAsBase()) 199 this->getParentAsBase()->grandchildRemoved(grandchild); 200 200 } 201 201 … … 208 208 GameStateBase* GameStateBase::getState(const std::string& name) 209 209 { 210 if (this->getParent ())211 return this->getParent ()->getState(name);210 if (this->getParentAsBase()) 211 return this->getParentAsBase()->getState(name); 212 212 else 213 213 { … … 227 227 GameStateBase* GameStateBase::getRoot() 228 228 { 229 if (this->getParent ())230 return this->getParent ()->getRoot();229 if (this->getParentAsBase()) 230 return this->getParentAsBase()->getRoot(); 231 231 else 232 232 return this; … … 251 251 else 252 252 { 253 if (this->getParent ())254 return this->getParent ()->getCurrentState();253 if (this->getParentAsBase()) 254 return this->getParentAsBase()->getCurrentState(); 255 255 else 256 256 return 0; … … 288 288 void GameStateBase::makeTransition(GameStateBase* source, GameStateBase* destination) 289 289 { 290 if (source == this->getParent ())290 if (source == this->getParentAsBase()) 291 291 { 292 292 // call is from the parent … … 319 319 { 320 320 // parent. We can be sure of this. 321 assert(this->getParent () != 0);321 assert(this->getParentAsBase() != 0); 322 322 323 323 this->deactivate(); 324 this->getParent ()->makeTransition(this, destination);324 this->getParentAsBase()->makeTransition(this, destination); 325 325 } 326 326 } -
code/branches/gui/src/core/GameState.h
r2805 r2815 109 109 void tickChild(const Clock& time) { if (this->getActiveChild()) this->getActiveChild()->tick(time); } 110 110 111 virtual GameStateBase* getParent () const = 0;111 virtual GameStateBase* getParentAsBase() const = 0; 112 112 virtual void setParent(GameStateBase* state) = 0; 113 113 … … 146 146 virtual ~GameState() { } 147 147 148 GameStateBase* getParentAsBase() const 149 { return parent_; } 150 148 151 ParentType* getParent() const 149 152 { return parent_; } -
code/branches/gui/src/core/Iterator.h
r2784 r2815 181 181 this->list_->unregisterIterator(this); 182 182 183 this->element_ = (other.element_) ? (ObjectListBaseElement*)other.element_: 0;183 this->element_ = (other.element_) ? static_cast<ObjectListBaseElement*>(other.element_) : 0; 184 184 this->list_ = ClassIdentifier<O>::getIdentifier()->getObjects(); 185 185 this->list_->registerIterator(this); -
code/branches/gui/src/core/ObjectListBase.h
r2784 r2815 71 71 { 72 72 public: 73 ObjectListElement(T* object) : ObjectListBaseElement( (OrxonoxClass*)object), object_(object) {}73 ObjectListElement(T* object) : ObjectListBaseElement(static_cast<OrxonoxClass*>(object)), object_(object) {} 74 74 T* object_; //!< The object 75 75 }; -
code/branches/gui/src/core/RootGameState.cc
r2805 r2815 69 69 if (it != this->grandchildrenToChildren_.end()) 70 70 { 71 OrxAssert( dynamic_cast<GameStateBase*>(it->second) != 0,71 OrxAssert(static_cast<GameStateBase*>(it->second) != 0, 72 72 "There was a mix with RootGameState and GameState, could not cast."); 73 73 GameStateBase* child = static_cast<GameStateBase*>(it->second); -
code/branches/gui/src/core/Template.cc
r2710 r2815 65 65 if (element) 66 66 { 67 TiXmlElement* tixmlelement = dynamic_cast<TiXmlElement*>(element->GetTiXmlPointer());67 TiXmlElement* tixmlelement = static_cast<TiXmlElement*>(element->GetTiXmlPointer()); 68 68 if (tixmlelement) 69 69 this->setXMLElement(*tixmlelement); … … 138 138 COUT(4) << object->getLoaderIndentation() << " aplying Template \"" << this->getName() << "\"..." << std::endl; 139 139 140 Element temp = ((TiXmlElement*)&this->getXMLElement());140 Element temp = &const_cast<TiXmlElement&>(this->getXMLElement()); 141 141 142 142 if (this->bLoadDefaults_) -
code/branches/gui/src/core/XMLPort.h
r2710 r2815 556 556 try 557 557 { 558 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl;558 COUT(4) << object->getLoaderIndentation() << "fabricating " << child->Value() << "..." << std::endl; 559 559 560 560 BaseObject* newObject = identifier->fabricate((BaseObject*)object); 561 561 assert(newObject); 562 newObject->setLoaderIndentation( ((BaseObject*)object)->getLoaderIndentation() + " ");562 newObject->setLoaderIndentation(object->getLoaderIndentation() + " "); 563 563 564 564 O* castedObject = dynamic_cast<O*>(newObject); … … 568 568 { 569 569 newObject->XMLPort(*child, XMLPort::LoadObject); 570 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;570 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 571 571 } 572 572 else 573 573 { 574 COUT(4) << ((BaseObject*)object)->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl;574 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (object not yet loaded) to " << this->identifier_->getName() << " (objectname " << ((BaseObject*)object)->getName() << ")" << std::endl; 575 575 } 576 576 577 COUT(5) << ((BaseObject*)object)->getLoaderIndentation();577 COUT(5) << object->getLoaderIndentation(); 578 578 (*this->loadexecutor_)(object, castedObject); 579 579 … … 581 581 newObject->XMLPort(*child, XMLPort::LoadObject); 582 582 583 COUT(5) << ((BaseObject*)object)->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;583 COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl; 584 584 } 585 585 catch (AbortLoadingException& ex) … … 601 601 else 602 602 { 603 COUT(2) << ((BaseObject*)object)->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not loadable." << std::endl;603 COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not loadable." << std::endl; 604 604 } 605 605 } 606 606 else 607 607 { 608 COUT(2) << ((BaseObject*)object)->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << Class(O)->getName() << "'." << std::endl;608 COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << Class(O)->getName() << "'." << std::endl; 609 609 } 610 610 } … … 626 626 { 627 627 COUT(1) << std::endl; 628 COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << ((BaseObject*)object)->getName() << ") in " << object->getFilename() << ":" << std::endl;628 COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ":" << std::endl; 629 629 COUT(1) << ex.what() << std::endl; 630 630 } -
code/branches/gui/src/core/input/InputBuffer.h
r2800 r2815 127 127 for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ) 128 128 { 129 InputBufferListenerTuple<T>* refListener = dynamic_cast<InputBufferListenerTuple<T>*>(*it);129 InputBufferListenerTuple<T>* refListener = static_cast<InputBufferListenerTuple<T>*>(*it); 130 130 if (refListener && refListener->listener_ == listener) 131 131 this->listeners_.erase(it++); -
code/branches/gui/src/orxonox/objects/EventTarget.cc
r2662 r2815 66 66 void EventTarget::addAsEvent(BaseObject* object) 67 67 { 68 if (object != (BaseObject*)this)68 if (object != static_cast<BaseObject*>(this)) 69 69 object->addEvent(this, ""); 70 70 } -
code/branches/gui/src/orxonox/objects/Radar.cc
r2662 r2815 144 144 for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it) 145 145 { 146 if (*it == (RadarViewable*)this->owner_)146 if (*it == static_cast<RadarViewable*>(this)->owner_) 147 147 continue; 148 148 -
code/branches/gui/src/orxonox/objects/pickup/PickupSpawner.cc
r2662 r2815 89 89 ExecutorMember<BaseObject>* executor = createExecutor(createFunctor(&BaseObject::setActive)); 90 90 executor->setDefaultValues(true); 91 RespawnTimer_.setTimer(this->respawntimer_, false, (BaseObject*)this, executor);91 RespawnTimer_.setTimer(this->respawntimer_, false, this, executor); 92 92 COUT(0) << "TIMER SET" << std::endl; 93 93 } -
code/branches/gui/src/orxonox/overlays/hud/HUDRadar.cc
r2662 r2815 94 94 void HUDRadar::displayObject(RadarViewable* object, bool bIsMarked) 95 95 { 96 if (object == (RadarViewable*)this->owner_)96 if (object == static_cast<RadarViewable*>(this->owner_)) 97 97 return; 98 98
Note: See TracChangeset
for help on using the changeset viewer.