SL-17182 FIXED Viewer crashes after changing the environment settings

master
Mnikolenko Productengine 2022-04-11 17:51:10 +03:00
parent e20aafa2fe
commit d248961c30
3 changed files with 23 additions and 2 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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();