]> git.jsancho.org Git - lugaru.git/blobdiff - Source/main.cpp
Sorted all source files in folders
[lugaru.git] / Source / main.cpp
index 4ff4ebc29d788e0063ef18e70bbe2b0e1b44686b..2144a8cf9c8612187fcdfd712ea71434f9518fa9 100644 (file)
@@ -25,15 +25,15 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include <iostream>
 #include <zlib.h>
 #include <set>
-#include "gamegl.h"
 #include "MacCompatibility.h"
-#include "Settings.h"
+#include "Graphic/gamegl.h"
+#include "User/Settings.h"
 
 #include "Game.h"
 
 using namespace Game;
 
-#include "openal_wrapper.h"
+#include "Audio/openal_wrapper.h"
 
 #ifdef WIN32
 #include <windows.h>
@@ -55,6 +55,8 @@ extern float slomospeed;
 extern float slomofreq;
 extern bool visibleloading;
 
+extern int difficulty;
+
 extern SDL_Window *sdlwindow;
 
 using namespace std;
@@ -581,7 +583,7 @@ const option::Descriptor usage[] =
     {SOUND,             OPENAL_OUTPUT_OSS,      "",     "force-oss",        option::Arg::None,  " --force-oss       Force use of OSS back-end." },
     {OPENALINFO,        0,                      "",     "openal-info",      option::Arg::None,  " --openal-info     Print info about OpenAL at launch." },
     {SHOWRESOLUTIONS,   0,                      "",     "showresolutions",  option::Arg::None,  " --showresolutions List the resolutions found by SDL at launch." },
-    {DEBUG,             0,                      "d",     "debug",           option::Arg::None,  " -d, --debug       Activates console, level editor and debug information." },
+    {DEVTOOLS,          0,                      "d",    "devtools",         option::Arg::None,  " -d, --devtools    Enable dev tools: console, level editor and debug info." },
     {0,0,0,0,0,0}
 };
 
@@ -617,8 +619,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    debugmode = commandLineOptions[DEBUG];
-
     // !!! FIXME: we could use a Win32 API for this.  --ryan.
 #ifndef WIN32
     chdirToAppPath(argv[0]);
@@ -626,7 +626,9 @@ int main(int argc, char **argv)
 
     LOGFUNC;
 
+#ifdef NDEBUG
     try {
+#endif
         {
             newGame();
 
@@ -635,6 +637,10 @@ int main(int argc, char **argv)
                 return 42;
             }
 
+            if (commandLineOptions[DEVTOOLS]) {
+                devtools = true;
+            }
+
             bool gameDone = false;
             bool gameFocused = true;
 
@@ -677,6 +683,7 @@ int main(int argc, char **argv)
         CleanUp ();
 
         return 0;
+#ifdef NDEBUG
     } catch (const std::exception& error) {
         CleanUp();
 
@@ -689,4 +696,5 @@ int main(int argc, char **argv)
 
         return -1;
     }
+#endif
 }