summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-06-01 23:32:30 +0100
committerGraham Linden <graham@lindenlab.com>2018-06-01 23:32:30 +0100
commit8cfdc07e790a557e881fadaa1b6258e5b16751f4 (patch)
treea792d0e6f03886f4a3d8f064811fdcbbf2ce1a61 /indra/llinventory
parent8dd85013865cc5b426234cd71b605d7208bcfe01 (diff)
Code cleanup and move to using typedefs of S64Seconds/F64Seconds for ease in sync w/ sim side which has not llunits types.
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingsbase.cpp2
-rw-r--r--indra/llinventory/llsettingsbase.h13
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp14
-rw-r--r--indra/llinventory/llsettingsdaycycle.h21
-rw-r--r--indra/llinventory/llsettingssky.cpp10
-rw-r--r--indra/llinventory/llsettingssky.h4
-rw-r--r--indra/llinventory/llsettingswater.h8
7 files changed, 37 insertions, 35 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp
index d8e337e231..a661d52b7f 100644
--- a/indra/llinventory/llsettingsbase.cpp
+++ b/indra/llinventory/llsettingsbase.cpp
@@ -572,7 +572,7 @@ F64 LLSettingsBlenderTimeDelta::calculateBlend(F64 spanpos, F64 spanlen) const
void LLSettingsBlenderTimeDelta::update(F64 timedelta)
{
- mTimeSpent += F64Seconds(timedelta);
+ mTimeSpent += LLSettingsBase::Seconds(timedelta);
if (mTimeSpent > mBlendSpan)
{
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index 0b99166a86..6f072a4e50 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -41,6 +41,7 @@
#include "llquaternion.h"
#include "v4color.h"
#include "v3color.h"
+#include "llunits.h"
#include "llinventorysettings.h"
@@ -54,6 +55,8 @@ class LLSettingsBase :
friend std::ostream &operator <<(std::ostream& os, LLSettingsBase &settings);
public:
+ typedef F64Seconds Seconds;
+
static const std::string SETTING_ID;
static const std::string SETTING_NAME;
static const std::string SETTING_HASH;
@@ -344,7 +347,7 @@ public:
mLastUpdate(0.0f),
mTimeSpent(0.0f)
{
- mTimeStart = F64Seconds(LLDate::now().secondsSinceEpoch());
+ mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch());
mLastUpdate = mTimeStart;
}
@@ -367,10 +370,10 @@ public:
protected:
F64 calculateBlend(F64 spanpos, F64 spanlen) const;
- F64Seconds mBlendSpan;
- F64Seconds mLastUpdate;
- F64Seconds mTimeSpent;
- F64Seconds mTimeStart;
+ LLSettingsBase::Seconds mBlendSpan;
+ LLSettingsBase::Seconds mLastUpdate;
+ LLSettingsBase::Seconds mTimeSpent;
+ LLSettingsBase::Seconds mTimeStart;
};
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 577b12b031..6f4e70e98f 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -89,13 +89,13 @@ const std::string LLSettingsDay::SETTING_KEYHASH("key_hash");
const std::string LLSettingsDay::SETTING_TRACKS("tracks");
const std::string LLSettingsDay::SETTING_FRAMES("frames");
-const S64Seconds LLSettingsDay::MINIMUM_DAYLENGTH(300); // 5 mins
-const S64Seconds LLSettingsDay::DEFAULT_DAYLENGTH(14400); // 4 hours
-const S64Seconds LLSettingsDay::MAXIMUM_DAYLENGTH(604800); // 7 days
+const LLSettingsDay::Seconds LLSettingsDay::MINIMUM_DAYLENGTH(300); // 5 mins
+const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYLENGTH(14400); // 4 hours
+const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYLENGTH(604800); // 7 days
-const S64Seconds LLSettingsDay::MINIMUM_DAYOFFSET(0);
-const S64Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 hours == -8 hours (SLT time offset)
-const S64Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours
+const LLSettingsDay::Seconds LLSettingsDay::MINIMUM_DAYOFFSET(0);
+const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 hours == -8 hours (SLT time offset)
+const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours
const S32 LLSettingsDay::TRACK_WATER(0); // water track is 0
const S32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water
@@ -465,7 +465,7 @@ LLSettingsDay::CycleTrack_t &LLSettingsDay::getCycleTrack(S32 track)
//=========================================================================
void LLSettingsDay::startDayCycle()
{
- F64Seconds now(LLDate::now().secondsSinceEpoch());
+ LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch());
if (!mInitialized)
{
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index 5e6fc7f21d..0929cff87c 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -48,13 +48,16 @@ public:
static const std::string SETTING_TRACKS;
static const std::string SETTING_FRAMES;
- static const S64Seconds MINIMUM_DAYLENGTH;
- static const S64Seconds DEFAULT_DAYLENGTH;
- static const S64Seconds MAXIMUM_DAYLENGTH;
+ // 32-bit as LLSD only supports that width at present
+ typedef S32Seconds Seconds;
- static const S64Seconds MINIMUM_DAYOFFSET;
- static const S64Seconds DEFAULT_DAYOFFSET;
- static const S64Seconds MAXIMUM_DAYOFFSET;
+ static const Seconds MINIMUM_DAYLENGTH;
+ static const Seconds DEFAULT_DAYLENGTH;
+ static const Seconds MAXIMUM_DAYLENGTH;
+
+ static const Seconds MINIMUM_DAYOFFSET;
+ static const Seconds DEFAULT_DAYOFFSET;
+ static const Seconds MAXIMUM_DAYOFFSET;
static const S32 TRACK_WATER;
static const S32 TRACK_MAX;
@@ -129,7 +132,7 @@ protected:
private:
CycleList_t mDayTracks;
- F64Seconds mLastUpdateTime;
+ LLSettingsBase::Seconds mLastUpdateTime;
void parseFromLLSD(LLSD &data);
@@ -137,10 +140,6 @@ private:
static CycleTrack_t::iterator getEntryAtOrAfter(CycleTrack_t &track, F32 keyframe);
TrackBound_t getBoundingEntries(CycleTrack_t &track, F32 keyframe);
-
-// void onSkyTransitionDone(S32 track, const LLSettingsBlender::ptr_t &blender);
-// void onWaterTransitionDone(const LLSettingsBlender::ptr_t &blender);
-
};
#endif
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 6c5ed8f12b..b6320e0942 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -790,7 +790,7 @@ bool LLSettingsSky::getIsMoonUp() const
return moonDir.mV[2] > NIGHTTIME_ELEVATION_SIN;
}
-void LLSettingsSky::calculateHeavnlyBodyPositions() const
+void LLSettingsSky::calculateHeavenlyBodyPositions() const
{
if (!mPositionsDirty)
{
@@ -811,7 +811,7 @@ void LLSettingsSky::calculateHeavnlyBodyPositions() const
LLVector3 LLSettingsSky::getLightDirection() const
{
- calculateHeavnlyBodyPositions();
+ calculateHeavenlyBodyPositions();
// is the normal from the sun or the moon
if (getIsSunUp())
@@ -955,13 +955,13 @@ LLColor3 LLSettingsSky::gammaCorrect(const LLColor3& in) const
LLVector3 LLSettingsSky::getSunDirection() const
{
- calculateHeavnlyBodyPositions();
+ calculateHeavenlyBodyPositions();
return mSunDirection;
}
LLVector3 LLSettingsSky::getMoonDirection() const
{
- calculateHeavnlyBodyPositions();
+ calculateHeavenlyBodyPositions();
return mMoonDirection;
}
@@ -1008,7 +1008,7 @@ void LLSettingsSky::calculateLightSettings() const
return;
}
- calculateHeavnlyBodyPositions();
+ calculateHeavenlyBodyPositions();
mLightingDirty = false;
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index ee201f4122..6e532eba55 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -423,7 +423,7 @@ protected:
LLSettingsSky();
virtual stringset_t getSlerpKeys() const override;
-
+ virtual stringset_t getSkipInterpolateKeys() const;
virtual void updateSettings() override;
private:
@@ -434,7 +434,7 @@ private:
static LLSD absorptionConfigDefault();
static LLSD mieConfigDefault();
- void calculateHeavnlyBodyPositions() const;
+ void calculateHeavenlyBodyPositions() const;
void calculateLightSettings() const;
mutable LLVector3 mSunDirection;
diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h
index acae903e92..35e5b7bcf6 100644
--- a/indra/llinventory/llsettingswater.h
+++ b/indra/llinventory/llsettingswater.h
@@ -76,22 +76,22 @@ public:
setValue(SETTING_BLUR_MULTIPILER, val);
}
- LLColor3 getFogColor() const
+ LLColor3 getWaterFogColor() const
{
return LLColor3(mSettings[SETTING_FOG_COLOR]);
}
- void setFogColor(LLColor3 val)
+ void setWaterFogColor(LLColor3 val)
{
setValue(SETTING_FOG_COLOR, val);
}
- F32 getFogDensity() const
+ F32 getWaterFogDensity() const
{
return mSettings[SETTING_FOG_DENSITY].asReal();
}
- void setFogDensity(F32 val)
+ void setWaterFogDensity(F32 val)
{
setValue(SETTING_FOG_DENSITY, val);
}