diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llwldaycycle.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llwldaycycle.cpp')
-rw-r--r-- | linden/indra/newview/llwldaycycle.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/linden/indra/newview/llwldaycycle.cpp b/linden/indra/newview/llwldaycycle.cpp index 4626160..2bf9e58 100644 --- a/linden/indra/newview/llwldaycycle.cpp +++ b/linden/indra/newview/llwldaycycle.cpp | |||
@@ -48,17 +48,17 @@ LLWLDayCycle::~LLWLDayCycle() | |||
48 | { | 48 | { |
49 | } | 49 | } |
50 | 50 | ||
51 | void LLWLDayCycle::loadDayCycle(const LLString & fileName) | 51 | void LLWLDayCycle::loadDayCycle(const std::string & fileName) |
52 | { | 52 | { |
53 | // clear the first few things | 53 | // clear the first few things |
54 | mTimeMap.clear(); | 54 | mTimeMap.clear(); |
55 | 55 | ||
56 | // now load the file | 56 | // now load the file |
57 | LLString pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, | 57 | std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, |
58 | "windlight/days", fileName)); | 58 | "windlight/days", fileName)); |
59 | llinfos << "Loading DayCycle settings from " << pathName << llendl; | 59 | llinfos << "Loading DayCycle settings from " << pathName << llendl; |
60 | 60 | ||
61 | llifstream day_cycle_xml(pathName.c_str()); | 61 | llifstream day_cycle_xml(pathName); |
62 | if (day_cycle_xml.is_open()) | 62 | if (day_cycle_xml.is_open()) |
63 | { | 63 | { |
64 | // load and parse it | 64 | // load and parse it |
@@ -82,7 +82,7 @@ void LLWLDayCycle::loadDayCycle(const LLString & fileName) | |||
82 | if(!success) | 82 | if(!success) |
83 | { | 83 | { |
84 | // alert the user | 84 | // alert the user |
85 | LLString::format_map_t args; | 85 | LLStringUtil::format_map_t args; |
86 | args["[SKY]"] = day_data[i][1].asString(); | 86 | args["[SKY]"] = day_data[i][1].asString(); |
87 | gViewerWindow->alertXml("WLMissingSky", args); | 87 | gViewerWindow->alertXml("WLMissingSky", args); |
88 | continue; | 88 | continue; |
@@ -96,11 +96,11 @@ void LLWLDayCycle::loadDayCycle(const LLString & fileName) | |||
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | void LLWLDayCycle::saveDayCycle(const LLString & fileName) | 99 | void LLWLDayCycle::saveDayCycle(const std::string & fileName) |
100 | { | 100 | { |
101 | LLSD day_data(LLSD::emptyArray()); | 101 | LLSD day_data(LLSD::emptyArray()); |
102 | 102 | ||
103 | LLString pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", fileName)); | 103 | std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", fileName)); |
104 | //llinfos << "Saving WindLight settings to " << pathName << llendl; | 104 | //llinfos << "Saving WindLight settings to " << pathName << llendl; |
105 | 105 | ||
106 | for(std::map<F32, std::string>::const_iterator mIt = mTimeMap.begin(); | 106 | for(std::map<F32, std::string>::const_iterator mIt = mTimeMap.begin(); |
@@ -113,11 +113,10 @@ void LLWLDayCycle::saveDayCycle(const LLString & fileName) | |||
113 | day_data.append(key); | 113 | day_data.append(key); |
114 | } | 114 | } |
115 | 115 | ||
116 | std::ofstream day_cycle_xml(pathName.c_str()); | 116 | llofstream day_cycle_xml(pathName); |
117 | LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); | 117 | LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); |
118 | formatter->format(day_data, day_cycle_xml, LLSDFormatter::OPTIONS_PRETTY); | 118 | formatter->format(day_data, day_cycle_xml, LLSDFormatter::OPTIONS_PRETTY); |
119 | 119 | day_cycle_xml.close(); | |
120 | //day_cycle_xml.close(); | ||
121 | } | 120 | } |
122 | 121 | ||
123 | 122 | ||
@@ -127,7 +126,7 @@ void LLWLDayCycle::clearKeys() | |||
127 | } | 126 | } |
128 | 127 | ||
129 | 128 | ||
130 | bool LLWLDayCycle::addKey(F32 newTime, const LLString & paramName) | 129 | bool LLWLDayCycle::addKey(F32 newTime, const std::string & paramName) |
131 | { | 130 | { |
132 | // no adding negative time | 131 | // no adding negative time |
133 | if(newTime < 0) | 132 | if(newTime < 0) |
@@ -160,7 +159,7 @@ bool LLWLDayCycle::changeKeyTime(F32 oldTime, F32 newTime) | |||
160 | return addKey(newTime, name); | 159 | return addKey(newTime, name); |
161 | } | 160 | } |
162 | 161 | ||
163 | bool LLWLDayCycle::changeKeyParam(F32 time, const LLString & name) | 162 | bool LLWLDayCycle::changeKeyParam(F32 time, const std::string & name) |
164 | { | 163 | { |
165 | // just remove and add back | 164 | // just remove and add back |
166 | // make sure param exists | 165 | // make sure param exists |
@@ -189,7 +188,7 @@ bool LLWLDayCycle::removeKey(F32 time) | |||
189 | return false; | 188 | return false; |
190 | } | 189 | } |
191 | 190 | ||
192 | bool LLWLDayCycle::getKey(const LLString & name, F32& key) | 191 | bool LLWLDayCycle::getKey(const std::string & name, F32& key) |
193 | { | 192 | { |
194 | // scroll through till we find the | 193 | // scroll through till we find the |
195 | std::map<F32, std::string>::iterator mIt = mTimeMap.begin(); | 194 | std::map<F32, std::string>::iterator mIt = mTimeMap.begin(); |
@@ -218,7 +217,7 @@ bool LLWLDayCycle::getKeyedParam(F32 time, LLWLParamSet& param) | |||
218 | return false; | 217 | return false; |
219 | } | 218 | } |
220 | 219 | ||
221 | bool LLWLDayCycle::getKeyedParamName(F32 time, LLString & name) | 220 | bool LLWLDayCycle::getKeyedParamName(F32 time, std::string & name) |
222 | { | 221 | { |
223 | // just scroll on through till you find it | 222 | // just scroll on through till you find it |
224 | std::map<F32, std::string>::iterator mIt = mTimeMap.find(time); | 223 | std::map<F32, std::string>::iterator mIt = mTimeMap.find(time); |