diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-01-26 01:31:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-01-26 01:31:38 +0300 |
commit | 85d58aef208ae7c1f0ef5d449e17a1410a6eb04d (patch) | |
tree | d50ea0b708b9ae00432deb54e4def67e26c0796b /src/gui | |
parent | d1153fc8c1f226d802e82cba7d11c686998a1523 (diff) | |
download | manaplus-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.tar.gz manaplus-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.tar.bz2 manaplus-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.tar.xz manaplus-85d58aef208ae7c1f0ef5d449e17a1410a6eb04d.zip |
Add support for manual compression selection.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup_perfomance.cpp | 26 | ||||
-rw-r--r-- | src/gui/setup_perfomance.h | 8 |
2 files changed, 30 insertions, 4 deletions
diff --git a/src/gui/setup_perfomance.cpp b/src/gui/setup_perfomance.cpp index 06838dcb6..9d99f6491 100644 --- a/src/gui/setup_perfomance.cpp +++ b/src/gui/setup_perfomance.cpp @@ -31,6 +31,7 @@ #include "gui/widgets/inttextfield.h" #include "gui/widgets/label.h" #include "gui/widgets/layouthelper.h" +#include "gui/widgets/namesmodel.h" #include "gui/widgets/scrollarea.h" #include "gui/widgets/setupitem.h" @@ -41,8 +42,19 @@ #include "debug.h" +static const int texturesListSize = 4; + +static const char *const texturesList[] = +{ + N_("no"), + N_("s3tc"), + N_("fxt1"), + N_("ARB") +}; + Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : - SetupTabScroll(widget) + SetupTabScroll(widget), + mTexturesList(new NamesModel) { setName(_("Perfomance")); @@ -103,8 +115,10 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : new SetupItemLabel(_("Different options (enable or disable can " "improve perfomance)"), "", this); - new SetupItemCheckBox(_("Enable texture compression (fast OpenGL)"), "", - "compresstextures", this, "compresstexturesEvent"); + + mTexturesList->fillFromArray(&texturesList[0], texturesListSize); + new SetupItemDropDown(_("Enable texture compression (fast OpenGL)"), "", + "compresstextures", this, "compresstexturesEvent", mTexturesList, 100); new SetupItemCheckBox(_("Enable rectangular texture extension (OpenGL)"), "", "rectangulartextures", this, "rectangulartexturesEvent"); @@ -118,6 +132,12 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : setDimension(gcn::Rectangle(0, 0, 550, 350)); } +Setup_Perfomance::~Setup_Perfomance() +{ + delete mTexturesList; + mTexturesList = nullptr; +} + void Setup_Perfomance::apply() { SetupTabScroll::apply(); diff --git a/src/gui/setup_perfomance.h b/src/gui/setup_perfomance.h index ee6f729fc..7cfcee3b4 100644 --- a/src/gui/setup_perfomance.h +++ b/src/gui/setup_perfomance.h @@ -27,8 +27,9 @@ #include <guichan/actionlistener.hpp> -class IntTextField; class EditDialog; +class IntTextField; +class NamesModel; class Setup_Perfomance final : public SetupTabScroll { @@ -37,7 +38,12 @@ class Setup_Perfomance final : public SetupTabScroll A_DELETE_COPY(Setup_Perfomance) + ~Setup_Perfomance(); + void apply(); + + private: + NamesModel *mTexturesList; }; #endif |