summaryrefslogtreecommitdiff
path: root/indra/newview/llwldaycycle.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llwldaycycle.h')
-rw-r--r--indra/newview/llwldaycycle.h54
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);
};