Index: /code/branches/unity_build/src/libraries/core/GUIManager.cc
===================================================================
--- /code/branches/unity_build/src/libraries/core/GUIManager.cc	(revision 8677)
+++ /code/branches/unity_build/src/libraries/core/GUIManager.cc	(revision 8678)
@@ -419,5 +419,5 @@
     }
 
-    const std::string& GUIManager::createInputState(const std::string& name, TriBool::Value showCursor, TriBool::Value useKeyboard, bool bBlockJoyStick)
+    const std::string& GUIManager::createInputState(const std::string& name, tribool showCursor, tribool useKeyboard, bool bBlockJoyStick)
     {
         InputState* state = InputManager::getInstance().createInputState(name);
@@ -435,22 +435,22 @@
 #ifdef ORXONOX_PLATFORM_APPLE
         // There is no non exclusive mode on OS X yet
-        state->setMouseExclusive(TriBool::True);
-#else
-        if (showCursor == TriBool::Dontcare)
-            state->setMouseExclusive(TriBool::Dontcare);
-        else if (GraphicsManager::getInstance().isFullScreen() || showCursor == TriBool::False)
-            state->setMouseExclusive(TriBool::True);
+        state->setMouseExclusive(true);
+#else
+        if (showCursor == dontcare)
+            state->setMouseExclusive(dontcare);
+        else if (GraphicsManager::getInstance().isFullScreen() || showCursor == false)
+            state->setMouseExclusive(true);
         else
-            state->setMouseExclusive(TriBool::False);
-#endif
-
-        if (showCursor == TriBool::True)
+            state->setMouseExclusive(false);
+#endif
+
+        if (showCursor == true)
             state->setMouseHandler(this);
-        else if (showCursor == TriBool::False)
+        else if (showCursor == false)
             state->setMouseHandler(&InputHandler::EMPTY);
 
-        if (useKeyboard == TriBool::True)
+        if (useKeyboard == true)
             state->setKeyHandler(this);
-        else if (useKeyboard == TriBool::False)
+        else if (useKeyboard == false)
             state->setKeyHandler(&InputHandler::EMPTY);
 
Index: /code/branches/unity_build/src/libraries/core/GUIManager.h
===================================================================
--- /code/branches/unity_build/src/libraries/core/GUIManager.h	(revision 8677)
+++ /code/branches/unity_build/src/libraries/core/GUIManager.h	(revision 8678)
@@ -46,14 +46,9 @@
 #include "util/DestructionHelper.h"
 #include "util/OgreForwardRefs.h"
-#include "util/TriBool.h"
+#include "util/tribool.h"
 #include "util/Singleton.h"
 #include "input/InputHandler.h"
 #include "OrxonoxClass.h"
 #include "WindowEventListener.h"
-
-// Tolua includes (have to be relative to the current directory)
-/*
-$cfile "../util/TriBool.h" // tolua_export
-*/
 
 #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
@@ -64,4 +59,7 @@
 { // tolua_export
     class PlayerInfo; // Forward declaration
+
+    // Acquaint Tolua with tribool
+    class tribool; // tolua_export
 
     /**
@@ -105,5 +103,5 @@
 
         //! Creates a new InputState to be used with a GUI Sheet
-        const std::string& createInputState(const std::string& name, TriBool::Value showCursor = TriBool::True, TriBool::Value useKeyboard = TriBool::True, bool bBlockJoyStick = false); // tolua_export
+        const std::string& createInputState(const std::string& name, tribool showCursor = true, tribool useKeyboard = true, bool bBlockJoyStick = false); // tolua_export
         LuaState* getLuaState(void)
             { return this->luaState_; }
Index: /code/branches/unity_build/src/libraries/core/input/InputManager.cc
===================================================================
--- /code/branches/unity_build/src/libraries/core/input/InputManager.cc	(revision 8677)
+++ /code/branches/unity_build/src/libraries/core/input/InputManager.cc	(revision 8678)
@@ -94,5 +94,5 @@
         , oisInputManager_(0)
         , devices_(2)
-        , exclusiveMouse_(TriBool::False)
+        , exclusiveMouse_(false)
         , emptyState_(0)
         , calibratorCallbackHandler_(0)
@@ -108,5 +108,5 @@
 
         if (GraphicsManager::getInstance().isFullScreen())
-            exclusiveMouse_ = TriBool::True;
+            exclusiveMouse_ = true;
         this->loadDevices();
 
@@ -161,5 +161,5 @@
         paramList.insert(StringPair("w32_keyboard", "DISCL_FOREGROUND"));
         paramList.insert(StringPair("w32_mouse", "DISCL_FOREGROUND"));
-        if (exclusiveMouse_ == TriBool::True || GraphicsManager::getInstance().isFullScreen())
+        if (exclusiveMouse_ || GraphicsManager::getInstance().isFullScreen())
         {
             // Disable Windows key plus special keys (like play, stop, next, etc.)
@@ -174,5 +174,5 @@
         paramList.insert(StringPair("XAutoRepeatOn", "true"));
 
-        if (exclusiveMouse_ == TriBool::True || GraphicsManager::getInstance().isFullScreen())
+        if (exclusiveMouse_ || GraphicsManager::getInstance().isFullScreen())
         {
             if (CommandLineParser::getValue("keyboard_no_grab").getBool())
@@ -447,13 +447,14 @@
 
         // Check whether we have to change the mouse mode
-        TriBool::Value requestedMode = TriBool::Dontcare;
+        tribool requestedMode = dontcare;
         std::vector<InputState*>& mouseStates = devices_[InputDeviceEnumerator::Mouse]->getStateListRef();
         if (mouseStates.empty())
-            requestedMode = TriBool::False;
+            requestedMode = false;
         else
             requestedMode = mouseStates.front()->getMouseExclusive();
-        if (requestedMode != TriBool::Dontcare && exclusiveMouse_ != requestedMode)
-        {
-            exclusiveMouse_ = requestedMode;
+        if (requestedMode != dontcare && exclusiveMouse_ != requestedMode)
+        {
+            assert(requestedMode != dontcare);
+            exclusiveMouse_ = (requestedMode == true);
             if (!GraphicsManager::getInstance().isFullScreen())
                 this->reloadInternal();
@@ -644,5 +645,5 @@
     }
 
-    bool InputManager::setMouseExclusive(const std::string& name, TriBool::Value value)
+    bool InputManager::setMouseExclusive(const std::string& name, tribool value)
     {
         if (name == "empty")
Index: /code/branches/unity_build/src/libraries/core/input/InputManager.h
===================================================================
--- /code/branches/unity_build/src/libraries/core/input/InputManager.h	(revision 8677)
+++ /code/branches/unity_build/src/libraries/core/input/InputManager.h	(revision 8678)
@@ -38,5 +38,5 @@
 
 #include "util/Singleton.h"
-#include "util/TriBool.h"
+#include "util/tribool.h"
 #include "core/WindowEventListener.h"
 
@@ -168,5 +168,5 @@
             True if the call was successful, fals if the name was not found
         */
-        bool setMouseExclusive(const std::string& name, TriBool::Value value); // tolua_export
+        bool setMouseExclusive(const std::string& name, tribool value); // tolua_export
 
         //-------------------------------
@@ -214,5 +214,5 @@
         OIS::InputManager*                  oisInputManager_;      //!< OIS input manager
         std::vector<InputDevice*>           devices_;              //!< List of all input devices (keyboard, mouse, joy sticks)
-        TriBool::Value                      exclusiveMouse_;       //!< Currently applied mouse mode
+        bool                                exclusiveMouse_;       //!< Currently applied mouse mode
 
         // some internally handled states and handlers
Index: /code/branches/unity_build/src/libraries/core/input/InputState.cc
===================================================================
--- /code/branches/unity_build/src/libraries/core/input/InputState.cc	(revision 8677)
+++ /code/branches/unity_build/src/libraries/core/input/InputState.cc	(revision 8678)
@@ -37,5 +37,5 @@
         , bAlwaysGetsInput_(bAlwaysGetsInput)
         , bTransparent_(bTransparent)
-        , exclusiveMouse_(TriBool::Dontcare)
+        , exclusiveMouse_(dontcare)
         , bExpired_(true)
         , handlers_(2)
Index: /code/branches/unity_build/src/libraries/core/input/InputState.h
===================================================================
--- /code/branches/unity_build/src/libraries/core/input/InputState.h	(revision 8677)
+++ /code/branches/unity_build/src/libraries/core/input/InputState.h	(revision 8678)
@@ -38,5 +38,5 @@
 #include <boost/bind.hpp>
 
-#include "util/TriBool.h"
+#include "util/tribool.h"
 #include "InputHandler.h"
 #include "InputManager.h"
@@ -112,6 +112,6 @@
         void setHandler        (InputHandler* handler);
 
-        void setMouseExclusive(TriBool::Value value) { exclusiveMouse_ = value; this->bExpired_ = true; }
-        TriBool::Value getMouseExclusive() const { return exclusiveMouse_; }
+        void setMouseExclusive(tribool value) { exclusiveMouse_ = value; this->bExpired_ = true; }
+        tribool getMouseExclusive() const { return exclusiveMouse_; }
 
         //! Returns the name of the state (which is unique!)
@@ -166,5 +166,5 @@
         const bool                  bAlwaysGetsInput_;      //!< See class declaration for explanation
         const bool                  bTransparent_;          //!< See class declaration for explanation
-        TriBool::Value              exclusiveMouse_;        //!< See class declaration for explanation
+        tribool                     exclusiveMouse_;        //!< See class declaration for explanation
         int                         priority_;              //!< Current priority (might change)
         bool                        bExpired_;              //!< See hasExpired()
Index: de/branches/unity_build/src/libraries/util/TriBool.h
===================================================================
--- /code/branches/unity_build/src/libraries/util/TriBool.h	(revision 8677)
+++ 	(revision )
@@ -1,59 +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:
- *      ...
- *
- */
-
-/**
-    @file
-    @ingroup Util
-*/
-
-#ifndef _TriBool_H__
-#define _TriBool_H__
-
-#include "UtilPrereqs.h"
-
-// tolua_begin
-namespace orxonox
-{
-    /** Sort of a boolean value that also has state \c Dontcare
-    @remarks
-        Even though \c False has the value 0, both \c True and \c Dontcare have
-        a value other than 0. Keep that in mind when using TriBools in if statements.
-    */
-    namespace TriBool
-    {
-        enum Value
-        {
-            False    =  0,
-            True     =  1,
-            Dontcare =  2
-        };
-    }
-}
-// tolua_end
-
-#endif /* _TriBool_H__ */
Index: /code/branches/unity_build/src/libraries/util/tribool.h
===================================================================
--- /code/branches/unity_build/src/libraries/util/tribool.h	(revision 8678)
+++ /code/branches/unity_build/src/libraries/util/tribool.h	(revision 8678)
@@ -0,0 +1,228 @@
+// Three-state boolean logic library
+
+// Copyright Douglas Gregor 2002-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Modifications by Orxonox to shape the third state into 'dontcare' instead
+// of 'indeterminate'. The difference is that 'dontcare' is actually a value
+// so that (dontcare == dontcare).
+// Also removed all logic operators except for == and !=
+
+
+// For more information, see http://www.boost.org
+#ifndef ORXONOX_TRIBOOL_H
+#define ORXONOX_TRIBOOL_H
+
+namespace orxonox {
+
+// Forward declare tribool
+class tribool;
+
+/// INTERNAL ONLY
+namespace detail {
+/**
+ * INTERNAL ONLY
+ *
+ * \brief A type used only to uniquely identify the 'dontcare'
+ * function/keyword.
+ */
+struct dontcare_t
+{
+};
+
+} // end namespace detail
+
+/**
+ * INTERNAL ONLY
+ * The type of the 'dontcare' keyword. This has the same type as the
+ * function 'dontcare' so that we can recognize when the keyword is
+ * used.
+ */
+typedef bool (*dontcare_keyword_t)(tribool, detail::dontcare_t);
+
+/**
+ * \brief Keyword and test function for the dontcare tribool value
+ *
+ * The \c dontcare function has a dual role. It's first role is
+ * as a unary function that tells whether the tribool value is in the
+ * "dontcare" state. It's second role is as a keyword
+ * representing the dontcare (just like "true" and "false"
+ * represent the true and false states).
+ *
+ * \returns <tt>x.value == tribool::dontcare_value</tt>
+ * \throws nothrow
+ */
+inline bool
+dontcare(tribool x, detail::dontcare_t dummy = detail::dontcare_t());
+
+/**
+ * \brief A 3-state boolean type.
+ *
+ * 3-state boolean values are either true, false, or
+ * dontcare.
+ */
+class tribool
+{
+public:
+  /**
+   * Construct a new 3-state boolean value with the value 'false'.
+   *
+   * \throws nothrow
+   */
+  tribool() : value(false_value) {}
+
+  /**
+   * Construct a new 3-state boolean value with the given boolean
+   * value, which may be \c true or \c false.
+   *
+   * \throws nothrow
+   */
+  tribool(bool value) : value(value? true_value : false_value) {}
+
+  /**
+   * Construct a new 3-state boolean value with an dontcare value.
+   *
+   * \throws nothrow
+   */
+  tribool(dontcare_keyword_t) : value(dontcare_value) {}
+
+  /**
+   * The actual stored value in this 3-state boolean, which may be false, true,
+   * or dontcare.
+   */
+  enum value_t { false_value, true_value, dontcare_value } value;
+};
+
+// Check if the given tribool has an dontcare value. Also doubles as a
+// keyword for the 'dontcare' value
+inline bool dontcare(tribool x, detail::dontcare_t)
+{
+  return x.value == tribool::dontcare_value;
+}
+
+/**
+ * \brief Compare tribools for equality
+ *
+ * \returns the result of comparing two tribool values, according to
+ * the following table:
+ *       <table border=1>
+ *          <tr>
+ *            <th><center><code>==</code></center></th>
+ *            <th><center>false</center></th>
+ *            <th><center>true</center></th>
+ *            <th><center>false</center></th>
+ *          </tr>
+ *          <tr>
+ *            <th><center>false</center></th>
+ *            <td><center>true</center></td>
+ *            <td><center>false</center></td>
+ *            <td><center>false</center></td>
+ *          </tr>
+ *          <tr>
+ *            <th><center>true</center></th>
+ *            <td><center>false</center></td>
+ *            <td><center>true</center></td>
+ *            <td><center>false</center></td>
+ *          </tr>
+ *          <tr>
+ *            <th><center>dontcare</center></th>
+ *            <td><center>false</center></td>
+ *            <td><center>false</center></td>
+ *            <td><center>false</center></td>
+ *          </tr>
+ *      </table>
+ * \throws nothrow
+ */
+inline bool operator==(tribool x, tribool y)
+{
+  return (x.value == y.value);
+}
+
+/**
+ * \overload
+ */
+inline bool operator==(tribool x, bool y) { return x == tribool(y); }
+
+/**
+ * \overload
+ */
+inline bool operator==(bool x, tribool y) { return tribool(x) == y; }
+
+/**
+ * \overload
+ */
+inline bool operator==(dontcare_keyword_t, tribool x)
+{ return tribool(dontcare) == x; }
+
+/**
+ * \overload
+ */
+inline bool operator==(tribool x, dontcare_keyword_t)
+{ return tribool(dontcare) == x; }
+
+/**
+ * \brief Compare tribools for inequality
+ *
+ * \returns the result of comparing two tribool values for inequality,
+ * according to the following table:
+ *       <table border=1>
+ *           <tr>
+ *             <th><center><code>!=</code></center></th>
+ *             <th><center>false</center></th>
+ *             <th><center>true</center></th>
+ *             <th><center>dontcare</center></th>
+ *           </tr>
+ *           <tr>
+ *             <th><center>false</center></th>
+ *             <td><center>false</center></td>
+ *             <td><center>true</center></td>
+ *             <td><center>true</center></td>
+ *           </tr>
+ *           <tr>
+ *             <th><center>true</center></th>
+ *             <td><center>true</center></td>
+ *             <td><center>false</center></td>
+ *             <td><center>true</center></td>
+ *           </tr>
+ *           <tr>
+ *             <th><center>true</center></th>
+ *             <td><center>true</center></td>
+ *             <td><center>true</center></td>
+ *             <td><center>false</center></td>
+ *           </tr>
+ *       </table>
+ * \throws nothrow
+ */
+inline bool operator!=(tribool x, tribool y)
+{
+  return !(x == y);
+}
+
+/**
+ * \overload
+ */
+inline bool operator!=(tribool x, bool y) { return x != tribool(y); }
+
+/**
+ * \overload
+ */
+inline bool operator!=(bool x, tribool y) { return tribool(x) != y; }
+
+/**
+ * \overload
+ */
+inline bool operator!=(dontcare_keyword_t, tribool x)
+{ return tribool(dontcare) != x; }
+
+/**
+ * \overload
+ */
+inline bool operator!=(tribool x, dontcare_keyword_t)
+{ return x != tribool(dontcare); }
+
+} // end namespace orxonox
+
+#endif // ORXONOX_TRIBOOL_H
+
Index: /code/branches/unity_build/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- /code/branches/unity_build/src/orxonox/gamestates/GSLevel.cc	(revision 8677)
+++ /code/branches/unity_build/src/orxonox/gamestates/GSLevel.cc	(revision 8678)
@@ -77,10 +77,10 @@
         {
             gameInputState_ = InputManager::getInstance().createInputState("game");
-            gameInputState_->setMouseExclusive(TriBool::True);
+            gameInputState_->setMouseExclusive(true);
             gameInputState_->setHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
             KeyBinderManager::getInstance().setToDefault();
 
             guiMouseOnlyInputState_ = InputManager::getInstance().createInputState("guiMouseOnly");
-            guiMouseOnlyInputState_->setMouseExclusive(TriBool::True);
+            guiMouseOnlyInputState_->setMouseExclusive(true);
             guiMouseOnlyInputState_->setMouseHandler(&GUIManager::getInstance());
 
