summaryrefslogtreecommitdiff
path: root/src/gui/setup_video.cpp
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 /src/gui/setup_video.cpp
parent9a7048a29bb9710eb2626c7eadb4eb6a165a521e (diff)
downloadmanaverse-feee96b61b8effb160b00484e156b8cc9caf219b.tar.gz
manaverse-feee96b61b8effb160b00484e156b8cc9caf219b.tar.bz2
manaverse-feee96b61b8effb160b00484e156b8cc9caf219b.tar.xz
manaverse-feee96b61b8effb160b00484e156b8cc9caf219b.zip
Add perfomance setup tab.
Move some settings from video to perfomance tab.
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r--src/gui/setup_video.cpp96
1 files changed, 21 insertions, 75 deletions
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);
}
}