diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-04-11 17:51:10 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-04-11 17:51:10 +0300 |
commit | d248961c306511f633cefedbec5269c7a81e5bc9 (patch) | |
tree | f65c2cbfbc5bd2299e49a29a873a4cb3b44d6880 /indra/newview | |
parent | e20aafa2fe200cecf1f4d3ae31294ba0eb5ce194 (diff) |
SL-17182 FIXED Viewer crashes after changing the environment settings
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llenvironment.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llenvironment.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 1 |
3 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 42f3d15a1c..b76dc6a961 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1155,6 +1155,10 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe mSignalEnvChanged(env, env_version); } +void LLEnvironment::setCurrentEnvironmentSelection(LLEnvironment::EnvSelection_t env) +{ + mCurrentEnvironment->setEnvironmentSelection(env); +} void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironment::fixedEnvironment_t fixed, S32 env_version) { @@ -1761,8 +1765,22 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader* shader) void LLEnvironment::updateSettingsUniforms() { - updateGLVariablesForSettings(mWaterUniforms, mCurrentEnvironment->getWater()); - updateGLVariablesForSettings(mSkyUniforms, mCurrentEnvironment->getSky()); + if (mCurrentEnvironment->getWater()) + { + updateGLVariablesForSettings(mWaterUniforms, mCurrentEnvironment->getWater()); + } + else + { + LL_WARNS("ENVIRONMENT") << "Failed to update GL variable for water settings, environment is not properly set" << LL_ENDL; + } + if (mCurrentEnvironment->getSky()) + { + updateGLVariablesForSettings(mSkyUniforms, mCurrentEnvironment->getSky()); + } + else + { + LL_WARNS("ENVIRONMENT") << "Failed to update GL variable for sky settings, environment is not properly set" << LL_ENDL; + } } void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition) diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 0ec06402f8..330de2bea8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -158,6 +158,8 @@ public: static void logEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version = NO_VERSION); + void setCurrentEnvironmentSelection(LLEnvironment::EnvSelection_t env); + LLSettingsDay::ptr_t getEnvironmentDay(EnvSelection_t env); LLSettingsDay::Seconds getEnvironmentDayLength(EnvSelection_t env); diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 4f2c36f45b..fec218ca3b 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -137,6 +137,7 @@ void LLFloaterFixedEnvironment::onClose(bool app_quitting) doCloseInventoryFloater(app_quitting); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setCurrentEnvironmentSelection(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); mSettings.reset(); |