summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingsdaycycle.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-05-11 20:10:08 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-05-11 20:10:08 +0300
commitcef4e29b901c5a8964e53ec3eb6659faeea0059a (patch)
treec91810c6c53c4b82617a7a77ccb3945946ac6f89 /indra/llinventory/llsettingsdaycycle.cpp
parent3c18de21369260ec9b7ba39c0e360045dd65e30d (diff)
MAINT-8344 Day cycle editor (part 1)
Diffstat (limited to 'indra/llinventory/llsettingsdaycycle.cpp')
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp49
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));