Index: /code/branches/hud/bin/levels/sample.oxw
===================================================================
--- /code/branches/hud/bin/levels/sample.oxw	(revision 1617)
+++ /code/branches/hud/bin/levels/sample.oxw	(revision 1618)
@@ -9,5 +9,5 @@
   </audio--> 
 
-<Ambient colourvalue="0.1, 0.1, 0.1" />
+<Ambient colourvalue="1.0, 1.0, 1.0" />
 <Skybox src="Orxonox/Starbox" />
 <SpaceShip camera="true" position="0,0,0" scale="10" yawpitchroll="0,0,0" mesh="assff.mesh" maxSpeed="500" maxSideAndBackSpeed="50" maxRotation="1.0" transAcc="200" rotAcc="3.0" transDamp="75" rotDamp="1.0" />
Index: /code/branches/hud/src/orxonox/GraphicsEngine.h
===================================================================
--- /code/branches/hud/src/orxonox/GraphicsEngine.h	(revision 1617)
+++ /code/branches/hud/src/orxonox/GraphicsEngine.h	(revision 1618)
@@ -77,4 +77,7 @@
             void setAverageRTR(float rtr) { this->renderTimeRatio_ = rtr; }
 
+            void setWindowActivity(bool activity)
+            { if (this->renderWindow_) this->renderWindow_->setActive(activity); }
+
             void windowMoved       (Ogre::RenderWindow* rw);
             void windowResized     (Ogre::RenderWindow* rw);
Index: /code/branches/hud/src/orxonox/Orxonox.cc
===================================================================
--- /code/branches/hud/src/orxonox/Orxonox.cc	(revision 1617)
+++ /code/branches/hud/src/orxonox/Orxonox.cc	(revision 1618)
@@ -501,4 +501,5 @@
         // This calls the WindowEventListener objects.
         Ogre::WindowEventUtilities::messagePump();
+        GraphicsEngine::getSingleton().setWindowActivity(true);
 
         // render
Index: /code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- /code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1617)
+++ /code/branches/hud/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 1618)
@@ -111,4 +111,5 @@
                 this->overlay_->hide();
 
+            this->sizeCorrectionChanged();
             this->sizeChanged();
             this->positionChanged();
@@ -160,8 +161,12 @@
         {
             float angle = this->angle_.valueDegrees();
+            if (angle < 0.0)
+                angle = -angle;
+            angle -= 180.0 * (int)(angle / 180.0);
+
             float tempAspect;
-            if (angle > 89.0 && angle < 91.0 || angle > 269 && angle < 271)
+            if (angle > 89.0 && angle < 91.0)
                 tempAspect = 1.0 / this->windowAspectRatio_;
-            else if (angle > 359 && angle < 1 || angle > 179 && angle < 181)
+            else if (angle > 179 || angle < 1)
                 tempAspect = this->windowAspectRatio_;
             else
Index: /code/branches/hud/src/orxonox/overlays/debug/HUDFPSText.cc
===================================================================
--- /code/branches/hud/src/orxonox/overlays/debug/HUDFPSText.cc	(revision 1618)
+++ /code/branches/hud/src/orxonox/overlays/debug/HUDFPSText.cc	(revision 1618)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HUDFPSText.h"
+#include <OgreTextAreaOverlayElement.h>
+#include "core/CoreIncludes.h"
+#include "GraphicsEngine.h"
+#include "util/Convert.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDFPSText);
+
+    HUDFPSText::HUDFPSText()
+    {
+        RegisterObject(HUDFPSText);
+    }
+
+    HUDFPSText::~HUDFPSText()
+    {
+    }
+
+    void HUDFPSText::tick(float dt)
+    {
+        float fps = GraphicsEngine::getSingleton().getAverageFPS();
+        this->text_->setCaption(this->getCaption() + convertToString(fps));
+    }
+}
Index: /code/branches/hud/src/orxonox/overlays/debug/HUDFPSText.h
===================================================================
--- /code/branches/hud/src/orxonox/overlays/debug/HUDFPSText.h	(revision 1618)
+++ /code/branches/hud/src/orxonox/overlays/debug/HUDFPSText.h	(revision 1618)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDFPSText_H__
+#define _HUDFPSText_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/OverlayText.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HUDFPSText : public OverlayText, public Tickable
+    {
+    public:
+        HUDFPSText();
+        ~HUDFPSText();
+
+    private:
+        void tick(float dt);
+
+    private:
+    };
+}
+#endif /* _HUDFPSText_H__ */
Index: /code/branches/hud/src/orxonox/overlays/debug/HUDRTRText.cc
===================================================================
--- /code/branches/hud/src/orxonox/overlays/debug/HUDRTRText.cc	(revision 1618)
+++ /code/branches/hud/src/orxonox/overlays/debug/HUDRTRText.cc	(revision 1618)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "HUDRTRText.h"
+#include <OgreTextAreaOverlayElement.h>
+#include "core/CoreIncludes.h"
+#include "util/Convert.h"
+#include "GraphicsEngine.h"
+
+namespace orxonox
+{
+    CreateFactory(HUDRTRText);
+
+    HUDRTRText::HUDRTRText()
+    {
+        RegisterObject(HUDRTRText);
+    }
+
+    HUDRTRText::~HUDRTRText()
+    {
+    }
+
+    void HUDRTRText::tick(float dt)
+    {
+        float rtr = GraphicsEngine::getSingleton().getAverageRTR();
+        this->text_->setCaption(this->getCaption() + convertToString(rtr));
+    }
+}
Index: /code/branches/hud/src/orxonox/overlays/debug/HUDRTRText.h
===================================================================
--- /code/branches/hud/src/orxonox/overlays/debug/HUDRTRText.h	(revision 1618)
+++ /code/branches/hud/src/orxonox/overlays/debug/HUDRTRText.h	(revision 1618)
@@ -0,0 +1,49 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HUDRTRText_H__
+#define _HUDRTRText_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "overlays/OverlayText.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HUDRTRText : public OverlayText, public Tickable
+    {
+    public:
+        HUDRTRText();
+        ~HUDRTRText();
+
+    private:
+        void tick(float dt);
+    };
+}
+#endif /* _HUDRTRText_H__ */
Index: /code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc
===================================================================
--- /code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc	(revision 1617)
+++ /code/branches/hud/src/orxonox/overlays/hud/HUDBar.cc	(revision 1618)
@@ -43,4 +43,21 @@
 namespace orxonox
 {
+    CreateFactory(BarColour);
+
+    BarColour::BarColour()
+        : position_(0.0)
+    {
+        RegisterObject(BarColour);
+    }
+
+    void BarColour::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlElement, mode);
+
+        XMLPortParam(BarColour, "colour", setColour, getColour, xmlElement, mode);
+        XMLPortParam(BarColour, "position", setPosition, getPosition, xmlElement, mode);
+    }
+
+
     unsigned int HUDBar::materialcount_s = 0;
 
