diff options
author | Rider Linden <rider@lindenlab.com> | 2018-05-22 10:49:55 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-05-22 10:49:55 -0700 |
commit | 044b80e4e1a7b55f46e6f3b52c9cae6d9c6df3eb (patch) | |
tree | 3505ebdff373a1c32117cddd42700776d8f051d3 /indra/llinventory/llsettingsdaycycle.cpp | |
parent | 9dc8df35c0ae24ed8a1d8329c7b0ac0f71d239bf (diff) |
Manual blender for use in day editing dialog.
Diffstat (limited to 'indra/llinventory/llsettingsdaycycle.cpp')
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 5a6280884d..aa3fd4e0e6 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -551,23 +551,15 @@ bool LLSettingsDay::removeTrackKeyframe(S32 trackno, F32 frame) void LLSettingsDay::setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 keyframe) { - mDayTracks[TRACK_WATER][llclamp(keyframe, 0.0f, 1.0f)] = water; - setDirtyFlag(true); + setSettingsAtKeyframe(water, keyframe, TRACK_WATER); } -const LLSettingsWaterPtr_t LLSettingsDay::getWaterAtKeyframe(F32 keyframe) +LLSettingsWater::ptr_t LLSettingsDay::getWaterAtKeyframe(F32 keyframe) const { - // 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); + return std::dynamic_pointer_cast<LLSettingsWater>(getSettingsAtKeyframe(keyframe, TRACK_WATER)); } -void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track) +void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSky::ptr_t &sky, F32 keyframe, S32 track) { if ((track < 1) || (track >= TRACK_MAX)) { @@ -575,44 +567,48 @@ void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe return; } - mDayTracks[track][llclamp(keyframe, 0.0f, 1.0f)] = sky; - setDirtyFlag(true); + setSettingsAtKeyframe(sky, keyframe, track); } -const LLSettingsSkyPtr_t LLSettingsDay::getSkyAtKeyframe(F32 keyframe, S32 track) +LLSettingsSky::ptr_t LLSettingsDay::getSkyAtKeyframe(F32 keyframe, S32 track) const { if ((track < 1) || (track >= TRACK_MAX)) { LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL; - return LLSettingsSkyPtr_t(NULL); + return LLSettingsSky::ptr_t(); } - // 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>(getSettingsAtKeyframe(keyframe, track)); +} + +void LLSettingsDay::setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, F32 keyframe, S32 track) +{ + if ((track < 0) || (track >= TRACK_MAX)) { - return std::dynamic_pointer_cast<LLSettingsSky>(iter->second); + LL_WARNS("DAYCYCLE") << "Attempt to set track (#" << track << ") out of range!" << LL_ENDL; + return; } - return LLSettingsSkyPtr_t(NULL); + mDayTracks[track][llclamp(keyframe, 0.0f, 1.0f)] = settings; + setDirtyFlag(true); } -const LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(F32 keyframe, S32 track) +LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(F32 keyframe, S32 track) const { 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); + return LLSettingsBase::ptr_t(); } // todo: better way to identify keyframes? - CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe); + CycleTrack_t::const_iterator iter = mDayTracks[track].find(keyframe); if (iter != mDayTracks[track].end()) { return iter->second; } - return LLSettingsSkyPtr_t(NULL); + return LLSettingsBase::ptr_t(); } LLSettingsDay::TrackBound_t LLSettingsDay::getBoundingEntries(LLSettingsDay::CycleTrack_t &track, F32 keyframe) |