Index: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt	(revision 1076)
+++ code/trunk/CMakeLists.txt	(revision 1084)
@@ -93,5 +93,4 @@
 #generate lua bind source files
 EXECUTE_PROCESS(COMMAND bin/./tolua-exec-script)
-EXECUTE_PROCESS(COMMAND ls)
 
 #add main source dir
Index: code/trunk/bin/levels/sample.oxw
===================================================================
--- code/trunk/bin/levels/sample.oxw	(revision 1076)
+++ code/trunk/bin/levels/sample.oxw	(revision 1084)
@@ -115,5 +115,5 @@
 
 <?lua
-for i = 1, 226, 1 
+for i = 1, 2, 1 
 do ?>
   <Model position="<?lua print(math.random(-19597, 18732))?>, <?lua print(math.random(-19597, 18732)) ?>, <?lua print(math.random(-19597, 18732)) ?>" scale="<?lua print(math.random( 20, 119)) ?>" mesh="ast<?lua print(i%6 + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random(16, 44)) ?>" />
Index: code/trunk/src/core/CMakeLists.txt
===================================================================
--- code/trunk/src/core/CMakeLists.txt	(revision 1076)
+++ code/trunk/src/core/CMakeLists.txt	(revision 1084)
@@ -1,6 +1,4 @@
 #get the created files
 AUX_SOURCE_DIRECTORY(tolua TOLUA_BIND_FILES) 
-
-MESSAGE(STATUS "tolua sources: ${TOLUA_BIND_FILES}")
 
 SET( CORE_SRC_FILES
Index: code/trunk/src/core/InputManager.cc
===================================================================
--- code/trunk/src/core/InputManager.cc	(revision 1076)
+++ code/trunk/src/core/InputManager.cc	(revision 1084)
@@ -39,7 +39,10 @@
 #include "InputHandler.h"
 #include "InputBuffer.h"
+#include "ConsoleCommand.h"
 
 namespace orxonox
 {
+  ConsoleCommand(InputManager, setInputMode, AccessLevel::Admin, true).setDefaultValue(0, IM_INGAME);
+
   /**
     @brief Constructor only resets the pointer values to 0.
@@ -227,7 +230,8 @@
     @remark Only has an affect if the mode actually changes
   */
-  void InputManager::setInputMode(InputMode mode)
-  {
-    this->setMode_ = mode;
+  void InputManager::setInputMode(int mode)
+  {
+    if (mode > 0 && mode < 4)
+      getSingleton().setMode_ = (InputMode)mode;
   }
 
Index: code/trunk/src/core/InputManager.h
===================================================================
--- code/trunk/src/core/InputManager.h	(revision 1076)
+++ code/trunk/src/core/InputManager.h	(revision 1084)
@@ -72,5 +72,4 @@
     void tick(float dt);
     void setWindowExtents(int width, int height);
-    void setInputMode(InputMode mode);
     InputMode getInputMode();
 
@@ -84,4 +83,5 @@
     static InputManager& getSingleton();
     static InputManager* getSingletonPtr() { return &getSingleton(); }
+    static void setInputMode(int mode);
 
   private:
Index: code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- code/trunk/src/orxonox/Orxonox.cc	(revision 1076)
+++ code/trunk/src/orxonox/Orxonox.cc	(revision 1084)
@@ -115,4 +115,8 @@
       {
         this->ib_->removeLast();
+      }
+      void exit() const
+      {
+        CommandExecutor::execute("setInputMode 2");
       }
 
@@ -405,4 +409,5 @@
     ib->registerListener(console, &Testconsole::clear, '§', true);
     ib->registerListener(console, &Testconsole::removeLast, '\b', true);
+    ib->registerListener(console, &Testconsole::exit, (char)0x1B, true);
 
     // first check whether ogre root object has been created
@@ -452,6 +457,6 @@
       {
         (it)->tick((float)evt.timeSinceLastFrame * this->timefactor_);
-         it++;
-     }
+        it++;
+      }
 
       // don't forget to call _fireFrameStarted in ogre to make sure
Index: code/trunk/src/util/CMakeLists.txt
===================================================================
--- code/trunk/src/util/CMakeLists.txt	(revision 1076)
+++ code/trunk/src/util/CMakeLists.txt	(revision 1084)
@@ -1,4 +1,3 @@
 AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES)
-AUX_SOURCE_DIRECTORY(tolua   TOLUA_SRC_FILES)
 
 SET (UTIL_SRC_FILES
@@ -11,6 +10,10 @@
   MultiTypeString.cc
   MultiTypeMath.cc
+  tolua_event.c
+  tolua_is.c
+  tolua_map.c
+  tolua_push.c
+  tolua_to.c
   ${TINYXML_SRC_FILES}
-  ${TOLUA_SRC_FILES}
 )
 
Index: code/trunk/visual_studio/base_properties.vsprops
===================================================================
--- code/trunk/visual_studio/base_properties.vsprops	(revision 1076)
+++ code/trunk/visual_studio/base_properties.vsprops	(revision 1084)
@@ -8,5 +8,5 @@
 	<Tool
 		Name="VCCLCompilerTool"
-		AdditionalIncludeDirectories="&quot;$(RootDir)src&quot;;&quot;$(RootDir)src\orxonox&quot;;&quot;$(DependencyDir)include&quot;"
+		AdditionalIncludeDirectories="&quot;$(RootDir)src&quot;;&quot;$(RootDir)src\orxonox&quot;;&quot;$(RootDir)src\util\tolua&quot;;&quot;$(DependencyDir)include&quot;"
 		PreprocessorDefinitions="WIN32;__WIN32__;_WIN32;BOOST_ALL_DYN_LINK;OIS_DYNAMIC_LIB; ZLIB_WINAPI"
 		WarningLevel="3"
Index: code/trunk/visual_studio/base_properties_debug.vsprops
===================================================================
--- code/trunk/visual_studio/base_properties_debug.vsprops	(revision 1076)
+++ code/trunk/visual_studio/base_properties_debug.vsprops	(revision 1084)
@@ -13,5 +13,5 @@
 		BasicRuntimeChecks="3"
 		RuntimeLibrary="3"
-		DebugInformationFormat="4"
+		DebugInformationFormat="3"
 	/>
 	<Tool
Index: code/trunk/visual_studio/core_properties.vsprops
===================================================================
--- code/trunk/visual_studio/core_properties.vsprops	(revision 1076)
+++ code/trunk/visual_studio/core_properties.vsprops	(revision 1084)
@@ -12,5 +12,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CS).lib OIS$(CSS).lib lua$(CS).lib"
+		AdditionalDependencies="OgreMain$(CSS).lib OIS$(CS).lib lua51$(CS).lib"
 	/>
 </VisualStudioPropertySheet>
