summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-06-04 23:12:21 +0100
committerGraham Linden <graham@lindenlab.com>2018-06-04 23:12:21 +0100
commitcd8f0da2d187df69a99a665ea11faaa4e13b7a12 (patch)
tree45d02c7c8bf5387c35393ccc980a52fe0907ab75
parent38271e9980f2ccb6b80b27cd063933748247a7be (diff)
Fix use of new typedefs in inventory settings code in llenvironment.
-rw-r--r--indra/llinventory/llsettingsbase.cpp12
-rw-r--r--indra/llinventory/llsettingsbase.h31
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp42
-rw-r--r--indra/llinventory/llsettingsdaycycle.h24
-rw-r--r--indra/llinventory/llsettingswater.cpp2
-rw-r--r--indra/newview/llenvironment.cpp50
-rw-r--r--indra/newview/llenvironment.h8
7 files changed, 78 insertions, 91 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index 23afbdfa3a..76b1e0b2a6 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -35,7 +35,7 @@
//=========================================================================
namespace
{
- const LLSettingsBase::BlendFactor BREAK_POINT = 0.5;
+ const LLSettingsBase::TrackPosition BREAK_POINT = 0.5;
}
//=========================================================================
@@ -554,10 +554,10 @@ bool LLSettingsBase::Validator::verifyIntegerRange(LLSD &value, LLSD range)
//=========================================================================
void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf)
{
- setPosition(blendf);
+ setBlendFactor(blendf);
}
-F64 LLSettingsBlender::setPosition(const LLSettingsBase::TrackPosition& blendf_in)
+F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in)
{
LLSettingsBase::TrackPosition blendf = blendf_in;
if (blendf >= 1.0)
@@ -565,7 +565,7 @@ F64 LLSettingsBlender::setPosition(const LLSettingsBase::TrackPosition& blendf_i
triggerComplete();
return 1.0;
}
- blendf = llclamp(blendf, 0.0, 1.0);
+ blendf = llclamp(blendf, 0.0f, 1.0f);
mTarget->replaceSettings(mInitial->getSettings());
if (!mFinal || (mInitial == mFinal) || (blendf == 0.0))
@@ -590,7 +590,7 @@ LLSettingsBase::BlendFactor LLSettingsBlenderTimeDelta::calculateBlend(const LLS
return LLSettingsBase::BlendFactor(fmod((F64)spanpos, (F64)spanlen) / (F64)spanlen);
}
-void LLSettingsBlenderTimeDelta::advance(const LLSettingsBase::Seconds& timedelta)
+void LLSettingsBlenderTimeDelta::applyTimeDelta(const LLSettingsBase::Seconds& timedelta)
{
mTimeSpent += timedelta;
@@ -602,5 +602,5 @@ void LLSettingsBlenderTimeDelta::advance(const LLSettingsBase::Seconds& timedelt
LLSettingsBase::BlendFactor blendf = calculateBlend(mTimeSpent, mBlendSpan);
- setPosition(blendf);
+ update(blendf);
}
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index a8e1cc5eea..374a2ec246 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -48,9 +48,6 @@
#define PTR_NAMESPACE std
#define SETTINGS_OVERRIDE override
-//#define PTR_NAMESPACE boost
-//#define SETTINGS_OVERRIDE
-
class LLSettingsBase :
public PTR_NAMESPACE::enable_shared_from_this<LLSettingsBase>,
private boost::noncopyable
@@ -63,7 +60,7 @@ class LLSettingsBase :
public:
typedef F64Seconds Seconds;
typedef F64 BlendFactor;
- typedef F64 TrackPosition;
+ typedef F32 TrackPosition; // 32-bit as these are stored in LLSD as such
static const std::string SETTING_ID;
static const std::string SETTING_NAME;
@@ -305,7 +302,7 @@ public:
virtual ~LLSettingsBlender() {}
- virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& span)
+ virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::TrackPosition&)
{
// note: the 'span' reset parameter is unused by the base class.
if (!mInitial)
@@ -341,9 +338,15 @@ public:
}
virtual void update(const LLSettingsBase::BlendFactor& blendf);
- virtual F64 setPosition(const LLSettingsBase::TrackPosition& position);
+ virtual void applyTimeDelta(const LLSettingsBase::Seconds& delta)
+ {
+ llassert(false);
+ // your derived class needs to implement an override of this func
+ }
+
+ virtual F64 setBlendFactor(const LLSettingsBase::BlendFactor& position);
- virtual void switchTrack(S32 trackno, const LLSettingsBase::BlendFactor& position) { /*NoOp*/ }
+ virtual void switchTrack(S32 trackno, const LLSettingsBase::TrackPosition& position) { /*NoOp*/ }
protected:
void triggerComplete();
@@ -359,9 +362,9 @@ class LLSettingsBlenderTimeDelta : public LLSettingsBlender
{
public:
LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target,
- const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, LLSettingsBase::Seconds seconds) :
+ const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, LLSettingsBase::Seconds blend_span) :
LLSettingsBlender(target, initsetting, endsetting),
- mBlendSpan(seconds),
+ mBlendSpan(blend_span),
mLastUpdate(0.0f),
mTimeSpent(0.0f)
{
@@ -373,22 +376,22 @@ public:
{
}
- virtual void reset(LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& span) SETTINGS_OVERRIDE
+ virtual void reset(LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::TrackPosition& blend_span) SETTINGS_OVERRIDE
{
- LLSettingsBlender::reset(initsetting, endsetting, span);
+ LLSettingsBlender::reset(initsetting, endsetting, blend_span);
- mBlendSpan = span;
+ mBlendSpan = blend_span;
mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch());
mLastUpdate = mTimeStart;
mTimeSpent = LLSettingsBase::Seconds(0.0);
}
- virtual void advance(const LLSettingsBase::Seconds& timedelta);
+ virtual void applyTimeDelta(const LLSettingsBase::Seconds& timedelta) SETTINGS_OVERRIDE;
protected:
LLSettingsBase::BlendFactor calculateBlend(const LLSettingsBase::TrackPosition& spanpos, const LLSettingsBase::TrackPosition& spanlen) const;
- LLSettingsBase::Seconds mBlendSpan;
+ LLSettingsBase::TrackPosition mBlendSpan;
LLSettingsBase::Seconds mLastUpdate;
LLSettingsBase::Seconds mTimeSpent;
LLSettingsBase::Seconds mTimeStart;
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index cd2102a527..00391ca82d 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -51,7 +51,7 @@ namespace
}
else if (begin > end)
{
- return 1.0 - (begin - end);
+ return T(1.0) - (begin - end);
}
return 0;
@@ -227,9 +227,8 @@ bool LLSettingsDay::initialize()
LLSD curtrack = tracks[i];
for (LLSD::array_const_iterator it = curtrack.beginArray(); it != curtrack.endArray(); ++it)
{
- LLSettingsBase::Seconds keyframe = LLSettingsBase::Seconds((*it)[SETTING_KEYKFRAME].asReal());
- // is this supposed to be a blend factor or a time value?
- //keyframe = llclamp((F32)keyframe, 0.0f, 1.0f);
+ LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition((*it)[SETTING_KEYKFRAME].asReal());
+ keyframe = llclamp(keyframe, 0.0f, 1.0f);
LLSettingsBase::ptr_t setting;
if ((*it).has(SETTING_KEYNAME))
@@ -262,10 +261,6 @@ bool LLSettingsDay::initialize()
hassky |= true;
mDayTracks[i][keyframe] = setting;
}
- else
- {
- LL_WARNS("SETTINGS", "DAYCYCLE") << "Skipping frame on track #" << i << " at time index " << keyframe << LL_ENDL;
- }
}
}
@@ -312,6 +307,7 @@ LLSD LLSettingsDay::defaults()
dfltsetting[SETTING_FRAMES] = frames;
dfltsetting[SETTING_TYPE] = "daycycle";
+
return dfltsetting;
}
@@ -365,7 +361,7 @@ namespace
continue;
}
- F32 frame = elem[LLSettingsDay::SETTING_KEYKFRAME].asReal();
+ LLSettingsBase::TrackPosition frame = elem[LLSettingsDay::SETTING_KEYKFRAME].asReal();
if ((frame < 0.0) || (frame > 1.0))
{
frame = llclamp(frame, 0.0f, 1.0f);
@@ -483,8 +479,6 @@ LLSettingsDay::CycleTrack_t &LLSettingsDay::getCycleTrack(S32 track)
//=========================================================================
void LLSettingsDay::startDayCycle()
{
- LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch());
-
if (!mInitialized)
{
LL_WARNS("DAYCYCLE") << "Attempt to start day cycle on uninitialized object." << LL_ENDL;
@@ -519,7 +513,7 @@ LLSettingsDay::KeyframeList_t LLSettingsDay::getTrackKeyframes(S32 trackno)
return keyframes;
}
-bool LLSettingsDay::moveTrackKeyframe(S32 trackno, const LLSettingsBase::Seconds& old_frame, const LLSettingsBase::Seconds& new_frame)
+bool LLSettingsDay::moveTrackKeyframe(S32 trackno, const LLSettingsBase::TrackPosition& old_frame, const LLSettingsBase::TrackPosition& new_frame)
{
if ((trackno < 0) || (trackno >= TRACK_MAX))
{
@@ -538,8 +532,7 @@ bool LLSettingsDay::moveTrackKeyframe(S32 trackno, const LLSettingsBase::Seconds
{
LLSettingsBase::ptr_t base = iter->second;
track.erase(iter);
- // why are we clamping a time value as if its a blend factor
- //track[llclamp(new_frame, 0.0f, 1.0f)] = base;
+ track[llclamp(new_frame, 0.0f, 1.0f)] = base;
track[new_frame] = base;
return true;
}
@@ -548,7 +541,7 @@ bool LLSettingsDay::moveTrackKeyframe(S32 trackno, const LLSettingsBase::Seconds
}
-bool LLSettingsDay::removeTrackKeyframe(S32 trackno, const LLSettingsBase::Seconds& frame)
+bool LLSettingsDay::removeTrackKeyframe(S32 trackno, const LLSettingsBase::TrackPosition& frame)
{
if ((trackno < 0) || (trackno >= TRACK_MAX))
{
@@ -568,18 +561,18 @@ bool LLSettingsDay::removeTrackKeyframe(S32 trackno, const LLSettingsBase::Secon
return false;
}
-void LLSettingsDay::setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, const LLSettingsBase::Seconds& keyframe)
+void LLSettingsDay::setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, const LLSettingsBase::TrackPosition& keyframe)
{
setSettingsAtKeyframe(water, keyframe, TRACK_WATER);
}
-LLSettingsWater::ptr_t LLSettingsDay::getWaterAtKeyframe(const LLSettingsBase::Seconds& keyframe) const
+LLSettingsWater::ptr_t LLSettingsDay::getWaterAtKeyframe(const LLSettingsBase::TrackPosition& keyframe) const
{
LLSettingsBase* p = getSettingsAtKeyframe(keyframe, TRACK_WATER).get();
return LLSettingsWater::ptr_t((LLSettingsWater*)p);
}
-void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSky::ptr_t &sky, const LLSettingsBase::Seconds& keyframe, S32 track)
+void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSky::ptr_t &sky, const LLSettingsBase::TrackPosition& keyframe, S32 track)
{
if ((track < 1) || (track >= TRACK_MAX))
{
@@ -590,18 +583,18 @@ void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSky::ptr_t &sky, const LLSe
setSettingsAtKeyframe(sky, keyframe, track);
}
-LLSettingsSky::ptr_t LLSettingsDay::getSkyAtKeyframe(const LLSettingsBase::Seconds& keyframe, S32 track) const
+LLSettingsSky::ptr_t LLSettingsDay::getSkyAtKeyframe(const LLSettingsBase::TrackPosition& 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 LLSettingsSky::ptr_t();
}
- LLSettingsBase* p = getSettingsAtKeyframe(keyframe, track).get();
- return LLSettingsSky::ptr_t((LLSettingsSky*)p);
+
+ return PTR_NAMESPACE::dynamic_pointer_cast<LLSettingsSky>(getSettingsAtKeyframe(keyframe, track));
}
-void LLSettingsDay::setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, const LLSettingsBase::Seconds& keyframe, S32 track)
+void LLSettingsDay::setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, const LLSettingsBase::TrackPosition& keyframe, S32 track)
{
if ((track < 0) || (track >= TRACK_MAX))
{
@@ -609,12 +602,11 @@ void LLSettingsDay::setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings,
return;
}
- //mDayTracks[track][llclamp(keyframe, 0.0f, 1.0f)] = settings;
- mDayTracks[track][keyframe] = settings;
+ mDayTracks[track][llclamp(keyframe, 0.0f, 1.0f)] = settings;
setDirtyFlag(true);
}
-LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(const LLSettingsBase::Seconds& keyframe, S32 track) const
+LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(const LLSettingsBase::TrackPosition& keyframe, S32 track) const
{
if ((track < 0) || (track >= TRACK_MAX))
{
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index 6f54833c74..6635bc0c5a 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -59,9 +59,9 @@ public:
static const Seconds DEFAULT_DAYOFFSET;
static const Seconds MAXIMUM_DAYOFFSET;
- static const S32 TRACK_WATER;
- static const S32 TRACK_MAX;
- static const S32 FRAME_MAX;
+ static const S32 TRACK_WATER;
+ static const S32 TRACK_MAX;
+ static const S32 FRAME_MAX;
typedef std::map<LLSettingsBase::TrackPosition, LLSettingsBase::ptr_t> CycleTrack_t;
typedef std::vector<CycleTrack_t> CycleList_t;
@@ -91,15 +91,15 @@ public:
//---------------------------------------------------------------------
KeyframeList_t getTrackKeyframes(S32 track);
- bool moveTrackKeyframe(S32 track, const LLSettingsBase::Seconds& old_frame, const LLSettingsBase::Seconds& new_frame);
- bool removeTrackKeyframe(S32 track, const LLSettingsBase::Seconds& frame);
-
- void setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, const LLSettingsBase::Seconds& keyframe);
- LLSettingsWaterPtr_t getWaterAtKeyframe(const LLSettingsBase::Seconds& keyframe) const;
- void setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, const LLSettingsBase::Seconds& keyframe, S32 track);
- LLSettingsSkyPtr_t getSkyAtKeyframe(const LLSettingsBase::Seconds& keyframe, S32 track) const;
- void setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, const LLSettingsBase::Seconds& keyframe, S32 track);
- LLSettingsBase::ptr_t getSettingsAtKeyframe(const LLSettingsBase::Seconds& keyframe, S32 track) const;
+ bool moveTrackKeyframe(S32 track, const LLSettingsBase::TrackPosition& old_frame, const LLSettingsBase::TrackPosition& new_frame);
+ bool removeTrackKeyframe(S32 track, const LLSettingsBase::TrackPosition& frame);
+
+ void setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, const LLSettingsBase::TrackPosition& keyframe);
+ LLSettingsWaterPtr_t getWaterAtKeyframe(const LLSettingsBase::TrackPosition& keyframe) const;
+ void setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, const LLSettingsBase::TrackPosition& keyframe, S32 track);
+ LLSettingsSkyPtr_t getSkyAtKeyframe(const LLSettingsBase::TrackPosition& keyframe, S32 track) const;
+ void setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, const LLSettingsBase::TrackPosition& keyframe, S32 track);
+ LLSettingsBase::ptr_t getSettingsAtKeyframe(const LLSettingsBase::TrackPosition& keyframe, S32 track) const;
//---------------------------------------------------------------------
void startDayCycle();
diff --git a/indra/llinventory/llsettingswater.cpp b/indra/llinventory/llsettingswater.cpp
index 03e174b454..ba147baed7 100644
--- a/indra/llinventory/llsettingswater.cpp
+++ b/indra/llinventory/llsettingswater.cpp
@@ -165,7 +165,7 @@ LLSD LLSettingsWater::translateLegacySettings(LLSD legacy)
void LLSettingsWater::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
{
- LLSettingsWater::ptr_t other((LLSettingsWater*)end.get());
+ LLSettingsWater::ptr_t other = PTR_NAMESPACE::static_pointer_cast<LLSettingsWater>(end);
LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, blendf);
replaceSettings(blenddata);
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 3f6241fa0b..cc9cd4fb86 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -121,6 +121,13 @@ namespace
return LLSettingsDay::TrackBound_t(get_wrapping_atbefore(track, keyframe), get_wrapping_atafter(track, keyframe));
}
+ // Find normalized track position of given time along full length of cycle
+ inline LLSettingsBase::TrackPosition convert_time_to_position(const LLSettingsBase::Seconds& time, const LLSettingsBase::Seconds& len)
+ {
+ LLSettingsBase::TrackPosition position = LLSettingsBase::TrackPosition(fmod((F64)time, (F64)len) / (F64)len);
+ return llclamp(position, 0.0f, 1.0f);
+ }
+
//---------------------------------------------------------------------
class LLTrackBlenderLoopingTime : public LLSettingsBlenderTimeDelta
{
@@ -143,8 +150,7 @@ namespace
setOnFinished([this](const LLSettingsBlender::ptr_t &){ onFinishedSpan(); });
}
-
- void switchTrack(S32 trackno, const LLSettingsBase::BlendFactor&) override
+ void switchTrack(S32 trackno, const LLSettingsBase::TrackPosition&) override
{
S32 use_trackno = selectTrackNumber(trackno);
@@ -160,7 +166,7 @@ namespace
LLSettingsDay::TrackBound_t bounds = getBoundingEntries(now);
LLSettingsBase::ptr_t pendsetting = (*bounds.first).second->buildDerivedClone();
- LLSettingsBase::TrackPosition targetpos = convertTimeToPosition(now) - (*bounds.first).first;
+ LLSettingsBase::TrackPosition targetpos = convert_time_to_position(now, mCycleLength) - (*bounds.first).first;
LLSettingsBase::TrackPosition targetspan = get_wrapping_distance((*bounds.first).first, (*bounds.second).first);
LLSettingsBase::BlendFactor blendf = calculateBlend(targetpos, targetspan);
@@ -191,8 +197,7 @@ namespace
LLSettingsDay::TrackBound_t getBoundingEntries(LLSettingsBase::Seconds time)
{
LLSettingsDay::CycleTrack_t &wtrack = mDay->getCycleTrack(mTrackNo);
- F64 position = convertTimeToPosition(time);
-
+ LLSettingsBase::TrackPosition position = convert_time_to_position(time, mCycleLength);
LLSettingsDay::TrackBound_t bounds = get_bounding_entries(wtrack, position);
return bounds;
}
@@ -209,12 +214,6 @@ namespace
return mCycleLength * get_wrapping_distance((*bounds.first).first, (*bounds.second).first);
}
- LLSettingsBase::TrackPosition convertTimeToPosition(const LLSettingsBase::Seconds& time)
- {
- F64 position = fmod((F64)time, (F64)mCycleLength) / (F64)mCycleLength;
- return llclamp(position, 0.0, 1.0);
- }
-
private:
LLSettingsDay::ptr_t mDay;
S32 mTrackNo;
@@ -764,7 +763,7 @@ void LLEnvironment::update(const LLViewerCamera * cam)
F32Seconds delta(timer.getElapsedTimeAndResetF32());
- mCurrentEnvironment->update(delta);
+ mCurrentEnvironment->applyTimeDelta(delta);
// update clouds, sun, and general
updateCloudScroll();
@@ -1640,20 +1639,15 @@ LLEnvironment::DayInstance::DayInstance() :
mSkyTrack(1)
{ }
-void LLEnvironment::DayInstance::update(LLSettingsBase::Seconds delta)
+void LLEnvironment::DayInstance::applyTimeDelta(const LLSettingsBase::Seconds& delta)
{
if (!mInitialized)
initialize();
if (mBlenderSky)
- mBlenderSky->update(delta.value());
+ mBlenderSky->applyTimeDelta(delta);
if (mBlenderWater)
- mBlenderWater->update(delta.value());
-
-// if (mSky)
-// mSky->update();
-// if (mWater)
-// mWater->update();
+ mBlenderWater->applyTimeDelta(delta);
}
void LLEnvironment::DayInstance::setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset)
@@ -1747,11 +1741,9 @@ void LLEnvironment::DayInstance::setBlenders(const LLSettingsBlender::ptr_t &sky
mBlenderWater = waterblend;
}
-F64 LLEnvironment::DayInstance::secondsToKeyframe(LLSettingsDay::Seconds seconds)
+LLSettingsBase::TrackPosition LLEnvironment::DayInstance::secondsToKeyframe(LLSettingsDay::Seconds seconds)
{
- F64 frame = static_cast<F64>(seconds.value() % mDayLength.value()) / static_cast<F64>(mDayLength.value());
-
- return llclamp(frame, 0.0, 1.0);
+ return convert_time_to_position(seconds, mDayLength);
}
void LLEnvironment::DayInstance::animate()
@@ -1814,10 +1806,10 @@ LLEnvironment::DayTransition::DayTransition(const LLSettingsSky::ptr_t &skystart
}
-void LLEnvironment::DayTransition::update(LLSettingsBase::Seconds delta)
+void LLEnvironment::DayTransition::applyTimeDelta(const LLSettingsBase::Seconds& delta)
{
- mNextInstance->update(delta);
- DayInstance::update(delta);
+ mNextInstance->applyTimeDelta(delta);
+ DayInstance::applyTimeDelta(delta);
}
void LLEnvironment::DayTransition::animate()
@@ -1866,7 +1858,7 @@ LLTrackBlenderLoopingManual::LLTrackBlenderLoopingManual(const LLSettingsBase::p
LLSettingsBase::BlendFactor LLTrackBlenderLoopingManual::setPosition(const LLSettingsBase::TrackPosition& position)
{
- mPosition = llclamp(position, 0.0, 1.0);
+ mPosition = llclamp(position, 0.0f, 1.0f);
LLSettingsDay::TrackBound_t bounds = getBoundingEntries(mPosition);
@@ -1883,7 +1875,7 @@ LLSettingsBase::BlendFactor LLTrackBlenderLoopingManual::setPosition(const LLSet
F64 spanPos = ((mPosition < (*bounds.first).first) ? (mPosition + 1.0) : mPosition) - (*bounds.first).first;
F64 blendf = fmod(spanPos, spanLength) / spanLength;
- return LLSettingsBlender::setPosition(blendf);
+ return LLSettingsBlender::setBlendFactor(blendf);
}
void LLTrackBlenderLoopingManual::switchTrack(S32 trackno, const LLSettingsBase::TrackPosition& position)
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 1be846b710..b7a8ea84c4 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -262,7 +262,7 @@ private:
DayInstance();
virtual ~DayInstance() { };
- virtual void update(LLSettingsBase::Seconds);
+ virtual void applyTimeDelta(const LLSettingsBase::Seconds& delta);
void setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset);
void setSky(const LLSettingsSky::ptr_t &psky);
@@ -302,7 +302,7 @@ private:
LLSettingsBlender::ptr_t mBlenderSky;
LLSettingsBlender::ptr_t mBlenderWater;
- F64 secondsToKeyframe(LLSettingsDay::Seconds seconds);
+ LLSettingsBase::TrackPosition secondsToKeyframe(LLSettingsDay::Seconds seconds);
};
typedef std::array<DayInstance::ptr_t, ENV_END> InstanceArray_t;
@@ -313,7 +313,7 @@ private:
DayTransition(const LLSettingsSky::ptr_t &skystart, const LLSettingsWater::ptr_t &waterstart, DayInstance::ptr_t &end, LLSettingsDay::Seconds time);
virtual ~DayTransition() { };
- virtual void update(LLSettingsBase::Seconds);
+ virtual void applyTimeDelta(const LLSettingsBase::Seconds& delta);
virtual void animate();
protected:
@@ -410,7 +410,7 @@ class LLTrackBlenderLoopingManual : public LLSettingsBlender
public:
LLTrackBlenderLoopingManual(const LLSettingsBase::ptr_t &target, const LLSettingsDay::ptr_t &day, S32 trackno);
- F64 setPosition(const LLSettingsBase::TrackPosition& position) override;
+ F64 setPosition(const LLSettingsBase::TrackPosition& position);
virtual void switchTrack(S32 trackno, const LLSettingsBase::TrackPosition& position) override;
S32 getTrack() const { return mTrackNo; }