[Orxonox-commit 1739] r6457 - in code/branches/network2/src: libraries/network/synchronisable orxonox/sound
scheusso at orxonox.net
scheusso at orxonox.net
Sat Jan 23 16:38:42 CET 2010
Author: scheusso
Date: 2010-01-23 16:38:41 +0100 (Sat, 23 Jan 2010)
New Revision: 6457
Modified:
code/branches/network2/src/libraries/network/synchronisable/Synchronisable.h
code/branches/network2/src/orxonox/sound/BaseSound.cc
code/branches/network2/src/orxonox/sound/BaseSound.h
code/branches/network2/src/orxonox/sound/WorldSound.cc
Log:
changed synchronisation of worldsound state (1 instead of 4 bytes)
fix in Synchronisable::unregisterVariable
Modified: code/branches/network2/src/libraries/network/synchronisable/Synchronisable.h
===================================================================
--- code/branches/network2/src/libraries/network/synchronisable/Synchronisable.h 2010-01-22 16:49:36 UTC (rev 6456)
+++ code/branches/network2/src/libraries/network/synchronisable/Synchronisable.h 2010-01-23 15:38:41 UTC (rev 6457)
@@ -224,6 +224,7 @@
std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin();
while(it!=syncList_.end()){
if( ((*it)->getReference()) == &variable ){
+ this->dataSize_ -= (*it)->getSize(Synchronisable::state_);
delete (*it);
syncList_.erase(it);
return;
Modified: code/branches/network2/src/orxonox/sound/BaseSound.cc
===================================================================
--- code/branches/network2/src/orxonox/sound/BaseSound.cc 2010-01-22 16:49:36 UTC (rev 6456)
+++ code/branches/network2/src/orxonox/sound/BaseSound.cc 2010-01-23 15:38:41 UTC (rev 6457)
@@ -247,7 +247,7 @@
}
else // No source acquired so far, but might be set to playing or paused
{
- State state = this->state_; // save
+ State state = static_cast<State>(this->state_); // save
if (this->isPlaying() || this->isPaused())
doPlay();
if (state == Paused)
Modified: code/branches/network2/src/orxonox/sound/BaseSound.h
===================================================================
--- code/branches/network2/src/orxonox/sound/BaseSound.h 2010-01-22 16:49:36 UTC (rev 6456)
+++ code/branches/network2/src/orxonox/sound/BaseSound.h 2010-01-23 15:38:41 UTC (rev 6457)
@@ -111,7 +111,7 @@
std::string source_;
float volume_;
bool bLooping_;
- State state_;
+ uint8_t state_; // This Variable is actually of type State
float pitch_;
private:
Modified: code/branches/network2/src/orxonox/sound/WorldSound.cc
===================================================================
--- code/branches/network2/src/orxonox/sound/WorldSound.cc 2010-01-22 16:49:36 UTC (rev 6456)
+++ code/branches/network2/src/orxonox/sound/WorldSound.cc 2010-01-23 15:38:41 UTC (rev 6457)
@@ -57,7 +57,7 @@
registerVariable(source_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::sourceChanged));
registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::loopingChanged));
registerVariable(pitch_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::pitchChanged));
- registerVariable((int&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
+ registerVariable((uint8_t&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
}
void WorldSound::XMLPort(Element& xmlelement, XMLPort::Mode mode)
More information about the Orxonox-commit
mailing list