[Orxonox-commit 1500] r6218 - in code/branches/presentation2/src: libraries/core libraries/tools modules/overlays/hud orxonox/interfaces orxonox/overlays

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Dec 2 22:20:37 CET 2009


Author: rgrieder
Date: 2009-12-02 22:20:37 +0100 (Wed, 02 Dec 2009)
New Revision: 6218

Modified:
   code/branches/presentation2/src/libraries/core/ConfigValueContainer.h
   code/branches/presentation2/src/libraries/tools/ParticleInterface.cc
   code/branches/presentation2/src/libraries/tools/Shader.cc
   code/branches/presentation2/src/modules/overlays/hud/HUDBar.cc
   code/branches/presentation2/src/orxonox/interfaces/RadarViewable.cc
   code/branches/presentation2/src/orxonox/overlays/Map.cc
   code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc
Log:
Fixed at least 8 unitialised value problems though not all of them are problematic. Still, the values are being used and some condition depends on it.

Modified: code/branches/presentation2/src/libraries/core/ConfigValueContainer.h
===================================================================
--- code/branches/presentation2/src/libraries/core/ConfigValueContainer.h	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/libraries/core/ConfigValueContainer.h	2009-12-02 21:20:37 UTC (rev 6218)
@@ -145,18 +145,18 @@
             {
                 if ((this->callback_ && object) || this->bContainerIsNew_)
                 {
-                    if (this->bContainerIsNew_)
-                        this->bContainerIsNew_ = false;
-
                     T temp = *value;
                     this->value_.getValue(value);
-                    if ((*value) != temp)
+                    if (this->bContainerIsNew_ || (*value) != temp)
                     {
                         if (this->callback_ && object)
                             this->callback_->call(object);
                         else
                             this->bDoInitialCallback_ = true;
                     }
+
+                    if (this->bContainerIsNew_)
+                        this->bContainerIsNew_ = false;
                 }
                 else
                 {

Modified: code/branches/presentation2/src/libraries/tools/ParticleInterface.cc
===================================================================
--- code/branches/presentation2/src/libraries/tools/ParticleInterface.cc	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/libraries/tools/ParticleInterface.cc	2009-12-02 21:20:37 UTC (rev 6218)
@@ -64,6 +64,8 @@
         this->bAllowedByLOD_ = true;
         this->speedFactor_ = 1.0f;
 
+        this->setDetailLevel(static_cast<unsigned int>(detaillevel));
+
         this->setConfigValues();
 
         if (GameMode::showsGraphics())
@@ -79,8 +81,6 @@
                 this->particleSystem_ = 0;
             }
         }
-
-        this->setDetailLevel(static_cast<unsigned int>(detaillevel));
     }
 
     ParticleInterface::~ParticleInterface()

Modified: code/branches/presentation2/src/libraries/tools/Shader.cc
===================================================================
--- code/branches/presentation2/src/libraries/tools/Shader.cc	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/libraries/tools/Shader.cc	2009-12-02 21:20:37 UTC (rev 6218)
@@ -78,8 +78,7 @@
 
     Shader::~Shader()
     {
-
-        if (this->bLoadCompositor_ && this->compositorInstance_)
+        if (this->compositorInstance_ && this->bLoadCompositor_)
         {
             Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
             assert(viewport);

Modified: code/branches/presentation2/src/modules/overlays/hud/HUDBar.cc
===================================================================
--- code/branches/presentation2/src/modules/overlays/hud/HUDBar.cc	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/modules/overlays/hud/HUDBar.cc	2009-12-02 21:20:37 UTC (rev 6218)
@@ -84,9 +84,9 @@
         this->bar_->setMaterialName(materialname);
 
         this->value_ = 1.0f;  // initielize with 1.0f to trigger a change when calling setValue(0.0f) on the line below
+        this->setAutoColour(true);
         this->setValue(0.0f); // <--
         this->setRightToLeft(false);
-        this->setAutoColour(true);
         this->currentColour_ = ColourValue::White;
 
         this->background_->addChild(bar_);

Modified: code/branches/presentation2/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/branches/presentation2/src/orxonox/interfaces/RadarViewable.cc	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/orxonox/interfaces/RadarViewable.cc	2009-12-02 21:20:37 UTC (rev 6218)
@@ -50,15 +50,14 @@
         , MapEntity_(NULL)
         , line_(NULL)
         , LineNode_(NULL)
+        , isHumanShip_(false)
+        , bVisibility_(false)
         , radarObjectCamouflage_(0.0f)
         , radarObjectShape_(Dot)
         , radarObjectDescription_("staticObject")
     {
         RegisterRootObject(RadarViewable);
 
-        this->bVisibility_ = true;
-        this->isHumanShip_ = false;
-
         this->uniqueId_=getUniqueNumberString();
 /*
         if(Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr())

Modified: code/branches/presentation2/src/orxonox/overlays/Map.cc
===================================================================
--- code/branches/presentation2/src/orxonox/overlays/Map.cc	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/orxonox/overlays/Map.cc	2009-12-02 21:20:37 UTC (rev 6218)
@@ -93,11 +93,8 @@
         Map::singletonMap_s=this;
 
         //Getting Scene Manager (Hack)
-        if( !sManager_ )
-        {
-            ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
-            this->sManager_ = it->getSceneManager();
-        }
+        ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
+        this->sManager_ = it->getSceneManager();
         if( !Map::getMapSceneManager() )
         {
             Map::setMapSceneManager( Ogre::Root::getSingletonPtr()->createSceneManager( Ogre::ST_GENERIC,"MapScene" ) );

Modified: code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc	2009-12-02 21:13:13 UTC (rev 6217)
+++ code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc	2009-12-02 21:20:37 UTC (rev 6218)
@@ -82,15 +82,15 @@
 
         // Get aspect ratio from the render window. Later on, we get informed automatically
         this->windowAspectRatio_ = static_cast<float>(this->getWindowWidth()) / this->getWindowHeight();
-        this->sizeCorrectionChanged();
 
-        this->changedVisibility();
+        this->size_ = Vector2(1.0f, 1.0f);
+        this->pickPoint_= Vector2(0.0f, 0.0f);
+        this->position_ = Vector2(0.0f, 0.0f);
+        this->angle_ = Degree(0.0);
+        this->bCorrectAspect_ = false;
+        this->rotState_ = Horizontal;
+        this->angleChanged(); // updates all other values as well
 
-        setSize(Vector2(1.0f, 1.0f));
-        setPickPoint(Vector2(0.0f, 0.0f));
-        setPosition(Vector2(0.0f, 0.0f));
-        setRotation(Degree(0.0));
-        setAspectCorrection(false);
         setBackgroundMaterial("");
     }
 




More information about the Orxonox-commit mailing list