aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterpostprocess.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llfloaterpostprocess.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llfloaterpostprocess.cpp')
-rw-r--r--linden/indra/newview/llfloaterpostprocess.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/linden/indra/newview/llfloaterpostprocess.cpp b/linden/indra/newview/llfloaterpostprocess.cpp
index 999ad5d..40589fb 100644
--- a/linden/indra/newview/llfloaterpostprocess.cpp
+++ b/linden/indra/newview/llfloaterpostprocess.cpp
@@ -35,7 +35,7 @@
35 35
36#include "llsliderctrl.h" 36#include "llsliderctrl.h"
37#include "llcheckboxctrl.h" 37#include "llcheckboxctrl.h"
38#include "llvieweruictrlfactory.h" 38#include "lluictrlfactory.h"
39#include "llviewerdisplay.h" 39#include "llviewerdisplay.h"
40#include "llpostprocess.h" 40#include "llpostprocess.h"
41#include "llcombobox.h" 41#include "llcombobox.h"
@@ -48,7 +48,7 @@ LLFloaterPostProcess* LLFloaterPostProcess::sPostProcess = NULL;
48 48
49LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater("Post-Process Floater") 49LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater("Post-Process Floater")
50{ 50{
51 gUICtrlFactory->buildFloater(this, "floater_post_process.xml"); 51 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml");
52 52
53 /// Color Filter Callbacks 53 /// Color Filter Callbacks
54 childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter"); 54 childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter");
@@ -75,11 +75,11 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater("Post-Process Floater")
75 childSetCommitCallback("BloomStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_strength"); 75 childSetCommitCallback("BloomStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_strength");
76 76
77 // Effect loading and saving. 77 // Effect loading and saving.
78 LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "PPEffectsCombo"); 78 LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
79 childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox); 79 childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox);
80 comboBox->setCommitCallback(onChangeEffectName); 80 comboBox->setCommitCallback(onChangeEffectName);
81 81
82 LLLineEditor* editBox = LLUICtrlFactory::getLineEditorByName(this, "PPEffectNameEditor"); 82 LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor");
83 childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox); 83 childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox);
84 84
85 syncMenu(); 85 syncMenu();
@@ -186,8 +186,7 @@ void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl, void * userData)
186{ 186{
187 // get the combo box and name 187 // get the combo box and name
188 LLComboBox * comboBox = static_cast<LLComboBox*>(ctrl); 188 LLComboBox * comboBox = static_cast<LLComboBox*>(ctrl);
189 LLLineEditor* editBox = LLUICtrlFactory::getLineEditorByName(sPostProcess, 189 LLLineEditor* editBox = sPostProcess->getChild<LLLineEditor>("PPEffectNameEditor");
190 "PPEffectNameEditor");
191 190
192 // set the parameter's new name 191 // set the parameter's new name
193 editBox->setValue(comboBox->getSelectedValue()); 192 editBox->setValue(comboBox->getSelectedValue());
@@ -231,23 +230,21 @@ void LLFloaterPostProcess::onClose(bool app_quitting)
231void LLFloaterPostProcess::syncMenu() 230void LLFloaterPostProcess::syncMenu()
232{ 231{
233 // add the combo boxe contents 232 // add the combo boxe contents
234 LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "PPEffectsCombo"); 233 LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
235 234
236 if(comboBox != NULL) { 235 comboBox->removeall();
237 comboBox->removeall(); 236
238 237 LLSD::map_const_iterator currEffect;
239 LLSD::map_const_iterator currEffect; 238 for(currEffect = gPostProcess->mAllEffects.beginMap();
240 for(currEffect = gPostProcess->mAllEffects.beginMap(); 239 currEffect != gPostProcess->mAllEffects.endMap();
241 currEffect != gPostProcess->mAllEffects.endMap(); 240 ++currEffect)
242 ++currEffect) 241 {
243 { 242 comboBox->add(currEffect->first);
244 comboBox->add(currEffect->first);
245 }
246
247 // set the current effect as selected.
248 comboBox->selectByValue(gPostProcess->getSelectedEffect());
249 } 243 }
250 244
245 // set the current effect as selected.
246 comboBox->selectByValue(gPostProcess->getSelectedEffect());
247
251 /// Sync Color Filter Menu 248 /// Sync Color Filter Menu
252 childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter()); 249 childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter());
253 //childSetValue("ColorFilterGamma", gPostProcess->tweaks.gamma()); 250 //childSetValue("ColorFilterGamma", gPostProcess->tweaks.gamma());