diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-13 21:54:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-13 21:54:39 +0300 |
commit | 86b19d64c2692665aba33e44ee5db6cbf36b6342 (patch) | |
tree | 93d91c84258f9b76ab29ab51119bbc0044d729a4 /src/gui/widgets/tabs/setup_perfomance.cpp | |
parent | a45303dc06c74735389607e5b281bb69543547ed (diff) | |
download | manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.gz manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.bz2 manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.xz manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.zip |
Add option to select any existing SDL renderer drivers for SDL2 default mode.
Diffstat (limited to 'src/gui/widgets/tabs/setup_perfomance.cpp')
-rw-r--r-- | src/gui/widgets/tabs/setup_perfomance.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp index d28b82680..664183276 100644 --- a/src/gui/widgets/tabs/setup_perfomance.cpp +++ b/src/gui/widgets/tabs/setup_perfomance.cpp @@ -22,6 +22,8 @@ #include "gui/widgets/tabs/setup_perfomance.h" +#include "configuration.h" + #include "gui/models/namesmodel.h" #include "gui/widgets/containerplacer.h" @@ -31,6 +33,9 @@ #include "utils/delete2.h" #include "utils/gettext.h" +#ifdef USE_SDL2 +#include "utils/sdlhelper.h" +#endif // USE_SDL2 #include "debug.h" @@ -48,7 +53,8 @@ static const char *const texturesList[] = Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : SetupTabScroll(widget), - mTexturesList(new NamesModel) + mTexturesList(new NamesModel), + mSdlDriversList(new NamesModel) { // TRANSLATORS: settings tab name setName(_("Performance")); @@ -58,6 +64,15 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : ContainerPlacer place = h.getPlacer(0, 0); place(0, 0, mScroll, 10, 10); +#ifdef USE_SDL2 + StringVect sdlDriversList; + SDL::getRenderers(sdlDriversList, + config.getStringValue("sdlDriver")); + sdlDriversList.insert(sdlDriversList.begin(), + // TRANSLATORS: sdl driver name + N_("default")); +#endif // USE_SDL2 + // TRANSLATORS: settings option new SetupItemLabel(_("Better performance (enable for better performance)"), "", this); @@ -138,6 +153,14 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : new SetupItemLabel(_("Different options (enable or disable can " "improve performance)"), "", this); +#ifdef USE_SDL2 + mSdlDriversList->fillFromVector(sdlDriversList); + new SetupItemDropDownStr( + // TRANSLATORS: settings option + _("Try first sdl driver (only for SDL2 default mode)"), + "", "sdlDriver", this, "sdlDriverEvent", mSdlDriversList, 100); +#endif // USE_SDL2 + mTexturesList->fillFromArray(&texturesList[0], texturesListSize); // TRANSLATORS: settings option new SetupItemDropDown(_("Enable texture compression (OpenGL)"), "", @@ -179,4 +202,7 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : Setup_Perfomance::~Setup_Perfomance() { delete2(mTexturesList); +#ifdef USE_SDL2 + delete2(mSdlDriversList); +#endif // USE_SDL2 } |