summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp49
-rw-r--r--indra/llinventory/llsettingsdaycycle.h3
2 files changed, 51 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));
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index da572572c4..93c275bfb8 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -88,7 +88,10 @@ public:
KeyframeList_t getTrackKeyframes(S32 track);
void setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 keyframe);
+ const LLSettingsWaterPtr_t getWaterAtKeyframe(F32 keyframe);
void setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track);
+ const LLSettingsSkyPtr_t getSkyAtKeyframe(F32 keyframe, S32 track);
+ const LLSettingsBase::ptr_t getSettingsAtKeyframe(F32 keyframe, S32 track);
//---------------------------------------------------------------------
void startDayCycle();