summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-11 18:39:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-11 18:39:34 +0300
commit350b3a4029d2850aa3057f25566abf8a589f487f (patch)
tree87f19e178dd827b60ef84db919d564041029390d
parent2274758726d1138a2b65535244e84225c3de5304 (diff)
downloadmanaplus-350b3a4029d2850aa3057f25566abf8a589f487f.tar.gz
manaplus-350b3a4029d2850aa3057f25566abf8a589f487f.tar.bz2
manaplus-350b3a4029d2850aa3057f25566abf8a589f487f.tar.xz
manaplus-350b3a4029d2850aa3057f25566abf8a589f487f.zip
Enable best mode autodetection for linux.
-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);
}