mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Windows_AllocConsole config
This commit is contained in:
parent
3a9f437e83
commit
c3b0565714
4 changed files with 21 additions and 9 deletions
|
|
@ -176,3 +176,8 @@
|
||||||
# this number. Maximum: 64.
|
# this number. Maximum: 64.
|
||||||
#
|
#
|
||||||
# SE.sourceCount=6
|
# SE.sourceCount=6
|
||||||
|
|
||||||
|
# [Windows only] Alloc console
|
||||||
|
# Launch a console window with debug information along with the game.
|
||||||
|
#
|
||||||
|
# Windows_AllocConsole=false
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,9 @@ void Config::read(int argc, char *argv[]){
|
||||||
PO_DESC(allowSymlinks, bool, false) \
|
PO_DESC(allowSymlinks, bool, false) \
|
||||||
PO_DESC(iconPath, std::string, "") \
|
PO_DESC(iconPath, std::string, "") \
|
||||||
PO_DESC(SE.sourceCount, int, 6) \
|
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
|
// Not gonna take your shit boost
|
||||||
#define GUARD_ALL( exp ) try { exp } catch(...) {}
|
#define GUARD_ALL( exp ) try { exp } catch(...) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ struct Config{
|
||||||
bool printFPS;
|
bool printFPS;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool fixedAspectRatio;
|
bool fixedAspectRatio;
|
||||||
|
bool Windows_AllocConsole;
|
||||||
bool smoothScaling;
|
bool smoothScaling;
|
||||||
bool vsync;
|
bool vsync;
|
||||||
bool EnableSixteenByNine;
|
bool EnableSixteenByNine;
|
||||||
|
|
|
||||||
19
src/main.cpp
19
src/main.cpp
|
|
@ -111,9 +111,9 @@ int rgssThreadFun(void *userdata){
|
||||||
SDL_GL_SwapWindow(win);
|
SDL_GL_SwapWindow(win);
|
||||||
|
|
||||||
Debug() << "[main] GL Vendor :" << glGetStringInt(GL_VENDOR);
|
Debug() << "[main] GL Vendor :" << glGetStringInt(GL_VENDOR);
|
||||||
Debug() << "[main] GL Renderer :" << glGetStringInt(GL_RENDERER);
|
Debug() << "[main] GL Renderer :" << glGetStringInt(GL_RENDERER);
|
||||||
Debug() << "[main] GL Version :" << glGetStringInt(GL_VERSION);
|
Debug() << "[main] GL Version :" << glGetStringInt(GL_VERSION);
|
||||||
Debug() << "[main] GLSL Version :" << glGetStringInt(GL_SHADING_LANGUAGE_VERSION);
|
Debug() << "[main] GLSL Version :" << glGetStringInt(GL_SHADING_LANGUAGE_VERSION);
|
||||||
|
|
||||||
bool vsync = conf.vsync || conf.syncToRefreshrate;
|
bool vsync = conf.vsync || conf.syncToRefreshrate;
|
||||||
SDL_GL_SetSwapInterval(vsync ? 1 : 0);
|
SDL_GL_SetSwapInterval(vsync ? 1 : 0);
|
||||||
|
|
@ -218,6 +218,15 @@ static void setGamePathInRegistry() {
|
||||||
}
|
}
|
||||||
int main(int argc, char *argv[]){
|
int main(int argc, char *argv[]){
|
||||||
char msg[512];
|
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
|
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");
|
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 */
|
/* Initialize physfs here so that config can call PHYSFS_getPrefDir */
|
||||||
PHYSFS_init(argv[0]);
|
PHYSFS_init(argv[0]);
|
||||||
|
|
||||||
/* now we load the config */
|
|
||||||
Config conf;
|
|
||||||
conf.read(argc, argv);
|
|
||||||
|
|
||||||
if (!conf.gameFolder.empty())
|
if (!conf.gameFolder.empty())
|
||||||
if (chdir(conf.gameFolder.c_str()) != 0){
|
if (chdir(conf.gameFolder.c_str()) != 0){
|
||||||
showInitError(std::string("Unable to switch into gameFolder ") + conf.gameFolder);
|
showInitError(std::string("Unable to switch into gameFolder ") + conf.gameFolder);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue