summaryrefslogtreecommitdiff
path: root/src/gui/setup_video.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r--src/gui/setup_video.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 5157f8e9f..35293fec4 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -50,6 +50,8 @@
#include "utils/gettext.h"
+#include "test/testmain.h"
+
#include <guichan/key.hpp>
#include <guichan/listmodel.hpp>
@@ -559,9 +561,14 @@ void Setup_Video::action(const gcn::ActionEvent &event)
}
else if (id == "detect")
{
- const int val = graphicsManager.startDetection();
- if (val >= 0 && val <= 2)
- mOpenGLDropDown->setSelected(val);
+ TestMain *test = graphicsManager.startDetection();
+ if (test)
+ {
+ const int val = test->getConfig().getValueInt("opengl", -1);
+ if (val >= 0 && val <= 2)
+ mOpenGLDropDown->setSelected(val);
+ delete test;
+ }
}
}