diff --git a/oneshot.conf b/oneshot.conf index 3dd6622..af99499 100644 --- a/oneshot.conf +++ b/oneshot.conf @@ -176,3 +176,8 @@ # this number. Maximum: 64. # # SE.sourceCount=6 + +# [Windows only] Alloc console +# Launch a console window with debug information along with the game. +# +# Windows_AllocConsole=false diff --git a/src/config.cpp b/src/config.cpp index cfaa8c1..8bddd62 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -90,8 +90,9 @@ void Config::read(int argc, char *argv[]){ PO_DESC(allowSymlinks, bool, false) \ PO_DESC(iconPath, std::string, "") \ PO_DESC(SE.sourceCount, int, 6) \ - PO_DESC(pathCache, bool, true) - + PO_DESC(pathCache, bool, true) \ + PO_DESC(Windows_AllocConsole, bool, false) + // Not gonna take your shit boost #define GUARD_ALL( exp ) try { exp } catch(...) {} diff --git a/src/config.h b/src/config.h index e08db1f..2f4f510 100644 --- a/src/config.h +++ b/src/config.h @@ -34,6 +34,7 @@ struct Config{ bool printFPS; bool fullscreen; bool fixedAspectRatio; + bool Windows_AllocConsole; bool smoothScaling; bool vsync; bool EnableSixteenByNine; diff --git a/src/main.cpp b/src/main.cpp index c16f7a0..36890a0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -111,9 +111,9 @@ int rgssThreadFun(void *userdata){ SDL_GL_SwapWindow(win); Debug() << "[main] GL Vendor :" << glGetStringInt(GL_VENDOR); - Debug() << "[main] GL Renderer :" << glGetStringInt(GL_RENDERER); - Debug() << "[main] GL Version :" << glGetStringInt(GL_VERSION); - Debug() << "[main] GLSL Version :" << glGetStringInt(GL_SHADING_LANGUAGE_VERSION); + Debug() << "[main] GL Renderer :" << glGetStringInt(GL_RENDERER); + Debug() << "[main] GL Version :" << glGetStringInt(GL_VERSION); + Debug() << "[main] GLSL Version :" << glGetStringInt(GL_SHADING_LANGUAGE_VERSION); bool vsync = conf.vsync || conf.syncToRefreshrate; SDL_GL_SetSwapInterval(vsync ? 1 : 0); @@ -218,6 +218,15 @@ static void setGamePathInRegistry() { } int main(int argc, char *argv[]){ char msg[512]; + /* now we load the config */ + Config conf; + conf.read(argc, argv); + #if defined WIN32 + if(conf.Windows_AllocConsole == true){ + + } + #endif + loadLanguageMetadata(); //there will be a segfault on fclose if I don't move it here SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); @@ -267,10 +276,6 @@ int main(int argc, char *argv[]){ /* Initialize physfs here so that config can call PHYSFS_getPrefDir */ PHYSFS_init(argv[0]); - /* now we load the config */ - Config conf; - conf.read(argc, argv); - if (!conf.gameFolder.empty()) if (chdir(conf.gameFolder.c_str()) != 0){ showInitError(std::string("Unable to switch into gameFolder ") + conf.gameFolder);