@@ -87,11 +104,9 @@
             this->autoColour_ = true;
             this->right2Left_ = false; // default is left to right progress
-
-            this->addColour(0.7, ColourValue(0.2, 0.7, 0.2));
-            this->addColour(0.4, ColourValue(0.7, 0.5, 0.2));
-            this->addColour(0.1, ColourValue(0.7, 0.2, 0.2));
         }
 
         XMLPortParamLoadOnly(HUDBar, "value", setValue, xmlElement, mode);
+        XMLPortParam(HUDBar, "right2left", setRightToLeft, getRightToLeft, xmlElement, mode);
+        XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlElement, mode, false, true);
     }
 
@@ -154,8 +169,18 @@
     }
 
-    void HUDBar::addColour(float value, const ColourValue& colour)
+    void HUDBar::addColour(BarColour* colour)
     {
-        value = clamp<float>(value, 0, 1);
-        this->colours_[value] = colour;
+        float value = clamp<float>(colour->getPosition(), 0.0, 1.0);
+        this->colours_[value] = colour->getColour();
+
+        this->barColours_.push_back(colour);
+    }
+
+    BarColour* HUDBar::getColour(unsigned int index)
+    {
+        if (index < this->barColours_.size())
+            return barColours_[index];
+        else
+            return 0;
     }
 
