summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-09 02:49:59 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-09 02:49:59 +0300
commitfeee96b61b8effb160b00484e156b8cc9caf219b (patch)
tree61c3315d2f16967ac619aba2167435430128fa59
parent9a7048a29bb9710eb2626c7eadb4eb6a165a521e (diff)
downloadmanaplus-feee96b61b8effb160b00484e156b8cc9caf219b.tar.gz
manaplus-feee96b61b8effb160b00484e156b8cc9caf219b.tar.bz2
manaplus-feee96b61b8effb160b00484e156b8cc9caf219b.tar.xz
manaplus-feee96b61b8effb160b00484e156b8cc9caf219b.zip
Add perfomance setup tab.
Move some settings from video to perfomance tab.
-rw-r--r--manaplus.cbp2
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/gui/setup.cpp4
-rw-r--r--src/gui/setup_video.cpp96
-rw-r--r--src/gui/setup_video.h10
6 files changed, 30 insertions, 86 deletions
diff --git a/manaplus.cbp b/manaplus.cbp
index 2634e6e63..538555c7b 100644
--- a/manaplus.cbp
+++ b/manaplus.cbp
@@ -234,6 +234,8 @@
<Unit filename="src\gui\setup_keyboard.h" />
<Unit filename="src\gui\setup_other.cpp" />
<Unit filename="src\gui\setup_other.h" />
+ <Unit filename="src\gui\setup_perfomance.cpp" />
+ <Unit filename="src\gui\setup_perfomance.h" />
<Unit filename="src\gui\setup_players.cpp" />
<Unit filename="src\gui\setup_players.h" />
<Unit filename="src\gui\setup_theme.cpp" />
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4d230c18f..ff9c75770 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -315,6 +315,8 @@ SET(SRCS
gui/setup_chat.h
gui/setup_keyboard.cpp
gui/setup_keyboard.h
+ gui/setup_perfomance.cpp
+ gui/setup_perfomance.h
gui/setup_players.cpp
gui/setup_players.h
gui/setup_video.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 18ae560b8..ba04b5f2b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -318,6 +318,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
gui/setup_chat.h \
gui/setup_keyboard.cpp \
gui/setup_keyboard.h \
+ gui/setup_perfomance.cpp \
+ gui/setup_perfomance.h \
gui/setup_players.cpp \
gui/setup_players.h \
gui/setup_video.cpp \
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 33ff6ddb7..129914ad8 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -27,14 +27,15 @@
#include "main.h"
#include "gui/setup_audio.h"
+#include "gui/setup_chat.h"
#include "gui/setup_colors.h"
#include "gui/setup_joystick.h"
#include "gui/setup_other.h"
#include "gui/setup_theme.h"
#include "gui/setup_keyboard.h"
+#include "gui/setup_perfomance.h"
#include "gui/setup_players.h"
#include "gui/setup_video.h"
-#include "gui/setup_chat.h"
#include "gui/widgets/button.h"
#include "gui/widgets/label.h"
@@ -88,6 +89,7 @@ Setup::Setup():
mTabs.push_back(new Setup_Video);
mTabs.push_back(new Setup_Audio);
+ mTabs.push_back(new Setup_Perfomance);
mTabs.push_back(new Setup_Joystick);
mTabs.push_back(new Setup_Keyboard);
mTabs.push_back(new Setup_Colors);
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 3e5c56f64..d73a9e1bb 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -274,24 +274,17 @@ const char *Setup_Video::particleDetailToString(int detail)
Setup_Video::Setup_Video():
mFullScreenEnabled(config.getBoolValue("screen")),
mOpenGLEnabled(config.getIntValue("opengl")),
- mHwAccelEnabled(config.getBoolValue("hwaccel")),
mCustomCursorEnabled(config.getBoolValue("customcursor")),
mParticleEffectsEnabled(config.getBoolValue("particleeffects")),
mPickupChatEnabled(config.getBoolValue("showpickupchat")),
mPickupParticleEnabled(config.getBoolValue("showpickupparticle")),
- mOpacity(config.getFloatValue("guialpha")),
mFps(config.getIntValue("fpslimit")),
mAltFps(config.getIntValue("altfpslimit")),
- mAlphaCache(config.getBoolValue("alphaCache")),
- mEnableMapReduce(config.getBoolValue("enableMapReduce")),
- mAdjustPerfomance(config.getBoolValue("adjustPerfomance")),
- mBeingOpacity(config.getBoolValue("beingopacity")),
mSpeechMode(static_cast<Being::Speech>(
config.getIntValue("speech"))),
mModeListModel(new ModeListModel),
mModeList(new ListBox(mModeListModel)),
mFsCheckBox(new CheckBox(_("Full screen"), mFullScreenEnabled)),
- mHwAccelCheckBox(new CheckBox(_("Hw acceleration"), mHwAccelEnabled)),
mCustomCursorCheckBox(new CheckBox(_("Custom cursor"),
mCustomCursorEnabled)),
mParticleEffectsCheckBox(new CheckBox(_("Particle effects"),
@@ -302,13 +295,6 @@ Setup_Video::Setup_Video():
// TRANSLATORS: Refers to "Show own name"
mPickupParticleCheckBox(new CheckBox(_("as particle"),
mPickupParticleEnabled)),
- mAlphaCacheCheckBox(new CheckBox(_("Enable opacity cache"), mAlphaCache)),
- mEnableMapReduceCheckBox(new CheckBox(_("Enable map reduce"),
- mEnableMapReduce)),
- mAdjustPerfomanceCheckBox(new CheckBox(_("Auto adjust perfomance"),
- mAdjustPerfomance)),
- mBeingOpacityCheckBox(new CheckBox(_("Show beings transparency"),
- mBeingOpacity)),
mSpeechSlider(new Slider(0, 3)),
mSpeechLabel(new Label("")),
mAlphaSlider(new Slider(0.1, 1.0)),
@@ -348,8 +334,6 @@ Setup_Video::Setup_Video():
mAlphaSlider->setValue(mOpacity);
mAlphaSlider->setWidth(90);
- mAlphaCacheCheckBox->setEnabled(mOpenGLDropDown->getSelected() == 0);
- mEnableMapReduceCheckBox->setEnabled(mOpenGLDropDown->getSelected() == 0);
mFpsLabel->setCaption(mFps > 0 ? toString(mFps) : _("None"));
mFpsLabel->setWidth(60);
@@ -381,9 +365,6 @@ Setup_Video::Setup_Video():
mOverlayDetailField->setActionEventId("overlaydetailfield");
mParticleDetailSlider->setActionEventId("particledetailslider");
mParticleDetailField->setActionEventId("particledetailfield");
- mAlphaCacheCheckBox->setActionEventId("alphaCache");
- mEnableMapReduceCheckBox->setActionEventId("enableMapReduce");
- mAdjustPerfomanceCheckBox->setActionEventId("adjustPerfomance");
mOpenGLDropDown->setActionEventId("opengl");
mModeList->addActionListener(this);
@@ -402,10 +383,6 @@ Setup_Video::Setup_Video():
mParticleDetailField->addKeyListener(this);
mOpenGLDropDown->addActionListener(this);
- mAlphaCacheCheckBox->addKeyListener(this);
- mEnableMapReduceCheckBox->addKeyListener(this);
- mAdjustPerfomanceCheckBox->addKeyListener(this);
-
mSpeechLabel->setCaption(speechModeToString(mSpeechMode));
mSpeechSlider->setValue(mSpeechMode);
@@ -422,45 +399,40 @@ Setup_Video::Setup_Video():
place(0, 0, scrollArea, 1, 5).setPadding(2);
place(0, 5, mOpenGLDropDown, 1);
- place(0, 6, mHwAccelCheckBox, 6);
- place(0, 7, mAlphaCacheCheckBox, 6);
- place(0, 8, mEnableMapReduceCheckBox, 6);
+// place(0, 6, mHwAccelCheckBox, 6);
place(1, 0, mFsCheckBox, 2);
place(1, 1, mCustomCursorCheckBox, 3);
- place(1, 2, mBeingOpacityCheckBox);
- place(1, 3, mParticleEffectsCheckBox, 2);
-
- place(1, 4, mPickupNotifyLabel, 4);
+ place(1, 2, mParticleEffectsCheckBox, 2);
- place(1, 5, mPickupChatCheckBox, 1);
- place(2, 5, mPickupParticleCheckBox, 2);
+ place(1, 3, mPickupNotifyLabel, 4);
- place(0, 9, mAdjustPerfomanceCheckBox, 6);
+ place(1, 4, mPickupChatCheckBox, 1);
+ place(2, 4, mPickupParticleCheckBox, 2);
- place(0, 10, mAlphaSlider);
- place(1, 10, alphaLabel, 3);
+ place(0, 6, mAlphaSlider);
+ place(1, 6, alphaLabel, 3);
- place(0, 11, mFpsSlider);
- place(1, 11, mFpsCheckBox).setPadding(3);
- place(2, 11, mFpsLabel).setPadding(1);
+ place(0, 7, mFpsSlider);
+ place(1, 7, mFpsCheckBox).setPadding(3);
+ place(2, 7, mFpsLabel).setPadding(1);
- place(0, 12, mAltFpsSlider);
- place(1, 12, mAltFpsLabel).setPadding(3);
+ place(0, 8, mAltFpsSlider);
+ place(1, 8, mAltFpsLabel).setPadding(3);
- place(0, 13, mSpeechSlider);
- place(1, 13, speechLabel);
- place(2, 13, mSpeechLabel, 3).setPadding(2);
+ place(0, 9, mSpeechSlider);
+ place(1, 9, speechLabel);
+ place(2, 9, mSpeechLabel, 3).setPadding(2);
- place(0, 14, mOverlayDetailSlider);
- place(1, 14, overlayDetailLabel);
- place(2, 14, mOverlayDetailField, 3).setPadding(2);
+ place(0, 10, mOverlayDetailSlider);
+ place(1, 10, overlayDetailLabel);
+ place(2, 10, mOverlayDetailField, 3).setPadding(2);
- place(0, 15, mParticleDetailSlider);
- place(1, 15, particleDetailLabel);
- place(2, 15, mParticleDetailField, 3).setPadding(2);
+ place(0, 11, mParticleDetailSlider);
+ place(1, 11, particleDetailLabel);
+ place(2, 11, mParticleDetailField, 3).setPadding(2);
int width = 600;
@@ -551,33 +523,20 @@ void Setup_Video::apply()
mAltFpsSlider->setEnabled(mAltFps > 0);
- config.setValue("hwaccel", mHwAccelCheckBox->isSelected());
-
// FPS change
config.setValue("fpslimit", mFps);
config.setValue("altfpslimit", mAltFps);
- config.setValue("alphaCache", mAlphaCacheCheckBox->isSelected());
- config.setValue("enableMapReduce", mEnableMapReduceCheckBox->isSelected());
- config.setValue("adjustPerfomance",
- mAdjustPerfomanceCheckBox->isSelected());
- config.setValue("beingopacity", mBeingOpacityCheckBox->isSelected());
-
// We sync old and new values at apply time
mFullScreenEnabled = config.getBoolValue("screen");
mCustomCursorEnabled = config.getBoolValue("customcursor");
mParticleEffectsEnabled = config.getBoolValue("particleeffects");
- mAlphaCache = config.getBoolValue("alphaCache");
- mEnableMapReduce = config.getBoolValue("enableMapReduce");
- mAdjustPerfomance = config.getBoolValue("adjustPerfomance");
- mBeingOpacity = config.getBoolValue("beingopacity");
mSpeechMode = static_cast<Being::Speech>(
config.getIntValue("speech"));
mOpacity = config.getFloatValue("guialpha");
mOverlayDetail = config.getIntValue("OverlayDetail");
mOpenGLEnabled = config.getIntValue("opengl");
- mHwAccelEnabled = config.getBoolValue("hwaccel");
mPickupChatEnabled = config.getBoolValue("showpickupchat");
mPickupParticleEnabled = config.getBoolValue("showpickupparticle");
}
@@ -587,7 +546,6 @@ void Setup_Video::cancel()
mFpsCheckBox->setSelected(mFps > 0);
mFsCheckBox->setSelected(mFullScreenEnabled);
mOpenGLDropDown->setSelected(mOpenGLEnabled);
- mHwAccelCheckBox->setSelected(mHwAccelEnabled);
mCustomCursorCheckBox->setSelected(mCustomCursorEnabled);
mParticleEffectsCheckBox->setSelected(mParticleEffectsEnabled);
mFpsSlider->setValue(mFps);
@@ -595,10 +553,6 @@ void Setup_Video::cancel()
mAltFpsSlider->setValue(mAltFps);
mAltFpsSlider->setEnabled(mAltFps > 0);
mSpeechSlider->setValue(mSpeechMode);
- mAlphaCacheCheckBox->setSelected(mAlphaCache);
- mEnableMapReduceCheckBox->setSelected(mEnableMapReduce);
- mAdjustPerfomanceCheckBox->setSelected(mAdjustPerfomance);
- mBeingOpacityCheckBox->setSelected(mBeingOpacity);
mAlphaSlider->setValue(mOpacity);
mOverlayDetailSlider->setValue(mOverlayDetail);
mParticleDetailSlider->setValue(mParticleDetail);
@@ -618,17 +572,11 @@ void Setup_Video::cancel()
config.setValue("customcursor", mCustomCursorEnabled);
config.setValue("particleeffects", mParticleEffectsEnabled);
config.setValue("speech", static_cast<int>(mSpeechMode));
- config.setValue("alphaCache", mAlphaCache);
- config.setValue("enableMapReduce", mEnableMapReduce);
- config.setValue("adjustPerfomance", mAdjustPerfomance);
- config.setValue("beingopacity", mBeingOpacity);
config.setValue("guialpha", mOpacity);
Image::setEnableAlpha(mOpacity != 1.0f);
config.setValue("opengl", mOpenGLEnabled);
- config.setValue("hwaccel", mHwAccelEnabled);
config.setValue("showpickupchat", mPickupChatEnabled);
config.setValue("showpickupparticle", mPickupParticleEnabled);
- mAlphaCacheCheckBox->setEnabled(mOpenGLDropDown->getSelected() == 0);
}
void Setup_Video::action(const gcn::ActionEvent &event)
@@ -764,8 +712,6 @@ void Setup_Video::action(const gcn::ActionEvent &event)
else if (id == "opengl")
{
bool isSoftware = (mOpenGLDropDown->getSelected() == 0);
- mAlphaCacheCheckBox->setEnabled(isSoftware);
- mEnableMapReduceCheckBox->setEnabled(isSoftware);
}
}
diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h
index 9533877fb..509deb2fd 100644
--- a/src/gui/setup_video.h
+++ b/src/gui/setup_video.h
@@ -55,7 +55,6 @@ class Setup_Video : public SetupTab, public gcn::KeyListener
private:
bool mFullScreenEnabled;
int mOpenGLEnabled;
- bool mHwAccelEnabled;
bool mCustomCursorEnabled;
bool mParticleEffectsEnabled;
bool mPickupChatEnabled;
@@ -63,10 +62,6 @@ class Setup_Video : public SetupTab, public gcn::KeyListener
float mOpacity;
int mFps;
int mAltFps;
- bool mAlphaCache;
- bool mEnableMapReduce;
- bool mAdjustPerfomance;
- bool mBeingOpacity;
Being::Speech mSpeechMode;
ModeListModel *mModeListModel;
@@ -83,7 +78,6 @@ class Setup_Video : public SetupTab, public gcn::KeyListener
gcn::ListBox *mModeList;
gcn::CheckBox *mFsCheckBox;
gcn::DropDown *mOpenGLDropDown;
- gcn::CheckBox *mHwAccelCheckBox;
gcn::CheckBox *mCustomCursorCheckBox;
gcn::CheckBox *mParticleEffectsCheckBox;
@@ -91,10 +85,6 @@ class Setup_Video : public SetupTab, public gcn::KeyListener
gcn::CheckBox *mPickupChatCheckBox;
gcn::CheckBox *mPickupParticleCheckBox;
- gcn::CheckBox *mAlphaCacheCheckBox;
- gcn::CheckBox *mEnableMapReduceCheckBox;
- gcn::CheckBox *mAdjustPerfomanceCheckBox;
- gcn::CheckBox *mBeingOpacityCheckBox;
gcn::Slider *mSpeechSlider;
gcn::Label *mSpeechLabel;
gcn::Slider *mAlphaSlider;