aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterhardwaresettings.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/llfloaterhardwaresettings.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/llfloaterhardwaresettings.cpp')
-rw-r--r--linden/indra/newview/llfloaterhardwaresettings.cpp42
1 files changed, 25 insertions, 17 deletions
diff --git a/linden/indra/newview/llfloaterhardwaresettings.cpp b/linden/indra/newview/llfloaterhardwaresettings.cpp
index 0d92764..1f0a68f 100644
--- a/linden/indra/newview/llfloaterhardwaresettings.cpp
+++ b/linden/indra/newview/llfloaterhardwaresettings.cpp
@@ -40,7 +40,7 @@
40#include "llstartup.h" 40#include "llstartup.h"
41 41
42#include "llradiogroup.h" 42#include "llradiogroup.h"
43#include "llvieweruictrlfactory.h" 43#include "lluictrlfactory.h"
44 44
45#include "llimagegl.h" 45#include "llimagegl.h"
46#include "pipeline.h" 46#include "pipeline.h"
@@ -49,7 +49,7 @@ LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL;
49 49
50LLFloaterHardwareSettings::LLFloaterHardwareSettings() : LLFloater("Hardware Settings Floater") 50LLFloaterHardwareSettings::LLFloaterHardwareSettings() : LLFloater("Hardware Settings Floater")
51{ 51{
52 gUICtrlFactory->buildFloater(this, "floater_hardware_settings.xml"); 52 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml");
53 53
54 // load it up 54 // load it up
55 initCallbacks(); 55 initCallbacks();
@@ -77,11 +77,13 @@ void LLFloaterHardwareSettings::refresh()
77 77
78 mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable"); 78 mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable");
79 mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic"); 79 mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic");
80 mFSAASamples = gSavedSettings.getU32("RenderFSAASamples");
80 mGamma = gSavedSettings.getF32("RenderGamma"); 81 mGamma = gSavedSettings.getF32("RenderGamma");
81 mVideoCardMem = gSavedSettings.getS32("TextureMemory"); 82 mVideoCardMem = gSavedSettings.getS32("TextureMemory");
82 mFogRatio = gSavedSettings.getF32("RenderFogRatio"); 83 mFogRatio = gSavedSettings.getF32("RenderFogRatio");
83 mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); 84 mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup");
84 85
86 childSetValue("fsaa", (LLSD::Integer) mFSAASamples);
85 refreshEnabledState(); 87 refreshEnabledState();
86} 88}
87 89
@@ -92,7 +94,7 @@ void LLFloaterHardwareSettings::refreshEnabledState()
92 childSetMinValue("GrapicsCardTextureMemory", min_tex_mem); 94 childSetMinValue("GrapicsCardTextureMemory", min_tex_mem);
93 childSetMaxValue("GrapicsCardTextureMemory", max_tex_mem); 95 childSetMaxValue("GrapicsCardTextureMemory", max_tex_mem);
94 96
95 if (!gFeatureManagerp->isFeatureAvailable("RenderVBOEnable") || 97 if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
96 !gGLManager.mHasVertexBufferObject) 98 !gGLManager.mHasVertexBufferObject)
97 { 99 {
98 childSetEnabled("vbo", FALSE); 100 childSetEnabled("vbo", FALSE);
@@ -122,7 +124,7 @@ void LLFloaterHardwareSettings::show()
122 hardSettings->center(); 124 hardSettings->center();
123 125
124 // comment in if you want the menu to rebuild each time 126 // comment in if you want the menu to rebuild each time
125 //gUICtrlFactory->buildFloater(hardSettings, "floater_hardware_settings.xml"); 127 //LLUICtrlFactory::getInstance()->buildFloater(hardSettings, "floater_hardware_settings.xml");
126 //hardSettings->initCallbacks(); 128 //hardSettings->initCallbacks();
127 129
128 hardSettings->open(); 130 hardSettings->open();
@@ -151,17 +153,6 @@ void LLFloaterHardwareSettings::onClose(bool app_quitting)
151 153
152BOOL LLFloaterHardwareSettings::postBuild() 154BOOL LLFloaterHardwareSettings::postBuild()
153{ 155{
154 requires("ani", WIDGET_TYPE_CHECKBOX);
155 requires("gamma", WIDGET_TYPE_SPINNER);
156 requires("vbo", WIDGET_TYPE_CHECKBOX);
157 requires("GrapicsCardTextureMemory", WIDGET_TYPE_SLIDER);
158 requires("fog", WIDGET_TYPE_SPINNER);
159
160 if (!checkRequirements())
161 {
162 return FALSE;
163 }
164
165 childSetAction("OK", onBtnOK, this); 156 childSetAction("OK", onBtnOK, this);
166 157
167 refresh(); 158 refresh();
@@ -175,9 +166,25 @@ void LLFloaterHardwareSettings::apply()
175 // Anisotropic rendering 166 // Anisotropic rendering
176 BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; 167 BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic;
177 LLImageGL::sGlobalUseAnisotropic = childGetValue("ani"); 168 LLImageGL::sGlobalUseAnisotropic = childGetValue("ani");
178 if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) 169
170 U32 fsaa = (U32) childGetValue("fsaa").asInteger();
171 U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples");
172
173 BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED);
174
175 if (old_fsaa != fsaa)
176 {
177 gSavedSettings.setU32("RenderFSAASamples", fsaa);
178 LLWindow* window = gViewerWindow->getWindow();
179 LLCoordScreen size;
180 window->getSize(&size);
181 gViewerWindow->changeDisplaySettings(window->getFullscreen(),
182 size,
183 gSavedSettings.getBOOL("DisableVerticalSync"),
184 logged_in);
185 }
186 else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic)
179 { 187 {
180 BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED);
181 gViewerWindow->restartDisplay(logged_in); 188 gViewerWindow->restartDisplay(logged_in);
182 } 189 }
183 190
@@ -189,6 +196,7 @@ void LLFloaterHardwareSettings::cancel()
189{ 196{
190 gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO); 197 gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO);
191 gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); 198 gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso);
199 gSavedSettings.setU32("RenderFSAASamples", mFSAASamples);
192 gSavedSettings.setF32("RenderGamma", mGamma); 200 gSavedSettings.setF32("RenderGamma", mGamma);
193 gSavedSettings.setS32("TextureMemory", mVideoCardMem); 201 gSavedSettings.setS32("TextureMemory", mVideoCardMem);
194 gSavedSettings.setF32("RenderFogRatio", mFogRatio); 202 gSavedSettings.setF32("RenderFogRatio", mFogRatio);