[Orxonox-commit 2718] r7423 - in sandbox_qt/src: . orxonox

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Sep 12 13:39:02 CEST 2010


Author: rgrieder
Date: 2010-09-12 13:39:02 +0200 (Sun, 12 Sep 2010)
New Revision: 7423

Modified:
   sandbox_qt/src/CMakeLists.txt
   sandbox_qt/src/Orxonox.cc
   sandbox_qt/src/orxonox/CMakeLists.txt
   sandbox_qt/src/orxonox/Main.cc
   sandbox_qt/src/orxonox/Main.h
Log:
Sorted out application entry point.

Modified: sandbox_qt/src/CMakeLists.txt
===================================================================
--- sandbox_qt/src/CMakeLists.txt	2010-09-12 05:55:04 UTC (rev 7422)
+++ sandbox_qt/src/CMakeLists.txt	2010-09-12 11:39:02 UTC (rev 7423)
@@ -93,6 +93,7 @@
   # When defined as WIN32 this removes the console window on Windows
   ${ORXONOX_WIN32}
   LINK_LIBRARIES
+    ${QT_QTMAIN_LIBRARY}
     orxonox
   SOURCE_FILES
     Orxonox.cc

Modified: sandbox_qt/src/Orxonox.cc
===================================================================
--- sandbox_qt/src/Orxonox.cc	2010-09-12 05:55:04 UTC (rev 7422)
+++ sandbox_qt/src/Orxonox.cc	2010-09-12 11:39:02 UTC (rev 7423)
@@ -33,15 +33,8 @@
     Entry point of the program.
 */
 
-#include "SpecialConfig.h"
+#include "OrxonoxConfig.h"
 
-#ifdef ORXONOX_USE_WINMAIN
-# ifndef WIN32_LEAN_AND_MEAN
-#  define WIN32_LEAN_AND_MEAN
-# endif
-#include <windows.h>
-#endif
-
 #include "util/Debug.h"
 #include "util/Exception.h"
 #include "orxonox/Main.h"
@@ -50,21 +43,11 @@
 @brief
     Main method. Game starts here (except for static initialisations).
 */
-#ifdef ORXONOX_USE_WINMAIN
-INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
-#else
 int main(int argc, char** argv)
-#endif
 {
     try
     {
-#ifndef ORXONOX_USE_WINMAIN
-        std::string strCmdLine;
-        for (int i = 1; i < argc; ++i)
-            strCmdLine = strCmdLine + argv[i] + ' ';
-#endif
-
-        return orxonox::main(strCmdLine);
+        return orxonox::main(argc, argv);
     }
     catch (...)
     {

Modified: sandbox_qt/src/orxonox/CMakeLists.txt
===================================================================
--- sandbox_qt/src/orxonox/CMakeLists.txt	2010-09-12 05:55:04 UTC (rev 7422)
+++ sandbox_qt/src/orxonox/CMakeLists.txt	2010-09-12 11:39:02 UTC (rev 7423)
@@ -32,6 +32,7 @@
   FIND_HEADER_FILES
   LINK_LIBRARIES
     ${QT_QTCORE_LIBRARY}
+    ${QT_QTGUI_LIBRARY}
     util
     core
   SOURCE_FILES ${ORXONOX_SRC_FILES}

Modified: sandbox_qt/src/orxonox/Main.cc
===================================================================
--- sandbox_qt/src/orxonox/Main.cc	2010-09-12 05:55:04 UTC (rev 7422)
+++ sandbox_qt/src/orxonox/Main.cc	2010-09-12 11:39:02 UTC (rev 7423)
@@ -35,6 +35,9 @@
 
 #include "OrxonoxPrereqs.h"
 
+#include <QApplication>
+#include <QCoreApplication>
+
 #include "core/Game.h"
 #include "Main.h"
 
@@ -44,15 +47,17 @@
     @brief
         Starting point of orxonox (however not the entry point of the program!)
     */
-    int main(const std::string& strCmdLine)
+    int main(int argc, char** argv)
     {
-        Game* game = new Game(strCmdLine);
+        QApplication app(argc, argv);
 
+        QCoreApplication::setOrganizationName("");
+        QCoreApplication::setOrganizationDomain("");
+        QCoreApplication::setApplicationName("");
+
         //if (CommandLineParser::getValue("generateDoc").getString().empty())
-        //    game->run();
 
-        delete game;
-
-        return 0;
+        return app.exec();
+        //return 0;
     }
 }

Modified: sandbox_qt/src/orxonox/Main.h
===================================================================
--- sandbox_qt/src/orxonox/Main.h	2010-09-12 05:55:04 UTC (rev 7422)
+++ sandbox_qt/src/orxonox/Main.h	2010-09-12 11:39:02 UTC (rev 7423)
@@ -34,7 +34,7 @@
 
 namespace orxonox
 {
-    _OrxonoxExport int main(const std::string& strCmdLine);
+    _OrxonoxExport int main(int argc, char** argv);
 }
 
 #endif /* _Main_H__ */




More information about the Orxonox-commit mailing list