diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llpaneldisplay.cpp | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-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/llpaneldisplay.cpp')
-rw-r--r-- | linden/indra/newview/llpaneldisplay.cpp | 191 |
1 files changed, 64 insertions, 127 deletions
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index 5bc1f7e..e5072c5 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp | |||
@@ -53,6 +53,7 @@ | |||
53 | #include "llspinctrl.h" | 53 | #include "llspinctrl.h" |
54 | #include "llstartup.h" | 54 | #include "llstartup.h" |
55 | #include "lltextbox.h" | 55 | #include "lltextbox.h" |
56 | #include "lltexteditor.h" | ||
56 | #include "llui.h" | 57 | #include "llui.h" |
57 | #include "llviewercamera.h" | 58 | #include "llviewercamera.h" |
58 | #include "llviewerimage.h" | 59 | #include "llviewerimage.h" |
@@ -67,7 +68,7 @@ | |||
67 | #include "llwindow.h" | 68 | #include "llwindow.h" |
68 | #include "llworld.h" | 69 | #include "llworld.h" |
69 | #include "pipeline.h" | 70 | #include "pipeline.h" |
70 | #include "llvieweruictrlfactory.h" | 71 | #include "lluictrlfactory.h" |
71 | #include "llfeaturemanager.h" | 72 | #include "llfeaturemanager.h" |
72 | #include "llglslshader.h" | 73 | #include "llglslshader.h" |
73 | #include "llfloaterhardwaresettings.h" | 74 | #include "llfloaterhardwaresettings.h" |
@@ -88,63 +89,11 @@ const S32 ASPECT_RATIO_STR_LEN = 100; | |||
88 | 89 | ||
89 | LLPanelDisplay::LLPanelDisplay() | 90 | LLPanelDisplay::LLPanelDisplay() |
90 | { | 91 | { |
91 | gUICtrlFactory->buildPanel(this, "panel_preferences_graphics1.xml"); | 92 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_graphics1.xml"); |
92 | } | 93 | } |
93 | 94 | ||
94 | BOOL LLPanelDisplay::postBuild() | 95 | BOOL LLPanelDisplay::postBuild() |
95 | { | 96 | { |
96 | requires("windowed mode", WIDGET_TYPE_CHECKBOX); | ||
97 | requires("fullscreen combo", WIDGET_TYPE_COMBO_BOX); | ||
98 | requires("aspect_ratio", WIDGET_TYPE_COMBO_BOX); | ||
99 | requires("aspect_auto_detect", WIDGET_TYPE_CHECKBOX); | ||
100 | requires("AspectRatioLabel1", WIDGET_TYPE_TEXT_BOX); | ||
101 | requires("DisplayResLabel", WIDGET_TYPE_TEXT_BOX); | ||
102 | requires("FullScreenInfo", WIDGET_TYPE_TEXT_EDITOR); | ||
103 | |||
104 | requires("QualityPerformanceSelection", WIDGET_TYPE_SLIDER); | ||
105 | requires("CustomSettings", WIDGET_TYPE_CHECKBOX); | ||
106 | |||
107 | requires("GraphicsHardwareButton", WIDGET_TYPE_BUTTON); | ||
108 | requires("Defaults", WIDGET_TYPE_BUTTON); | ||
109 | |||
110 | requires("BumpShiny", WIDGET_TYPE_CHECKBOX); | ||
111 | requires("BasicShaders", WIDGET_TYPE_CHECKBOX); | ||
112 | requires("AvatarVertexProgram", WIDGET_TYPE_CHECKBOX); | ||
113 | requires("WindLightUseAtmosShaders", WIDGET_TYPE_CHECKBOX); | ||
114 | requires("Reflections", WIDGET_TYPE_CHECKBOX); | ||
115 | |||
116 | requires("AvatarImpostors", WIDGET_TYPE_CHECKBOX); | ||
117 | requires("AvatarCloth", WIDGET_TYPE_CHECKBOX); | ||
118 | |||
119 | requires("DrawDistance", WIDGET_TYPE_SLIDER); | ||
120 | requires("DrawDistanceMeterText1", WIDGET_TYPE_TEXT_BOX); | ||
121 | requires("DrawDistanceMeterText2", WIDGET_TYPE_TEXT_BOX); | ||
122 | |||
123 | requires("ObjectMeshDetail", WIDGET_TYPE_SLIDER); | ||
124 | requires("FlexibleMeshDetail", WIDGET_TYPE_SLIDER); | ||
125 | requires("TreeMeshDetail", WIDGET_TYPE_SLIDER); | ||
126 | requires("AvatarMeshDetail", WIDGET_TYPE_SLIDER); | ||
127 | requires("TerrainMeshDetail", WIDGET_TYPE_SLIDER); | ||
128 | requires("SkyMeshDetail", WIDGET_TYPE_SLIDER); | ||
129 | requires("MaxParticleCount", WIDGET_TYPE_SLIDER); | ||
130 | requires("RenderPostProcess", WIDGET_TYPE_SLIDER); | ||
131 | |||
132 | requires("ObjectMeshDetailText", WIDGET_TYPE_TEXT_BOX); | ||
133 | requires("FlexibleMeshDetailText", WIDGET_TYPE_TEXT_BOX); | ||
134 | requires("TreeMeshDetailText", WIDGET_TYPE_TEXT_BOX); | ||
135 | requires("AvatarMeshDetailText", WIDGET_TYPE_TEXT_BOX); | ||
136 | requires("TerrainMeshDetailText", WIDGET_TYPE_TEXT_BOX); | ||
137 | requires("SkyMeshDetailText", WIDGET_TYPE_TEXT_BOX); | ||
138 | requires("PostProcessText", WIDGET_TYPE_TEXT_BOX); | ||
139 | |||
140 | requires("LightingDetailRadio", WIDGET_TYPE_RADIO_GROUP); | ||
141 | requires("TerrainDetailRadio", WIDGET_TYPE_RADIO_GROUP); | ||
142 | |||
143 | if (!checkRequirements()) | ||
144 | { | ||
145 | return FALSE; | ||
146 | } | ||
147 | |||
148 | // return to default values | 97 | // return to default values |
149 | childSetAction("Defaults", setHardwareDefaults, NULL); | 98 | childSetAction("Defaults", setHardwareDefaults, NULL); |
150 | 99 | ||
@@ -159,20 +108,20 @@ BOOL LLPanelDisplay::postBuild() | |||
159 | 108 | ||
160 | // radio set for fullscreen size | 109 | // radio set for fullscreen size |
161 | 110 | ||
162 | mCtrlWindowed = LLUICtrlFactory::getCheckBoxByName(this, "windowed mode"); | 111 | mCtrlWindowed = getChild<LLCheckBoxCtrl>( "windowed mode"); |
163 | mCtrlWindowed->setCommitCallback(onCommitWindowedMode); | 112 | mCtrlWindowed->setCommitCallback(onCommitWindowedMode); |
164 | mCtrlWindowed->setCallbackUserData(this); | 113 | mCtrlWindowed->setCallbackUserData(this); |
165 | 114 | ||
166 | mAspectRatioLabel1 = LLUICtrlFactory::getTextBoxByName(this, "AspectRatioLabel1"); | 115 | mAspectRatioLabel1 = getChild<LLTextBox>("AspectRatioLabel1"); |
167 | mFullScreenInfo = LLUICtrlFactory::getTextEditorByName(this, "FullScreenInfo"); | 116 | mFullScreenInfo = getChild<LLTextEditor>("FullScreenInfo"); |
168 | mDisplayResLabel = LLUICtrlFactory::getTextBoxByName(this, "DisplayResLabel"); | 117 | mDisplayResLabel = getChild<LLTextBox>("DisplayResLabel"); |
169 | 118 | ||
170 | S32 num_resolutions = 0; | 119 | S32 num_resolutions = 0; |
171 | LLWindow::LLWindowResolution* supported_resolutions = gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions); | 120 | LLWindow::LLWindowResolution* supported_resolutions = gViewerWindow->getWindow()->getSupportedResolutions(num_resolutions); |
172 | 121 | ||
173 | S32 fullscreen_mode = num_resolutions - 1; | 122 | S32 fullscreen_mode = num_resolutions - 1; |
174 | 123 | ||
175 | mCtrlFullScreen = LLUICtrlFactory::getComboBoxByName(this, "fullscreen combo"); | 124 | mCtrlFullScreen = getChild<LLComboBox>( "fullscreen combo"); |
176 | 125 | ||
177 | LLUIString resolution_label = getUIString("resolution_format"); | 126 | LLUIString resolution_label = getUIString("resolution_format"); |
178 | 127 | ||
@@ -239,7 +188,7 @@ BOOL LLPanelDisplay::postBuild() | |||
239 | aspect_ratio_text = llformat("%.3f", mAspectRatio); | 188 | aspect_ratio_text = llformat("%.3f", mAspectRatio); |
240 | } | 189 | } |
241 | 190 | ||
242 | mCtrlAspectRatio = LLUICtrlFactory::getComboBoxByName(this, "aspect_ratio"); | 191 | mCtrlAspectRatio = getChild<LLComboBox>( "aspect_ratio"); |
243 | mCtrlAspectRatio->setTextEntryCallback(onKeystrokeAspectRatio); | 192 | mCtrlAspectRatio->setTextEntryCallback(onKeystrokeAspectRatio); |
244 | mCtrlAspectRatio->setCommitCallback(onSelectAspectRatio); | 193 | mCtrlAspectRatio->setCommitCallback(onSelectAspectRatio); |
245 | mCtrlAspectRatio->setCallbackUserData(this); | 194 | mCtrlAspectRatio->setCallbackUserData(this); |
@@ -247,125 +196,123 @@ BOOL LLPanelDisplay::postBuild() | |||
247 | mCtrlAspectRatio->add(aspect_ratio_text, &mAspectRatio, ADD_TOP); | 196 | mCtrlAspectRatio->add(aspect_ratio_text, &mAspectRatio, ADD_TOP); |
248 | mCtrlAspectRatio->setCurrentByIndex(0); | 197 | mCtrlAspectRatio->setCurrentByIndex(0); |
249 | 198 | ||
250 | mCtrlAutoDetectAspect = LLUICtrlFactory::getCheckBoxByName(this, "aspect_auto_detect"); | 199 | mCtrlAutoDetectAspect = getChild<LLCheckBoxCtrl>( "aspect_auto_detect"); |
251 | mCtrlAutoDetectAspect->setCommitCallback(onCommitAutoDetectAspect); | 200 | mCtrlAutoDetectAspect->setCommitCallback(onCommitAutoDetectAspect); |
252 | mCtrlAutoDetectAspect->setCallbackUserData(this); | 201 | mCtrlAutoDetectAspect->setCallbackUserData(this); |
253 | 202 | ||
254 | // radio performance box | 203 | // radio performance box |
255 | mCtrlSliderQuality = LLUICtrlFactory::getSliderByName(this, | 204 | mCtrlSliderQuality = getChild<LLSliderCtrl>("QualityPerformanceSelection"); |
256 | "QualityPerformanceSelection"); | ||
257 | mCtrlSliderQuality->setSliderMouseUpCallback(onChangeQuality); | 205 | mCtrlSliderQuality->setSliderMouseUpCallback(onChangeQuality); |
258 | mCtrlSliderQuality->setCallbackUserData(this); | 206 | mCtrlSliderQuality->setCallbackUserData(this); |
259 | 207 | ||
260 | mCtrlCustomSettings = LLUICtrlFactory::getCheckBoxByName(this, "CustomSettings"); | 208 | mCtrlCustomSettings = getChild<LLCheckBoxCtrl>("CustomSettings"); |
261 | mCtrlCustomSettings->setCommitCallback(onChangeCustom); | 209 | mCtrlCustomSettings->setCommitCallback(onChangeCustom); |
262 | mCtrlCustomSettings->setCallbackUserData(this); | 210 | mCtrlCustomSettings->setCallbackUserData(this); |
263 | 211 | ||
264 | mGraphicsBorder = static_cast<LLViewBorder*>(getChildByName("GraphicsBorder")); | 212 | mGraphicsBorder = getChild<LLViewBorder>("GraphicsBorder"); |
265 | llassert(mGraphicsBorder != NULL); | ||
266 | 213 | ||
267 | //---------------------------------------------------------------------------- | 214 | //---------------------------------------------------------------------------- |
268 | // Enable Bump/Shiny | 215 | // Enable Bump/Shiny |
269 | mCtrlBumpShiny = LLUICtrlFactory::getCheckBoxByName(this, "BumpShiny"); | 216 | mCtrlBumpShiny = getChild<LLCheckBoxCtrl>("BumpShiny"); |
270 | 217 | ||
271 | //---------------------------------------------------------------------------- | 218 | //---------------------------------------------------------------------------- |
272 | // Enable Reflections | 219 | // Enable Reflections |
273 | mCtrlReflections = LLUICtrlFactory::getCheckBoxByName(this, "Reflections"); | 220 | mCtrlReflections = getChild<LLCheckBoxCtrl>("Reflections"); |
274 | mCtrlReflections->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); | 221 | mCtrlReflections->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); |
275 | mCtrlReflections->setCallbackUserData(this); | 222 | mCtrlReflections->setCallbackUserData(this); |
276 | mRadioReflectionDetail = LLUICtrlFactory::getRadioGroupByName(this, "ReflectionDetailRadio"); | 223 | mRadioReflectionDetail = getChild<LLRadioGroup>("ReflectionDetailRadio"); |
277 | 224 | ||
278 | // WindLight | 225 | // WindLight |
279 | mCtrlWindLight = LLUICtrlFactory::getCheckBoxByName(this, "WindLightUseAtmosShaders"); | 226 | mCtrlWindLight = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders"); |
280 | mCtrlWindLight->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); | 227 | mCtrlWindLight->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); |
281 | mCtrlWindLight->setCallbackUserData(this); | 228 | mCtrlWindLight->setCallbackUserData(this); |
282 | 229 | ||
283 | //---------------------------------------------------------------------------- | 230 | //---------------------------------------------------------------------------- |
284 | // Enable Avatar Shaders | 231 | // Enable Avatar Shaders |
285 | mCtrlAvatarVP = LLUICtrlFactory::getCheckBoxByName(this, "AvatarVertexProgram"); | 232 | mCtrlAvatarVP = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); |
286 | mCtrlAvatarVP->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); | 233 | mCtrlAvatarVP->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); |
287 | mCtrlAvatarVP->setCallbackUserData(this); | 234 | mCtrlAvatarVP->setCallbackUserData(this); |
288 | 235 | ||
289 | //---------------------------------------------------------------------------- | 236 | //---------------------------------------------------------------------------- |
290 | // Avatar Render Mode | 237 | // Avatar Render Mode |
291 | mCtrlAvatarCloth = LLUICtrlFactory::getCheckBoxByName(this, "AvatarCloth"); | 238 | mCtrlAvatarCloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); |
292 | mCtrlAvatarImpostors = LLUICtrlFactory::getCheckBoxByName(this, "AvatarImpostors"); | 239 | mCtrlAvatarImpostors = getChild<LLCheckBoxCtrl>("AvatarImpostors"); |
293 | 240 | ||
294 | //---------------------------------------------------------------------------- | 241 | //---------------------------------------------------------------------------- |
295 | // radio set for lighting detail | 242 | // radio set for lighting detail |
296 | mRadioLightingDetail2 = LLUICtrlFactory::getRadioGroupByName(this, "LightingDetailRadio"); | 243 | mRadioLightingDetail2 = getChild<LLRadioGroup>("LightingDetailRadio"); |
297 | 244 | ||
298 | //---------------------------------------------------------------------------- | 245 | //---------------------------------------------------------------------------- |
299 | // radio set for terrain detail mode | 246 | // radio set for terrain detail mode |
300 | mRadioTerrainDetail = LLUICtrlFactory::getRadioGroupByName(this, "TerrainDetailRadio"); | 247 | mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); |
301 | 248 | ||
302 | //---------------------------------------------------------------------------- | 249 | //---------------------------------------------------------------------------- |
303 | // Global Shader Enable | 250 | // Global Shader Enable |
304 | mCtrlShaderEnable = LLUICtrlFactory::getCheckBoxByName(this, "BasicShaders"); | 251 | mCtrlShaderEnable = getChild<LLCheckBoxCtrl>("BasicShaders"); |
305 | mCtrlShaderEnable->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); | 252 | mCtrlShaderEnable->setCommitCallback(&LLPanelDisplay::onVertexShaderEnable); |
306 | mCtrlShaderEnable->setCallbackUserData(this); | 253 | mCtrlShaderEnable->setCallbackUserData(this); |
307 | 254 | ||
308 | //============================================================================ | 255 | //============================================================================ |
309 | 256 | ||
310 | // Object detail slider | 257 | // Object detail slider |
311 | mCtrlDrawDistance = LLUICtrlFactory::getSliderByName(this, "DrawDistance"); | 258 | mCtrlDrawDistance = getChild<LLSliderCtrl>("DrawDistance"); |
312 | mDrawDistanceMeterText1 = LLUICtrlFactory::getTextBoxByName(this, "DrawDistanceMeterText1"); | 259 | mDrawDistanceMeterText1 = getChild<LLTextBox>("DrawDistanceMeterText1"); |
313 | mDrawDistanceMeterText2 = LLUICtrlFactory::getTextBoxByName(this, "DrawDistanceMeterText2"); | 260 | mDrawDistanceMeterText2 = getChild<LLTextBox>("DrawDistanceMeterText2"); |
314 | mCtrlDrawDistance->setCommitCallback(&LLPanelDisplay::updateMeterText); | 261 | mCtrlDrawDistance->setCommitCallback(&LLPanelDisplay::updateMeterText); |
315 | mCtrlDrawDistance->setCallbackUserData(this); | 262 | mCtrlDrawDistance->setCallbackUserData(this); |
316 | 263 | ||
317 | // Object detail slider | 264 | // Object detail slider |
318 | mCtrlLODFactor = LLUICtrlFactory::getSliderByName(this, "ObjectMeshDetail"); | 265 | mCtrlLODFactor = getChild<LLSliderCtrl>("ObjectMeshDetail"); |
319 | mLODFactorText = LLUICtrlFactory::getTextBoxByName(this, "ObjectMeshDetailText"); | 266 | mLODFactorText = getChild<LLTextBox>("ObjectMeshDetailText"); |
320 | mCtrlLODFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); | 267 | mCtrlLODFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); |
321 | mCtrlLODFactor->setCallbackUserData(mLODFactorText); | 268 | mCtrlLODFactor->setCallbackUserData(mLODFactorText); |
322 | 269 | ||
323 | // Flex object detail slider | 270 | // Flex object detail slider |
324 | mCtrlFlexFactor = LLUICtrlFactory::getSliderByName(this, "FlexibleMeshDetail"); | 271 | mCtrlFlexFactor = getChild<LLSliderCtrl>("FlexibleMeshDetail"); |
325 | mFlexFactorText = LLUICtrlFactory::getTextBoxByName(this, "FlexibleMeshDetailText"); | 272 | mFlexFactorText = getChild<LLTextBox>("FlexibleMeshDetailText"); |
326 | mCtrlFlexFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); | 273 | mCtrlFlexFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); |
327 | mCtrlFlexFactor->setCallbackUserData(mFlexFactorText); | 274 | mCtrlFlexFactor->setCallbackUserData(mFlexFactorText); |
328 | 275 | ||
329 | // Tree detail slider | 276 | // Tree detail slider |
330 | mCtrlTreeFactor = LLUICtrlFactory::getSliderByName(this, "TreeMeshDetail"); | 277 | mCtrlTreeFactor = getChild<LLSliderCtrl>("TreeMeshDetail"); |
331 | mTreeFactorText = LLUICtrlFactory::getTextBoxByName(this, "TreeMeshDetailText"); | 278 | mTreeFactorText = getChild<LLTextBox>("TreeMeshDetailText"); |
332 | mCtrlTreeFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); | 279 | mCtrlTreeFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); |
333 | mCtrlTreeFactor->setCallbackUserData(mTreeFactorText); | 280 | mCtrlTreeFactor->setCallbackUserData(mTreeFactorText); |
334 | 281 | ||
335 | // Avatar detail slider | 282 | // Avatar detail slider |
336 | mCtrlAvatarFactor = LLUICtrlFactory::getSliderByName(this, "AvatarMeshDetail"); | 283 | mCtrlAvatarFactor = getChild<LLSliderCtrl>("AvatarMeshDetail"); |
337 | mAvatarFactorText = LLUICtrlFactory::getTextBoxByName(this, "AvatarMeshDetailText"); | 284 | mAvatarFactorText = getChild<LLTextBox>("AvatarMeshDetailText"); |
338 | mCtrlAvatarFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); | 285 | mCtrlAvatarFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); |
339 | mCtrlAvatarFactor->setCallbackUserData(mAvatarFactorText); | 286 | mCtrlAvatarFactor->setCallbackUserData(mAvatarFactorText); |
340 | 287 | ||
341 | // Terrain detail slider | 288 | // Terrain detail slider |
342 | mCtrlTerrainFactor = LLUICtrlFactory::getSliderByName(this, "TerrainMeshDetail"); | 289 | mCtrlTerrainFactor = getChild<LLSliderCtrl>("TerrainMeshDetail"); |
343 | mTerrainFactorText = LLUICtrlFactory::getTextBoxByName(this, "TerrainMeshDetailText"); | 290 | mTerrainFactorText = getChild<LLTextBox>("TerrainMeshDetailText"); |
344 | mCtrlTerrainFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); | 291 | mCtrlTerrainFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); |
345 | mCtrlTerrainFactor->setCallbackUserData(mTerrainFactorText); | 292 | mCtrlTerrainFactor->setCallbackUserData(mTerrainFactorText); |
346 | 293 | ||
347 | // Terrain detail slider | 294 | // Terrain detail slider |
348 | mCtrlSkyFactor = LLUICtrlFactory::getSliderByName(this, "SkyMeshDetail"); | 295 | mCtrlSkyFactor = getChild<LLSliderCtrl>("SkyMeshDetail"); |
349 | mSkyFactorText = LLUICtrlFactory::getTextBoxByName(this, "SkyMeshDetailText"); | 296 | mSkyFactorText = getChild<LLTextBox>("SkyMeshDetailText"); |
350 | mCtrlSkyFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); | 297 | mCtrlSkyFactor->setCommitCallback(&LLPanelDisplay::updateSliderText); |
351 | mCtrlSkyFactor->setCallbackUserData(mSkyFactorText); | 298 | mCtrlSkyFactor->setCallbackUserData(mSkyFactorText); |
352 | 299 | ||
353 | // Particle detail slider | 300 | // Particle detail slider |
354 | mCtrlMaxParticle = LLUICtrlFactory::getSliderByName(this, "MaxParticleCount"); | 301 | mCtrlMaxParticle = getChild<LLSliderCtrl>("MaxParticleCount"); |
355 | 302 | ||
356 | // Glow detail slider | 303 | // Glow detail slider |
357 | mCtrlPostProcess = LLUICtrlFactory::getSliderByName(this, "RenderPostProcess"); | 304 | mCtrlPostProcess = getChild<LLSliderCtrl>("RenderPostProcess"); |
358 | mPostProcessText = LLUICtrlFactory::getTextBoxByName(this, "PostProcessText"); | 305 | mPostProcessText = getChild<LLTextBox>("PostProcessText"); |
359 | mCtrlPostProcess->setCommitCallback(&LLPanelDisplay::updateSliderText); | 306 | mCtrlPostProcess->setCommitCallback(&LLPanelDisplay::updateSliderText); |
360 | mCtrlPostProcess->setCallbackUserData(mPostProcessText); | 307 | mCtrlPostProcess->setCallbackUserData(mPostProcessText); |
361 | 308 | ||
362 | // Text boxes (for enabling/disabling) | 309 | // Text boxes (for enabling/disabling) |
363 | mShaderText = LLUICtrlFactory::getTextBoxByName(this, "ShadersText"); | 310 | mShaderText = getChild<LLTextBox>("ShadersText"); |
364 | mReflectionText = LLUICtrlFactory::getTextBoxByName(this, "ReflectionDetailText"); | 311 | mReflectionText = getChild<LLTextBox>("ReflectionDetailText"); |
365 | mAvatarText = LLUICtrlFactory::getTextBoxByName(this, "AvatarRenderingText"); | 312 | mAvatarText = getChild<LLTextBox>("AvatarRenderingText"); |
366 | mTerrainText = LLUICtrlFactory::getTextBoxByName(this, "TerrainDetailText"); | 313 | mTerrainText = getChild<LLTextBox>("TerrainDetailText"); |
367 | mLightingText = LLUICtrlFactory::getTextBoxByName(this, "LightingDetailText"); | 314 | mLightingText = getChild<LLTextBox>("LightingDetailText"); |
368 | mMeshDetailText = LLUICtrlFactory::getTextBoxByName(this, "MeshDetailText"); | 315 | mMeshDetailText = getChild<LLTextBox>("MeshDetailText"); |
369 | 316 | ||
370 | refresh(); | 317 | refresh(); |
371 | 318 | ||
@@ -462,11 +409,11 @@ void LLPanelDisplay::refreshEnabledState() | |||
462 | // Reflections | 409 | // Reflections |
463 | BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") | 410 | BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") |
464 | && gGLManager.mHasCubeMap | 411 | && gGLManager.mHasCubeMap |
465 | && gFeatureManagerp->isFeatureAvailable("RenderCubeMap"); | 412 | && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); |
466 | mCtrlReflections->setEnabled(reflections); | 413 | mCtrlReflections->setEnabled(reflections); |
467 | 414 | ||
468 | // Bump & Shiny | 415 | // Bump & Shiny |
469 | bool bumpshiny = gGLManager.mHasCubeMap && gFeatureManagerp->isFeatureAvailable("RenderCubeMap") && gFeatureManagerp->isFeatureAvailable("RenderObjectBump"); | 416 | bool bumpshiny = gGLManager.mHasCubeMap && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap") && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); |
470 | mCtrlBumpShiny->setEnabled(bumpshiny ? TRUE : FALSE); | 417 | mCtrlBumpShiny->setEnabled(bumpshiny ? TRUE : FALSE); |
471 | 418 | ||
472 | for (S32 i = 0; i < mRadioReflectionDetail->getItemCount(); ++i) | 419 | for (S32 i = 0; i < mRadioReflectionDetail->getItemCount(); ++i) |
@@ -489,7 +436,7 @@ void LLPanelDisplay::refreshEnabledState() | |||
489 | } | 436 | } |
490 | 437 | ||
491 | // Vertex Shaders | 438 | // Vertex Shaders |
492 | mCtrlShaderEnable->setEnabled(gFeatureManagerp->isFeatureAvailable("VertexShaderEnable")); | 439 | mCtrlShaderEnable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); |
493 | 440 | ||
494 | BOOL shaders = mCtrlShaderEnable->get(); | 441 | BOOL shaders = mCtrlShaderEnable->get(); |
495 | if (shaders) | 442 | if (shaders) |
@@ -517,7 +464,7 @@ void LLPanelDisplay::refreshEnabledState() | |||
517 | void LLPanelDisplay::disableUnavailableSettings() | 464 | void LLPanelDisplay::disableUnavailableSettings() |
518 | { | 465 | { |
519 | // if vertex shaders off, disable all shader related products | 466 | // if vertex shaders off, disable all shader related products |
520 | if(!gFeatureManagerp->isFeatureAvailable("VertexShaderEnable")) | 467 | if(!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")) |
521 | { | 468 | { |
522 | mCtrlShaderEnable->setEnabled(FALSE); | 469 | mCtrlShaderEnable->setEnabled(FALSE); |
523 | mCtrlShaderEnable->setValue(FALSE); | 470 | mCtrlShaderEnable->setValue(FALSE); |
@@ -536,21 +483,21 @@ void LLPanelDisplay::disableUnavailableSettings() | |||
536 | } | 483 | } |
537 | 484 | ||
538 | // disabled windlight | 485 | // disabled windlight |
539 | if(!gFeatureManagerp->isFeatureAvailable("WindLightUseAtmosShaders")) | 486 | if(!LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) |
540 | { | 487 | { |
541 | mCtrlWindLight->setEnabled(FALSE); | 488 | mCtrlWindLight->setEnabled(FALSE); |
542 | mCtrlWindLight->setValue(FALSE); | 489 | mCtrlWindLight->setValue(FALSE); |
543 | } | 490 | } |
544 | 491 | ||
545 | // disabled reflections | 492 | // disabled reflections |
546 | if(!gFeatureManagerp->isFeatureAvailable("RenderWaterReflections")) | 493 | if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderWaterReflections")) |
547 | { | 494 | { |
548 | mCtrlReflections->setEnabled(FALSE); | 495 | mCtrlReflections->setEnabled(FALSE); |
549 | mCtrlReflections->setValue(FALSE); | 496 | mCtrlReflections->setValue(FALSE); |
550 | } | 497 | } |
551 | 498 | ||
552 | // disabled av | 499 | // disabled av |
553 | if(!gFeatureManagerp->isFeatureAvailable("RenderAvatarVP")) | 500 | if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP")) |
554 | { | 501 | { |
555 | mCtrlAvatarVP->setEnabled(FALSE); | 502 | mCtrlAvatarVP->setEnabled(FALSE); |
556 | mCtrlAvatarVP->setValue(FALSE); | 503 | mCtrlAvatarVP->setValue(FALSE); |
@@ -559,13 +506,13 @@ void LLPanelDisplay::disableUnavailableSettings() | |||
559 | mCtrlAvatarCloth->setValue(FALSE); | 506 | mCtrlAvatarCloth->setValue(FALSE); |
560 | } | 507 | } |
561 | // disabled cloth | 508 | // disabled cloth |
562 | if(!gFeatureManagerp->isFeatureAvailable("RenderAvatarCloth")) | 509 | if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) |
563 | { | 510 | { |
564 | mCtrlAvatarCloth->setEnabled(FALSE); | 511 | mCtrlAvatarCloth->setEnabled(FALSE); |
565 | mCtrlAvatarCloth->setValue(FALSE); | 512 | mCtrlAvatarCloth->setValue(FALSE); |
566 | } | 513 | } |
567 | // disabled impostors | 514 | // disabled impostors |
568 | if(!gFeatureManagerp->isFeatureAvailable("RenderUseImpostors")) | 515 | if(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors")) |
569 | { | 516 | { |
570 | mCtrlAvatarImpostors->setEnabled(FALSE); | 517 | mCtrlAvatarImpostors->setEnabled(FALSE); |
571 | mCtrlAvatarImpostors->setValue(FALSE); | 518 | mCtrlAvatarImpostors->setValue(FALSE); |
@@ -722,7 +669,7 @@ void LLPanelDisplay::onChangeQuality(LLUICtrl *ctrl, void *data) | |||
722 | } | 669 | } |
723 | 670 | ||
724 | U32 set = (U32)sldr->getValueF32(); | 671 | U32 set = (U32)sldr->getValueF32(); |
725 | gFeatureManagerp->setGraphicsLevel(set, true); | 672 | LLFeatureManager::getInstance()->setGraphicsLevel(set, true); |
726 | 673 | ||
727 | LLFloaterPreference::refreshEnabledGraphics(); | 674 | LLFloaterPreference::refreshEnabledGraphics(); |
728 | cur_panel->refresh(); | 675 | cur_panel->refresh(); |
@@ -859,15 +806,12 @@ void LLPanelDisplay::applyResolution() | |||
859 | } | 806 | } |
860 | 807 | ||
861 | // force aspect ratio | 808 | // force aspect ratio |
862 | if (fullscreen && gCamera) | 809 | if (fullscreen) |
863 | { | 810 | { |
864 | gCamera->setAspect( gViewerWindow->getDisplayAspectRatio() ); | 811 | LLViewerCamera::getInstance()->setAspect( gViewerWindow->getDisplayAspectRatio() ); |
865 | } | 812 | } |
866 | 813 | ||
867 | if (gWorldPointer) | 814 | send_agent_update(TRUE); |
868 | { | ||
869 | send_agent_update(TRUE); | ||
870 | } | ||
871 | 815 | ||
872 | // Update enable/disable | 816 | // Update enable/disable |
873 | refresh(); | 817 | refresh(); |
@@ -955,11 +899,8 @@ void LLPanelDisplay::onVertexShaderEnable(LLUICtrl* self, void* data) | |||
955 | 899 | ||
956 | void LLPanelDisplay::setHardwareDefaults(void* user_data) | 900 | void LLPanelDisplay::setHardwareDefaults(void* user_data) |
957 | { | 901 | { |
958 | if (gFeatureManagerp) | 902 | LLFeatureManager::getInstance()->applyRecommendedSettings(); |
959 | { | 903 | LLFloaterPreference::refreshEnabledGraphics(); |
960 | gFeatureManagerp->applyRecommendedSettings(); | ||
961 | LLFloaterPreference::refreshEnabledGraphics(); | ||
962 | } | ||
963 | } | 904 | } |
964 | 905 | ||
965 | void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data) | 906 | void LLPanelDisplay::updateSliderText(LLUICtrl* ctrl, void* user_data) |
@@ -999,12 +940,8 @@ void LLPanelDisplay::updateMeterText(LLUICtrl* ctrl, void* user_data) | |||
999 | LLPanelDisplay* panel = (LLPanelDisplay*)user_data; | 940 | LLPanelDisplay* panel = (LLPanelDisplay*)user_data; |
1000 | LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; | 941 | LLSliderCtrl* slider = (LLSliderCtrl*) ctrl; |
1001 | 942 | ||
1002 | LLTextBox* m1 = LLUICtrlFactory::getTextBoxByName(panel, "DrawDistanceMeterText1"); | 943 | LLTextBox* m1 = panel->getChild<LLTextBox>("DrawDistanceMeterText1"); |
1003 | LLTextBox* m2 = LLUICtrlFactory::getTextBoxByName(panel, "DrawDistanceMeterText2"); | 944 | LLTextBox* m2 = panel->getChild<LLTextBox>("DrawDistanceMeterText2"); |
1004 | if(m1 == NULL || m2 == NULL || slider == NULL) | ||
1005 | { | ||
1006 | return; | ||
1007 | } | ||
1008 | 945 | ||
1009 | // toggle the two text boxes based on whether we have 1 or two digits | 946 | // toggle the two text boxes based on whether we have 1 or two digits |
1010 | F32 val = slider->getValueF32(); | 947 | F32 val = slider->getValueF32(); |