From cf0e4f79f52b4fb24769aa6e355ec8c95c6d2afc Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 27 Apr 2018 17:12:13 -0700 Subject: Adding fixed water edit dialog. --- indra/newview/llenvironment.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llenvironment.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index c5a1af8747..214ebb82b0 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -329,6 +329,30 @@ S64Seconds LLEnvironment::getEnvironmentDayOffset(EnvSelection_t env) LLEnvironment::fixedEnvironment_t LLEnvironment::getEnvironmentFixed(LLEnvironment::EnvSelection_t env) { + if (env == ENV_CURRENT) + { + fixedEnvironment_t fixed; + for (S32 idx = mSelectedEnvironment; idx < ENV_END; ++idx) + { + if (fixed.first && fixed.second) + break; + + DayInstance::ptr_t environment = getEnvironmentInstance(static_cast(idx)); + if (environment) + { + if (!fixed.first) + fixed.first = environment->getSky(); + if (!fixed.second) + fixed.second = environment->getWater(); + } + } + + if (!fixed.first || !fixed.second) + LL_WARNS("ENVIRONMENT") << "Can not construct complete fixed environment. Missing Sky and/or Water." << LL_ENDL; + + return fixed; + } + if ((env < ENV_EDIT) || (env > ENV_DEFAULT)) { LL_WARNS("ENVIRONMENT") << "Attempt to retrieve invalid environment selection." << LL_ENDL; -- cgit v1.2.3