From ad181dcaac1fe6fd54082240a9892f40462f8724 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 21 Oct 2010 14:24:03 -0500 Subject: Fix for crash when toggling anisotropic filtering. --- indra/newview/llfloaterhardwaresettings.cpp | 25 ------------------------- indra/newview/llviewercontrol.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index e562b00a04..1e91710552 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -131,31 +131,6 @@ BOOL LLFloaterHardwareSettings::postBuild() void LLFloaterHardwareSettings::apply() { - // Anisotropic rendering - //Do nothing here -- this code is unreliable, and UI now tells users to restart for changes to take affect - /*BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic; - LLImageGL::sGlobalUseAnisotropic = getChild("ani")->getValue(); - - U32 fsaa = (U32) getChild("fsaa")->getValue().asInteger(); - U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples"); - - BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED); - - if (old_fsaa != fsaa) - { - gSavedSettings.setU32("RenderFSAASamples", fsaa); - LLWindow* window = gViewerWindow->getWindow(); - LLCoordScreen size; - window->getSize(&size); - gViewerWindow->changeDisplaySettings(size, - gSavedSettings.getBOOL("DisableVerticalSync"), - logged_in); - } - else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic) - { - gViewerWindow->restartDisplay(logged_in); - }*/ - refresh(); } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 522b5a7dfa..fbec2a7b9e 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -131,6 +131,13 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue) return true; } +static bool handleAnisotropicChanged(const LLSD& newvalue) +{ + LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); + LLImageGL::dirtyTexOptions(); + return true; +} + static bool handleVolumeLODChanged(const LLSD& newvalue) { LLVOVolume::sLODFactor = (F32) newvalue.asReal(); @@ -498,6 +505,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); -- cgit v1.2.3