Changeset 10555 for code/branches/core7/src/orxonox
- Timestamp:
- Aug 29, 2015, 5:35:59 PM (9 years ago)
- Location:
- code/branches/core7/src/orxonox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/orxonox/Scene.cc
r10415 r10555 62 62 RegisterObject(Scene); 63 63 64 this->setScene(S martPtr<Scene>(this, false), OBJECTID_UNKNOWN);64 this->setScene(StrongPtr<Scene>(this, false), OBJECTID_UNKNOWN); 65 65 this->bShadows_ = true; 66 66 this->bDebugDrawPhysics_ = false; … … 366 366 { 367 367 // get the WorldEntity pointers 368 S martPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());369 S martPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());368 StrongPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer()); 369 StrongPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer()); 370 370 371 371 // get the CollisionShape pointers -
code/branches/core7/src/orxonox/gametypes/Gametype.cc
r10554 r10555 61 61 RegisterObject(Gametype); 62 62 63 this->setGametype(S martPtr<Gametype>(this, false));63 this->setGametype(StrongPtr<Gametype>(this, false)); 64 64 65 65 this->gtinfo_ = new GametypeInfo(context); -
code/branches/core7/src/orxonox/interfaces/RadarViewable.h
r9939 r10555 37 37 #include "util/Math.h" 38 38 #include "core/class/OrxonoxInterface.h" 39 #include "core/object/S martPtr.h"39 #include "core/object/StrongPtr.h" 40 40 41 41 namespace orxonox … … 163 163 //Radar 164 164 const WorldEntity* wePtr_; 165 S martPtr<Radar> radar_;165 StrongPtr<Radar> radar_; 166 166 float radarObjectCamouflage_; 167 167 Shape radarObjectShape_; -
code/branches/core7/src/orxonox/overlays/OverlayGroup.cc
r10347 r10555 61 61 OverlayGroup::~OverlayGroup() 62 62 { 63 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)63 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 64 64 (*it)->destroy(); 65 65 this->hudElements_.clear(); … … 85 85 void OverlayGroup::setScale(const Vector2& scale) 86 86 { 87 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)87 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 88 88 (*it)->scale(scale / this->scale_); 89 89 this->scale_ = scale; … … 93 93 void OverlayGroup::setScroll(const Vector2& scroll) 94 94 { 95 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)95 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 96 96 (*it)->scroll(scroll - this->scroll_); 97 97 this->scroll_ = scroll; … … 106 106 void OverlayGroup::addElement(OrxonoxOverlay* element) 107 107 { 108 hudElements_.insert(S martPtr<OrxonoxOverlay>(element));108 hudElements_.insert(StrongPtr<OrxonoxOverlay>(element)); 109 109 element->setOverlayGroup( this ); 110 110 if (this->owner_) … … 122 122 bool OverlayGroup::removeElement(OrxonoxOverlay* element) 123 123 { 124 if(this->hudElements_.erase(S martPtr<OrxonoxOverlay>(element)) == 0)124 if(this->hudElements_.erase(StrongPtr<OrxonoxOverlay>(element)) == 0) 125 125 return false; 126 126 return true; … … 132 132 if (index < this->hudElements_.size()) 133 133 { 134 std::set< S martPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();134 std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin(); 135 135 for (unsigned int i = 0; i != index; ++it, ++i) 136 136 ; … … 146 146 SUPER( OverlayGroup, changedVisibility ); 147 147 148 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)148 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 149 149 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed 150 150 } … … 155 155 SUPER( OverlayGroup, changedGametype ); 156 156 157 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)157 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 158 158 (*it)->setGametype(this->getGametype()); 159 159 } … … 163 163 this->owner_ = owner; 164 164 165 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)165 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 166 166 (*it)->setOwner(owner); 167 167 } -
code/branches/core7/src/orxonox/overlays/OverlayGroup.h
r9667 r10555 65 65 static void scrollGroup(const std::string& name, const Vector2& scroll); 66 66 67 inline const std::set< S martPtr<OrxonoxOverlay> >& getOverlays() const67 inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const 68 68 { return this->hudElements_; } 69 69 … … 92 92 93 93 private: 94 std::set< S martPtr<OrxonoxOverlay> > hudElements_; //!< Contains all the OrxonoxOverlays of the this group.94 std::set< StrongPtr<OrxonoxOverlay> > hudElements_; //!< Contains all the OrxonoxOverlays of the this group. 95 95 Vector2 scale_; //!< Current scale (independent of the elements). 96 96 Vector2 scroll_; //!< Current scrolling offset. -
code/branches/core7/src/orxonox/sound/AmbientSound.cc
r10380 r10555 51 51 if (GameMode::playsSound()) 52 52 { 53 // Smoothly fade out by keeping a S martPtr53 // Smoothly fade out by keeping a StrongPtr 54 54 SoundManager::getInstance().unregisterAmbientSound(this); 55 55 } -
code/branches/core7/src/orxonox/sound/SoundBuffer.h
r6764 r10555 46 46 friend class SoundManager; 47 47 #if !defined(_MSC_VER) || _MSC_VER >= 1500 48 // Make sure nobody deletes an instance (using s martpointers)48 // Make sure nobody deletes an instance (using strong pointers) 49 49 template <class T> 50 50 friend void boost::checked_delete(T*); -
code/branches/core7/src/orxonox/sound/SoundManager.cc
r10464 r10555 165 165 SoundManager::~SoundManager() 166 166 { 167 // Erase fade lists because of the s martpointers167 // Erase fade lists because of the strong pointers 168 168 this->bDestructorCalled_ = true; 169 169 this->fadeInList_.clear(); … … 419 419 } 420 420 421 void SoundManager::fadeIn(const S martPtr<AmbientSound>& sound)421 void SoundManager::fadeIn(const StrongPtr<AmbientSound>& sound) 422 422 { 423 423 // If we're already fading out --> remove that 424 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)424 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++) 425 425 { 426 426 if (*it == sound) … … 435 435 } 436 436 437 void SoundManager::fadeOut(const S martPtr<AmbientSound>& sound)437 void SoundManager::fadeOut(const StrongPtr<AmbientSound>& sound) 438 438 { 439 439 // If we're already fading in --> remove that 440 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)440 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++) 441 441 { 442 442 if (*it == sound) … … 461 461 462 462 // FADE IN 463 for (std::list<S martPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )463 for (std::list<StrongPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); ) 464 464 { 465 465 if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f) … … 476 476 477 477 // FADE OUT 478 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )478 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); ) 479 479 { 480 480 if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f) -
code/branches/core7/src/orxonox/sound/SoundManager.h
r10413 r10555 40 40 #include "util/Singleton.h" 41 41 #include "core/config/Configurable.h" 42 #include "core/object/S martPtr.h"42 #include "core/object/StrongPtr.h" 43 43 #include "core/UpdateListener.h" 44 44 … … 106 106 private: 107 107 void processCrossFading(float dt); 108 void fadeIn(const S martPtr<AmbientSound>& sound);109 void fadeOut(const S martPtr<AmbientSound>& sound);108 void fadeIn(const StrongPtr<AmbientSound>& sound); 109 void fadeOut(const StrongPtr<AmbientSound>& sound); 110 110 111 111 void checkFadeStepValidity(); … … 129 129 //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading 130 130 float crossFadeStep_; 131 std::list<S martPtr<AmbientSound> > fadeInList_;132 std::list<S martPtr<AmbientSound> > fadeOutList_;131 std::list<StrongPtr<AmbientSound> > fadeInList_; 132 std::list<StrongPtr<AmbientSound> > fadeOutList_; 133 133 134 134 // Volume related -
code/branches/core7/src/orxonox/worldentities/ControllableEntity.cc
r10478 r10555 108 108 this->camera_->destroy(); 109 109 110 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)110 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 111 111 (*it)->destroy(); 112 112 … … 165 165 { 166 166 unsigned int i = 0; 167 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)167 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 168 168 { 169 169 if (i == index) … … 180 180 181 181 unsigned int counter = 0; 182 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)182 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 183 183 { 184 184 if ((*it) == this->currentCameraPosition_) … … 219 219 else if (this->cameraPositions_.size() > 0) 220 220 { 221 for (std::list<S martPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)221 for (std::list<StrongPtr<CameraPosition> >::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 222 222 { 223 223 if ((*it) == this->camera_->getParent()) … … 477 477 if (parent) 478 478 { 479 for (std::list<S martPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)479 for (std::list<StrongPtr<CameraPosition> >::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it) 480 480 if ((*it)->getIsAbsolute()) 481 481 parent->attach((*it)); -
code/branches/core7/src/orxonox/worldentities/ControllableEntity.h
r9667 r10555 114 114 void addCameraPosition(CameraPosition* position); 115 115 CameraPosition* getCameraPosition(unsigned int index) const; 116 inline const std::list<S martPtr<CameraPosition> >& getCameraPositions() const116 inline const std::list<StrongPtr<CameraPosition> >& getCameraPositions() const 117 117 { return this->cameraPositions_; } 118 118 unsigned int getCurrentCameraIndex() const; … … 235 235 bool bMouseLook_; 236 236 float mouseLookSpeed_; 237 std::list<S martPtr<CameraPosition> > cameraPositions_;237 std::list<StrongPtr<CameraPosition> > cameraPositions_; 238 238 CameraPosition* currentCameraPosition_; 239 239 std::string cameraPositionTemplate_; -
code/branches/core7/src/orxonox/worldentities/WorldEntity.cc
r10362 r10555 130 130 WorldEntity* entity = *it; 131 131 132 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to s martpointers pointing to it132 // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to strong pointers pointing to it 133 133 entity->setPosition(entity->getWorldPosition()); 134 134 this->detach(entity); // detach also erases the element from the children set
Note: See TracChangeset
for help on using the changeset viewer.