[Orxonox-commit 1567] r6285 - in code/branches/presentation2/src: modules/weapons/projectiles modules/weapons/weaponmodes orxonox/sound
youngk at orxonox.net
youngk at orxonox.net
Wed Dec 9 14:31:54 CET 2009
Author: youngk
Date: 2009-12-09 14:31:54 +0100 (Wed, 09 Dec 2009)
New Revision: 6285
Modified:
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h
code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc
code/branches/presentation2/src/orxonox/sound/BaseSound.cc
Log:
Launching sound of the Rocket plays normally now. Changed AL_MAX_DISTANCE to 10000.
Modified: code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc 2009-12-09 13:02:31 UTC (rev 6284)
+++ code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc 2009-12-09 13:31:54 UTC (rev 6285)
@@ -92,6 +92,11 @@
this->defSndWpnEngine_->setLooping(true);
this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
this->attach(defSndWpnEngine_);
+
+ this->defSndWpnLaunch_ = new WorldSound(this);
+ this->defSndWpnLaunch_->setLooping(false);
+ this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
+ this->attach(defSndWpnLaunch_);
}
/**
@@ -110,7 +115,12 @@
{
this->defSndWpnEngine_->stop();
}
+ if(this->defSndWpnLaunch_->isPlaying())
+ {
+ this->defSndWpnLaunch_->stop();
+ }
delete this->defSndWpnEngine_;
+ delete this->defSndWpnLaunch_;
}
}
@@ -132,6 +142,7 @@
this->owner_->getPlayer()->startTemporaryControl(this);
this->defSndWpnEngine_->play();
+ this->defSndWpnLaunch_->play();
}
/**
Modified: code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h 2009-12-09 13:02:31 UTC (rev 6284)
+++ code/branches/presentation2/src/modules/weapons/projectiles/Rocket.h 2009-12-09 13:31:54 UTC (rev 6285)
@@ -123,7 +123,7 @@
float lifetime_;
WorldSound* defSndWpnEngine_;
- WorldSound* defSndWpnExplosion_;
+ WorldSound* defSndWpnLaunch_;
};
}
Modified: code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc 2009-12-09 13:02:31 UTC (rev 6284)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/RocketFire.cc 2009-12-09 13:31:54 UTC (rev 6285)
@@ -53,7 +53,7 @@
this->speed_ = 500;
this->setMunitionName("RocketMunition");
- this->setDefaultSound("sounds/Rocket_launch.ogg");
+ // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
}
RocketFire::~RocketFire()
Modified: code/branches/presentation2/src/orxonox/sound/BaseSound.cc
===================================================================
--- code/branches/presentation2/src/orxonox/sound/BaseSound.cc 2009-12-09 13:02:31 UTC (rev 6284)
+++ code/branches/presentation2/src/orxonox/sound/BaseSound.cc 2009-12-09 13:31:54 UTC (rev 6285)
@@ -60,7 +60,7 @@
if (alIsSource(this->audioSource_))
{
alSourcei(this->audioSource_, AL_REFERENCE_DISTANCE, 20);
- alSourcei(this->audioSource_, AL_MAX_DISTANCE, 300);
+ alSourcei(this->audioSource_, AL_MAX_DISTANCE, 10000);
}
}
}
More information about the Orxonox-commit
mailing list