diff options
| author | Rider Linden <rider@lindenlab.com> | 2018-08-17 12:38:08 -0700 | 
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2018-08-17 12:38:08 -0700 | 
| commit | f33d3a40bb361796d0ffcc086eedcb8de204e6ae (patch) | |
| tree | 29493d10b96a96aa103f476431862a9eb33c9606 | |
| parent | 1716129fd23ff35e030808406af1a8f796dc4b01 (diff) | |
| parent | 597d28ad343d39f0812f7403119cc817dfab3d64 (diff) | |
Merge
| -rw-r--r-- | indra/llinventory/llsettingsbase.h | 2 | ||||
| -rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 11 | ||||
| -rw-r--r-- | indra/llinventory/llsettingsdaycycle.h | 7 | ||||
| -rw-r--r-- | indra/llinventory/llsettingssky.h | 4 | ||||
| -rw-r--r-- | indra/llinventory/llsettingswater.h | 4 | ||||
| -rw-r--r-- | indra/newview/llsettingsvo.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llsettingsvo.h | 8 | 
7 files changed, 29 insertions, 19 deletions
diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 3356727ee6..9757092794 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.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 364ff570ed..25cd99b997 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -609,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 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(); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 55b4b88c7d..c56b5df74d 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -486,7 +486,7 @@ LLSettingsSky::ptr_t LLSettingsVOSky::buildDefaultSky()      return skyp;  } -LLSettingsSky::ptr_t LLSettingsVOSky::buildClone() +LLSettingsSky::ptr_t LLSettingsVOSky::buildClone() const  {      LLSD settings = cloneSettings(); @@ -737,7 +737,7 @@ LLSettingsWater::ptr_t LLSettingsVOWater::buildDefaultWater()      return waterp;  } -LLSettingsWater::ptr_t LLSettingsVOWater::buildClone() +LLSettingsWater::ptr_t LLSettingsVOWater::buildClone() const  {      LLSD settings = cloneSettings();      LLSettingsWater::validation_list_t validations = LLSettingsWater::validationList(); @@ -1113,7 +1113,7 @@ void LLSettingsVODay::combineIntoDayCycle(LLSettingsDay::ptr_t pday, LLSettingsB  } -LLSettingsDay::ptr_t LLSettingsVODay::buildClone() +LLSettingsDay::ptr_t LLSettingsVODay::buildClone() const  {      LLSD settings = cloneSettings(); @@ -1131,7 +1131,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildClone()      return dayp;  } -LLSettingsDay::ptr_t LLSettingsVODay::buildDeepCloneAndUncompress() +LLSettingsDay::ptr_t LLSettingsVODay::buildDeepCloneAndUncompress() const  {      // no need for SETTING_TRACKS or SETTING_FRAMES, so take base LLSD      LLSD settings = llsd_clone(mSettings); @@ -1140,8 +1140,8 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildDeepCloneAndUncompress()      for (S32 i = 0; i < LLSettingsDay::TRACK_MAX; ++i)      { -        LLSettingsDay::CycleTrack_t track = getCycleTrack(i); -        LLSettingsDay::CycleTrack_t::iterator iter = track.begin(); +        const LLSettingsDay::CycleTrack_t& track = getCycleTrackConst(i); +        LLSettingsDay::CycleTrack_t::const_iterator iter = track.begin();          while (iter != track.end())          {              // 'Unpack', usually for editing diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 46f91c2264..d314eed24e 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -89,7 +89,7 @@ public:      static ptr_t    buildFromLegacyPreset(const std::string &name, const LLSD &oldsettings);      static ptr_t    buildDefaultSky(); -    virtual ptr_t   buildClone() override; +    virtual ptr_t   buildClone() const SETTINGS_OVERRIDE;      static ptr_t    buildFromLegacyPresetFile(const std::string &name, const std::string &path); @@ -123,7 +123,7 @@ public:      static ptr_t    buildFromLegacyPreset(const std::string &name, const LLSD &oldsettings);      static ptr_t    buildDefaultWater(); -    virtual ptr_t   buildClone() override; +    virtual ptr_t   buildClone() const SETTINGS_OVERRIDE;      static ptr_t    buildFromLegacyPresetFile(const std::string &name, const std::string &path); @@ -158,8 +158,8 @@ public:      static ptr_t    buildDefaultDayCycle();      static ptr_t    buildFromEnvironmentMessage(LLSD settings);      static void     buildFromOtherSetting(LLSettingsBase::ptr_t settings, asset_built_fn cb); -    virtual ptr_t   buildClone() override; -    virtual ptr_t   buildDeepCloneAndUncompress() override; +    virtual ptr_t   buildClone() const SETTINGS_OVERRIDE; +    virtual ptr_t   buildDeepCloneAndUncompress() const SETTINGS_OVERRIDE;      static LLSD     convertToLegacy(const ptr_t &);  | 
