X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2Fmain.cpp;h=1ee05a5b0494cb53940c7f3f4f9fed7582a51547;hb=b32cd80b243d77cd80e026c7ae73e33ec39b1de9;hp=4ff4ebc29d788e0063ef18e70bbe2b0e1b44686b;hpb=f8b5a2099dbe702e15dc5d010c7bc2e545b9cd74;p=lugaru.git
diff --git a/Source/main.cpp b/Source/main.cpp
index 4ff4ebc..1ee05a5 100644
--- a/Source/main.cpp
+++ b/Source/main.cpp
@@ -18,27 +18,27 @@ You should have received a copy of the GNU General Public License
along with Lugaru. If not, see .
*/
+#include "Game.hpp"
+
+#include "Audio/openal_wrapper.hpp"
+#include "Graphic/gamegl.hpp"
+#include "MacCompatibility.hpp"
+#include "User/Settings.hpp"
+
+#include
+#include
#include
+#include
#include
#include
-#include
-#include
#include
-#include
-#include "gamegl.h"
-#include "MacCompatibility.h"
-#include "Settings.h"
-
-#include "Game.h"
using namespace Game;
-#include "openal_wrapper.h"
-
#ifdef WIN32
-#include
#include
-#include "win-res/resource.h"
+#include
+#include "win-res/resource.hpp"
#endif
extern float multiplier;
@@ -53,7 +53,8 @@ extern int mainmenu;
extern float slomospeed;
extern float slomofreq;
-extern bool visibleloading;
+
+extern int difficulty;
extern SDL_Window *sdlwindow;
@@ -581,7 +582,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 +618,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 +625,9 @@ int main(int argc, char **argv)
LOGFUNC;
+#ifdef NDEBUG
try {
+#endif
{
newGame();
@@ -635,6 +636,10 @@ int main(int argc, char **argv)
return 42;
}
+ if (commandLineOptions[DEVTOOLS]) {
+ devtools = true;
+ }
+
bool gameDone = false;
bool gameFocused = true;
@@ -677,6 +682,7 @@ int main(int argc, char **argv)
CleanUp ();
return 0;
+#ifdef NDEBUG
} catch (const std::exception& error) {
CleanUp();
@@ -689,4 +695,5 @@ int main(int argc, char **argv)
return -1;
}
+#endif
}