summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp9
-rw-r--r--src/gui/setup_video.cpp10
-rw-r--r--src/utils/process.cpp2
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<char *>(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<char *>(nullptr));
exit(ret);
}