]> git.jsancho.org Git - lugaru.git/blobdiff - Source/main.cpp
Stopped using Account pointers, and removed general difficulty setting (difficulty...
[lugaru.git] / Source / main.cpp
index c50e893b67ef572a4457bd61fcc4dcd3d36167b6..09a10cb9d785429d6e9a2e96806b69cb73fcb157 100644 (file)
@@ -55,6 +55,8 @@ extern float slomospeed;
 extern float slomofreq;
 extern bool visibleloading;
 
+extern int difficulty;
+
 extern SDL_Window *sdlwindow;
 
 using namespace std;
@@ -581,6 +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." },
+    {DEVTOOLS,          0,                      "d",    "devtools",         option::Arg::None,  " -d, --devtools    Enable dev tools: console, level editor and debug info." },
     {0,0,0,0,0,0}
 };
 
@@ -623,7 +626,9 @@ int main(int argc, char **argv)
 
     LOGFUNC;
 
+#ifdef NDEBUG
     try {
+#endif
         {
             newGame();
 
@@ -632,6 +637,10 @@ int main(int argc, char **argv)
                 return 42;
             }
 
+            if (commandLineOptions[DEVTOOLS]) {
+                devtools = true;
+            }
+
             bool gameDone = false;
             bool gameFocused = true;
 
@@ -674,6 +683,7 @@ int main(int argc, char **argv)
         CleanUp ();
 
         return 0;
+#ifdef NDEBUG
     } catch (const std::exception& error) {
         CleanUp();
 
@@ -686,4 +696,5 @@ int main(int argc, char **argv)
 
         return -1;
     }
+#endif
 }