Index: code/trunk/visual_studio/network_properties.vsprops
===================================================================
--- code/trunk/visual_studio/network_properties.vsprops	(revision 1076)
+++ code/trunk/visual_studio/network_properties.vsprops	(revision 1084)
@@ -12,5 +12,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="enet$(CSS).lib zlib$(CSS).lib"
+		AdditionalDependencies="enet$(CS).lib zlib$(CS).lib"
 		IgnoreDefaultLibraryNames="LIBCMT;LIBCMTD"
 	/>
Index: code/trunk/visual_studio/orxonox_properties.vsprops
===================================================================
--- code/trunk/visual_studio/orxonox_properties.vsprops	(revision 1076)
+++ code/trunk/visual_studio/orxonox_properties.vsprops	(revision 1084)
@@ -14,5 +14,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CS).lib OIS$(CSS).lib"
+		AdditionalDependencies="OgreMain$(CSS).lib OIS$(CS).lib"
 		OutputFile="$(OutDir)$(ProjectName)$(CS).exe"
 		IgnoreDefaultLibraryNames=""
Index: code/trunk/visual_studio/tolua++_properties.vsprops
===================================================================
--- code/trunk/visual_studio/tolua++_properties.vsprops	(revision 1076)
+++ code/trunk/visual_studio/tolua++_properties.vsprops	(revision 1084)
@@ -6,7 +6,3 @@
 	InheritedPropertySheets=".\directory_properties.vsprops"
 	>
-	<Tool
-		Name="VCLinkerTool"
-		AdditionalDependencies="lua$(CS).lib"
-	/>
 </VisualStudioPropertySheet>
Index: code/trunk/visual_studio/util_properties.vsprops
===================================================================
--- code/trunk/visual_studio/util_properties.vsprops	(revision 1076)
+++ code/trunk/visual_studio/util_properties.vsprops	(revision 1084)
@@ -12,5 +12,5 @@
 	<Tool
 		Name="VCLinkerTool"
-		AdditionalDependencies="OgreMain$(CS).lib"
+		AdditionalDependencies="OgreMain$(CSS).lib"
 	/>
 </VisualStudioPropertySheet>
Index: code/trunk/visual_studio/vc8/core.vcproj
===================================================================
--- code/trunk/visual_studio/vc8/core.vcproj	(revision 1076)
+++ code/trunk/visual_studio/vc8/core.vcproj	(revision 1084)
@@ -249,11 +249,22 @@
 			</File>
 			<File
-				RelativePath="..\..\src\core\ToLuaBind.cc"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\core\XMLPort.cc"
 				>
 			</File>
+			<Filter
+				Name="tolua"
+				>
+				<File
+					RelativePath="..\..\src\core\tolua\tolua_bind.cc"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+						/>
+					</FileConfiguration>
+				</File>
+			</Filter>
 		</Filter>
 		<Filter
@@ -411,11 +422,15 @@
 			</File>
 			<File
-				RelativePath="..\..\src\core\ToLuaBind.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\core\XMLPort.h"
 				>
 			</File>
+			<Filter
+				Name="tolua"
+				>
+				<File
+					RelativePath="..\..\src\core\tolua\tolua_bind.h"
+					>
+				</File>
+			</Filter>
 		</Filter>
 	</Files>
Index: code/trunk/visual_studio/vc8/tolua++.vcproj
===================================================================
--- code/trunk/visual_studio/vc8/tolua++.vcproj	(revision 1076)
+++ code/trunk/visual_studio/vc8/tolua++.vcproj	(revision 1084)
@@ -133,4 +133,12 @@
 				RelativePath="..\..\src\util\tolua\tolua.c"
 				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
 			</File>
 			<File
@@ -157,4 +165,12 @@
 				RelativePath="..\..\src\util\tolua\toluabind.c"
 				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
 			</File>
 		</Filter>
