]> git.jsancho.org Git - lugaru.git/blobdiff - Source/main.cpp
Oops, should be ifdef not ifndef
[lugaru.git] / Source / main.cpp
index c50e893b67ef572a4457bd61fcc4dcd3d36167b6..2803226a0f4daeed83e077e173e835688562d2e0 100644 (file)
@@ -581,6 +581,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." },
     {0,0,0,0,0,0}
 };
 
@@ -616,6 +617,8 @@ 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]);
@@ -623,7 +626,9 @@ int main(int argc, char **argv)
 
     LOGFUNC;
 
+#ifdef NDEBUG
     try {
+#endif
         {
             newGame();
 
@@ -674,6 +679,7 @@ int main(int argc, char **argv)
         CleanUp ();
 
         return 0;
+#ifdef NDEBUG
     } catch (const std::exception& error) {
         CleanUp();
 
@@ -686,4 +692,5 @@ int main(int argc, char **argv)
 
         return -1;
     }
+#endif
 }