Index: /code/branches/hud/src/orxonox/overlays/hud/HUDBar.h
===================================================================
--- /code/branches/hud/src/orxonox/overlays/hud/HUDBar.h	(revision 1617)
+++ /code/branches/hud/src/orxonox/overlays/hud/HUDBar.h	(revision 1618)
@@ -41,4 +41,23 @@
 namespace orxonox
 {
+    class _OrxonoxExport BarColour : public BaseObject
+    {
+    public:
+        BarColour();
+        ~BarColour() { }
+
+        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        void setColour(const ColourValue& colour) { this->colour_ = colour; }
+        const ColourValue& getColour() const { return this->colour_; }
+
+        void setPosition(float pos) { this->position_ = pos; }
+        float getPosition() const    { return this->position_; }
+
+    private:
+        ColourValue colour_;
+        float position_;
+    };
+
     class _OrxonoxExport HUDBar : public OrxonoxOverlay
     {
@@ -50,5 +69,4 @@
 
         virtual void setValue(float value);
-        void addColour(float value, const ColourValue& colour);
         void clearColours();
 
@@ -61,4 +79,7 @@
 
     private:
+        void addColour(BarColour* colour);
+        BarColour* getColour(unsigned int index);
+
         bool right2Left_;
         bool autoColour_;                   //!< whether bar changes colour automatically
@@ -68,4 +89,5 @@
         Ogre::TextureUnitState* textureUnitState_;
         std::map<float, ColourValue> colours_;
+        std::vector<BarColour*> barColours_;
 
         float barWidth_s;
Index: de/branches/hud/src/orxonox/overlays/hud/HUDFPSText.cc
===================================================================
--- /code/branches/hud/src/orxonox/overlays/hud/HUDFPSText.cc	(revision 1617)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "HUDFPSText.h"
-#include <OgreTextAreaOverlayElement.h>
-#include "core/CoreIncludes.h"
-#include "GraphicsEngine.h"
-#include "util/Convert.h"
-
-namespace orxonox
-{
-    CreateFactory(HUDFPSText);
-
-    HUDFPSText::HUDFPSText()
-    {
-        RegisterObject(HUDFPSText);
-    }
-
-    HUDFPSText::~HUDFPSText()
-    {
-    }
-
-    void HUDFPSText::tick(float dt)
-    {
-        float fps = GraphicsEngine::getSingleton().getAverageFPS();
-        this->text_->setCaption(this->getCaption() + convertToString(fps));
-    }
-}
Index: de/branches/hud/src/orxonox/overlays/hud/HUDFPSText.h
===================================================================
--- /code/branches/hud/src/orxonox/overlays/hud/HUDFPSText.h	(revision 1617)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _HUDFPSText_H__
-#define _HUDFPSText_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "overlays/OverlayText.h"
-#include "objects/Tickable.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport HUDFPSText : public OverlayText, public Tickable
-    {
-    public:
-        HUDFPSText();
-        ~HUDFPSText();
-
-    private:
-        void tick(float dt);
-
-    private:
-    };
-}
-#endif /* _HUDFPSText_H__ */
Index: de/branches/hud/src/orxonox/overlays/hud/HUDRTRText.cc
===================================================================
--- /code/branches/hud/src/orxonox/overlays/hud/HUDRTRText.cc	(revision 1617)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "HUDRTRText.h"
-#include <OgreTextAreaOverlayElement.h>
-#include "core/CoreIncludes.h"
-#include "util/Convert.h"
-#include "GraphicsEngine.h"
-
-namespace orxonox
-{
-    CreateFactory(HUDRTRText);
-
-    HUDRTRText::HUDRTRText()
-    {
-        RegisterObject(HUDRTRText);
-    }
-
-    HUDRTRText::~HUDRTRText()
-    {
-    }
-
-    void HUDRTRText::tick(float dt)
-    {
-        float rtr = GraphicsEngine::getSingleton().getAverageRTR();
-        this->text_->setCaption(this->getCaption() + convertToString(rtr));
-    }
-}
Index: de/branches/hud/src/orxonox/overlays/hud/HUDRTRText.h
===================================================================
--- /code/branches/hud/src/orxonox/overlays/hud/HUDRTRText.h	(revision 1617)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _HUDRTRText_H__
-#define _HUDRTRText_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "overlays/OverlayText.h"
-#include "objects/Tickable.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport HUDRTRText : public OverlayText, public Tickable
-    {
-    public:
-        HUDRTRText();
-        ~HUDRTRText();
-
-    private:
-        void tick(float dt);
-    };
-}
-#endif /* _HUDRTRText_H__ */
Index: /code/branches/hud/src/tinyxml/ticpp.cc
===================================================================
--- /code/branches/hud/src/tinyxml/ticpp.cc	(revision 1617)
+++ /code/branches/hud/src/tinyxml/ticpp.cc	(revision 1618)
@@ -23,4 +23,11 @@
 */
 
+/*
+Modifications by the orxonox team:
+In function: void Document::Parse( const std::string& xml, bool throwIfParseError, TiXmlEncoding encoding )
+     change: Added row and column number to the error description.
+     author: Reto Grieder
+*/
+
 #ifdef TIXML_USE_TICPP
 
@@ -853,5 +860,6 @@
 	if( throwIfParseError && m_tiXmlPointer->Error() )
 	{
-		TICPPTHROW( "Error parsing xml: " << m_tiXmlPointer->ErrorDesc() );
+		TICPPTHROW( "Error parsing xml: " << m_tiXmlPointer->ErrorDesc()
+            << " In row " << m_tiXmlPointer->ErrorRow() << ", column " << m_tiXmlPointer->ErrorCol() << ".");
 	}
 }
Index: /code/branches/hud/src/util/Convert.h
===================================================================
--- /code/branches/hud/src/util/Convert.h	(revision 1617)
+++ /code/branches/hud/src/util/Convert.h	(revision 1618)
@@ -668,5 +668,5 @@
 
         SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-        if (tokens.size() >= 4)
+        if (tokens.size() >= 3)
         {
             if (!ConvertValue(&(output->r), tokens[0]))
@@ -676,6 +676,11 @@
             if (!ConvertValue(&(output->b), tokens[2]))
                 return false;
-            if (!ConvertValue(&(output->a), tokens[3]))
-                return false;
+            if (tokens.size() >= 4)
+            {
+                if (!ConvertValue(&(output->a), tokens[3]))
+                    return false;
+            }
+            else
+                output->a = 1.0;
 
             return true;
