diff options
author | Graham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com> | 2018-05-16 23:45:56 +0100 |
---|---|---|
committer | Graham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com> | 2018-05-16 23:45:56 +0100 |
commit | 4d4a7dfb9f28007c2ceb53668d065bbe0fa332af (patch) | |
tree | 9c9929e754fa8f6d0ad6c8fdc15c0fa494dbd0b6 /indra/llinventory/llsettingsdaycycle.cpp | |
parent | 3116416fcb8dfd54ef2807e9e75959429c946d79 (diff) | |
parent | 67a16cad8ab5c928f34b4299eae5499b59c3aa83 (diff) |
Merge and disable new sky render.
Diffstat (limited to 'indra/llinventory/llsettingsdaycycle.cpp')
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 70826d1410..3f60430715 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -483,7 +483,7 @@ void LLSettingsDay::updateSettings() //========================================================================= LLSettingsDay::KeyframeList_t LLSettingsDay::getTrackKeyframes(S32 trackno) { - if ((trackno < 1) || (trackno >= TRACK_MAX)) + if ((trackno < 0) || (trackno >= TRACK_MAX)) { LL_WARNS("DAYCYCLE") << "Attempt get track (#" << trackno << ") out of range!" << LL_ENDL; return KeyframeList_t(); @@ -508,6 +508,17 @@ void LLSettingsDay::setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 ke setDirtyFlag(true); } +const LLSettingsWaterPtr_t LLSettingsDay::getWaterAtKeyframe(F32 keyframe) +{ + // todo: better way to identify keyframes? + CycleTrack_t::iterator iter = mDayTracks[TRACK_WATER].find(keyframe); + if (iter != mDayTracks[TRACK_WATER].end()) + { + return std::dynamic_pointer_cast<LLSettingsWater>(iter->second); + } + + return LLSettingsWaterPtr_t(NULL); +} void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track) { @@ -521,6 +532,42 @@ void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe setDirtyFlag(true); } +const LLSettingsSkyPtr_t LLSettingsDay::getSkyAtKeyframe(F32 keyframe, S32 track) +{ + if ((track < 1) || (track >= TRACK_MAX)) + { + LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL; + return LLSettingsSkyPtr_t(NULL); + } + + // todo: better way to identify keyframes? + CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe); + if (iter != mDayTracks[track].end()) + { + return std::dynamic_pointer_cast<LLSettingsSky>(iter->second); + } + + return LLSettingsSkyPtr_t(NULL); +} + +const LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(F32 keyframe, S32 track) +{ + if ((track < 0) || (track >= TRACK_MAX)) + { + LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL; + return LLSettingsBase::ptr_t(NULL); + } + + // todo: better way to identify keyframes? + CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe); + if (iter != mDayTracks[track].end()) + { + return iter->second; + } + + return LLSettingsSkyPtr_t(NULL); +} + LLSettingsDay::TrackBound_t LLSettingsDay::getBoundingEntries(LLSettingsDay::CycleTrack_t &track, F32 keyframe) { return TrackBound_t(get_wrapping_atbefore(track, keyframe), get_wrapping_atafter(track, keyframe)); |