From 350b3a4029d2850aa3057f25566abf8a589f487f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Aug 2012 18:39:34 +0300 Subject: Enable best mode autodetection for linux. --- src/client.cpp | 9 +++++---- src/gui/setup_video.cpp | 10 ---------- src/utils/process.cpp | 2 ++ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 9861696d4..e35a6eca8 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -505,17 +505,18 @@ void Client::gameInit() } #endif -#ifdef WIN32 - if (mOptions.test.empty() && !config.getBoolValue("videodetected")) +#ifdef USE_OPENGL + if (!mOptions.safeMode && mOptions.test.empty() + && !config.getBoolValue("videodetected")) { + config.setValue("videodetected", true); int val = graphicsManager.startDetection(); if (val >= 0 && val <= 2) config.setValue("opengl", val); - config.setValue("videodetected", true); } #endif -#if defined USE_OPENGL +#ifdef USE_OPENGL OpenGLImageHelper::setBlur(config.getBoolValue("blur")); SDLImageHelper::SDLSetEnableAlphaCache(config.getBoolValue("alphaCache") && !config.getIntValue("opengl")); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 69f769b67..f6b83807a 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -26,9 +26,7 @@ #include "game.h" #include "graphics.h" -#ifdef WIN32 #include "graphicsmanager.h" -#endif #include "localplayer.h" #include "logger.h" @@ -240,11 +238,7 @@ Setup_Video::Setup_Video(): mFpsLabel(new Label), mAltFpsSlider(new Slider(2, 160)), mAltFpsLabel(new Label(_("Alt FPS limit: "))), -#ifdef WIN32 mDetectButton(new Button(_("Detect best mode"), "detect", this)), -#else - mDetectButton(nullptr), -#endif mDialog(nullptr) { setName(_("Video")); @@ -319,9 +313,7 @@ Setup_Video::Setup_Video(): place(0, 7, mAltFpsSlider); place(1, 7, mAltFpsLabel).setPadding(3); -#ifdef WIN32 place(0, 8, mDetectButton); -#endif int width = 600; @@ -556,14 +548,12 @@ void Setup_Video::action(const gcn::ActionEvent &event) { config.setValue("noframe", mNoFrameCheckBox->isSelected()); } -#ifdef WIN32 else if (id == "detect") { int val = graphicsManager.startDetection(); if (val >= 0 && val <= 2) mOpenGLDropDown->setSelected(val); } -#endif } void Setup_Video::externalUpdated() diff --git a/src/utils/process.cpp b/src/utils/process.cpp index 3a742b313..620cb3b93 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -171,6 +171,7 @@ int execFileWait(std::string pathName, std::string name, { // sleep pid sleep (waitTime); // printf ("time out\n"); + execl("/bin/true", "/bin/true", static_cast(nullptr)); exit(-1); } @@ -189,6 +190,7 @@ int execFileWait(std::string pathName, std::string name, ret = -1; } wait(nullptr); + execl("/bin/true", "/bin/true", static_cast(nullptr)); exit(ret); } -- cgit v1.2.3-60-g2f50