X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2Fmain.cpp;h=79c139f8ae9a70df92d3edcb4472f092ffe0f062;hb=8b8230c564e1f0063b381e77bf6222af9f2e678d;hp=c50e893b67ef572a4457bd61fcc4dcd3d36167b6;hpb=e4d3d3f1df59e142d358503b8c41dfb1db4f4231;p=lugaru.git diff --git a/Source/main.cpp b/Source/main.cpp index c50e893..79c139f 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; @@ -576,11 +577,10 @@ const option::Descriptor usage[] = {FULLSCREEN, 0, "w", "windowed", option::Arg::None, " -w, --windowed Start the game in windowed mode (default)." }, {NOMOUSEGRAB, 1, "", "nomousegrab", option::Arg::None, " --nomousegrab Disable mousegrab." }, {NOMOUSEGRAB, 0, "", "mousegrab", option::Arg::None, " --mousegrab Enable mousegrab (default)." }, - {SOUND, OPENAL_OUTPUT_NOSOUND, "", "nosound", option::Arg::None, " --nosound Disable sound." }, - {SOUND, OPENAL_OUTPUT_ALSA, "", "force-alsa", option::Arg::None, " --force-alsa Force use of ALSA back-end." }, - {SOUND, OPENAL_OUTPUT_OSS, "", "force-oss", option::Arg::None, " --force-oss Force use of OSS back-end." }, + {SOUND, 1, "", "nosound", option::Arg::None, " --nosound Disable sound." }, {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 +623,9 @@ int main(int argc, char **argv) LOGFUNC; +#ifdef NDEBUG try { +#endif { newGame(); @@ -632,6 +634,10 @@ int main(int argc, char **argv) return 42; } + if (commandLineOptions[DEVTOOLS]) { + devtools = true; + } + bool gameDone = false; bool gameFocused = true; @@ -674,6 +680,7 @@ int main(int argc, char **argv) CleanUp (); return 0; +#ifdef NDEBUG } catch (const std::exception& error) { CleanUp(); @@ -686,4 +693,5 @@ int main(int argc, char **argv) return -1; } +#endif }