[Orxonox-commit 1595] r6313 - in code/branches/presentation2/src: libraries/core modules/weapons/projectiles orxonox/gamestates orxonox/items
scheusso at orxonox.net
scheusso at orxonox.net
Thu Dec 10 08:49:33 CET 2009
Author: scheusso
Date: 2009-12-10 08:49:33 +0100 (Thu, 10 Dec 2009)
New Revision: 6313
Modified:
code/branches/presentation2/src/libraries/core/GraphicsManager.cc
code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc
code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc
Log:
further network fixes
changed screenshot format from jpeg to tiff (lossless)
Modified: code/branches/presentation2/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/GraphicsManager.cc 2009-12-09 22:23:29 UTC (rev 6312)
+++ code/branches/presentation2/src/libraries/core/GraphicsManager.cc 2009-12-10 07:49:33 UTC (rev 6313)
@@ -440,6 +440,6 @@
{
assert(this->renderWindow_);
- this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".jpg");
+ this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".tiff");
}
}
Modified: code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc 2009-12-09 22:23:29 UTC (rev 6312)
+++ code/branches/presentation2/src/modules/weapons/projectiles/Rocket.cc 2009-12-10 07:49:33 UTC (rev 6313)
@@ -88,15 +88,23 @@
camPosition->setAllowMouseLook(true);
this->addCameraPosition(camPosition);
- this->defSndWpnEngine_ = new WorldSound(this);
- this->defSndWpnEngine_->setLooping(true);
- this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
- this->attach(defSndWpnEngine_);
+ if( GameMode::isMaster() )
+ {
+ this->defSndWpnEngine_ = new WorldSound(this);
+ 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_);
+ this->defSndWpnLaunch_ = new WorldSound(this);
+ this->defSndWpnLaunch_->setLooping(false);
+ this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
+ this->attach(defSndWpnLaunch_);
+ }
+ else
+ {
+ this->defSndWpnEngine_ = 0;
+ this->defSndWpnLaunch_ = 0;
+ }
}
/**
Modified: code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc 2009-12-09 22:23:29 UTC (rev 6312)
+++ code/branches/presentation2/src/orxonox/gamestates/GSMainMenu.cc 2009-12-10 07:49:33 UTC (rev 6313)
@@ -65,6 +65,7 @@
{
// Load sound
this->ambient_ = new AmbientSound(0);
+ this->ambient_->setSyncMode(0x0);
}
}
Modified: code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc
===================================================================
--- code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc 2009-12-09 22:23:29 UTC (rev 6312)
+++ code/branches/presentation2/src/orxonox/items/MultiStateEngine.cc 2009-12-10 07:49:33 UTC (rev 6313)
@@ -54,10 +54,18 @@
{
RegisterObject(MultiStateEngine);
- this->defEngineSndNormal_ = new WorldSound(this);
- this->defEngineSndBoost_ = new WorldSound(this);
- this->defEngineSndNormal_->setLooping(true);
- this->defEngineSndBoost_->setLooping(true);
+ if( GameMode::isMaster() )
+ {
+ this->defEngineSndNormal_ = new WorldSound(this);
+ this->defEngineSndBoost_ = new WorldSound(this);
+ this->defEngineSndNormal_->setLooping(true);
+ this->defEngineSndBoost_->setLooping(true);
+ }
+ else
+ {
+ this->defEngineSndBoost_ = 0;
+ this->defEngineSndNormal_ = 0;
+ }
this->lua_ = new LuaState();
this->state_ = 0;
@@ -73,8 +81,10 @@
for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsBegin(); ++it2)
(*it2)->destroy();
- delete this->defEngineSndNormal_;
- delete this->defEngineSndBoost_;
+ if( this->defEngineSndNormal_ )
+ delete this->defEngineSndNormal_;
+ if( this->defEngineSndBoost_ )
+ delete this->defEngineSndBoost_;
delete this->lua_;
}
}
@@ -96,7 +106,8 @@
{
if (this->getShip())
{
- if (this->getShip()->hasLocalController())
+// if (this->getShip()->hasLocalController())
+ if (GameMode::isMaster() && this->getShip()->hasLocalController())
{
this->setSyncMode(ObjectDirection::Bidirectional);
@@ -191,8 +202,10 @@
if (!ship)
return;
- this->getShip()->attach(defEngineSndNormal_);
- this->getShip()->attach(defEngineSndBoost_);
+ if( this->defEngineSndNormal_ )
+ this->getShip()->attach(defEngineSndNormal_);
+ if( this->defEngineSndBoost_ )
+ this->getShip()->attach(defEngineSndBoost_);
for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsEnd(); ++it2)
@@ -225,21 +238,35 @@
void MultiStateEngine::setDefEngSndNormal(const std::string &engineSound)
{
- defEngineSndNormal_->setSource(engineSound);
+ if( defEngineSndNormal_ )
+ defEngineSndNormal_->setSource(engineSound);
+ else
+ assert(0); // This should never happen, because soundpointer is only available on master
}
const std::string& MultiStateEngine::getDefEngSndNormal()
{
- return defEngineSndNormal_->getSource();
+ if( defEngineSndNormal_ )
+ return defEngineSndNormal_->getSource();
+ else
+ assert(0);
+ return std::string();
}
void MultiStateEngine::setDefEngSndBoost(const std::string &engineSound)
{
- defEngineSndBoost_->setSource(engineSound);
+ if( defEngineSndBoost_ )
+ defEngineSndBoost_->setSource(engineSound);
+ else
+ assert(0);
}
const std::string& MultiStateEngine::getDefEngSndBoost()
{
- return defEngineSndBoost_->getSource();
+ if( this->defEngineSndBoost_ )
+ return defEngineSndBoost_->getSource();
+ else
+ assert(0);
+ return std::string();
}
}
More information about the Orxonox-commit
mailing list