aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/llimage/llimage.cpp2
-rw-r--r--linden/indra/llimage/llpngwrapper.cpp18
-rw-r--r--linden/indra/llimage/llpngwrapper.h3
-rw-r--r--linden/indra/newview/app_settings/default_grids.xml17
-rw-r--r--linden/indra/newview/app_settings/logcontrol.xml17
-rw-r--r--linden/indra/newview/llface.h4
-rw-r--r--linden/indra/newview/llfloaterpreference.cpp14
-rw-r--r--linden/indra/newview/llfloaterpreference.h3
-rw-r--r--linden/indra/newview/llfloatertools.cpp5
-rw-r--r--linden/indra/newview/llprefsim.cpp166
-rw-r--r--linden/indra/newview/llprefsim.h1
-rw-r--r--linden/indra/newview/llstartup.cpp3
-rw-r--r--linden/indra/newview/lltexturecache.cpp4
-rw-r--r--linden/indra/newview/lltexturefetch.cpp15
-rw-r--r--linden/indra/newview/llviewerimage.cpp144
-rw-r--r--linden/indra/newview/llviewerimage.h26
-rw-r--r--linden/indra/newview/llviewermenu.cpp8
-rw-r--r--linden/indra/newview/llvovolume.cpp62
-rw-r--r--linden/indra/newview/llvovolume.h6
-rw-r--r--linden/indra/newview/pipeline.cpp1
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_login.xml2
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml12
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml3
23 files changed, 395 insertions, 141 deletions
diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp
index e933750..3a8dc3b 100644
--- a/linden/indra/llimage/llimage.cpp
+++ b/linden/indra/llimage/llimage.cpp
@@ -269,7 +269,7 @@ LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components)
269 : LLImageBase() 269 : LLImageBase()
270{ 270{
271 mMemType = LLMemType::MTYPE_IMAGERAW; 271 mMemType = LLMemType::MTYPE_IMAGERAW;
272 if(allocateDataSize(width, height, components)) 272 if(allocateDataSize(width, height, components) && data)
273 { 273 {
274 memcpy(getData(), data, width*height*components); 274 memcpy(getData(), data, width*height*components);
275 } 275 }
diff --git a/linden/indra/llimage/llpngwrapper.cpp b/linden/indra/llimage/llpngwrapper.cpp
index 0dd991a..2274a38 100644
--- a/linden/indra/llimage/llpngwrapper.cpp
+++ b/linden/indra/llimage/llpngwrapper.cpp
@@ -56,8 +56,6 @@ LLPngWrapper::LLPngWrapper()
56 mCompressionType( 0 ), 56 mCompressionType( 0 ),
57 mFilterMethod( 0 ), 57 mFilterMethod( 0 ),
58 mFinalSize( 0 ), 58 mFinalSize( 0 ),
59 mHasBKGD(false),
60 mBackgroundColor(),
61 mGamma(0.f) 59 mGamma(0.f)
62{ 60{
63} 61}
@@ -117,9 +115,9 @@ void LLPngWrapper::writeFlush(png_structp png_ptr)
117} 115}
118 116
119// Read the PNG file using the libpng. The low-level interface is used here 117// Read the PNG file using the libpng. The low-level interface is used here
120// because we want to do various transformations (including setting the 118// because we want to do various transformations (including applying gama)
121// matte background if any, and applying gama) which can't be done with 119// which can't be done with the high-level interface.
122// the high-level interface. The scanline also begins at the bottom of 120// The scanline also begins at the bottom of
123// the image (per SecondLife conventions) instead of at the top, so we 121// the image (per SecondLife conventions) instead of at the top, so we
124// must assign row-pointers in "reverse" order. 122// must assign row-pointers in "reverse" order.
125BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop) 123BOOL LLPngWrapper::readPng(U8* src, LLImageRaw* rawImage, ImageInfo *infop)
@@ -207,8 +205,7 @@ void LLPngWrapper::normalizeImage()
207 // 2. Convert grayscales to RGB 205 // 2. Convert grayscales to RGB
208 // 3. Create alpha layer from transparency 206 // 3. Create alpha layer from transparency
209 // 4. Ensure 8-bpp for all images 207 // 4. Ensure 8-bpp for all images
210 // 5. Apply background matte if any 208 // 5. Set (or guess) gamma
211 // 6. Set (or guess) gamma
212 209
213 if (mColorType == PNG_COLOR_TYPE_PALETTE) 210 if (mColorType == PNG_COLOR_TYPE_PALETTE)
214 { 211 {
@@ -235,12 +232,6 @@ void LLPngWrapper::normalizeImage()
235 { 232 {
236 png_set_strip_16(mReadPngPtr); 233 png_set_strip_16(mReadPngPtr);
237 } 234 }
238 mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
239 if (mHasBKGD)
240 {
241 png_set_background(mReadPngPtr, mBackgroundColor,
242 PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
243 }
244 235
245#if LL_DARWIN 236#if LL_DARWIN
246 const F64 SCREEN_GAMMA = 1.8; 237 const F64 SCREEN_GAMMA = 1.8;
@@ -267,7 +258,6 @@ void LLPngWrapper::updateMetaData()
267 mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr); 258 mBitDepth = png_get_bit_depth(mReadPngPtr, mReadInfoPtr);
268 mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr); 259 mColorType = png_get_color_type(mReadPngPtr, mReadInfoPtr);
269 mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr); 260 mChannels = png_get_channels(mReadPngPtr, mReadInfoPtr);
270 mHasBKGD = png_get_bKGD(mReadPngPtr, mReadInfoPtr, &mBackgroundColor);
271} 261}
272 262
273// Method to write raw image into PNG at dest. The raw scanline begins 263// Method to write raw image into PNG at dest. The raw scanline begins
diff --git a/linden/indra/llimage/llpngwrapper.h b/linden/indra/llimage/llpngwrapper.h
index 2e6c1dc..0c3168c 100644
--- a/linden/indra/llimage/llpngwrapper.h
+++ b/linden/indra/llimage/llpngwrapper.h
@@ -94,9 +94,6 @@ private:
94 94
95 U32 mFinalSize; 95 U32 mFinalSize;
96 96
97 bool mHasBKGD;
98 png_color_16p mBackgroundColor;
99
100 F64 mGamma; 97 F64 mGamma;
101 98
102 std::string mErrorMessage; 99 std::string mErrorMessage;
diff --git a/linden/indra/newview/app_settings/default_grids.xml b/linden/indra/newview/app_settings/default_grids.xml
index 802558a..cdf99e5 100644
--- a/linden/indra/newview/app_settings/default_grids.xml
+++ b/linden/indra/newview/app_settings/default_grids.xml
@@ -1,7 +1,7 @@
1<llsd> 1<llsd>
2 <array> 2 <array>
3 <map> 3 <map>
4 <key>default_grids_version</key><string>31</string> 4 <key>default_grids_version</key><string>32</string>
5 </map> 5 </map>
6 6
7 <!-- Second Life --> 7 <!-- Second Life -->
@@ -60,6 +60,21 @@
60 <key>version</key><string>2</string> 60 <key>version</key><string>2</string>
61 </map> 61 </map>
62 62
63 <!-- Aurora Grid -->
64 <map>
65 <key>gridname</key> <string>Aurora-Grid</string>
66 <key>gridnick</key> <string>auroragrid</string>
67 <key>platform</key> <string>OpenSim</string>
68 <key>loginuri</key> <string>http://login.aurora-sim.org:8002/</string>
69 <key>loginpage</key> <string>http://login.aurora-sim.org/splash/</string>
70 <key>helperuri</key> <string>http://grid.aurora-sim.org/</string>
71 <key>password</key> <string />
72 <key>register</key> <string />
73 <key>support</key> <string>http://forum.aurora-sim.org/</string>
74 <key>website</key> <string>http://aurora-sim.org</string>
75 <key>version</key> <string>0</string>
76 </map>
77
63 <!-- WorldSimTerra --> 78 <!-- WorldSimTerra -->
64 <map> 79 <map>
65 <key>gridnick</key><string>worldsimterra</string> 80 <key>gridnick</key><string>worldsimterra</string>
diff --git a/linden/indra/newview/app_settings/logcontrol.xml b/linden/indra/newview/app_settings/logcontrol.xml
index cdc837d..2c6c6a4 100644
--- a/linden/indra/newview/app_settings/logcontrol.xml
+++ b/linden/indra/newview/app_settings/logcontrol.xml
@@ -66,14 +66,15 @@
66 66
67 <!--<string>Messaging</string>--> 67 <!--<string>Messaging</string>-->
68 <!--<string>Notifications</string>--> 68 <!--<string>Notifications</string>-->
69 <string>Plugin</string> 69
70 <string>PluginClassMedia</string> 70 <!--<string>Plugin</string>-->
71 <string>PluginInstance</string> 71 <!--<string>PluginClassMedia</string>-->
72 <string>PluginPipe</string> 72 <!--<string>PluginInstance</string>-->
73 <string>PluginChild</string> 73 <!--<string>PluginPipe</string>-->
74 <!--<string>PluginSpam</string>--> 74 <!--<string>PluginChild</string>-->
75 <string>PluginParent</string> 75 <!--<string>PluginSpam</string>-->
76 <string>PluginViewerMedia</string> 76 <!--<string>PluginParent</string>-->
77 <!--<string>PluginViewerMedia</string>-->
77 78
78 <!--<string>Radar</string>--> 79 <!--<string>Radar</string>-->
79 <!--<string>ShaderLoading</string>--> 80 <!--<string>ShaderLoading</string>-->
diff --git a/linden/indra/newview/llface.h b/linden/indra/newview/llface.h
index 4893e82..e31b93f 100644
--- a/linden/indra/newview/llface.h
+++ b/linden/indra/newview/llface.h
@@ -106,6 +106,9 @@ public:
106 F32 getVirtualSize() const { return mVSize; } 106 F32 getVirtualSize() const { return mVSize; }
107 F32 getPixelArea() const { return mPixelArea; } 107 F32 getPixelArea() const { return mPixelArea; }
108 108
109 S32 getIndexInTex() const {return mIndexInTex ;}
110 void setIndexInTex(S32 index) { mIndexInTex = index ;}
111
109 void renderSetColor() const; 112 void renderSetColor() const;
110 S32 renderElements(const U16 *index_array) const; 113 S32 renderElements(const U16 *index_array) const;
111 S32 renderIndexed (); 114 S32 renderIndexed ();
@@ -225,6 +228,7 @@ private:
225 U16 mGeomIndex; // index into draw pool 228 U16 mGeomIndex; // index into draw pool
226 U32 mIndicesCount; 229 U32 mIndicesCount;
227 U32 mIndicesIndex; // index into draw pool for indices (yeah, I know!) 230 U32 mIndicesIndex; // index into draw pool for indices (yeah, I know!)
231 S32 mIndexInTex ;
228 232
229 //previous rebuild's geometry info 233 //previous rebuild's geometry info
230 U16 mLastGeomCount; 234 U16 mLastGeomCount;
diff --git a/linden/indra/newview/llfloaterpreference.cpp b/linden/indra/newview/llfloaterpreference.cpp
index 2fe4b4d..0f81be6 100644
--- a/linden/indra/newview/llfloaterpreference.cpp
+++ b/linden/indra/newview/llfloaterpreference.cpp
@@ -362,6 +362,11 @@ void LLPreferenceCore::setPersonalInfo(const std::string& visibility, bool im_vi
362 mPrefsIM->setPersonalInfo(visibility, im_via_email, email); 362 mPrefsIM->setPersonalInfo(visibility, im_via_email, email);
363} 363}
364 364
365void LLPreferenceCore::updateIsLoggedIn(bool enable)
366{
367 mPrefsIM->preparePerAccountPrefs(enable);
368}
369
365void LLPreferenceCore::refreshEnabledGraphics() 370void LLPreferenceCore::refreshEnabledGraphics()
366{ 371{
367 LLFloaterHardwareSettings::instance()->refreshEnabledState(); 372 LLFloaterHardwareSettings::instance()->refreshEnabledState();
@@ -537,6 +542,15 @@ void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_
537 } 542 }
538} 543}
539 544
545// static
546void LLFloaterPreference::updateIsLoggedIn(bool enable)
547{
548 if(sInstance && sInstance->mPreferenceCore)
549 {
550 sInstance->mPreferenceCore->updateIsLoggedIn(enable);
551 }
552}
553
540void LLFloaterPreference::refreshEnabledGraphics() 554void LLFloaterPreference::refreshEnabledGraphics()
541{ 555{
542 sInstance->mPreferenceCore->refreshEnabledGraphics(); 556 sInstance->mPreferenceCore->refreshEnabledGraphics();
diff --git a/linden/indra/newview/llfloaterpreference.h b/linden/indra/newview/llfloaterpreference.h
index c52f541..931c8b6 100644
--- a/linden/indra/newview/llfloaterpreference.h
+++ b/linden/indra/newview/llfloaterpreference.h
@@ -73,6 +73,7 @@ public:
73 LLTabContainer* getTabContainer() { return mTabContainer; } 73 LLTabContainer* getTabContainer() { return mTabContainer; }
74 74
75 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); 75 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
76 void updateIsLoggedIn(bool enable);
76 77
77 static void onTabChanged(void* user_data, bool from_click); 78 static void onTabChanged(void* user_data, bool from_click);
78 79
@@ -113,6 +114,8 @@ public:
113 114
114 // static data update, called from message handler 115 // static data update, called from message handler
115 static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email); 116 static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email);
117 // static data update, called after login
118 static void updateIsLoggedIn(bool enable);
116 119
117 // refresh all the graphics preferences menus 120 // refresh all the graphics preferences menus
118 static void refreshEnabledGraphics(); 121 static void refreshEnabledGraphics();
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 2aed361..e22de66 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -1259,9 +1259,8 @@ void LLFloaterTools::onClickLink(void* data)
1259 } 1259 }
1260 1260
1261 S32 max_linked_prims = 0; 1261 S32 max_linked_prims = 0;
1262 1262 LLViewerObject* first_rootp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
1263 LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); 1263 if(first_rootp && first_rootp->usePhysics())
1264 if(object && object->usePhysics())
1265 { 1264 {
1266 //Physical - use phys prim limit 1265 //Physical - use phys prim limit
1267 max_linked_prims = gHippoLimits->getMaxPhysLinkedPrims(); 1266 max_linked_prims = gHippoLimits->getMaxPhysLinkedPrims();
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp
index 9e86cd3..5ac2bb2 100644
--- a/linden/indra/newview/llprefsim.cpp
+++ b/linden/indra/newview/llprefsim.cpp
@@ -66,6 +66,7 @@ public:
66 void apply(); 66 void apply();
67 void cancel(); 67 void cancel();
68 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); 68 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
69 void preparePerAccountPrefs(bool enable);
69 void enableHistory(); 70 void enableHistory();
70 71
71 static void onClickLogPath(void* user_data); 72 static void onClickLogPath(void* user_data);
@@ -76,6 +77,7 @@ public:
76protected: 77protected:
77 78
78 bool mGotPersonalInfo; 79 bool mGotPersonalInfo;
80 bool mGotPerAccountSettings;
79 bool mOriginalIMViaEmail; 81 bool mOriginalIMViaEmail;
80 82
81 bool mOriginalHideOnlineStatus; 83 bool mOriginalHideOnlineStatus;
@@ -86,7 +88,9 @@ protected:
86LLPrefsIMImpl::LLPrefsIMImpl() 88LLPrefsIMImpl::LLPrefsIMImpl()
87 : LLPanel(std::string("IM Prefs Panel")), 89 : LLPanel(std::string("IM Prefs Panel")),
88 mGotPersonalInfo(false), 90 mGotPersonalInfo(false),
89 mOriginalIMViaEmail(false) 91 mGotPerAccountSettings(false),
92 mOriginalIMViaEmail(false),
93 mOriginalHideOnlineStatus(false)
90{ 94{
91 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml"); 95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_im.xml");
92} 96}
@@ -106,55 +110,38 @@ BOOL LLPrefsIMImpl::postBuild()
106 110
107 childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change")); 111 childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change"));
108 112
109 // Don't enable this until we get personal data 113 // Don't enable these until we get personal data
110 // Unless we're already logged in. Some non-SL grids won't send us the data we need -- MC 114 childSetEnabled("online_visibility", false);
111 childSetEnabled("include_im_in_chat_console", LLStartUp::isLoggedIn()); 115 childSetEnabled("send_im_to_email", false);
112 childSetEnabled("include_im_in_chat_history", LLStartUp::isLoggedIn());
113 childSetEnabled("show_timestamps_check", LLStartUp::isLoggedIn());
114 childSetEnabled("friends_online_notify_checkbox", LLStartUp::isLoggedIn());
115
116 childSetEnabled("online_visibility", LLStartUp::isLoggedIn());
117 childSetEnabled("send_im_to_email", LLStartUp::isLoggedIn());
118 childSetEnabled("log_instant_messages", LLStartUp::isLoggedIn());
119 childSetEnabled("log_chat", LLStartUp::isLoggedIn());
120 childSetEnabled("log_show_history", LLStartUp::isLoggedIn());
121 childSetEnabled("log_path_button", LLStartUp::isLoggedIn());
122 childSetEnabled("busy_response", LLStartUp::isLoggedIn());
123 childSetEnabled("log_instant_messages_timestamp", LLStartUp::isLoggedIn());
124 childSetEnabled("log_chat_timestamp", LLStartUp::isLoggedIn());
125 childSetEnabled("log_chat_IM", LLStartUp::isLoggedIn());
126 childSetEnabled("log_date_timestamp", LLStartUp::isLoggedIn());
127
128 childSetText("busy_response", getString("log_in_to_change"));
129 116
117 // These are safe to enable
118 childSetEnabled("include_im_in_chat_console", true);
119 childSetEnabled("include_im_in_chat_history", true);
120 childSetEnabled("show_timestamps_check", true);
121 childSetEnabled("friends_online_notify_checkbox", true);
122 childSetEnabled("vertical-imtabs-toggle", true);
130 childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole")); 123 childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole"));
131 childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory")); 124 childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory"));
132 childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); 125 childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps"));
133 childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); 126 childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification"));
134 childSetValue("vertical-imtabs-toggle", gSavedSettings.getBOOL("VerticalIMTabs")); 127 childSetValue("vertical-imtabs-toggle", gSavedSettings.getBOOL("VerticalIMTabs"));
135 128
136 childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath"));
137 childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages"));
138 childSetValue("log_chat", gSavedPerAccountSettings.getBOOL("LogChat"));
139 childSetValue("log_show_history", gSavedPerAccountSettings.getBOOL("LogShowHistory"));
140 childSetValue("log_instant_messages_timestamp", gSavedPerAccountSettings.getBOOL("IMLogTimestamp"));
141 childSetValue("log_chat_timestamp", gSavedPerAccountSettings.getBOOL("LogChatTimestamp"));
142 childSetValue("log_chat_IM", gSavedPerAccountSettings.getBOOL("LogChatIM"));
143 childSetValue("log_date_timestamp", gSavedPerAccountSettings.getBOOL("LogTimestampDate"));
144
145 childSetAction("log_path_button", onClickLogPath, this); 129 childSetAction("log_path_button", onClickLogPath, this);
146 childSetCommitCallback("log_chat",onCommitLogging,this); 130 childSetCommitCallback("log_chat",onCommitLogging,this);
147 childSetCommitCallback("log_instant_messages",onCommitLogging,this); 131 childSetCommitCallback("log_instant_messages",onCommitLogging,this);
148 132
149 childSetAction("busy_adv_btn", onClickBusyAdvanced, this); 133 childSetAction("busy_adv_btn", onClickBusyAdvanced, this);
150 134
135 preparePerAccountPrefs(LLStartUp::isLoggedIn());
136
151 return TRUE; 137 return TRUE;
152} 138}
153 139
154void LLPrefsIMImpl::enableHistory() 140void LLPrefsIMImpl::enableHistory()
155{ 141{
156 142
157 if (childGetValue("log_instant_messages").asBoolean() || childGetValue("log_chat").asBoolean()) 143 if (mGotPerAccountSettings &&
144 (childGetValue("log_instant_messages").asBoolean() || childGetValue("log_chat").asBoolean()))
158 { 145 {
159 childEnable("log_show_history"); 146 childEnable("log_show_history");
160 childEnable("log_path_button"); 147 childEnable("log_path_button");
@@ -168,23 +155,16 @@ void LLPrefsIMImpl::enableHistory()
168 155
169void LLPrefsIMImpl::apply() 156void LLPrefsIMImpl::apply()
170{ 157{
171 LLTextEditor* busy = getChild<LLTextEditor>("busy_response"); 158 if (mGotPerAccountSettings)
172 LLWString busy_response;
173 if (busy) busy_response = busy->getWText();
174 LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
175 LLWStringUtil::replaceChar(busy_response, '\n', '^');
176 LLWStringUtil::replaceChar(busy_response, ' ', '%');
177
178 if(mGotPersonalInfo)
179 { 159 {
180 160 LLTextEditor* busy = getChild<LLTextEditor>("busy_response");
161 LLWString busy_response;
162 if (busy) busy_response = busy->getWText();
163 LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
164 LLWStringUtil::replaceChar(busy_response, '\n', '^');
165 LLWStringUtil::replaceChar(busy_response, ' ', '%');
181 gSavedPerAccountSettings.setString("BusyModeResponse", std::string(wstring_to_utf8str(busy_response))); 166 gSavedPerAccountSettings.setString("BusyModeResponse", std::string(wstring_to_utf8str(busy_response)));
182 167
183 gSavedSettings.setBOOL("IMInChatConsole", childGetValue("include_im_in_chat_console").asBoolean());
184 gSavedSettings.setBOOL("IMInChatHistory", childGetValue("include_im_in_chat_history").asBoolean());
185 gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean());
186 gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean());
187
188 gSavedPerAccountSettings.setString("InstantMessageLogPath", childGetText("log_path_string")); 168 gSavedPerAccountSettings.setString("InstantMessageLogPath", childGetText("log_path_string"));
189 gSavedPerAccountSettings.setBOOL("LogInstantMessages",childGetValue("log_instant_messages").asBoolean()); 169 gSavedPerAccountSettings.setBOOL("LogInstantMessages",childGetValue("log_instant_messages").asBoolean());
190 gSavedPerAccountSettings.setBOOL("LogChat",childGetValue("log_chat").asBoolean()); 170 gSavedPerAccountSettings.setBOOL("LogChat",childGetValue("log_chat").asBoolean());
@@ -207,7 +187,10 @@ void LLPrefsIMImpl::apply()
207 gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") ); 187 gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
208 } 188 }
209 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); 189 LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());
210 190 }
191
192 if (mGotPersonalInfo)
193 {
211 bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); 194 bool new_im_via_email = childGetValue("send_im_to_email").asBoolean();
212 bool new_hide_online = childGetValue("online_visibility").asBoolean(); 195 bool new_hide_online = childGetValue("online_visibility").asBoolean();
213 196
@@ -237,9 +220,15 @@ void LLPrefsIMImpl::apply()
237 gAgent.sendReliableMessage(); 220 gAgent.sendReliableMessage();
238 } 221 }
239 } 222 }
223
240 gSavedSettings.setBOOL("VerticalIMTabs", childGetValue("vertical-imtabs-toggle").asBoolean()); 224 gSavedSettings.setBOOL("VerticalIMTabs", childGetValue("vertical-imtabs-toggle").asBoolean());
225 gSavedSettings.setBOOL("IMInChatConsole", childGetValue("include_im_in_chat_console").asBoolean());
226 gSavedSettings.setBOOL("IMInChatHistory", childGetValue("include_im_in_chat_history").asBoolean());
227 gSavedSettings.setBOOL("IMShowTimestamps", childGetValue("show_timestamps_check").asBoolean());
228 gSavedSettings.setBOOL("ChatOnlineNotification", childGetValue("friends_online_notify_checkbox").asBoolean());
241} 229}
242 230
231// Enable and set the value of settings recieved from the sim in AgentInfoReply
243void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) 232void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
244{ 233{
245 mGotPersonalInfo = true; 234 mGotPersonalInfo = true;
@@ -261,36 +250,10 @@ void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_e
261 mOriginalHideOnlineStatus = true; 250 mOriginalHideOnlineStatus = true;
262 } 251 }
263 252
264 childEnable("include_im_in_chat_console");
265 childEnable("include_im_in_chat_history");
266 childEnable("show_timestamps_check");
267 childEnable("friends_online_notify_checkbox");
268
269 childSetValue("online_visibility", mOriginalHideOnlineStatus); 253 childSetValue("online_visibility", mOriginalHideOnlineStatus);
270 childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility); 254 childSetLabelArg("online_visibility", "[DIR_VIS]", mDirectoryVisibility);
271 childEnable("send_im_to_email"); 255 childEnable("send_im_to_email");
272 childSetValue("send_im_to_email", im_via_email); 256 childSetValue("send_im_to_email", im_via_email);
273 childEnable("log_instant_messages");
274 childEnable("log_chat");
275 childEnable("busy_response");
276 childEnable("log_instant_messages_timestamp");
277 childEnable("log_chat_timestamp");
278 childEnable("log_chat_IM");
279 childEnable("log_date_timestamp");
280
281 //RN: get wide string so replace char can work (requires fixed-width encoding)
282 LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") );
283 LLWStringUtil::replaceChar(busy_response, '^', '\n');
284 LLWStringUtil::replaceChar(busy_response, '%', ' ');
285 childSetText("busy_response", wstring_to_utf8str(busy_response));
286// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
287 if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
288 {
289 childDisable("busy_response");
290 }
291// [/RLVa:KB]
292
293 enableHistory();
294 257
295 // Truncate the e-mail address if it's too long (to prevent going off 258 // Truncate the e-mail address if it's too long (to prevent going off
296 // the edge of the dialog). 259 // the edge of the dialog).
@@ -300,10 +263,62 @@ void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_e
300 display_email.resize(30); 263 display_email.resize(30);
301 display_email += "..."; 264 display_email += "...";
302 } 265 }
303 266 else if (display_email.empty())
267 {
268 display_email = getString("default_email_used");
269 }
304 childSetLabelArg("send_im_to_email", "[EMAIL]", display_email); 270 childSetLabelArg("send_im_to_email", "[EMAIL]", display_email);
305} 271}
306 272
273// Enable and set the value of settings that need an account name
274void LLPrefsIMImpl::preparePerAccountPrefs(bool enable)
275{
276 if (mGotPerAccountSettings && enable)
277 {
278 return; // prevent overwriting unsaved changes.
279 }
280 mGotPerAccountSettings = enable;
281
282 childSetEnabled("log_chat", enable);
283 childSetEnabled("log_chat_timestamp", enable);
284 childSetEnabled("log_chat_IM", enable);
285 childSetEnabled("log_instant_messages_timestamp", enable);
286 childSetEnabled("log_instant_messages", enable);
287 childSetEnabled("log_date_timestamp", enable);
288
289 childSetValue("log_chat", gSavedPerAccountSettings.getBOOL("LogChat"));
290 childSetValue("log_chat_timestamp", gSavedPerAccountSettings.getBOOL("LogChatTimestamp"));
291 childSetValue("log_chat_IM", gSavedPerAccountSettings.getBOOL("LogChatIM"));
292 childSetValue("log_instant_messages_timestamp", gSavedPerAccountSettings.getBOOL("IMLogTimestamp"));
293 childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages"));
294 childSetValue("log_date_timestamp", gSavedPerAccountSettings.getBOOL("LogTimestampDate"));
295
296 childSetValue("log_show_history", gSavedPerAccountSettings.getBOOL("LogShowHistory"));
297 enableHistory();
298 childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath"));
299
300 childSetEnabled("busy_response", enable);
301 if (enable)
302 {
303 //RN: get wide string so replace char can work (requires fixed-width encoding)
304 LLWString busy_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("BusyModeResponse") );
305 LLWStringUtil::replaceChar(busy_response, '^', '\n');
306 LLWStringUtil::replaceChar(busy_response, '%', ' ');
307 childSetText("busy_response", wstring_to_utf8str(busy_response));
308 }
309 else
310 {
311 childSetText("busy_response", getString("log_in_to_change"));
312 }
313// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
314 if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM))
315 {
316 childDisable("busy_response");
317 }
318// [/RLVa:KB]
319
320 childSetEnabled("busy_adv_btn", enable);
321}
307 322
308// static 323// static
309void LLPrefsIMImpl::onClickBusyAdvanced(void* user_data) 324void LLPrefsIMImpl::onClickBusyAdvanced(void* user_data)
@@ -363,6 +378,11 @@ void LLPrefsIM::setPersonalInfo(const std::string& visibility, bool im_via_email
363 impl.setPersonalInfo(visibility, im_via_email, email); 378 impl.setPersonalInfo(visibility, im_via_email, email);
364} 379}
365 380
381void LLPrefsIM::preparePerAccountPrefs(bool enable)
382{
383 impl.preparePerAccountPrefs(enable);
384}
385
366LLPanel* LLPrefsIM::getPanel() 386LLPanel* LLPrefsIM::getPanel()
367{ 387{
368 return &impl; 388 return &impl;
diff --git a/linden/indra/newview/llprefsim.h b/linden/indra/newview/llprefsim.h
index 90bf465..acf9b0f 100644
--- a/linden/indra/newview/llprefsim.h
+++ b/linden/indra/newview/llprefsim.h
@@ -46,6 +46,7 @@ public:
46 void apply(); 46 void apply();
47 void cancel(); 47 void cancel();
48 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); 48 void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email);
49 void preparePerAccountPrefs(bool enable);
49 50
50 LLPanel* getPanel(); 51 LLPanel* getPanel();
51 52
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index bd94a59..5a3a8ee 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -102,6 +102,7 @@
102#include "llfloatergesture.h" 102#include "llfloatergesture.h"
103#include "llfloaterhud.h" 103#include "llfloaterhud.h"
104#include "llfloaterland.h" 104#include "llfloaterland.h"
105#include "llfloaterpreference.h"
105#include "llfloaterteleporthistory.h" 106#include "llfloaterteleporthistory.h"
106#include "llfloatertopobjects.h" 107#include "llfloatertopobjects.h"
107#include "llfloatertos.h" 108#include "llfloatertos.h"
@@ -2918,6 +2919,8 @@ bool idle_startup()
2918 gDebugView->mFastTimerView->setVisible(TRUE); 2919 gDebugView->mFastTimerView->setVisible(TRUE);
2919#endif 2920#endif
2920 2921
2922 LLFloaterPreference::updateIsLoggedIn(true);
2923
2921 return TRUE; 2924 return TRUE;
2922 } 2925 }
2923 2926
diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp
index 2b032a5..3703f5e 100644
--- a/linden/indra/newview/lltexturecache.cpp
+++ b/linden/indra/newview/lltexturecache.cpp
@@ -250,9 +250,9 @@ bool LLTextureCacheLocalFileWorker::doRead()
250 } 250 }
251 } 251 }
252#else 252#else
253 if (!mDataSize || mDataSize > local_size) 253 if (!mDataSize || mDataSize + mOffset > local_size)
254 { 254 {
255 mDataSize = local_size; 255 mDataSize = local_size - mOffset;
256 } 256 }
257 mReadData = new U8[mDataSize]; 257 mReadData = new U8[mDataSize];
258 258
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp
index 072af25..ab867a6 100644
--- a/linden/indra/newview/lltexturefetch.cpp
+++ b/linden/indra/newview/lltexturefetch.cpp
@@ -664,16 +664,17 @@ bool LLTextureFetchWorker::doWork(S32 param)
664 mLoaded = FALSE; 664 mLoaded = FALSE;
665 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it 665 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
666 666
667 CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage);
668 if (mUrl.compare(0, 7, "file://") == 0) 667 if (mUrl.compare(0, 7, "file://") == 0)
669 { 668 {
670 // read file from local disk 669 // read file from local disk
671 std::string filename = mUrl.substr(7, std::string::npos); 670 std::string filename = mUrl.substr(7, std::string::npos);
671 CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage);
672 mCacheReadHandle = mFetcher->mTextureCache->readFromCache(filename, mID, cache_priority, 672 mCacheReadHandle = mFetcher->mTextureCache->readFromCache(filename, mID, cache_priority,
673 offset, size, responder); 673 offset, size, responder);
674 } 674 }
675 else if (mUrl.empty()) 675 else if (mUrl.empty())
676 { 676 {
677 CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage);
677 mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, 678 mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority,
678 offset, size, responder); 679 offset, size, responder);
679 } 680 }
@@ -723,6 +724,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
723 { 724 {
724 // we have enough data, decode it 725 // we have enough data, decode it
725 llassert_always(mFormattedImage->getDataSize() > 0); 726 llassert_always(mFormattedImage->getDataSize() > 0);
727 mLoadedDiscard = mDesiredDiscard;
726 mState = DECODE_IMAGE; 728 mState = DECODE_IMAGE;
727 mWriteToCacheState = NOT_WRITE ; 729 mWriteToCacheState = NOT_WRITE ;
728 LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() 730 LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize()
@@ -1113,6 +1115,17 @@ bool LLTextureFetchWorker::doWork(S32 param)
1113 return false; 1115 return false;
1114 } 1116 }
1115 S32 datasize = mFormattedImage->getDataSize(); 1117 S32 datasize = mFormattedImage->getDataSize();
1118 if(mFileSize < datasize)//This could happen when http fetching and sim fetching mixed.
1119 {
1120 if(mHaveAllData)
1121 {
1122 mFileSize = datasize ;
1123 }
1124 else
1125 {
1126 mFileSize = datasize + 1 ; //flag not fully loaded.
1127 }
1128 }
1116 llassert_always(datasize); 1129 llassert_always(datasize);
1117 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it 1130 setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
1118 U32 cache_priority = mWorkPriority; 1131 U32 cache_priority = mWorkPriority;
diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp
index 671a359..28561ed 100644
--- a/linden/indra/newview/llviewerimage.cpp
+++ b/linden/indra/newview/llviewerimage.cpp
@@ -61,6 +61,7 @@
61#include "llappviewer.h" 61#include "llappviewer.h"
62#include "llface.h" 62#include "llface.h"
63#include "llviewercamera.h" 63#include "llviewercamera.h"
64#include "llvovolume.h"
64/////////////////////////////////////////////////////////////////////////////// 65///////////////////////////////////////////////////////////////////////////////
65 66
66// statics 67// statics
@@ -352,6 +353,11 @@ void LLViewerImage::init(bool firstinit)
352 mDesiredSavedRawDiscardLevel = -1 ; 353 mDesiredSavedRawDiscardLevel = -1 ;
353 354
354 mCanUseHTTP = true; //default on if cap/settings allows us 355 mCanUseHTTP = true; //default on if cap/settings allows us
356
357 mNumFaces = 0 ;
358 mNumVolumes = 0;
359 mFaceList.clear() ;
360 mVolumeList.clear();
355} 361}
356 362
357// virtual 363// virtual
@@ -388,6 +394,7 @@ LLViewerImage::~LLViewerImage()
388void LLViewerImage::cleanup() 394void LLViewerImage::cleanup()
389{ 395{
390 mFaceList.clear() ; 396 mFaceList.clear() ;
397 mVolumeList.clear();
391 for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); 398 for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
392 iter != mLoadedCallbackList.end(); ) 399 iter != mLoadedCallbackList.end(); )
393 { 400 {
@@ -754,19 +761,19 @@ void LLViewerImage::updateVirtualSize()
754 { 761 {
755 addTextureStats(0.f, FALSE) ;//reset 762 addTextureStats(0.f, FALSE) ;//reset
756 } 763 }
757 if(mFaceList.size() > 0) 764 for(U32 i = 0 ; i < mNumFaces ; i++)
758 { 765 {
759 for(std::list<LLFace*>::iterator iter = mFaceList.begin(); iter != mFaceList.end(); ++iter) 766 LLFace* facep = mFaceList[i] ;
767 if(facep->getDrawable()->isRecentlyVisible())
760 { 768 {
761 LLFace* facep = *iter ; 769 addTextureStats(facep->getVirtualSize()) ;
762 if(facep->getDrawable()->isRecentlyVisible()) 770 setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
763 { 771 }
764 addTextureStats(facep->getVirtualSize()) ;
765 setAdditionalDecodePriority(facep->getImportanceToCamera()) ;
766 }
767 }
768 } 772 }
773
769 mNeedsResetMaxVirtualSize = TRUE ; 774 mNeedsResetMaxVirtualSize = TRUE ;
775 reorganizeFaceList();
776 reorganizeVolumeList();
770#endif 777#endif
771} 778}
772void LLViewerImage::scaleDown() 779void LLViewerImage::scaleDown()
@@ -1759,13 +1766,19 @@ void LLViewerImage::setCachedRawImage()
1759 if(mForSculpt) 1766 if(mForSculpt)
1760 { 1767 {
1761 max_size = MAX_CACHED_RAW_SCULPT_IMAGE_AREA ; 1768 max_size = MAX_CACHED_RAW_SCULPT_IMAGE_AREA ;
1769 // Even though we don't use the full pixel size, we want to decode up to discard 0,
1770 // because some legacy sculpts are weird like that.
1771 mCachedRawImageReady = !mRawDiscardLevel ;
1772 }
1773 else
1774 {
1775 mCachedRawImageReady = (!mRawDiscardLevel || ((w * h) >= max_size)) ;
1762 } 1776 }
1763 1777
1764 while(((w >> i) * (h >> i)) > max_size) 1778 while(((w >> i) * (h >> i)) > max_size)
1765 { 1779 {
1766 ++i ; 1780 ++i ;
1767 } 1781 }
1768 mCachedRawImageReady = (!mRawDiscardLevel || ((w * h) >= max_size)) ;
1769 1782
1770 if(i) 1783 if(i)
1771 { 1784 {
@@ -1776,7 +1789,8 @@ void LLViewerImage::setCachedRawImage()
1776 mRawImage->scale(w >> i, h >> i) ; 1789 mRawImage->scale(w >> i, h >> i) ;
1777 } 1790 }
1778 mCachedRawImage = mRawImage ; 1791 mCachedRawImage = mRawImage ;
1779 mCachedRawDiscardLevel = mRawDiscardLevel + i ; 1792 mRawDiscardLevel += i ;
1793 mCachedRawDiscardLevel = mRawDiscardLevel ;
1780 } 1794 }
1781} 1795}
1782 1796
@@ -1784,7 +1798,7 @@ void LLViewerImage::checkCachedRawSculptImage()
1784{ 1798{
1785 if(mCachedRawImageReady && mCachedRawDiscardLevel > 0) 1799 if(mCachedRawImageReady && mCachedRawDiscardLevel > 0)
1786 { 1800 {
1787 if(mCachedRawImage->getWidth() * mCachedRawImage->getHeight() < MAX_CACHED_RAW_SCULPT_IMAGE_AREA) 1801 if(getDiscardLevel() != 0)
1788 { 1802 {
1789 mCachedRawImageReady = FALSE ; 1803 mCachedRawImageReady = FALSE ;
1790 } 1804 }
@@ -1810,11 +1824,111 @@ void LLViewerImage::setForSculpt()
1810 checkCachedRawSculptImage() ; 1824 checkCachedRawSculptImage() ;
1811} 1825}
1812 1826
1827//virtual
1813void LLViewerImage::addFace(LLFace* facep) 1828void LLViewerImage::addFace(LLFace* facep)
1814{ 1829{
1815 mFaceList.push_back(facep) ; 1830 if(mNumFaces >= mFaceList.size())
1831 {
1832 mFaceList.resize(2 * mNumFaces + 1) ;
1833 }
1834 mFaceList[mNumFaces] = facep ;
1835 facep->setIndexInTex(mNumFaces) ;
1836 mNumFaces++ ;
1837 mLastFaceListUpdateTimer.reset() ;
1838}
1839
1840//virtual
1841void LLViewerImage::removeFace(LLFace* facep)
1842{
1843 if(mNumFaces > 1)
1844 {
1845 S32 index = facep->getIndexInTex() ;
1846 mFaceList[index] = mFaceList[--mNumFaces] ;
1847 mFaceList[index]->setIndexInTex(index) ;
1848 }
1849 else
1850 {
1851 mFaceList.clear() ;
1852 mNumFaces = 0 ;
1853 }
1854 mLastFaceListUpdateTimer.reset() ;
1855}
1856
1857S32 LLViewerImage::getNumFaces() const
1858{
1859 return mNumFaces ;
1860}
1861
1862
1863//virtual
1864void LLViewerImage::addVolume(LLVOVolume* volumep)
1865{
1866 if( mNumVolumes >= mVolumeList.size())
1867 {
1868 mVolumeList.resize(2 * mNumVolumes + 1) ;
1869 }
1870 mVolumeList[mNumVolumes] = volumep ;
1871 volumep->setIndexInTex(mNumVolumes) ;
1872 mNumVolumes++ ;
1873 mLastVolumeListUpdateTimer.reset() ;
1874}
1875
1876//virtual
1877void LLViewerImage::removeVolume(LLVOVolume* volumep)
1878{
1879 if(mNumVolumes > 1)
1880 {
1881 S32 index = volumep->getIndexInTex() ;
1882 mVolumeList[index] = mVolumeList[--mNumVolumes] ;
1883 mVolumeList[index]->setIndexInTex(index) ;
1884 }
1885 else
1886 {
1887 mVolumeList.clear() ;
1888 mNumVolumes = 0 ;
1889 }
1890 mLastVolumeListUpdateTimer.reset() ;
1816} 1891}
1817void LLViewerImage::removeFace(LLFace* facep) 1892
1893S32 LLViewerImage::getNumVolumes() const
1818{ 1894{
1819 mFaceList.remove(facep) ; 1895 return mNumVolumes ;
1896}
1897
1898void LLViewerImage::reorganizeFaceList()
1899{
1900 static const F32 MAX_WAIT_TIME = 20.f; // seconds
1901 static const U32 MAX_EXTRA_BUFFER_SIZE = 4 ;
1902
1903 if(mNumFaces + MAX_EXTRA_BUFFER_SIZE > mFaceList.size())
1904 {
1905 return ;
1906 }
1907
1908 if(mLastFaceListUpdateTimer.getElapsedTimeF32() < MAX_WAIT_TIME)
1909 {
1910 return ;
1911 }
1912
1913 mLastFaceListUpdateTimer.reset() ;
1914 mFaceList.erase(mFaceList.begin() + mNumFaces, mFaceList.end());
1915}
1916
1917void LLViewerImage::reorganizeVolumeList()
1918{
1919 static const F32 MAX_WAIT_TIME = 20.f; // seconds
1920 static const U32 MAX_EXTRA_BUFFER_SIZE = 4 ;
1921
1922 if(mNumVolumes + MAX_EXTRA_BUFFER_SIZE > mVolumeList.size())
1923 {
1924 return ;
1925 }
1926
1927 if(mLastVolumeListUpdateTimer.getElapsedTimeF32() < MAX_WAIT_TIME)
1928 {
1929 return ;
1930 }
1931
1932 mLastVolumeListUpdateTimer.reset() ;
1933 mVolumeList.erase(mVolumeList.begin() + mNumVolumes, mVolumeList.end());
1820} 1934}
diff --git a/linden/indra/newview/llviewerimage.h b/linden/indra/newview/llviewerimage.h
index 3bee51c..c2e3303 100644
--- a/linden/indra/newview/llviewerimage.h
+++ b/linden/indra/newview/llviewerimage.h
@@ -51,6 +51,7 @@ typedef void (*loaded_callback_func)( BOOL success, LLViewerImage *src_vi, LLIma
51 51
52class LLVFile; 52class LLVFile;
53class LLMessageSystem; 53class LLMessageSystem;
54class LLVOVolume;
54 55
55class LLLoadedCallbackEntry 56class LLLoadedCallbackEntry
56{ 57{
@@ -209,6 +210,9 @@ public:
209 INVALID_DISCARD_LEVEL = 0x7fff 210 INVALID_DISCARD_LEVEL = 0x7fff
210 }; 211 };
211 212
213 typedef std::vector<LLFace*> ll_face_list_t;
214 typedef std::vector<LLVOVolume*> ll_volume_list_t;
215
212protected: 216protected:
213 /*virtual*/ ~LLViewerImage(); 217 /*virtual*/ ~LLViewerImage();
214 218
@@ -311,8 +315,17 @@ public:
311 315
312 BOOL isSameTexture(const LLViewerImage* tex) const ; 316 BOOL isSameTexture(const LLViewerImage* tex) const ;
313 317
314 void addFace(LLFace* facep) ; 318 virtual void addFace(LLFace* facep) ;
315 void removeFace(LLFace* facep) ; 319 virtual void removeFace(LLFace* facep) ;
320 S32 getNumFaces() const;
321 const ll_face_list_t* getFaceList() const {return &mFaceList;}
322 void reorganizeFaceList() ;
323
324 virtual void addVolume(LLVOVolume* volumep);
325 virtual void removeVolume(LLVOVolume* volumep);
326 S32 getNumVolumes() const;
327 const ll_volume_list_t* getVolumeList() const { return &mVolumeList; }
328 void reorganizeVolumeList() ;
316 329
317 void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;}; 330 void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;};
318 331
@@ -417,8 +430,13 @@ private:
417 BOOL mForSculpt ; //a flag if the texture is used for a sculpt data. 430 BOOL mForSculpt ; //a flag if the texture is used for a sculpt data.
418 mutable BOOL mNeedsResetMaxVirtualSize ; 431 mutable BOOL mNeedsResetMaxVirtualSize ;
419 432
420 typedef std::list<LLFace*> ll_face_list_t ; 433 ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture
421 ll_face_list_t mFaceList ; //reverse pointer pointing to the faces using this image as texture 434 U32 mNumFaces ;
435 LLFrameTimer mLastFaceListUpdateTimer ;
436
437 ll_volume_list_t mVolumeList;
438 U32 mNumVolumes;
439 LLFrameTimer mLastVolumeListUpdateTimer;
422 440
423 bool mCanUseHTTP; // can this image be fetched by http 441 bool mCanUseHTTP; // can this image be fetched by http
424 442
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 777a871..cf3cec1 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -9219,6 +9219,14 @@ U32 info_display_from_string(std::string info_display)
9219 { 9219 {
9220 return LLPipeline::RENDER_DEBUG_GLOW; 9220 return LLPipeline::RENDER_DEBUG_GLOW;
9221 } 9221 }
9222 else if ("raycasting" == info_display)
9223 {
9224 return LLPipeline::RENDER_DEBUG_RAYCAST;
9225 }
9226 else if ("sculpt" == info_display)
9227 {
9228 return LLPipeline::RENDER_DEBUG_SCULPTED;
9229 }
9222 else 9230 else
9223 { 9231 {
9224 return 0; 9232 return 0;
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index 73ff860..204d641 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -89,12 +89,12 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
89 mRelativeXformInvTrans.setIdentity(); 89 mRelativeXformInvTrans.setIdentity();
90 90
91 mLOD = MIN_LOD; 91 mLOD = MIN_LOD;
92 mSculptLevel = -2;
93 mTextureAnimp = NULL; 92 mTextureAnimp = NULL;
94 mVObjRadius = LLVector3(1,1,0.5f).length(); 93 mVObjRadius = LLVector3(1,1,0.5f).length();
95 mNumFaces = 0; 94 mNumFaces = 0;
96 mLODChanged = FALSE; 95 mLODChanged = FALSE;
97 mSculptChanged = FALSE; 96 mSculptChanged = FALSE;
97 mIndexInTex = 0;
98} 98}
99 99
100LLVOVolume::~LLVOVolume() 100LLVOVolume::~LLVOVolume()
@@ -502,9 +502,8 @@ void LLVOVolume::updateTextureVirtualSize()
502 502
503 if (isSculpted()) 503 if (isSculpted())
504 { 504 {
505 LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); 505 updateSculptTexture();
506 LLUUID id = sculpt_params->getSculptTexture(); 506
507 mSculptTexture = gImageList.getImage(id);
508 if (mSculptTexture.notNull()) 507 if (mSculptTexture.notNull())
509 { 508 {
510 mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(), 509 mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(),
@@ -527,8 +526,8 @@ void LLVOVolume::updateTextureVirtualSize()
527 } 526 }
528 } 527 }
529 528
530 S32 texture_discard = mSculptTexture->getCachedRawImageLevel(); //try to match the texture 529 S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture
531 S32 current_discard = mSculptLevel; 530 S32 current_discard = getVolume() ? getVolume()->getSculptLevel() : -2 ;
532 531
533 if (texture_discard >= 0 && //texture has some data available 532 if (texture_discard >= 0 && //texture has some data available
534 (texture_discard < current_discard || //texture has more data than last rebuild 533 (texture_discard < current_discard || //texture has more data than last rebuild
@@ -682,25 +681,52 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail
682 mVolumeImpl->onSetVolume(volume_params, detail); 681 mVolumeImpl->onSetVolume(volume_params, detail);
683 } 682 }
684 683
684 updateSculptTexture();
685
685 if (isSculpted()) 686 if (isSculpted())
686 { 687 {
687 mSculptTexture = gImageList.getImage(volume_params.getSculptID());
688 if (mSculptTexture.notNull()) 688 if (mSculptTexture.notNull())
689 { 689 {
690 sculpt(); 690 sculpt();
691 mSculptLevel = getVolume()->getSculptLevel();
692 } 691 }
693 } 692 }
694 else
695 {
696 mSculptTexture = NULL;
697 }
698 693
699 return TRUE; 694 return TRUE;
700 } 695 }
701 return FALSE; 696 return FALSE;
702} 697}
703 698
699void LLVOVolume::updateSculptTexture()
700{
701 LLPointer<LLViewerImage> old_sculpt = mSculptTexture;
702
703 if (isSculpted())
704 {
705 LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
706 LLUUID id = sculpt_params->getSculptTexture();
707 if (id.notNull())
708 {
709 mSculptTexture = gImageList.getImage(id);
710 }
711 }
712 else
713 {
714 mSculptTexture = NULL;
715 }
716
717 if (mSculptTexture != old_sculpt)
718 {
719 if (old_sculpt.notNull())
720 {
721 old_sculpt->removeVolume(this);
722 }
723 if (mSculptTexture.notNull())
724 {
725 mSculptTexture->addVolume(this);
726 }
727 }
728}
729
704// sculpt replaces generate() for sculpted surfaces 730// sculpt replaces generate() for sculpted surfaces
705void LLVOVolume::sculpt() 731void LLVOVolume::sculpt()
706{ 732{
@@ -711,7 +737,7 @@ void LLVOVolume::sculpt()
711 S8 sculpt_components = 0; 737 S8 sculpt_components = 0;
712 const U8* sculpt_data = NULL; 738 const U8* sculpt_data = NULL;
713 739
714 S32 discard_level = mSculptTexture->getCachedRawImageLevel() ; 740 S32 discard_level = mSculptTexture->getDiscardLevel();
715 LLImageRaw* raw_image = mSculptTexture->getCachedRawImage() ; 741 LLImageRaw* raw_image = mSculptTexture->getCachedRawImage() ;
716 742
717 S32 max_discard = mSculptTexture->getMaxDiscardLevel(); 743 S32 max_discard = mSculptTexture->getMaxDiscardLevel();
@@ -754,6 +780,16 @@ void LLVOVolume::sculpt()
754 sculpt_data = raw_image->getData(); 780 sculpt_data = raw_image->getData();
755 } 781 }
756 getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level); 782 getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
783
784 //notify rebuild any other VOVolumes that reference this sculpty volume
785 for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i)
786 {
787 LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i];
788 if (volume != this && volume->getVolume() == getVolume())
789 {
790 gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE);
791 }
792 }
757 } 793 }
758} 794}
759 795
diff --git a/linden/indra/newview/llvovolume.h b/linden/indra/newview/llvovolume.h
index a78aa37..7c8a68d 100644
--- a/linden/indra/newview/llvovolume.h
+++ b/linden/indra/newview/llvovolume.h
@@ -169,8 +169,10 @@ public:
169 /*virtual*/ BOOL setMaterial(const U8 material); 169 /*virtual*/ BOOL setMaterial(const U8 material);
170 170
171 void setTexture(const S32 face); 171 void setTexture(const S32 face);
172 172 S32 getIndexInTex() const {return mIndexInTex ;}
173 /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); 173 /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false);
174 void updateSculptTexture();
175 void setIndexInTex(S32 index) { mIndexInTex = index ;}
174 void sculpt(); 176 void sculpt();
175 void updateRelativeXform(); 177 void updateRelativeXform();
176 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); 178 /*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
@@ -231,7 +233,6 @@ private:
231 LLFrameTimer mTextureUpdateTimer; 233 LLFrameTimer mTextureUpdateTimer;
232 S32 mLOD; 234 S32 mLOD;
233 BOOL mLODChanged; 235 BOOL mLODChanged;
234 S32 mSculptLevel;
235 BOOL mSculptChanged; 236 BOOL mSculptChanged;
236 LLMatrix4 mRelativeXform; 237 LLMatrix4 mRelativeXform;
237 LLMatrix3 mRelativeXformInvTrans; 238 LLMatrix3 mRelativeXformInvTrans;
@@ -239,6 +240,7 @@ private:
239 F32 mVObjRadius; 240 F32 mVObjRadius;
240 LLVolumeInterface *mVolumeImpl; 241 LLVolumeInterface *mVolumeImpl;
241 LLPointer<LLViewerImage> mSculptTexture; 242 LLPointer<LLViewerImage> mSculptTexture;
243 S32 mIndexInTex;
242 244
243 // statics 245 // statics
244public: 246public:
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index 9da0da0..36ffb05 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -157,6 +157,7 @@ std::string gPoolNames[] =
157 "POOL_GROUND", 157 "POOL_GROUND",
158 "POOL_INVISIBLE", 158 "POOL_INVISIBLE",
159 "POOL_AVATAR", 159 "POOL_AVATAR",
160 "POOL_VOIDWATER",
160 "POOL_WATER", 161 "POOL_WATER",
161 "POOL_GRASS", 162 "POOL_GRASS",
162 "POOL_FULLBRIGHT", 163 "POOL_FULLBRIGHT",
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_login.xml b/linden/indra/newview/skins/default/xui/en-us/menu_login.xml
index 18fb8e6..c65a737 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_login.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_login.xml
@@ -1,5 +1,5 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<menu_bar name="Login Menu" opaque="true" tear_off="false" height="18" bottom="-18"> 2<menu_bar name="Login Menu" opaque="true" tear_off="false" height="18" bottom="-18" follows="left|top|right">
3 <menu create_jump_keys="true" label="File" name="File" opaque="true" tear_off="false"> 3 <menu create_jump_keys="true" label="File" name="File" opaque="true" tear_off="false">
4 <menu_item_call label="Quit" name="Quit" shortcut="control|Q"> 4 <menu_item_call label="Quit" name="Quit" shortcut="control|Q">
5 <on_click function="File.Quit" userdata="" /> 5 <on_click function="File.Quit" userdata="" />
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
index c2afe40..4bde0f0 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
@@ -1287,6 +1287,18 @@
1287 <on_check function="Advanced.CheckInfoDisplay" 1287 <on_check function="Advanced.CheckInfoDisplay"
1288 userdata="glow" /> 1288 userdata="glow" />
1289 </menu_item_check> 1289 </menu_item_check>
1290 <menu_item_check name="Raycasting" label="Raycasting">
1291 <on_click function="Advanced.ToggleInfoDisplay"
1292 userdata="raycasting" />
1293 <on_check function="Advanced.CheckInfoDisplay"
1294 userdata="raycasting" />
1295 </menu_item_check>
1296 <menu_item_check name="Sculpt" label="Sculpt">
1297 <on_click function="Advanced.ToggleInfoDisplay"
1298 userdata="sculpt" />
1299 <on_check function="Advanced.CheckInfoDisplay"
1300 userdata="sculpt" />
1301 </menu_item_check>
1290 <menu_item_check name="Vectorize Perf Test" 1302 <menu_item_check name="Vectorize Perf Test"
1291 label="Vectorize Perf Test"> 1303 label="Vectorize Perf Test">
1292 <on_click function="ToggleControl" 1304 <on_click function="ToggleControl"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml
index e64f6c7..fe17e7a 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml
@@ -22,6 +22,9 @@
22 <string name="log_in_to_change"> 22 <string name="log_in_to_change">
23 log in to change 23 log in to change
24 </string> 24 </string>
25 <string name="default_email_used">
26 using default address
27 </string>
25 <check_box bottom="-45" enabled="true" follows="left|top" font="SansSerifSmall" 28 <check_box bottom="-45" enabled="true" follows="left|top" font="SansSerifSmall"
26 height="16" initial_value="false" label="Send IM to email ([EMAIL])" 29 height="16" initial_value="false" label="Send IM to email ([EMAIL])"
27 left="148" mouse_opaque="true" name="send_im_to_email" radio_style="false" 30 left="148" mouse_opaque="true" name="send_im_to_email" radio_style="false"