summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-08-21 19:25:06 +0100
committerGraham Linden <graham@lindenlab.com>2018-08-21 19:25:06 +0100
commit67d880781ee2463522edd11f9286635414aa46eb (patch)
tree3146816bbc9f0f1db1c9dc6eff2c6e22713bcd5c /indra/llinventory
parente3c2d3fd5138fa79946734e61b34d38e98c6a493 (diff)
parent163ae605be8871f37f19d94b71ec4370aadf9a49 (diff)
Merge
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llsettingsbase.h10
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp29
-rw-r--r--indra/llinventory/llsettingsdaycycle.h7
-rw-r--r--indra/llinventory/llsettingssky.h9
-rw-r--r--indra/llinventory/llsettingswater.h4
5 files changed, 41 insertions, 18 deletions
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h
index beaeac2d04..9757092794 100644
--- a/indra/llinventory/llsettingsbase.h
+++ b/indra/llinventory/llsettingsbase.h
@@ -87,7 +87,7 @@ public:
inline bool hasSetting(const std::string &param) const { return mSettings.has(param); }
inline bool isDirty() const { return mDirty; }
inline bool isVeryDirty() const { return mReplaced; }
- inline void setDirtyFlag(bool dirty) { mDirty = dirty; }
+ inline void setDirtyFlag(bool dirty) { mDirty = dirty; clearAssetId(); }
size_t getHash() const; // Hash will not include Name, ID or a previously stored Hash
@@ -116,10 +116,10 @@ public:
virtual void replaceSettings(LLSD settings)
{
- mSettings = settings;
mBlendedFactor = 0.0;
setDirtyFlag(true);
mReplaced = true;
+ mSettings = settings;
}
virtual LLSD getSettings() const;
@@ -130,8 +130,8 @@ public:
{
mSettings[name] = value;
mDirty = true;
- if (mSettings.has(SETTING_ASSETID))
- mSettings.erase(SETTING_ASSETID);
+ if (name != SETTING_ASSETID)
+ clearAssetId();
}
inline void setValue(const std::string &name, const LLSD &value)
@@ -200,7 +200,7 @@ public:
virtual bool validate();
- virtual ptr_t buildDerivedClone() = 0;
+ virtual ptr_t buildDerivedClone() const = 0;
class Validator
{
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 4a99be0c4b..25cd99b997 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -120,7 +120,7 @@ const S32 LLSettingsDay::FRAME_MAX(56);
const F32 LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR(0.02501f);
-const LLUUID LLSettingsDay::DEFAULT_ASSET_ID("283a26a3-b147-47b7-8057-cfff0302ec0e");
+const LLUUID LLSettingsDay::DEFAULT_ASSET_ID("94d296c2-6e05-963c-6b62-671199121dbb");
// Minimum value to prevent multislider in edit floaters from eating up frames that 'encroach' on one another's space
static const F32 DEFAULT_MULTISLIDER_INCREMENT(0.005f);
@@ -150,6 +150,9 @@ LLSD LLSettingsDay::getSettings() const
if (mSettings.has(SETTING_ID))
settings[SETTING_ID] = mSettings[SETTING_ID];
+ if (mSettings.has(SETTING_ASSETID))
+ settings[SETTING_ASSETID] = mSettings[SETTING_ASSETID];
+
settings[SETTING_TYPE] = getSettingsType();
std::map<std::string, LLSettingsBase::ptr_t> in_use;
@@ -194,6 +197,14 @@ bool LLSettingsDay::initialize(bool validate_frames)
LLSD tracks = mSettings[SETTING_TRACKS];
LLSD frames = mSettings[SETTING_FRAMES];
+ // save for later...
+ LLUUID assetid;
+ if (mSettings.has(SETTING_ASSETID))
+ {
+ assetid = mSettings[SETTING_ASSETID].asUUID();
+ LL_WARNS("LAPRAS") << "initializing daycycle with asset id " << assetid << LL_ENDL;
+ }
+
std::map<std::string, LLSettingsBase::ptr_t> used;
for (LLSD::map_const_iterator itFrame = frames.beginMap(); itFrame != frames.endMap(); ++itFrame)
@@ -380,6 +391,11 @@ bool LLSettingsDay::initialize(bool validate_frames)
mSettings.erase(SETTING_TRACKS);
mSettings.erase(SETTING_FRAMES);
+ if (!assetid.isNull())
+ {
+ mSettings[SETTING_ASSETID] = assetid;
+ }
+
mInitialized = true;
return true;
}
@@ -593,7 +609,16 @@ LLSettingsDay::validation_list_t LLSettingsDay::validationList()
return validation;
}
-LLSettingsDay::CycleTrack_t &LLSettingsDay::getCycleTrack(S32 track)
+LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(S32 track)
+{
+ static CycleTrack_t emptyTrack;
+ if (mDayTracks.size() <= track)
+ return emptyTrack;
+
+ return mDayTracks[track];
+}
+
+const LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrackConst(S32 track) const
{
static CycleTrack_t emptyTrack;
if (mDayTracks.size() <= track)
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index 0ee5ce3e0b..46dc0cec74 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -80,8 +80,8 @@ public:
bool initialize(bool validate_frames = false);
- virtual ptr_t buildClone() = 0;
- virtual ptr_t buildDeepCloneAndUncompress() = 0;
+ virtual ptr_t buildClone() const = 0;
+ virtual ptr_t buildDeepCloneAndUncompress() const = 0;
virtual LLSD getSettings() const SETTINGS_OVERRIDE;
virtual LLSettingsType::type_e getSettingsTypeValue() const SETTINGS_OVERRIDE { return LLSettingsType::ST_DAYCYCLE; }
@@ -118,6 +118,7 @@ public:
void setInitialized(bool value = true) { mInitialized = value; }
CycleTrack_t & getCycleTrack(S32 track);
+ const CycleTrack_t & getCycleTrackConst(S32 track) const;
bool clearCycleTrack(S32 track);
bool replaceCycleTrack(S32 track, const CycleTrack_t &source);
bool isTrackEmpty(S32 track) const;
@@ -125,7 +126,7 @@ public:
virtual validation_list_t getValidationList() const SETTINGS_OVERRIDE;
static validation_list_t validationList();
- virtual LLSettingsBase::ptr_t buildDerivedClone() SETTINGS_OVERRIDE { return buildClone(); }
+ virtual LLSettingsBase::ptr_t buildDerivedClone() const SETTINGS_OVERRIDE { return buildClone(); }
LLSettingsBase::TrackPosition getUpperBoundFrame(S32 track, const LLSettingsBase::TrackPosition& keyframe);
LLSettingsBase::TrackPosition getLowerBoundFrame(S32 track, const LLSettingsBase::TrackPosition& keyframe);
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index a9e708487f..14caca36a7 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -96,7 +96,7 @@ public:
LLSettingsSky(const LLSD &data);
virtual ~LLSettingsSky() { };
- virtual ptr_t buildClone() = 0;
+ virtual ptr_t buildClone() const = 0;
//---------------------------------------------------------------------
virtual std::string getSettingsType() const SETTINGS_OVERRIDE { return std::string("sky"); }
@@ -116,13 +116,10 @@ public:
F32 getMieAnisotropy() const;
LLSD getRayleighConfigs() const;
LLSD getMieConfigs() const;
+
LLSD getAbsorptionConfigs() const;
LLUUID getBloomTextureId() const;
- void setRayleighConfigs(const LLSD& rayleighConfig);
- void setMieConfigs(const LLSD& mieConfig);
- void setAbsorptionConfigs(const LLSD& absorptionConfig);
-
//---------------------------------------------------------------------
LLColor3 getAmbientColor() const;
void setAmbientColor(const LLColor3 &val);
@@ -234,7 +231,7 @@ public:
LLColor3 getSunDiffuse() const;
LLColor4 getTotalAmbient() const;
- virtual LLSettingsBase::ptr_t buildDerivedClone() SETTINGS_OVERRIDE { return buildClone(); }
+ virtual LLSettingsBase::ptr_t buildDerivedClone() const SETTINGS_OVERRIDE { return buildClone(); }
static LLUUID GetDefaultAssetId();
static LLUUID GetDefaultSunTextureId();
diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h
index b525912898..b33b082bbf 100644
--- a/indra/llinventory/llsettingswater.h
+++ b/indra/llinventory/llsettingswater.h
@@ -55,7 +55,7 @@ public:
LLSettingsWater(const LLSD &data);
virtual ~LLSettingsWater() { };
- virtual ptr_t buildClone() = 0;
+ virtual ptr_t buildClone() const = 0;
//---------------------------------------------------------------------
virtual std::string getSettingsType() const SETTINGS_OVERRIDE { return std::string("water"); }
@@ -226,7 +226,7 @@ public:
static LLSD translateLegacySettings(LLSD legacy);
- virtual LLSettingsBase::ptr_t buildDerivedClone() SETTINGS_OVERRIDE { return buildClone(); }
+ virtual LLSettingsBase::ptr_t buildDerivedClone() const SETTINGS_OVERRIDE { return buildClone(); }
static LLUUID GetDefaultAssetId();
static LLUUID GetDefaultWaterNormalAssetId();