summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-05-22 10:49:55 -0700
committerRider Linden <rider@lindenlab.com>2018-05-22 10:49:55 -0700
commit044b80e4e1a7b55f46e6f3b52c9cae6d9c6df3eb (patch)
tree3505ebdff373a1c32117cddd42700776d8f051d3 /indra/llinventory
parent9dc8df35c0ae24ed8a1d8329c7b0ac0f71d239bf (diff)
Manual blender for use in day editing dialog.
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingsbase.cpp2
-rw-r--r--indra/llinventory/llsettingsbase.h7
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp46
-rw-r--r--indra/llinventory/llsettingsdaycycle.h10
4 files changed, 32 insertions, 33 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index a6a7a9acf9..f870ec8904 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -535,7 +535,7 @@ bool LLSettingsBase::Validator::verifyIntegerRange(LLSD &value, LLSD range)
//=========================================================================
void LLSettingsBlender::update(F64 blendf)
{
-
+ setPosition(blendf);
}
F64 LLSettingsBlender::setPosition(F64 blendf)
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 6ab3032a3d..d00e340b4b 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -265,7 +265,7 @@ public:
typedef boost::signals2::connection connection_t;
LLSettingsBlender(const LLSettingsBase::ptr_t &target,
- const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 span = 1.0) :
+ const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting) :
mOnFinished(),
mTarget(target),
mInitial(initsetting),
@@ -277,8 +277,9 @@ public:
virtual ~LLSettingsBlender() {}
- virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 span = 1.0)
+ virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 /*span*/ = 1.0)
{
+ // note: the 'span' reset parameter is unused by the base class.
mInitial = initsetting;
mFinal = endsetting;
mTarget->replaceSettings(mInitial->getSettings());
@@ -322,7 +323,7 @@ class LLSettingsBlenderTimeDelta : public LLSettingsBlender
public:
LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target,
const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64Seconds seconds) :
- LLSettingsBlender(target, initsetting, endsetting, seconds.value()),
+ LLSettingsBlender(target, initsetting, endsetting),
mBlendSpan(seconds),
mLastUpdate(0.0f),
mTimeSpent(0.0f)
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)
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index 15a5b29f9f..9a89031aed 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -33,6 +33,8 @@
class LLSettingsWater;
class LLSettingsSky;
+// These are alias for LLSettingsWater::ptr_t and LLSettingsSky::ptr_t respectively.
+// Here for definitions only.
typedef std::shared_ptr<LLSettingsWater> LLSettingsWaterPtr_t;
typedef std::shared_ptr<LLSettingsSky> LLSettingsSkyPtr_t;
@@ -84,16 +86,16 @@ public:
static LLSD defaults();
//---------------------------------------------------------------------
-
KeyframeList_t getTrackKeyframes(S32 track);
bool moveTrackKeyframe(S32 track, F32 old_frame, F32 new_frame);
bool removeTrackKeyframe(S32 track, F32 frame);
void setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 keyframe);
- const LLSettingsWaterPtr_t getWaterAtKeyframe(F32 keyframe);
+ LLSettingsWaterPtr_t getWaterAtKeyframe(F32 keyframe) const;
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);
+ LLSettingsSkyPtr_t getSkyAtKeyframe(F32 keyframe, S32 track) const;
+ void setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, F32 keyframe, S32 track);
+ LLSettingsBase::ptr_t getSettingsAtKeyframe(F32 keyframe, S32 track) const;
//---------------------------------------------------------------------
void startDayCycle();