Changeset 9437 for code/branches/soundEffects
- Timestamp:
- Nov 8, 2012, 10:58:11 PM (12 years ago)
- Location:
- code/branches/soundEffects/src/modules/portals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/soundEffects/src/modules/portals/PortalEndPoint.cc
r8767 r9437 28 28 29 29 #include "PortalEndPoint.h" 30 #include "portals/PortalLink.h" 30 31 31 32 #include <ctime> … … 35 36 36 37 #include "worldentities/MobileEntity.h" 37 38 38 #include "objects/triggers/MultiTriggerContainer.h" 39 39 40 #include " portals/PortalLink.h"40 #include "sound/WorldSound.h" 41 41 42 42 namespace orxonox … … 59 59 this->setRadarObjectShape(RadarViewable::Dot); 60 60 this->setRadarVisibility(true); 61 if( GameMode::isMaster() ) 62 { 63 this->portalSound_ = new WorldSound(this); 64 this->portalSound_->setLooping(false); 65 this->attach(this->portalSound_); 66 this->portalSound_->setSource("sounds/Weapon_HsW01.ogg"); //TODO: change sound file 67 } 61 68 } 62 69 63 70 PortalEndPoint::~PortalEndPoint() 64 71 { 65 if(this->isInitialized() && this->trigger_ != NULL) 66 delete this->trigger_; 72 if (this->isInitialized()) 73 { 74 if (this->portalSound_ != NULL) 75 this->portalSound_->destroy(); 76 77 if (this->trigger_ != NULL) 78 delete this->trigger_; 79 } 67 80 } 68 81 … … 158 171 entity->rotate(this->getWorldOrientation()); 159 172 entity->setVelocity(this->getWorldOrientation() * entity->getVelocity()); 173 //play Sound 174 if( this->portalSound_ && !(this->portalSound_->isPlaying())) 175 { 176 this->portalSound_->play(); 177 } 160 178 } 161 179 -
code/branches/soundEffects/src/modules/portals/PortalEndPoint.h
r8767 r9437 115 115 std::map<MobileEntity *, time_t> jumpOutTimes_; //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint 116 116 std::set<MobileEntity *> recentlyJumpedOut_; //!< Stores the entities witch recently jumped out of this PortalEndPoint and haven't left the activation radius yet. This is needed in order to prevent them from beeing pulled into the PortalEndPoint they have just come out of. 117 118 WorldSound* portalSound_; 117 119 }; 118 120
Note: See TracChangeset
for help on using the changeset viewer.