diff options
author | Oz Linden <oz@lindenlab.com> | 2011-07-21 15:02:03 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-07-21 15:02:03 -0400 |
commit | c118ec209907618c77613990fe2359d4f92802e6 (patch) | |
tree | b2fa95d1fa1563cdee89d2bf035b680c64918c0f /indra/newview/llwldaycycle.h | |
parent | 54bb91fd03d0c2f2600993274c59ae89324eeb03 (diff) | |
parent | 67e365ba57bb7024a64bc0663782cd7f06b4a5cc (diff) |
merge up changes for 2.8.0 release
Diffstat (limited to 'indra/newview/llwldaycycle.h')
-rw-r--r-- | indra/newview/llwldaycycle.h | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/indra/newview/llwldaycycle.h b/indra/newview/llwldaycycle.h index 5cbf72191d..c8585564ed 100644 --- a/indra/newview/llwldaycycle.h +++ b/indra/newview/llwldaycycle.h @@ -34,13 +34,16 @@ class LLWLDayCycle; #include <string> #include "llwlparamset.h" #include "llwlanimator.h" +struct LLWLParamKey; +#include "llenvmanager.h" // for LLEnvKey::EScope class LLWLDayCycle { + LOG_CLASS(LLWLDayCycle); public: // lists what param sets are used when during the day - std::map<F32, std::string> mTimeMap; + std::map<F32, LLWLParamKey> mTimeMap; // how long is my day F32 mDayRate; @@ -54,35 +57,56 @@ public: ~LLWLDayCycle(); /// load a day cycle - void loadDayCycle(const std::string & fileName); + void loadDayCycle(const LLSD& llsd, LLEnvKey::EScope scope); /// load a day cycle + void loadDayCycleFromFile(const std::string & fileName); + + /// save a day cycle void saveDayCycle(const std::string & fileName); - /// clear keys - void clearKeys(); + /// save a day cycle + void save(const std::string& file_path); + + /// load the LLSD data from a file (returns the undefined LLSD if not found) + static LLSD loadCycleDataFromFile(const std::string & fileName); + + /// load the LLSD data from a file specified by full path + static LLSD loadDayCycleFromPath(const std::string& file_path); + + /// get the LLSD data for this day cycle + LLSD asLLSD(); + + // get skies referenced by this day cycle + bool getSkyRefs(std::map<LLWLParamKey, LLWLParamSet>& refs) const; + + // get referenced skies as LLSD + bool getSkyMap(LLSD& sky_map) const; + + /// clear keyframes + void clearKeyframes(); /// Getters and Setters /// add a new key frame to the day cycle /// returns true if successful /// no negative time - bool addKey(F32 newTime, const std::string & paramName); + bool addKeyframe(F32 newTime, LLWLParamKey key); - /// adjust a key's placement in the day cycle + /// adjust a keyframe's placement in the day cycle /// returns true if successful - bool changeKeyTime(F32 oldTime, F32 newTime); + bool changeKeyframeTime(F32 oldTime, F32 newTime); - /// adjust a key's parameter used + /// adjust a keyframe's parameter used /// returns true if successful - bool changeKeyParam(F32 time, const std::string & paramName); + bool changeKeyframeParam(F32 time, LLWLParamKey key); - /// remove a key from the day cycle + /// remove a key frame from the day cycle /// returns true if successful - bool removeKey(F32 time); + bool removeKeyframe(F32 time); /// get the first key time for a parameter /// returns false if not there - bool getKey(const std::string & name, F32& key); + bool getKeytime(LLWLParamKey keyFrame, F32& keyTime) const; /// get the param set at a given time /// returns true if found one @@ -92,6 +116,12 @@ public: /// returns true if it found one bool getKeyedParamName(F32 time, std::string & name); + /// @return true if there are references to the given sky + bool hasReferencesTo(const LLWLParamKey& keyframe) const; + + /// removes all references to the sky (paramkey) + /// does nothing if the sky doesn't exist in the day + void removeReferencesTo(const LLWLParamKey& keyframe); }; |