diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index a43bd01d4..8fb9ea033 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -1,5 +1,7 @@ #ifdef USE_SDL +#include +#include #include #include "SDL.h" #ifdef WIN32 @@ -22,6 +24,7 @@ #include "interface/Label.h" #include "simulation/SaveRenderer.h" #include "client/Client.h" +#include "Misc.h" #include "game/GameController.h" #include "game/GameView.h" @@ -128,6 +131,67 @@ SDL_Surface * SDLOpen() return surface; } +std::map readArguments(int argc, char * argv[]) +{ + std::map arguments; + + //Defaults + arguments["scale"] = ""; + arguments["proxy"] = ""; + arguments["nohud"] = "false"; + arguments["sound"] = "false"; + arguments["kiosk"] = "false"; + arguments["scripts"] = "false"; + arguments["open"] = ""; + arguments["ddir"] = ""; + arguments["ptsave"] = ""; + + for (int i=1; i arguments = readArguments(argc, argv); + sdl_scrn = SDLOpen(); #ifdef OGLI SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1); @@ -151,8 +217,6 @@ int main(int argc, char * argv[]) GameController * gameController = new GameController(); engine->ShowWindow(gameController->GetView()); - //new ErrorMessage("Error", "This is a test error message"); - SDL_Event event; while(engine->Running()) {