From eadf0b910174274e7c83fe37e417f576a7350edb Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 15 Aug 2018 13:35:53 -0700 Subject: MAINT-8990, MAINT-9002: First pass rework on environment panels, region/parcel --- indra/llinventory/llsettingsbase.h | 8 ++++---- indra/llinventory/llsettingsdaycycle.cpp | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index beaeac2d04..3356727ee6 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -87,7 +87,7 @@ public: inline bool hasSetting(const std::string ¶m) 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) diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index ea57c8987f..20efb23607 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 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 used; for (LLSD::map_const_iterator itFrame = frames.beginMap(); itFrame != frames.endMap(); ++itFrame) @@ -385,6 +396,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; } -- cgit v1.2.3 From 5ddd9d0c977bea070008baefdb452e808077f98c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 16 Aug 2018 21:38:49 +0100 Subject: Make settings vfuncs use SETTINGS_OVERRIDE macro (override keyword in viewer codebase) to fix OS X compilation. Mark cloning funcs and derived class overrides as const. --- indra/llinventory/llsettingsbase.h | 2 +- indra/llinventory/llsettingsdaycycle.h | 6 +++--- indra/llinventory/llsettingssky.h | 4 ++-- indra/llinventory/llsettingswater.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index beaeac2d04..481914a012 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -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.h b/indra/llinventory/llsettingsdaycycle.h index 0ee5ce3e0b..878eec8301 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; } @@ -125,7 +125,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 e2a6e6e8ae..e0ad480c0a 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"); } @@ -231,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(); -- cgit v1.2.3 From 597d28ad343d39f0812f7403119cc817dfab3d64 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 16 Aug 2018 22:00:53 +0100 Subject: Fix constness of LLSettingsVODay::buildDeepCloneAndUncompress. --- indra/llinventory/llsettingsdaycycle.cpp | 11 ++++++++++- indra/llinventory/llsettingsdaycycle.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llinventory') diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 4a99be0c4b..8ca4ca4a6d 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -593,7 +593,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 878eec8301..46dc0cec74 100644 --- a/indra/llinventory/llsettingsdaycycle.h +++ b/indra/llinventory/llsettingsdaycycle.h @@ -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; -- cgit v1.2.3