#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>
extern float slomofreq;
extern bool visibleloading;
+extern int difficulty;
+
extern SDL_Window *sdlwindow;
using namespace std;
{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}
};
return 1;
}
- debugmode = commandLineOptions[DEBUG];
-
// !!! FIXME: we could use a Win32 API for this. --ryan.
#ifndef WIN32
chdirToAppPath(argv[0]);
LOGFUNC;
- //~ try {
+#ifdef NDEBUG
+ try {
+#endif
{
newGame();
return 42;
}
+ if (commandLineOptions[DEVTOOLS]) {
+ devtools = true;
+ }
+
bool gameDone = false;
bool gameFocused = true;
CleanUp ();
return 0;
- //~ } catch (const std::exception& error) {
- //~ CleanUp();
+#ifdef NDEBUG
+ } catch (const std::exception& error) {
+ CleanUp();
- //~ std::string e = "Caught exception: ";
- //~ e += error.what();
+ std::string e = "Caught exception: ";
+ e += error.what();
- //~ LOG(e);
+ LOG(e);
- //~ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Exception catched", error.what(), NULL);
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Exception catched", error.what(), NULL);
- //~ return -1;
- //~ }
+ return -1;
+ }
+#endif
}