From d7dd10b88bc3fda88f6528ecc5936e4889f019f3 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 30 Nov 2017 11:32:22 -0800 Subject: Split for viewer/simhost sync LLSD with simhost. --- indra/llinventory/llsettingsbase.h | 306 +++++++++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 indra/llinventory/llsettingsbase.h (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h new file mode 100644 index 0000000000..2b59a103ad --- /dev/null +++ b/indra/llinventory/llsettingsbase.h @@ -0,0 +1,306 @@ +/** +* @file llsettingsbase.h +* @author optional +* @brief A base class for asset based settings groups. +* +* $LicenseInfo:2011&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2017, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#ifndef LL_SETTINGS_BASE_H +#define LL_SETTINGS_BASE_H + +#include +#include +#include +#include +#include + +#include "llsd.h" +#include "llsdutil.h" +#include "v2math.h" +#include "v3math.h" +#include "v4math.h" +#include "llquaternion.h" +#include "v4color.h" +#include "v3color.h" + +class LLSettingsBase : + public boost::enable_shared_from_this, + private boost::noncopyable +{ + friend class LLEnvironment; + friend class LLSettingsDay; + +public: + static const std::string SETTING_ID; + static const std::string SETTING_NAME; + static const std::string SETTING_HASH; + static const std::string SETTING_TYPE; + + typedef std::map parammapping_t; + + typedef boost::shared_ptr ptr_t; + + virtual ~LLSettingsBase() { }; + + //--------------------------------------------------------------------- + virtual std::string getSettingType() const = 0; + + //--------------------------------------------------------------------- + // Settings status + inline bool hasSetting(const std::string ¶m) const { return mSettings.has(param); } + inline bool isDirty() const { return mDirty; } + inline void setDirtyFlag(bool dirty) { mDirty = dirty; } + + size_t getHash() const; // Hash will not include Name, ID or a previously stored Hash + + inline LLUUID getId() const + { + return getValue(SETTING_ID).asUUID(); + } + + inline std::string getName() const + { + return getValue(SETTING_NAME).asString(); + } + + inline void setName(std::string val) + { + setValue(SETTING_NAME, val); + } + + inline void replaceSettings(LLSD settings) + { + mSettings = settings; + setDirtyFlag(true); + } + + virtual LLSD getSettings() const; + + //--------------------------------------------------------------------- + // + inline void setValue(const std::string &name, const LLSD &value) + { + mSettings[name] = value; + mDirty = true; + } + + inline LLSD getValue(const std::string &name, const LLSD &deflt = LLSD()) const + { + if (!mSettings.has(name)) + return deflt; + return mSettings[name]; + } + + inline void setValue(const std::string &name, const LLVector2 &value) + { + setValue(name, value.getValue()); + } + + inline void setValue(const std::string &name, const LLVector3 &value) + { + setValue(name, value.getValue()); + } + + inline void setValue(const std::string &name, const LLVector4 &value) + { + setValue(name, value.getValue()); + } + + inline void setValue(const std::string &name, const LLQuaternion &value) + { + setValue(name, value.getValue()); + } + + inline void setValue(const std::string &name, const LLColor3 &value) + { + setValue(name, value.getValue()); + } + + inline void setValue(const std::string &name, const LLColor4 &value) + { + setValue(name, value.getValue()); + } + + // Note this method is marked const but may modify the settings object. + // (note the internal const cast). This is so that it may be called without + // special consideration from getters. + inline void update() const + { + if (!mDirty) + return; + (const_cast(this))->updateSettings(); + } + + virtual void blend(const ptr_t &end, F32 blendf) = 0; + + virtual bool validate(); + +protected: + class Validator + { + public: + typedef boost::function verify_pr; + + Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr()) : + mName(name), + mRequired(required), + mType(type), + mVerify(verify) + { } + + std::string getName() const { return mName; } + bool isRequired() const { return mRequired; } + LLSD::Type getType() const { return mType; } + + bool verify(LLSD &data); + + // Some basic verifications + static bool verifyColor(LLSD &value); + static bool verifyVector(LLSD &value, S32 length); + static bool verifyVectorMinMax(LLSD &value, LLSD minvals, LLSD maxvals); + static bool verifyVectorNormalized(LLSD &value, S32 length); + static bool verifyQuaternion(LLSD &value); + static bool verifyQuaternionNormal(LLSD &value); + static bool verifyFloatRange(LLSD &value, LLSD range); + static bool verifyIntegerRange(LLSD &value, LLSD range); + + private: + std::string mName; + bool mRequired; + LLSD::Type mType; + verify_pr mVerify; + }; + typedef std::vector validation_list_t; + + LLSettingsBase(); + LLSettingsBase(const LLSD setting); + + typedef std::set stringset_t; + + // combining settings objects. Customize for specific setting types + virtual void lerpSettings(const LLSettingsBase &other, F32 mix); + LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, F32 mix) const; + + /// when lerping between settings, some may require special handling. + /// Get a list of these key to be skipped by the default settings lerp. + /// (handling should be performed in the override of lerpSettings. + virtual stringset_t getSkipInterpolateKeys() const { return stringset_t(); } + + // A list of settings that represent quaternions and should be slerped + // rather than lerped. + virtual stringset_t getSlerpKeys() const { return stringset_t(); } + + // Calculate any custom settings that may need to be cached. + virtual void updateSettings() { mDirty = false; }; + + virtual validation_list_t getValidationList() const = 0; + + // Apply any settings that need special handling. + virtual void applySpecial(void *) { }; + + virtual parammapping_t getParameterMap() const { return parammapping_t(); } + + LLSD mSettings; + bool mIsValid; + + LLSD cloneSettings() const; + +private: + bool mDirty; + + LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; + +}; + + +class LLSettingsBlender : public boost::enable_shared_from_this +{ +public: + typedef boost::shared_ptr ptr_t; + typedef boost::signals2::signal finish_signal_t; + typedef boost::signals2::connection connection_t; + + static const F32Seconds DEFAULT_THRESHOLD; + + LLSettingsBlender(const LLSettingsBase::ptr_t &target, + const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F32Seconds seconds) : + mTarget(target), + mInitial(initsetting), + mFinal(endsetting), + mSeconds(seconds), + mOnFinished(), + mBlendThreshold(DEFAULT_THRESHOLD), + mLastUpdate(0.0f), + mTimeSpent(0.0f) + { + mTarget->replaceSettings(mInitial->getSettings()); + mTimeStart = F32Seconds(LLDate::now().secondsSinceEpoch()); + mLastUpdate = mTimeStart; + } + + ~LLSettingsBlender() {} + + connection_t setOnFinished(const finish_signal_t::slot_type &onfinished) + { + return mOnFinished.connect(onfinished); + } + + void setUpdateThreshold(F32Seconds threshold) + { + mBlendThreshold = threshold; + } + + F32Seconds getUpdateThreshold() const + { + return mBlendThreshold; + } + + LLSettingsBase::ptr_t getTarget() const + { + return mTarget; + } + + LLSettingsBase::ptr_t getInitial() const + { + return mInitial; + } + + LLSettingsBase::ptr_t getFinal() const + { + return mFinal; + } + + void update(F32Seconds time); +private: + LLSettingsBase::ptr_t mTarget; + LLSettingsBase::ptr_t mInitial; + LLSettingsBase::ptr_t mFinal; + F32Seconds mSeconds; + finish_signal_t mOnFinished; + F32Seconds mBlendThreshold; + F32Seconds mLastUpdate; + F32Seconds mTimeSpent; + F32Seconds mTimeStart; +}; + +#endif -- cgit v1.2.3 From 8211f57205f0008d8ffb9bfcd465ca26d906e19c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 8 Jan 2018 15:10:25 -0800 Subject: MAINT-7699: Deliver new settings to viewer via cap --- indra/llinventory/llsettingsbase.h | 39 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 2b59a103ad..0a20754ffb 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -151,7 +151,7 @@ public: (const_cast(this))->updateSettings(); } - virtual void blend(const ptr_t &end, F32 blendf) = 0; + virtual void blend(const ptr_t &end, F64 blendf) = 0; virtual bool validate(); @@ -198,8 +198,8 @@ protected: typedef std::set stringset_t; // combining settings objects. Customize for specific setting types - virtual void lerpSettings(const LLSettingsBase &other, F32 mix); - LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, F32 mix) const; + virtual void lerpSettings(const LLSettingsBase &other, F64 mix); + LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, F64 mix) const; /// when lerping between settings, some may require special handling. /// Get a list of these key to be skipped by the default settings lerp. @@ -240,10 +240,10 @@ public: typedef boost::signals2::signal finish_signal_t; typedef boost::signals2::connection connection_t; - static const F32Seconds DEFAULT_THRESHOLD; + static const F64Seconds DEFAULT_THRESHOLD; LLSettingsBlender(const LLSettingsBase::ptr_t &target, - const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F32Seconds seconds) : + const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64Seconds seconds) : mTarget(target), mInitial(initsetting), mFinal(endsetting), @@ -254,23 +254,34 @@ public: mTimeSpent(0.0f) { mTarget->replaceSettings(mInitial->getSettings()); - mTimeStart = F32Seconds(LLDate::now().secondsSinceEpoch()); + mTimeStart = F64Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; } ~LLSettingsBlender() {} + void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 seconds ) + { + mInitial = initsetting; + mFinal = endsetting; + mSeconds.value(seconds); + mTarget->replaceSettings(mInitial->getSettings()); + mTimeStart.value(LLDate::now().secondsSinceEpoch()); + mLastUpdate = mTimeStart; + mTimeSpent.value(0.0f); + } + connection_t setOnFinished(const finish_signal_t::slot_type &onfinished) { return mOnFinished.connect(onfinished); } - void setUpdateThreshold(F32Seconds threshold) + void setUpdateThreshold(F64Seconds threshold) { mBlendThreshold = threshold; } - F32Seconds getUpdateThreshold() const + F64Seconds getUpdateThreshold() const { return mBlendThreshold; } @@ -290,17 +301,17 @@ public: return mFinal; } - void update(F32Seconds time); + void update(F64Seconds time); private: LLSettingsBase::ptr_t mTarget; LLSettingsBase::ptr_t mInitial; LLSettingsBase::ptr_t mFinal; - F32Seconds mSeconds; + F64Seconds mSeconds; finish_signal_t mOnFinished; - F32Seconds mBlendThreshold; - F32Seconds mLastUpdate; - F32Seconds mTimeSpent; - F32Seconds mTimeStart; + F64Seconds mBlendThreshold; + F64Seconds mLastUpdate; + F64Seconds mTimeSpent; + F64Seconds mTimeStart; }; #endif -- cgit v1.2.3 From 1b8c2b5ebbe0d42f147730bc9b6528fa8c6796ce Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 23 Jan 2018 08:54:34 -0800 Subject: MAINT-8052: Initial support for new EEP cap --- indra/llinventory/llsettingsbase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 0a20754ffb..fa5fb7a763 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -155,7 +155,6 @@ public: virtual bool validate(); -protected: class Validator { public: @@ -192,9 +191,14 @@ protected: }; typedef std::vector validation_list_t; + static LLSD settingValidation(LLSD &settings, validation_list_t &validations); +protected: + LLSettingsBase(); LLSettingsBase(const LLSD setting); + static LLSD settingValidation(LLSD settings); + typedef std::set stringset_t; // combining settings objects. Customize for specific setting types -- cgit v1.2.3 From 0bf50e2f8cfa5f3ccd6165ce935cf0fd9c174ced Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 30 Jan 2018 16:42:34 -0800 Subject: Cleanup on daycyle selection and stack. Move blenders into environment. (Transition bronken, instant only. Shaddows moved based on region, not parcel) --- indra/llinventory/llsettingsbase.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index fa5fb7a763..f5146b1c27 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -253,7 +253,6 @@ public: mFinal(endsetting), mSeconds(seconds), mOnFinished(), - mBlendThreshold(DEFAULT_THRESHOLD), mLastUpdate(0.0f), mTimeSpent(0.0f) { @@ -264,11 +263,11 @@ public: ~LLSettingsBlender() {} - void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 seconds ) + void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64Seconds seconds ) { mInitial = initsetting; mFinal = endsetting; - mSeconds.value(seconds); + mSeconds = seconds; mTarget->replaceSettings(mInitial->getSettings()); mTimeStart.value(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; @@ -280,16 +279,6 @@ public: return mOnFinished.connect(onfinished); } - void setUpdateThreshold(F64Seconds threshold) - { - mBlendThreshold = threshold; - } - - F64Seconds getUpdateThreshold() const - { - return mBlendThreshold; - } - LLSettingsBase::ptr_t getTarget() const { return mTarget; @@ -306,13 +295,13 @@ public: } void update(F64Seconds time); + private: LLSettingsBase::ptr_t mTarget; LLSettingsBase::ptr_t mInitial; LLSettingsBase::ptr_t mFinal; F64Seconds mSeconds; finish_signal_t mOnFinished; - F64Seconds mBlendThreshold; F64Seconds mLastUpdate; F64Seconds mTimeSpent; F64Seconds mTimeStart; -- cgit v1.2.3 From f07e5ee2a4907b9488a67a13db794c770878e648 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 5 Feb 2018 15:12:23 -0800 Subject: Transitions between skys. 1 --- indra/llinventory/llsettingsbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index f5146b1c27..073e4616a5 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -241,7 +241,7 @@ class LLSettingsBlender : public boost::enable_shared_from_this ptr_t; - typedef boost::signals2::signal finish_signal_t; + typedef boost::signals2::signal finish_signal_t; typedef boost::signals2::connection connection_t; static const F64Seconds DEFAULT_THRESHOLD; -- cgit v1.2.3 From 7838189843ff3b9c800e458b2452943edbc202ea Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 6 Feb 2018 17:27:56 -0800 Subject: boost->std & same level interp --- indra/llinventory/llsettingsbase.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 073e4616a5..420bcb9943 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "llsd.h" @@ -44,7 +43,7 @@ #include "v3color.h" class LLSettingsBase : - public boost::enable_shared_from_this, + public std::enable_shared_from_this, private boost::noncopyable { friend class LLEnvironment; @@ -58,7 +57,7 @@ public: typedef std::map parammapping_t; - typedef boost::shared_ptr ptr_t; + typedef std::shared_ptr ptr_t; virtual ~LLSettingsBase() { }; @@ -237,10 +236,10 @@ private: }; -class LLSettingsBlender : public boost::enable_shared_from_this +class LLSettingsBlender : public std::enable_shared_from_this { public: - typedef boost::shared_ptr ptr_t; + typedef std::shared_ptr ptr_t; typedef boost::signals2::signal finish_signal_t; typedef boost::signals2::connection connection_t; -- cgit v1.2.3 From b766466b3013e39831bcfcaef5d1089c07202afb Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 26 Feb 2018 09:27:14 -0800 Subject: Added settings inventory object with subtype --- indra/llinventory/llsettingsbase.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 420bcb9943..c7ed9e9e21 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -42,6 +42,8 @@ #include "v4color.h" #include "v3color.h" +#include "llinventorysettings.h" + class LLSettingsBase : public std::enable_shared_from_this, private boost::noncopyable @@ -49,6 +51,8 @@ class LLSettingsBase : friend class LLEnvironment; friend class LLSettingsDay; + friend std::ostream &operator <<(std::ostream& os, LLSettingsBase &settings); + public: static const std::string SETTING_ID; static const std::string SETTING_NAME; @@ -64,6 +68,8 @@ public: //--------------------------------------------------------------------- virtual std::string getSettingType() const = 0; + virtual LLSettingsType getSettingTypeValue() const = 0; + //--------------------------------------------------------------------- // Settings status inline bool hasSetting(const std::string ¶m) const { return mSettings.has(param); } @@ -143,27 +149,28 @@ public: // Note this method is marked const but may modify the settings object. // (note the internal const cast). This is so that it may be called without // special consideration from getters. - inline void update() const + inline void update() const { if (!mDirty) return; (const_cast(this))->updateSettings(); } - virtual void blend(const ptr_t &end, F64 blendf) = 0; + virtual void blend(const ptr_t &end, F64 blendf) = 0; - virtual bool validate(); + virtual bool validate(); class Validator { public: typedef boost::function verify_pr; - Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr()) : + Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr(), LLSD defval = LLSD()) : mName(name), mRequired(required), mType(type), - mVerify(verify) + mVerify(verify), + mDefault(defval) { } std::string getName() const { return mName; } @@ -187,6 +194,7 @@ public: bool mRequired; LLSD::Type mType; verify_pr mVerify; + LLSD mDefault; }; typedef std::vector validation_list_t; @@ -223,15 +231,16 @@ protected: virtual parammapping_t getParameterMap() const { return parammapping_t(); } - LLSD mSettings; - bool mIsValid; + LLSD mSettings; + bool mIsValid; + LLAssetID mAssetID; - LLSD cloneSettings() const; + LLSD cloneSettings() const; private: - bool mDirty; + bool mDirty; - LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; + LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; }; -- cgit v1.2.3 From cbe4cac78cf48cb9144dc2f6c194585cff87a1ce Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 6 Mar 2018 14:58:39 -0800 Subject: Settings type inventory objects and upload the assests. --- indra/llinventory/llsettingsbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index c7ed9e9e21..62a88cde73 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -68,7 +68,7 @@ public: //--------------------------------------------------------------------- virtual std::string getSettingType() const = 0; - virtual LLSettingsType getSettingTypeValue() const = 0; + virtual LLSettingsType::type_e getSettingTypeValue() const = 0; //--------------------------------------------------------------------- // Settings status -- cgit v1.2.3 From 3925e37532476c526375fd76143b2b5e1dcce9b9 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 15 May 2018 17:17:51 -0700 Subject: Fix the blend code to record the amount of the blend and to store what is being blended towards. --- indra/llinventory/llsettingsbase.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 62a88cde73..2220cca336 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -96,6 +96,7 @@ public: inline void replaceSettings(LLSD settings) { mSettings = settings; + mBlendedFactor = 0.0; setDirtyFlag(true); } @@ -146,6 +147,11 @@ public: setValue(name, value.getValue()); } + inline F64 getBlendFactor() const + { + return mBlendedFactor; + } + // Note this method is marked const but may modify the settings object. // (note the internal const cast). This is so that it may be called without // special consideration from getters. @@ -237,11 +243,17 @@ protected: LLSD cloneSettings() const; + inline void setBlendFactor(F64 blendfactor) + { + mBlendedFactor = blendfactor; + } + private: bool mDirty; LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; + F64 mBlendedFactor; }; -- cgit v1.2.3 From 4975bd03c12673778616e1cca1811bf906bb42a6 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 16 May 2018 13:42:48 -0700 Subject: Splitting the blender up to support manual positioning as well as time. Phase1 --- indra/llinventory/llsettingsbase.h | 79 +++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 27 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 2220cca336..ee0a86010c 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -264,67 +264,92 @@ public: typedef boost::signals2::signal finish_signal_t; typedef boost::signals2::connection connection_t; - static const F64Seconds DEFAULT_THRESHOLD; - LLSettingsBlender(const LLSettingsBase::ptr_t &target, - const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64Seconds seconds) : + const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 span = 1.0) : + mOnFinished(), mTarget(target), mInitial(initsetting), - mFinal(endsetting), - mSeconds(seconds), - mOnFinished(), - mLastUpdate(0.0f), - mTimeSpent(0.0f) + mFinal(endsetting) { mTarget->replaceSettings(mInitial->getSettings()); - mTimeStart = F64Seconds(LLDate::now().secondsSinceEpoch()); - mLastUpdate = mTimeStart; } - ~LLSettingsBlender() {} + virtual ~LLSettingsBlender() {} - void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64Seconds seconds ) + virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 span = 1.0) { mInitial = initsetting; mFinal = endsetting; - mSeconds = seconds; mTarget->replaceSettings(mInitial->getSettings()); - mTimeStart.value(LLDate::now().secondsSinceEpoch()); - mLastUpdate = mTimeStart; - mTimeSpent.value(0.0f); - } - - connection_t setOnFinished(const finish_signal_t::slot_type &onfinished) - { - return mOnFinished.connect(onfinished); } - LLSettingsBase::ptr_t getTarget() const + LLSettingsBase::ptr_t getTarget() const { return mTarget; } - LLSettingsBase::ptr_t getInitial() const + LLSettingsBase::ptr_t getInitial() const { return mInitial; } - LLSettingsBase::ptr_t getFinal() const + LLSettingsBase::ptr_t getFinal() const { return mFinal; } - void update(F64Seconds time); + connection_t setOnFinished(const finish_signal_t::slot_type &onfinished) + { + return mOnFinished.connect(onfinished); + } + + virtual void update(F64 blendf); + virtual F64 setPosition(F64 blendf); private: + finish_signal_t mOnFinished; + LLSettingsBase::ptr_t mTarget; LLSettingsBase::ptr_t mInitial; LLSettingsBase::ptr_t mFinal; - F64Seconds mSeconds; - finish_signal_t mOnFinished; +}; + +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()), + mBlendSpan(seconds), + mLastUpdate(0.0f), + mTimeSpent(0.0f) + { + mTimeStart = F64Seconds(LLDate::now().secondsSinceEpoch()); + mLastUpdate = mTimeStart; + } + + virtual ~LLSettingsBlenderTimeDelta() + { + } + + virtual void reset(LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 span = 1.0) override + { + LLSettingsBlender::reset(initsetting, endsetting, span); + + mBlendSpan.value(span); + mTimeStart.value(LLDate::now().secondsSinceEpoch()); + mLastUpdate = mTimeStart; + mTimeSpent.value(0.0f); + } + + virtual void update(F64 timedelta) override; + +private: + F64Seconds mBlendSpan; F64Seconds mLastUpdate; F64Seconds mTimeSpent; F64Seconds mTimeStart; }; + #endif -- cgit v1.2.3 From b117a9ea197a084eeec1e8330dbe7c562423e248 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 17 May 2018 12:05:31 -0700 Subject: Fix end of cycle trigger for time blender. --- indra/llinventory/llsettingsbase.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index ee0a86010c..d304638d20 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -306,6 +306,9 @@ public: virtual void update(F64 blendf); virtual F64 setPosition(F64 blendf); +protected: + void triggerComplete(); + private: finish_signal_t mOnFinished; -- cgit v1.2.3 From 430c5cd23558ba42c7da0e31845a3677e66f1fed Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 17 May 2018 16:16:33 -0700 Subject: Self contained looping track blender. Will blend over time across an entire track in a day cycle. --- indra/llinventory/llsettingsbase.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index d304638d20..6ab3032a3d 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -271,7 +271,8 @@ public: mInitial(initsetting), mFinal(endsetting) { - mTarget->replaceSettings(mInitial->getSettings()); + if (mInitial) + mTarget->replaceSettings(mInitial->getSettings()); } virtual ~LLSettingsBlender() {} @@ -309,7 +310,6 @@ public: protected: void triggerComplete(); -private: finish_signal_t mOnFinished; LLSettingsBase::ptr_t mTarget; @@ -347,7 +347,7 @@ public: virtual void update(F64 timedelta) override; -private: +protected: F64Seconds mBlendSpan; F64Seconds mLastUpdate; F64Seconds mTimeSpent; -- cgit v1.2.3 From 044b80e4e1a7b55f46e6f3b52c9cae6d9c6df3eb Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 22 May 2018 10:49:55 -0700 Subject: Manual blender for use in day editing dialog. --- indra/llinventory/llsettingsbase.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') 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) -- cgit v1.2.3 From fa4ac065cb332c8c90fb59eeff0b983a1fd56691 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 24 May 2018 13:11:33 -0700 Subject: Enable sky changes with altitude. --- indra/llinventory/llsettingsbase.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index d00e340b4b..71358d6a49 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -166,6 +166,8 @@ public: virtual bool validate(); + virtual ptr_t buildDerivedClone() = 0; + class Validator { public: @@ -269,10 +271,15 @@ public: mOnFinished(), mTarget(target), mInitial(initsetting), - mFinal(endsetting) + mFinal(endsetting), + mIsTrivial(false) { if (mInitial) mTarget->replaceSettings(mInitial->getSettings()); + + if (!mFinal) + mFinal = mInitial; + mIsTrivial = (mFinal == mInitial); } virtual ~LLSettingsBlender() {} @@ -280,8 +287,16 @@ public: 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. + if (!mInitial) + LL_WARNS("BLENDER") << "Reseting blender with empty initial setting. Expect badness in the future." << LL_ENDL; + mInitial = initsetting; mFinal = endsetting; + + if (!mFinal) + mFinal = mInitial; + mIsTrivial = (mFinal == mInitial); + mTarget->replaceSettings(mInitial->getSettings()); } @@ -308,6 +323,8 @@ public: virtual void update(F64 blendf); virtual F64 setPosition(F64 blendf); + virtual void switchTrack(S32 trackno, F64 position = -1.0) { /*NoOp*/ } + protected: void triggerComplete(); @@ -316,6 +333,7 @@ protected: LLSettingsBase::ptr_t mTarget; LLSettingsBase::ptr_t mInitial; LLSettingsBase::ptr_t mFinal; + bool mIsTrivial; }; class LLSettingsBlenderTimeDelta : public LLSettingsBlender @@ -349,6 +367,8 @@ public: virtual void update(F64 timedelta) override; protected: + F64 calculateBlend(F64 spanpos, F64 spanlen) const; + F64Seconds mBlendSpan; F64Seconds mLastUpdate; F64Seconds mTimeSpent; -- cgit v1.2.3 From acaf57100eade61262d73cf5b318c4545e921bd5 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 24 May 2018 17:09:01 -0700 Subject: switch track based on altitudes sent from region. --- indra/llinventory/llsettingsbase.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 71358d6a49..1ef7df79ad 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -271,15 +271,13 @@ public: mOnFinished(), mTarget(target), mInitial(initsetting), - mFinal(endsetting), - mIsTrivial(false) + mFinal(endsetting) { if (mInitial) mTarget->replaceSettings(mInitial->getSettings()); if (!mFinal) mFinal = mInitial; - mIsTrivial = (mFinal == mInitial); } virtual ~LLSettingsBlender() {} @@ -295,7 +293,6 @@ public: if (!mFinal) mFinal = mInitial; - mIsTrivial = (mFinal == mInitial); mTarget->replaceSettings(mInitial->getSettings()); } @@ -333,7 +330,6 @@ protected: LLSettingsBase::ptr_t mTarget; LLSettingsBase::ptr_t mInitial; LLSettingsBase::ptr_t mFinal; - bool mIsTrivial; }; class LLSettingsBlenderTimeDelta : public LLSettingsBlender -- cgit v1.2.3 From 64302d3000b69b31e72eb6a3bd8a981c80cb88de Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 00:18:36 +0100 Subject: Modify use of sky settings, reduce complexity, and name funcs to indicate coord systems in use. Fix class2 softenLightF shader. --- indra/llinventory/llsettingsbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 5b44dc4666..264c6c6c49 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -251,7 +251,7 @@ protected: void markDirty() { mDirty = true; } private: - bool mDirty; + bool mDirty = true; LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; -- cgit v1.2.3 From 8dd85013865cc5b426234cd71b605d7208bcfe01 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 15:50:25 +0100 Subject: Fix mis-merge of LLSettingsBase and remove optimize pragmas. --- indra/llinventory/llsettingsbase.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 29ed50419a..0b99166a86 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -166,6 +166,8 @@ public: virtual bool validate(); + virtual ptr_t buildDerivedClone() = 0; + class Validator { public: -- cgit v1.2.3 From 8cfdc07e790a557e881fadaa1b6258e5b16751f4 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 23:32:30 +0100 Subject: Code cleanup and move to using typedefs of S64Seconds/F64Seconds for ease in sync w/ sim side which has not llunits types. --- indra/llinventory/llsettingsbase.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') 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; }; -- cgit v1.2.3 From 7136956b90614bbd236be0e30231781c04346220 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 2 Jun 2018 23:28:48 +0100 Subject: Use more typedefs to simplify sync between viewer and sim env settings code. --- indra/llinventory/llsettingsbase.h | 64 ++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 23 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 6f072a4e50..a8e1cc5eea 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -45,8 +45,14 @@ #include "llinventorysettings.h" +#define PTR_NAMESPACE std +#define SETTINGS_OVERRIDE override + +//#define PTR_NAMESPACE boost +//#define SETTINGS_OVERRIDE + class LLSettingsBase : - public std::enable_shared_from_this, + public PTR_NAMESPACE::enable_shared_from_this, private boost::noncopyable { friend class LLEnvironment; @@ -56,6 +62,8 @@ class LLSettingsBase : public: typedef F64Seconds Seconds; + typedef F64 BlendFactor; + typedef F64 TrackPosition; static const std::string SETTING_ID; static const std::string SETTING_NAME; @@ -64,7 +72,7 @@ public: typedef std::map parammapping_t; - typedef std::shared_ptr ptr_t; + typedef PTR_NAMESPACE::shared_ptr ptr_t; virtual ~LLSettingsBase() { }; @@ -107,12 +115,17 @@ public: //--------------------------------------------------------------------- // - inline void setValue(const std::string &name, const LLSD &value) + inline void setLLSD(const std::string &name, const LLSD &value) { mSettings[name] = value; mDirty = true; } + inline void setValue(const std::string &name, const LLSD &value) + { + setLLSD(name, value); + } + inline LLSD getValue(const std::string &name, const LLSD &deflt = LLSD()) const { if (!mSettings.has(name)) @@ -120,6 +133,11 @@ public: return mSettings[name]; } + inline void setValue(const std::string &name, F32 v) + { + setLLSD(name, LLSD::Real(v)); + } + inline void setValue(const std::string &name, const LLVector2 &value) { setValue(name, value.getValue()); @@ -150,7 +168,7 @@ public: setValue(name, value.getValue()); } - inline F64 getBlendFactor() const + inline BlendFactor getBlendFactor() const { return mBlendedFactor; } @@ -165,7 +183,7 @@ public: (const_cast(this))->updateSettings(); } - virtual void blend(const ptr_t &end, F64 blendf) = 0; + virtual void blend(const ptr_t &end, BlendFactor blendf) = 0; virtual bool validate(); @@ -220,8 +238,8 @@ protected: typedef std::set stringset_t; // combining settings objects. Customize for specific setting types - virtual void lerpSettings(const LLSettingsBase &other, F64 mix); - LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, F64 mix) const; + virtual void lerpSettings(const LLSettingsBase &other, BlendFactor mix); + LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, BlendFactor mix) const; /// when lerping between settings, some may require special handling. /// Get a list of these key to be skipped by the default settings lerp. @@ -248,7 +266,7 @@ protected: LLSD cloneSettings() const; - inline void setBlendFactor(F64 blendfactor) + inline void setBlendFactor(BlendFactor blendfactor) { mBlendedFactor = blendfactor; } @@ -256,18 +274,18 @@ protected: void markDirty() { mDirty = true; } private: - bool mDirty = true; + bool mDirty; LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; - F64 mBlendedFactor; + BlendFactor mBlendedFactor; }; -class LLSettingsBlender : public std::enable_shared_from_this +class LLSettingsBlender : public PTR_NAMESPACE::enable_shared_from_this { public: - typedef std::shared_ptr ptr_t; + typedef PTR_NAMESPACE::shared_ptr ptr_t; typedef boost::signals2::signal finish_signal_t; typedef boost::signals2::connection connection_t; @@ -287,7 +305,7 @@ 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, const LLSettingsBase::Seconds& span) { // note: the 'span' reset parameter is unused by the base class. if (!mInitial) @@ -322,10 +340,10 @@ public: return mOnFinished.connect(onfinished); } - virtual void update(F64 blendf); - virtual F64 setPosition(F64 blendf); + virtual void update(const LLSettingsBase::BlendFactor& blendf); + virtual F64 setPosition(const LLSettingsBase::TrackPosition& position); - virtual void switchTrack(S32 trackno, F64 position = -1.0) { /*NoOp*/ } + virtual void switchTrack(S32 trackno, const LLSettingsBase::BlendFactor& position) { /*NoOp*/ } protected: void triggerComplete(); @@ -341,7 +359,7 @@ class LLSettingsBlenderTimeDelta : public LLSettingsBlender { public: LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target, - const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64Seconds seconds) : + const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, LLSettingsBase::Seconds seconds) : LLSettingsBlender(target, initsetting, endsetting), mBlendSpan(seconds), mLastUpdate(0.0f), @@ -355,20 +373,20 @@ public: { } - virtual void reset(LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, F64 span = 1.0) override + virtual void reset(LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& span) SETTINGS_OVERRIDE { LLSettingsBlender::reset(initsetting, endsetting, span); - mBlendSpan.value(span); - mTimeStart.value(LLDate::now().secondsSinceEpoch()); + mBlendSpan = span; + mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; - mTimeSpent.value(0.0f); + mTimeSpent = LLSettingsBase::Seconds(0.0); } - virtual void update(F64 timedelta) override; + virtual void advance(const LLSettingsBase::Seconds& timedelta); protected: - F64 calculateBlend(F64 spanpos, F64 spanlen) const; + LLSettingsBase::BlendFactor calculateBlend(const LLSettingsBase::TrackPosition& spanpos, const LLSettingsBase::TrackPosition& spanlen) const; LLSettingsBase::Seconds mBlendSpan; LLSettingsBase::Seconds mLastUpdate; -- cgit v1.2.3 From cd8f0da2d187df69a99a665ea11faaa4e13b7a12 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 4 Jun 2018 23:12:21 +0100 Subject: Fix use of new typedefs in inventory settings code in llenvironment. --- indra/llinventory/llsettingsbase.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') 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, 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; -- cgit v1.2.3 From 499993e3aa89f49412861a6b7daff8e0e6f1c196 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 5 Jun 2018 17:29:58 +0100 Subject: Restore dropped header include and make constness match sim code. --- indra/llinventory/llsettingsbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 374a2ec246..0920af4726 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -362,7 +362,7 @@ class LLSettingsBlenderTimeDelta : public LLSettingsBlender { public: LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target, - const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, LLSettingsBase::Seconds blend_span) : + const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& blend_span) : LLSettingsBlender(target, initsetting, endsetting), mBlendSpan(blend_span), mLastUpdate(0.0f), -- cgit v1.2.3 From bff5049b9262e703c3ae583962552ea416212e8b Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 6 Jun 2018 17:10:58 -0700 Subject: Various editor fixes. Start adding a settings picker. --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 0920af4726..4ebec4a99d 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -61,6 +61,7 @@ public: typedef F64Seconds Seconds; typedef F64 BlendFactor; typedef F32 TrackPosition; // 32-bit as these are stored in LLSD as such + static const TrackPosition INVALID_TRACKPOS; static const std::string SETTING_ID; static const std::string SETTING_NAME; -- cgit v1.2.3 From 1f9b8f59afceeb8201780b679659f64845dcd7c1 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 19 Jun 2018 16:46:12 -0700 Subject: Don't recalculate lighting every frame. Fix altitude transitions. On track switch ignore time threshold on blender. --- indra/llinventory/llsettingsbase.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index f2fa78e41f..81158d64a7 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -387,7 +387,8 @@ public: mLastUpdate(0.0f), mTimeSpent(0.0f), mTimeDeltaThreshold(0.0f), - mTimeDeltaPassed(0.0f) + mTimeDeltaPassed(0.0f), + mIgnoreTimeDelta(false) { mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; @@ -421,6 +422,9 @@ public: return mTimeDeltaThreshold; } + inline void setIgnoreTimeDeltaThreshold(bool val) { mIgnoreTimeDelta = val; } + inline bool getIgnoreTimeDeltaThreshold() const { return mIgnoreTimeDelta; } + protected: LLSettingsBase::BlendFactor calculateBlend(const LLSettingsBase::TrackPosition& spanpos, const LLSettingsBase::TrackPosition& spanlen) const; @@ -430,6 +434,7 @@ protected: LLSettingsBase::Seconds mTimeStart; LLSettingsBase::Seconds mTimeDeltaThreshold; LLSettingsBase::Seconds mTimeDeltaPassed; + bool mIgnoreTimeDelta; }; -- cgit v1.2.3 From 8365945f8af6e27e7180b40aae79f210f99bb7c8 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 8 Jun 2018 16:40:01 -0700 Subject: Settings inventory picker. --- indra/llinventory/llsettingsbase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 4ebec4a99d..5e40d185a1 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -75,9 +75,9 @@ public: virtual ~LLSettingsBase() { }; //--------------------------------------------------------------------- - virtual std::string getSettingType() const = 0; + virtual std::string getSettingsType() const = 0; - virtual LLSettingsType::type_e getSettingTypeValue() const = 0; + virtual LLSettingsType::type_e getSettingsTypeValue() const = 0; //--------------------------------------------------------------------- // Settings status -- cgit v1.2.3 From 2add1e7abdf536b32bfbfa4b353189782df8cb19 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 12 Jun 2018 12:39:59 -0700 Subject: Time threshold on timer based updates. Editor can replace frame with one from inventory. Extra check on adding a frame type. --- indra/llinventory/llsettingsbase.h | 46 +++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 5e40d185a1..f0d104ff53 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -67,6 +67,7 @@ public: static const std::string SETTING_NAME; static const std::string SETTING_HASH; static const std::string SETTING_TYPE; + static const std::string SETTING_ASSETID; typedef std::map parammapping_t; @@ -83,6 +84,7 @@ public: // Settings status 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; } size_t getHash() const; // Hash will not include Name, ID or a previously stored Hash @@ -102,11 +104,20 @@ public: setValue(SETTING_NAME, val); } + inline LLUUID getAssetId() const + { + if (mSettings.has(SETTING_ASSETID)) + return mSettings[SETTING_ASSETID].asUUID(); + return LLUUID(); + } + + inline void replaceSettings(LLSD settings) { mSettings = settings; mBlendedFactor = 0.0; setDirtyFlag(true); + mReplaced = true; } virtual LLSD getSettings() const; @@ -117,6 +128,8 @@ public: { mSettings[name] = value; mDirty = true; + if (mSettings.has(SETTING_ASSETID)) + mSettings.erase(SETTING_ASSETID); } inline void setValue(const std::string &name, const LLSD &value) @@ -176,7 +189,7 @@ public: // special consideration from getters. inline void update() const { - if (!mDirty) + if ((!mDirty) && (!mReplaced)) return; (const_cast(this))->updateSettings(); } @@ -226,6 +239,12 @@ public: typedef std::vector validation_list_t; static LLSD settingValidation(LLSD &settings, validation_list_t &validations); + + inline void setAssetId(LLUUID value) + { // note that this skips setLLSD + mSettings[SETTING_ASSETID] = value; + } + protected: LLSettingsBase(); @@ -249,7 +268,7 @@ protected: virtual stringset_t getSlerpKeys() const { return stringset_t(); } // Calculate any custom settings that may need to be cached. - virtual void updateSettings() { mDirty = false; }; + virtual void updateSettings() { mDirty = false; mReplaced = false; }; virtual validation_list_t getValidationList() const = 0; @@ -269,10 +288,9 @@ protected: mBlendedFactor = blendfactor; } - void markDirty() { mDirty = true; } - private: bool mDirty; + bool mReplaced; // super dirty! LLSD combineSDMaps(const LLSD &first, const LLSD &other) const; @@ -367,7 +385,9 @@ public: LLSettingsBlender(target, initsetting, endsetting), mBlendSpan(blend_span), mLastUpdate(0.0f), - mTimeSpent(0.0f) + mTimeSpent(0.0f), + mTimeDeltaThreshold(0.0f), + mTimeDeltaPassed(0.0f) { mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; @@ -384,11 +404,23 @@ public: mBlendSpan = blend_span; mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; - mTimeSpent = LLSettingsBase::Seconds(0.0); + mTimeSpent = LLSettingsBase::Seconds(0.0f); + mTimeDeltaPassed = LLSettingsBase::Seconds(0.0f); } virtual void applyTimeDelta(const LLSettingsBase::Seconds& timedelta) SETTINGS_OVERRIDE; + inline void setTimeDeltaThreshold(const LLSettingsBase::Seconds time) + { + mTimeDeltaThreshold = time; + mTimeDeltaPassed = time + LLSettingsBase::Seconds(1.0); // take the next update call. + } + + inline LLSettingsBase::Seconds getTimeDeltaThreshold() const + { + return mTimeDeltaThreshold; + } + protected: LLSettingsBase::BlendFactor calculateBlend(const LLSettingsBase::TrackPosition& spanpos, const LLSettingsBase::TrackPosition& spanlen) const; @@ -396,6 +428,8 @@ protected: LLSettingsBase::Seconds mLastUpdate; LLSettingsBase::Seconds mTimeSpent; LLSettingsBase::Seconds mTimeStart; + LLSettingsBase::Seconds mTimeDeltaThreshold; + LLSettingsBase::Seconds mTimeDeltaPassed; }; -- cgit v1.2.3 From 34865c4bb5cd12219606f44748159fe7cbeea264 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 13 Jun 2018 00:51:39 +0100 Subject: Mods to hook up water settings to water normals for rendering with support for current to next blending. Modify LLSettingsFoo::buildDefaultFoo to use a static and avoid re-validation of default sky/water/daycycle settings. Remove all references to gSun/MoonTextureId globals (they should come from sky settings now). --- indra/llinventory/llsettingsbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index f0d104ff53..f2fa78e41f 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -112,7 +112,7 @@ public: } - inline void replaceSettings(LLSD settings) + virtual void replaceSettings(LLSD settings) { mSettings = settings; mBlendedFactor = 0.0; -- cgit v1.2.3 From 66d78ce1c73d5da3bc5bc39fe0196a9f82040105 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 15 Jun 2018 21:15:02 +0100 Subject: Make water and sky defaults take a position value to allow for default daycycle w/ multiple frames. Make default daycycle add 8 frames at 0, 0.125, 0.25 etc Merge over server-side bugfixes. Eliminate extraneous dirty bits in sky settings. --- indra/llinventory/llsettingsbase.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index f2fa78e41f..3a5296daa4 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -312,7 +312,7 @@ public: mInitial(initsetting), mFinal(endsetting) { - if (mInitial) + if (mInitial && mTarget) mTarget->replaceSettings(mInitial->getSettings()); if (!mFinal) @@ -333,7 +333,8 @@ public: if (!mFinal) mFinal = mInitial; - mTarget->replaceSettings(mInitial->getSettings()); + if (mTarget) + mTarget->replaceSettings(mInitial->getSettings()); } LLSettingsBase::ptr_t getTarget() const -- cgit v1.2.3 From 7762829031236422dcb569017b7095424957c954 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 25 Jun 2018 14:52:08 -0700 Subject: Pair of LOG_CLASS macros (from simulator) --- indra/llinventory/llsettingsbase.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 7f88227a6d..caae2dcd23 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -300,6 +300,7 @@ private: class LLSettingsBlender : public PTR_NAMESPACE::enable_shared_from_this { + LOG_CLASS(LLSettingsBlender); public: typedef PTR_NAMESPACE::shared_ptr ptr_t; typedef boost::signals2::signal finish_signal_t; @@ -380,6 +381,7 @@ protected: class LLSettingsBlenderTimeDelta : public LLSettingsBlender { + LOG_CLASS(LLSettingsBlenderTimeDelta); public: LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target, const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& blend_span) : -- cgit v1.2.3 From a4137d72ebc9f49dfd8bd124b255da0dfbc4ba92 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 3 Jul 2018 14:18:24 -0700 Subject: MAINT-8821: New "My Environments" floater. First pass. --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index caae2dcd23..6c3b9e23ee 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -242,6 +242,7 @@ public: inline void setAssetId(LLUUID value) { // note that this skips setLLSD + LL_WARNS("LAPRAS") << "Settings asset id set to:{" << value << "}" << LL_ENDL; mSettings[SETTING_ASSETID] = value; } -- cgit v1.2.3 From ca5d5be4fb51fa1ee7ffda24a0aa58c71facd7dd Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 11 Jul 2018 16:46:14 -0700 Subject: Minor change from the simulator to throttle the minimum blend in a time based blend. --- indra/llinventory/llsettingsbase.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 6c3b9e23ee..a74579e7a6 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -57,6 +57,8 @@ class LLSettingsBase : friend std::ostream &operator <<(std::ostream& os, LLSettingsBase &settings); +protected: + LOG_CLASS(LLSettingsBase); public: typedef F64Seconds Seconds; typedef F64 BlendFactor; @@ -384,6 +386,8 @@ class LLSettingsBlenderTimeDelta : public LLSettingsBlender { LOG_CLASS(LLSettingsBlenderTimeDelta); public: + static const LLSettingsBase::BlendFactor MIN_BLEND_DELTA; + LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target, const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& blend_span) : LLSettingsBlender(target, initsetting, endsetting), @@ -392,7 +396,9 @@ public: mTimeSpent(0.0f), mTimeDeltaThreshold(0.0f), mTimeDeltaPassed(0.0f), - mIgnoreTimeDelta(false) + mIgnoreTimeDelta(false), + mBlendFMinDelta(MIN_BLEND_DELTA), + mLastBlendF(-1.0f) { mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; @@ -411,6 +417,7 @@ public: mLastUpdate = mTimeStart; mTimeSpent = LLSettingsBase::Seconds(0.0f); mTimeDeltaPassed = LLSettingsBase::Seconds(0.0f); + mLastBlendF = LLSettingsBase::BlendFactor(-1.0f); } virtual void applyTimeDelta(const LLSettingsBase::Seconds& timedelta) SETTINGS_OVERRIDE; @@ -439,6 +446,8 @@ protected: LLSettingsBase::Seconds mTimeDeltaThreshold; LLSettingsBase::Seconds mTimeDeltaPassed; bool mIgnoreTimeDelta; + LLSettingsBase::BlendFactor mBlendFMinDelta; + LLSettingsBase::BlendFactor mLastBlendF; }; -- cgit v1.2.3 From 3f6cedbbf340ae4a4d825472aca53e0c04ee5322 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 3 Aug 2018 16:32:31 -0700 Subject: Synch settings with simulator. --- indra/llinventory/llsettingsbase.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index a74579e7a6..beaeac2d04 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -244,10 +244,15 @@ public: inline void setAssetId(LLUUID value) { // note that this skips setLLSD - LL_WARNS("LAPRAS") << "Settings asset id set to:{" << value << "}" << LL_ENDL; mSettings[SETTING_ASSETID] = value; } + inline void clearAssetId() + { + if (mSettings.has(SETTING_ASSETID)) + mSettings.erase(SETTING_ASSETID); + } + protected: LLSettingsBase(); -- cgit v1.2.3 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 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') 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) -- 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') 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 { -- cgit v1.2.3 From 4859db1adabcf84b959ff0603f1bb8401232164c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 21 Aug 2018 15:59:18 -0700 Subject: MAINT-9026: Adding scale for sun and moon. Also don't allow the user to directly set the radio buttons for inventory and custom. --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 9757092794..7884240ae3 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -230,6 +230,7 @@ public: static bool verifyQuaternionNormal(LLSD &value); static bool verifyFloatRange(LLSD &value, LLSD range); static bool verifyIntegerRange(LLSD &value, LLSD range); + static bool verifyStringLength(LLSD &value, S32 length); private: std::string mName; -- cgit v1.2.3 From 3b10414c632e73d66d2840ddcd474a79fa120540 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 31 Aug 2018 11:47:18 -0700 Subject: Adding optional flags to settings objects. --- indra/llinventory/llsettingsbase.h | 48 +++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 7884240ae3..a90cec6323 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -70,6 +70,10 @@ public: static const std::string SETTING_HASH; static const std::string SETTING_TYPE; static const std::string SETTING_ASSETID; + static const std::string SETTING_FLAGS; + + static const U32 FLAG_NOCOPY; + static const U32 FLAG_NOMOD; typedef std::map parammapping_t; @@ -113,6 +117,48 @@ public: return LLUUID(); } + inline U32 getFlags() const + { + if (mSettings.has(SETTING_FLAGS)) + return static_cast(mSettings[SETTING_FLAGS].asInteger()); + return 0; + } + + inline void setFlags(U32 value) + { + setLLSD(SETTING_FLAGS, LLSD::Integer(value)); + } + + inline bool getFlag(U32 flag) const + { + if (mSettings.has(SETTING_FLAGS)) + return ((U32)mSettings[SETTING_FLAGS].asInteger() & flag) == flag; + return false; + } + + inline void setFlag(U32 flag) + { + U32 flags((mSettings.has(SETTING_FLAGS)) ? (U32)mSettings[SETTING_FLAGS].asInteger() : 0); + + flags |= flag; + + if (flags) + mSettings[SETTING_FLAGS] = LLSD::Integer(flags); + else + mSettings.erase(SETTING_FLAGS); + } + + inline void clearFlag(U32 flag) + { + U32 flags((mSettings.has(SETTING_FLAGS)) ? (U32)mSettings[SETTING_FLAGS].asInteger() : 0); + + flags &= ~flag; + + if (flags) + mSettings[SETTING_FLAGS] = LLSD::Integer(flags); + else + mSettings.erase(SETTING_FLAGS); + } virtual void replaceSettings(LLSD settings) { @@ -270,7 +316,7 @@ protected: /// when lerping between settings, some may require special handling. /// Get a list of these key to be skipped by the default settings lerp. /// (handling should be performed in the override of lerpSettings. - virtual stringset_t getSkipInterpolateKeys() const { return stringset_t(); } + virtual stringset_t getSkipInterpolateKeys() const; // A list of settings that represent quaternions and should be slerped // rather than lerped. -- cgit v1.2.3 From 114e358aae80e9e3ca70de093d51e4700c46df37 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 7 Sep 2018 16:09:32 -0700 Subject: Work to make edit floaters respect no mod and no trans. Importing no-trans frame will cause day cycle to become no trans. --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index a90cec6323..aea1bc3fde 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -74,6 +74,7 @@ public: static const U32 FLAG_NOCOPY; static const U32 FLAG_NOMOD; + static const U32 FLAG_NOTRANS; typedef std::map parammapping_t; -- cgit v1.2.3 From 659d14504f6ab4ad283efe4ecd950a4483e1498f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 29 Oct 2018 18:18:20 +0200 Subject: SL-1476 EEP Better shader resets and transitions --- indra/llinventory/llsettingsbase.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index aea1bc3fde..c7b685c6d5 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -76,7 +76,21 @@ public: static const U32 FLAG_NOMOD; static const U32 FLAG_NOTRANS; - typedef std::map parammapping_t; + class DefaultParam + { + public: + DefaultParam(S32 key, const LLSD& value) : mShaderKey(key), mDefaultValue(value) {} + DefaultParam() : mShaderKey(-1) {} + S32 getShaderKey() const { return mShaderKey; } + const LLSD getDefaultValue() const { return mDefaultValue; } + + private: + S32 mShaderKey; + LLSD mDefaultValue; + }; + // Contains settings' names (map key), related shader id-key and default + // value for revert in case we need to reset shader (no need to search each time) + typedef std::map parammapping_t; typedef PTR_NAMESPACE::shared_ptr ptr_t; @@ -312,7 +326,15 @@ protected: // combining settings objects. Customize for specific setting types virtual void lerpSettings(const LLSettingsBase &other, BlendFactor mix); - LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, BlendFactor mix) const; + + // combining settings maps where it can based on mix rate + // @settings initial value (mix==0) + // @other target value (mix==1) + // @defaults list of default values for legacy fields and (re)setting shaders + // @mix from 0 to 1, ratio or rate of transition from initial 'settings' to 'other' + // return interpolated and combined LLSD map + LLSD interpolateSDMap(const LLSD &settings, const LLSD &other, const parammapping_t& defaults, BlendFactor mix) const; + LLSD interpolateSDValue(const std::string& name, const LLSD &value, const LLSD &other, const parammapping_t& defaults, BlendFactor mix, const stringset_t& slerps) const; /// when lerping between settings, some may require special handling. /// Get a list of these key to be skipped by the default settings lerp. -- cgit v1.2.3 From 70ac8d9fa7049891ed1b65f68f112127dfb5f5f7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 12 Dec 2018 14:07:23 -0800 Subject: SL-10238: Viewer spport for push notifications from the simulator contaiting partial groups of settings. Blend these settings into the current environment. --- indra/llinventory/llsettingsbase.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index c7b685c6d5..87466e6570 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -266,6 +266,8 @@ public: class Validator { public: + static const U32 VALIDATION_PARTIAL; + typedef boost::function verify_pr; Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr(), LLSD defval = LLSD()) : @@ -280,7 +282,7 @@ public: bool isRequired() const { return mRequired; } LLSD::Type getType() const { return mType; } - bool verify(LLSD &data); + bool verify(LLSD &data, U32 flags); // Some basic verifications static bool verifyColor(LLSD &value); @@ -302,7 +304,7 @@ public: }; typedef std::vector validation_list_t; - static LLSD settingValidation(LLSD &settings, validation_list_t &validations); + static LLSD settingValidation(LLSD &settings, validation_list_t &validations, bool partial = false); inline void setAssetId(LLUUID value) { // note that this skips setLLSD @@ -346,7 +348,7 @@ protected: virtual stringset_t getSlerpKeys() const { return stringset_t(); } // Calculate any custom settings that may need to be cached. - virtual void updateSettings() { mDirty = false; mReplaced = false; }; + virtual void updateSettings() { mDirty = false; mReplaced = false; } virtual validation_list_t getValidationList() const = 0; @@ -366,6 +368,12 @@ protected: mBlendedFactor = blendfactor; } + void replaceWith(LLSettingsBase::ptr_t other) + { + replaceSettings(other->cloneSettings()); + setBlendFactor(other->getBlendFactor()); + } + private: bool mDirty; bool mReplaced; // super dirty! @@ -437,10 +445,11 @@ public: } virtual void update(const LLSettingsBase::BlendFactor& blendf); - virtual void applyTimeDelta(const LLSettingsBase::Seconds& delta) + virtual bool applyTimeDelta(const LLSettingsBase::Seconds& timedelta) { llassert(false); // your derived class needs to implement an override of this func + return false; } virtual F64 setBlendFactor(const LLSettingsBase::BlendFactor& position); @@ -495,7 +504,7 @@ public: mLastBlendF = LLSettingsBase::BlendFactor(-1.0f); } - virtual void applyTimeDelta(const LLSettingsBase::Seconds& timedelta) SETTINGS_OVERRIDE; + virtual bool applyTimeDelta(const LLSettingsBase::Seconds& timedelta) SETTINGS_OVERRIDE; inline void setTimeDeltaThreshold(const LLSettingsBase::Seconds time) { -- cgit v1.2.3 From f42ac5b94e384c789de0b2c4e865b087589a940e Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 22 Jan 2019 09:24:11 -0800 Subject: SL-10387: Move settings intjection to a setting object (and out of llEnvironment) --- indra/llinventory/llsettingsbase.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 87466e6570..9e03052892 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -317,6 +317,8 @@ public: mSettings.erase(SETTING_ASSETID); } + // Calculate any custom settings that may need to be cached. + virtual void updateSettings() { mDirty = false; mReplaced = false; } protected: LLSettingsBase(); @@ -347,9 +349,6 @@ protected: // rather than lerped. virtual stringset_t getSlerpKeys() const { return stringset_t(); } - // Calculate any custom settings that may need to be cached. - virtual void updateSettings() { mDirty = false; mReplaced = false; } - virtual validation_list_t getValidationList() const = 0; // Apply any settings that need special handling. -- cgit v1.2.3 From ce40f88ecb09c91061f7a18ad2b52dcaa3df7ca3 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 5 Feb 2019 15:09:32 -0800 Subject: Better calculation of time remaining in span for track animator (from SL-10465) --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 9e03052892..45d2fa0027 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -519,6 +519,7 @@ public: inline void setIgnoreTimeDeltaThreshold(bool val) { mIgnoreTimeDelta = val; } inline bool getIgnoreTimeDeltaThreshold() const { return mIgnoreTimeDelta; } + inline void setTimeSpent(LLSettingsBase::Seconds time) { mTimeSpent = time; } protected: LLSettingsBase::BlendFactor calculateBlend(const LLSettingsBase::TrackPosition& spanpos, const LLSettingsBase::TrackPosition& spanlen) const; -- cgit v1.2.3 From 2a740309d01ca2ab80fd054ea8d8a79fb7ebbbe0 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 11 Feb 2019 16:50:15 -0800 Subject: SL-10406, SL-10464: Experience injections now have their own sub class of day instance (DayInjection) Montitors underlying environments and switches the sources as needed. --- indra/llinventory/llsettingsbase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 45d2fa0027..592ae3478a 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -104,8 +104,8 @@ public: //--------------------------------------------------------------------- // Settings status inline bool hasSetting(const std::string ¶m) const { return mSettings.has(param); } - inline bool isDirty() const { return mDirty; } - inline bool isVeryDirty() const { return mReplaced; } + virtual bool isDirty() const { return mDirty; } + virtual bool isVeryDirty() const { return mReplaced; } inline void setDirtyFlag(bool dirty) { mDirty = dirty; clearAssetId(); } size_t getHash() const; // Hash will not include Name, ID or a previously stored Hash -- cgit v1.2.3 From 8ba159fed90fc221003e85c5d2d3b82ec30d81bf Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 27 Jun 2019 09:10:38 -0700 Subject: SL-11151, SL-11504 Remove update threshold logic causing hiccups and rework sky updates. Make deferred water do double transport again to match non-ALM rendering more closely. --- indra/llinventory/llsettingsbase.h | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 592ae3478a..afb5014409 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -477,9 +477,6 @@ public: mBlendSpan(blend_span), mLastUpdate(0.0f), mTimeSpent(0.0f), - mTimeDeltaThreshold(0.0f), - mTimeDeltaPassed(0.0f), - mIgnoreTimeDelta(false), mBlendFMinDelta(MIN_BLEND_DELTA), mLastBlendF(-1.0f) { @@ -499,26 +496,11 @@ public: mTimeStart = LLSettingsBase::Seconds(LLDate::now().secondsSinceEpoch()); mLastUpdate = mTimeStart; mTimeSpent = LLSettingsBase::Seconds(0.0f); - mTimeDeltaPassed = LLSettingsBase::Seconds(0.0f); mLastBlendF = LLSettingsBase::BlendFactor(-1.0f); } virtual bool applyTimeDelta(const LLSettingsBase::Seconds& timedelta) SETTINGS_OVERRIDE; - inline void setTimeDeltaThreshold(const LLSettingsBase::Seconds time) - { - mTimeDeltaThreshold = time; - mTimeDeltaPassed = time + LLSettingsBase::Seconds(1.0); // take the next update call. - } - - inline LLSettingsBase::Seconds getTimeDeltaThreshold() const - { - return mTimeDeltaThreshold; - } - - inline void setIgnoreTimeDeltaThreshold(bool val) { mIgnoreTimeDelta = val; } - inline bool getIgnoreTimeDeltaThreshold() const { return mIgnoreTimeDelta; } - inline void setTimeSpent(LLSettingsBase::Seconds time) { mTimeSpent = time; } protected: LLSettingsBase::BlendFactor calculateBlend(const LLSettingsBase::TrackPosition& spanpos, const LLSettingsBase::TrackPosition& spanlen) const; @@ -527,9 +509,6 @@ protected: LLSettingsBase::Seconds mLastUpdate; LLSettingsBase::Seconds mTimeSpent; LLSettingsBase::Seconds mTimeStart; - LLSettingsBase::Seconds mTimeDeltaThreshold; - LLSettingsBase::Seconds mTimeDeltaPassed; - bool mIgnoreTimeDelta; LLSettingsBase::BlendFactor mBlendFMinDelta; LLSettingsBase::BlendFactor mLastBlendF; }; -- cgit v1.2.3 From 1f656735d339fc4d83da86efbb400af1361c27db Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 26 Aug 2019 11:43:45 -0700 Subject: SL-11705, SL-11706: New flags in llsettings base for tracking by simulator. --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index afb5014409..8b969d81a6 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -75,6 +75,7 @@ public: static const U32 FLAG_NOCOPY; static const U32 FLAG_NOMOD; static const U32 FLAG_NOTRANS; + static const U32 FLAG_NOSAVE; class DefaultParam { -- cgit v1.2.3 From ad26896a1086536cf47d3cb0041b0410aebf2119 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 27 Aug 2019 12:49:18 -0700 Subject: SL-11055 Remedy cloud_shadow and hack halving being done twice to ambient in some cases (i.e. artificial dimunition of necessary bullshit factor). --- indra/llinventory/llsettingsbase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 8b969d81a6..26e2901968 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -353,7 +353,7 @@ protected: virtual validation_list_t getValidationList() const = 0; // Apply any settings that need special handling. - virtual void applySpecial(void *) { }; + virtual void applySpecial(void *, bool force = false) { }; virtual parammapping_t getParameterMap() const { return parammapping_t(); } -- cgit v1.2.3 From a7849c6ec4fa31597121e7c8601fe427e222db0b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 26 Mar 2020 18:09:09 +0200 Subject: Removed obsolete and misleading variable --- indra/llinventory/llsettingsbase.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 26e2901968..56e28fc899 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -359,7 +359,6 @@ protected: LLSD mSettings; bool mIsValid; - LLAssetID mAssetID; LLSD cloneSettings() const; -- cgit v1.2.3 From 6620211bff5dca7df0667cf9220da1a9e7ce079c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 27 Mar 2020 00:13:33 +0200 Subject: SL-12911 Add Debug setting EnvironmentPersistAcrossLogin --- indra/llinventory/llsettingsbase.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llinventory/llsettingsbase.h') diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 56e28fc899..1d118f0789 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -64,6 +64,7 @@ public: typedef F64 BlendFactor; typedef F32 TrackPosition; // 32-bit as these are stored in LLSD as such static const TrackPosition INVALID_TRACKPOS; + static const std::string DEFAULT_SETTINGS_NAME; static const std::string SETTING_ID; static const std::string SETTING_NAME; -- cgit v1.2.3