diff options
author | Rider Linden <rider@lindenlab.com> | 2018-04-27 17:12:13 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-04-27 17:12:13 -0700 |
commit | cf0e4f79f52b4fb24769aa6e355ec8c95c6d2afc (patch) | |
tree | dfcbc227522579c602240cf643a2960c3956688d /indra/newview/llenvironment.cpp | |
parent | 2fe4b5169f5d8846b1c6cd4e2aaaf2f41a7b7629 (diff) |
Adding fixed water edit dialog.
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r-- | indra/newview/llenvironment.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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<EnvSelection_t>(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; |