diff options
Diffstat (limited to 'indra/newview/llenvironment.cpp')
-rw-r--r-- | indra/newview/llenvironment.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 84a1f2c1ab..ceba7fda88 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -34,7 +34,6 @@ #include "llviewerregion.h" #include "llwaterparammanager.h" #include "llwlhandlers.h" -#include "llwlparammanager.h" #include "lltrans.h" #include "lltrace.h" #include "llfasttimer.h" @@ -66,6 +65,12 @@ LLEnvironment::~LLEnvironment() } //------------------------------------------------------------------------- +F32 LLEnvironment::getCamHeight() const +{ + return (mCurrentSky->getDomeOffset() * mCurrentSky->getDomeRadius()); +} + +//------------------------------------------------------------------------- void LLEnvironment::update(const LLViewerCamera * cam) { LL_RECORD_BLOCK_TIME(FTM_ENVIRONMENT_UPDATE); @@ -222,7 +227,7 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader) stop_glerror(); } - shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mCurrentSky->getSceneLightStrength()); + shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, getSceneLightStrength()); // { // LLVector4 cloud_scroll(mCloudScroll[0], mCloudScroll[1], 0.0, 0.0); @@ -244,6 +249,8 @@ void LLEnvironment::addSky(const LLSettingsSky::ptr_t &sky) { std::string name = sky->getValue(LLSettingsSky::SETTING_NAME).asString(); + LL_WARNS("RIDER") << "Adding sky as '" << name << "'" << LL_ENDL; + std::pair<NamedSkyMap_t::iterator, bool> result; result = mSkysByName.insert(NamedSkyMap_t::value_type(name, sky)); @@ -280,3 +287,14 @@ void LLEnvironment::clearAllSkys() mSkysById.clear(); } +void LLEnvironment::selectSky(const std::string &name) +{ + NamedSkyMap_t::iterator it = mSkysByName.find(name); + + if (it == mSkysByName.end()) + return; + + mCurrentSky = (*it).second; + mCurrentSky->setDirtyFlag(true); +} + |