aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorAleric Inglewood2010-10-02 15:14:37 +0200
committerAleric Inglewood2010-10-02 15:14:37 +0200
commit823a01a4d8c8c1f909a54c05f45787e5bbba1c6a (patch)
treedaba9dd3e245b915cf2e73c9435d04c927840df1 /linden/indra
parentRED-581: SNOW-796: Clicking 'Reset to default' in the Debug Settings floater ... (diff)
parentChanged version to Experimental 2010.10.02 (diff)
downloadmeta-impy-823a01a4d8c8c1f909a54c05f45787e5bbba1c6a.zip
meta-impy-823a01a4d8c8c1f909a54c05f45787e5bbba1c6a.tar.gz
meta-impy-823a01a4d8c8c1f909a54c05f45787e5bbba1c6a.tar.bz2
meta-impy-823a01a4d8c8c1f909a54c05f45787e5bbba1c6a.tar.xz
Merge branch 'weekly' of http://github.com/imprudence/imprudence into weekly
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/cmake/CMakeLists.txt0
-rw-r--r--linden/indra/llimagej2coj/llimagej2coj.cpp45
-rw-r--r--linden/indra/llrender/llgl.cpp30
-rw-r--r--linden/indra/llrender/llgl.h7
-rw-r--r--linden/indra/llrender/llglheaders.h10
-rw-r--r--linden/indra/llui/lllineeditor.cpp251
-rw-r--r--linden/indra/llui/lllineeditor.h24
-rw-r--r--linden/indra/llui/lltexteditor.cpp236
-rw-r--r--linden/indra/llui/lltexteditor.h17
-rw-r--r--linden/indra/newview/CMakeLists.txt5
-rw-r--r--linden/indra/newview/app_settings/settings.xml33
-rw-r--r--linden/indra/newview/app_settings/viewerversion.xml2
-rw-r--r--linden/indra/newview/chatbar_as_cmdline.cpp4
-rw-r--r--linden/indra/newview/hippoLimits.h2
-rw-r--r--linden/indra/newview/kowopenregionsettings.cpp162
-rw-r--r--linden/indra/newview/lgghunspell_wrapper.cpp18
-rw-r--r--linden/indra/newview/lgghunspell_wrapper.h4
-rw-r--r--linden/indra/newview/llagent.cpp99
-rw-r--r--linden/indra/newview/llagent.h9
-rw-r--r--linden/indra/newview/llappviewer.cpp43
-rw-r--r--linden/indra/newview/llcallingcard.cpp12
-rw-r--r--linden/indra/newview/llcallingcard.h2
-rw-r--r--linden/indra/newview/llchatbar.cpp3
-rw-r--r--linden/indra/newview/lldrawable.cpp1
-rw-r--r--linden/indra/newview/lldrawpool.cpp1
-rw-r--r--linden/indra/newview/lldrawpool.h1
-rw-r--r--linden/indra/newview/lldrawpoolbump.cpp3
-rw-r--r--linden/indra/newview/lldrawpoolground.cpp2
-rw-r--r--linden/indra/newview/lldrawpoolsky.cpp2
-rw-r--r--linden/indra/newview/lldrawpoolterrain.cpp5
-rw-r--r--linden/indra/newview/lldrawpooltree.cpp8
-rw-r--r--linden/indra/newview/lldrawpoolwater.cpp23
-rw-r--r--linden/indra/newview/lldrawpoolwlsky.cpp2
-rw-r--r--linden/indra/newview/llfloaterbuycurrency.cpp2
-rw-r--r--linden/indra/newview/llfloaterfriends.cpp9
-rw-r--r--linden/indra/newview/llfloatergodtools.cpp18
-rw-r--r--linden/indra/newview/llfloatersnapshot.cpp237
-rw-r--r--linden/indra/newview/llfloatertools.cpp4
-rw-r--r--linden/indra/newview/llfolderview.cpp19
-rw-r--r--linden/indra/newview/llgroupnotify.cpp10
-rw-r--r--linden/indra/newview/llhudeffectlookat.cpp7
-rw-r--r--linden/indra/newview/llhudeffecttrail.cpp8
-rw-r--r--linden/indra/newview/llhudtext.cpp11
-rw-r--r--linden/indra/newview/llimview.cpp16
-rw-r--r--linden/indra/newview/llinventorybridge.cpp20
-rw-r--r--linden/indra/newview/llmediaremotectrl.cpp13
-rw-r--r--linden/indra/newview/llnetmap.cpp20
-rw-r--r--linden/indra/newview/llnotify.cpp14
-rw-r--r--linden/indra/newview/lloverlaybar.cpp11
-rw-r--r--linden/indra/newview/llpanelaudiovolume.cpp5
-rw-r--r--linden/indra/newview/llpanelavatar.cpp12
-rw-r--r--linden/indra/newview/llpaneldisplay.cpp11
-rw-r--r--linden/indra/newview/llprefsadvanced.cpp6
-rw-r--r--linden/indra/newview/llprefschat.cpp3
-rw-r--r--linden/indra/newview/llpreviewlandmark.cpp4
-rw-r--r--linden/indra/newview/llspatialpartition.cpp26
-rw-r--r--linden/indra/newview/llspatialpartition.h8
-rw-r--r--linden/indra/newview/llstartup.cpp8
-rw-r--r--linden/indra/newview/llstatgraph.cpp4
-rw-r--r--linden/indra/newview/llstatusbar.cpp9
-rw-r--r--linden/indra/newview/llstatusbar.h3
-rw-r--r--linden/indra/newview/llsurface.cpp5
-rw-r--r--linden/indra/newview/lltexturefetch.cpp4
-rw-r--r--linden/indra/newview/lltoolfocus.cpp4
-rw-r--r--linden/indra/newview/llvieweraudio.cpp10
-rw-r--r--linden/indra/newview/llviewerdisplay.cpp3
-rw-r--r--linden/indra/newview/llviewerimagelist.cpp2
-rw-r--r--linden/indra/newview/llviewermenu.cpp46
-rwxr-xr-xlinden/indra/newview/llviewermessage.cpp59
-rw-r--r--linden/indra/newview/llviewermessage.h2
-rw-r--r--linden/indra/newview/llviewerobject.cpp2
-rw-r--r--linden/indra/newview/llviewerobject.h16
-rw-r--r--linden/indra/newview/llviewerobjectlist.cpp4
-rw-r--r--linden/indra/newview/llviewerregion.cpp1
-rw-r--r--linden/indra/newview/llviewerregion.h1
-rw-r--r--linden/indra/newview/llviewerstats.cpp3
-rw-r--r--linden/indra/newview/llviewerwindow.cpp30
-rw-r--r--linden/indra/newview/llvoavatar.cpp36
-rw-r--r--linden/indra/newview/llvograss.cpp10
-rw-r--r--linden/indra/newview/llvograss.h2
-rw-r--r--linden/indra/newview/llvoiceremotectrl.cpp6
-rw-r--r--linden/indra/newview/llvosky.cpp5
-rw-r--r--linden/indra/newview/llvosurfacepatch.cpp2
-rw-r--r--linden/indra/newview/llvotree.cpp16
-rw-r--r--linden/indra/newview/llvovolume.cpp12
-rw-r--r--linden/indra/newview/llvowater.cpp21
-rw-r--r--linden/indra/newview/llvowater.h15
-rw-r--r--linden/indra/newview/llvowlsky.cpp4
-rw-r--r--linden/indra/newview/llworld.cpp359
-rw-r--r--linden/indra/newview/llworld.h1
-rw-r--r--linden/indra/newview/pipeline.cpp76
-rw-r--r--linden/indra/newview/pipeline.h3
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml7
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_login.xml9
94 files changed, 1682 insertions, 678 deletions
diff --git a/linden/indra/cmake/CMakeLists.txt b/linden/indra/cmake/CMakeLists.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/linden/indra/cmake/CMakeLists.txt
diff --git a/linden/indra/llimagej2coj/llimagej2coj.cpp b/linden/indra/llimagej2coj/llimagej2coj.cpp
index b7a1b82..fd92370 100644
--- a/linden/indra/llimagej2coj/llimagej2coj.cpp
+++ b/linden/indra/llimagej2coj/llimagej2coj.cpp
@@ -152,8 +152,13 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
152 /* open a byte stream */ 152 /* open a byte stream */
153 cio = opj_cio_open((opj_common_ptr)dinfo, base.getData(), base.getDataSize()); 153 cio = opj_cio_open((opj_common_ptr)dinfo, base.getData(), base.getDataSize());
154 154
155 /* decode the stream and fill the image structure */ 155 /* decode the stream and fill the image structure, also fill in an additional
156 image = opj_decode(dinfo, cio); 156 structure to get the decoding result. This structure is a bit unusual in that
157 it is not received through opj, but still has some dynamically allocated fields
158 that need to be cleared up at the end by calling a destroy function. */
159 opj_codestream_info_t cinfo;
160 memset(&cinfo, 0, sizeof(opj_codestream_info_t));
161 image = opj_decode_with_info(dinfo, cio, &cinfo);
157 162
158 /* close the byte stream */ 163 /* close the byte stream */
159 opj_cio_close(cio); 164 opj_cio_close(cio);
@@ -180,6 +185,7 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
180 LL_DEBUGS("Openjpeg") << "ERROR -> decodeImpl: failed to decode image wrong number of components: " << img_components << LL_ENDL; 185 LL_DEBUGS("Openjpeg") << "ERROR -> decodeImpl: failed to decode image wrong number of components: " << img_components << LL_ENDL;
181 if (image) 186 if (image)
182 { 187 {
188 opj_destroy_cstr_info(&cinfo);
183 opj_image_destroy(image); 189 opj_image_destroy(image);
184 } 190 }
185 191
@@ -187,23 +193,40 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
187 } 193 }
188 194
189 // sometimes we get bad data out of the cache - check to see if the decode succeeded 195 // sometimes we get bad data out of the cache - check to see if the decode succeeded
190 for (S32 i = 0; i < img_components; i++) 196 int decompdifference = 0;
197 if (cinfo.numdecompos) // sanity
191 { 198 {
192 if (image->comps[i].factor != base.getRawDiscardLevel()) 199 for (int comp = 0; comp < image->numcomps; comp++)
200 { /* get maximum decomposition level difference, first field is from the COD header and the second
201 is what is actually met in the codestream, NB: if everything was ok, this calculation will
202 return what was set in the cp_reduce value! */
203 decompdifference = llmax(decompdifference, cinfo.numdecompos[comp] - image->comps[comp].resno_decoded);
204 }
205 if (decompdifference < 0) // sanity
193 { 206 {
194 // if we didn't get the discard level we're expecting, fail 207 decompdifference = 0;
195 if (image) //anyway somthing odd with the image, better check than crash
196 opj_image_destroy(image);
197 base.mDecoding = FALSE;
198 return TRUE;
199 } 208 }
200 } 209 }
201 210
211
212 /* if OpenJPEG failed to decode all requested decomposition levels
213 the difference will be greater than this level */
214 if (decompdifference > base.getRawDiscardLevel())
215 {
216 llwarns << "not enough data for requested discard level, setting mDecoding to FALSE, difference: " << (decompdifference - base.getRawDiscardLevel()) << llendl;
217 opj_destroy_cstr_info(&cinfo);
218 opj_image_destroy(image);
219 base.mDecoding = FALSE;
220 return TRUE;
221 }
222
202 if(img_components <= first_channel) 223 if(img_components <= first_channel)
203 { 224 {
225 // sanity
204 LL_DEBUGS("Openjpeg") << "trying to decode more channels than are present in image: numcomps: " << img_components << " first_channel: " << first_channel << LL_ENDL; 226 LL_DEBUGS("Openjpeg") << "trying to decode more channels than are present in image: numcomps: " << img_components << " first_channel: " << first_channel << LL_ENDL;
205 if (image) 227 if (image)
206 { 228 {
229 opj_destroy_cstr_info(&cinfo);
207 opj_image_destroy(image); 230 opj_image_destroy(image);
208 } 231 }
209 232
@@ -252,15 +275,17 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
252 else // Some rare OpenJPEG versions have this bug. 275 else // Some rare OpenJPEG versions have this bug.
253 { 276 {
254 llwarns << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << llendl; 277 llwarns << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << llendl;
278 opj_destroy_cstr_info(&cinfo);
255 opj_image_destroy(image); 279 opj_image_destroy(image);
256 280
257 return TRUE; // done 281 return TRUE; // done
258 } 282 }
259 } 283 }
260 284
261 /* free image data structure */ 285 /* free opj data structures */
262 if (image) 286 if (image)
263 { 287 {
288 opj_destroy_cstr_info(&cinfo);
264 opj_image_destroy(image); 289 opj_image_destroy(image);
265 } 290 }
266 291
diff --git a/linden/indra/llrender/llgl.cpp b/linden/indra/llrender/llgl.cpp
index 61194c4..2e9b2bd 100644
--- a/linden/indra/llrender/llgl.cpp
+++ b/linden/indra/llrender/llgl.cpp
@@ -552,41 +552,46 @@ extern LLCPUInfo gSysCPU;
552void LLGLManager::initExtensions() 552void LLGLManager::initExtensions()
553{ 553{
554#if LL_MESA_HEADLESS 554#if LL_MESA_HEADLESS
555# if GL_ARB_multitexture 555# ifdef GL_ARB_multitexture
556 mHasMultitexture = TRUE; 556 mHasMultitexture = TRUE;
557# else 557# else
558 mHasMultitexture = FALSE; 558 mHasMultitexture = FALSE;
559# endif 559# endif
560# if GL_ARB_texture_env_combine 560# ifdef GL_ARB_texture_env_combine
561 mHasARBEnvCombine = TRUE; 561 mHasARBEnvCombine = TRUE;
562# else 562# else
563 mHasARBEnvCombine = FALSE; 563 mHasARBEnvCombine = FALSE;
564# endif 564# endif
565# if GL_ARB_texture_compression 565# ifdef GL_ARB_texture_compression
566 mHasCompressedTextures = TRUE; 566 mHasCompressedTextures = TRUE;
567# else 567# else
568 mHasCompressedTextures = FALSE; 568 mHasCompressedTextures = FALSE;
569# endif 569# endif
570# if GL_ARB_vertex_buffer_object 570# ifdef GL_ARB_vertex_buffer_object
571 mHasVertexBufferObject = TRUE; 571 mHasVertexBufferObject = TRUE;
572# else 572# else
573 mHasVertexBufferObject = FALSE; 573 mHasVertexBufferObject = FALSE;
574# endif 574# endif
575# if GL_EXT_framebuffer_object 575# ifdef GL_EXT_framebuffer_object
576 mHasFramebufferObject = TRUE; 576 mHasFramebufferObject = TRUE;
577# else 577# else
578 mHasFramebufferObject = FALSE; 578 mHasFramebufferObject = FALSE;
579# endif 579# endif
580# if GL_EXT_framebuffer_multisample 580# ifdef GL_EXT_framebuffer_multisample
581 mHasFramebufferMultisample = TRUE; 581 mHasFramebufferMultisample = TRUE;
582# else 582# else
583 mHasFramebufferMultisample = FALSE; 583 mHasFramebufferMultisample = FALSE;
584# endif 584# endif
585# if GL_ARB_draw_buffers 585# ifdef GL_ARB_draw_buffers
586 mHasDrawBuffers = TRUE; 586 mHasDrawBuffers = TRUE;
587#else 587#else
588 mHasDrawBuffers = FALSE; 588 mHasDrawBuffers = FALSE;
589# endif 589# endif
590# if defined(GL_NV_depth_clamp) || defined(GL_ARB_depth_clamp)
591 mHasDepthClamp = TRUE;
592#else
593 mHasDepthClamp = FALSE;
594#endif
590 mHasMipMapGeneration = FALSE; 595 mHasMipMapGeneration = FALSE;
591 mHasSeparateSpecularColor = FALSE; 596 mHasSeparateSpecularColor = FALSE;
592 mHasAnisotropic = FALSE; 597 mHasAnisotropic = FALSE;
@@ -612,6 +617,7 @@ void LLGLManager::initExtensions()
612 && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts); 617 && ExtensionExists("GL_EXT_packed_depth_stencil", gGLHExts.mSysExts);
613 mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts); 618 mHasFramebufferMultisample = mHasFramebufferObject && ExtensionExists("GL_EXT_framebuffer_multisample", gGLHExts.mSysExts);
614 mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts); 619 mHasDrawBuffers = ExtensionExists("GL_ARB_draw_buffers", gGLHExts.mSysExts);
620 mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts);
615#if !LL_DARWIN 621#if !LL_DARWIN
616 mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); 622 mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts);
617#endif 623#endif
@@ -634,6 +640,7 @@ void LLGLManager::initExtensions()
634 mHasFramebufferObject = FALSE; 640 mHasFramebufferObject = FALSE;
635 mHasFramebufferMultisample = FALSE; 641 mHasFramebufferMultisample = FALSE;
636 mHasDrawBuffers = FALSE; 642 mHasDrawBuffers = FALSE;
643 mHasDepthClamp = FALSE;
637 mHasMipMapGeneration = FALSE; 644 mHasMipMapGeneration = FALSE;
638 mHasSeparateSpecularColor = FALSE; 645 mHasSeparateSpecularColor = FALSE;
639 mHasAnisotropic = FALSE; 646 mHasAnisotropic = FALSE;
@@ -685,10 +692,11 @@ void LLGLManager::initExtensions()
685 if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S 692 if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S
686 if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S 693 if (strchr(blacklist,'r')) mHasDrawBuffers = FALSE;//S
687 if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE; 694 if (strchr(blacklist,'s')) mHasFramebufferMultisample = FALSE;
695 if (strchr(blacklist,'t')) mHasDepthClamp = FALSE;
688 696
689 } 697 }
690#endif // LL_LINUX || LL_SOLARIS 698#endif // LL_LINUX || LL_SOLARIS
691 699
692 if (!mHasMultitexture) 700 if (!mHasMultitexture)
693 { 701 {
694 LL_INFOS("RenderInit") << "Couldn't initialize multitexturing" << LL_ENDL; 702 LL_INFOS("RenderInit") << "Couldn't initialize multitexturing" << LL_ENDL;
@@ -1773,7 +1781,7 @@ LLGLDepthTest::~LLGLDepthTest()
1773 } 1781 }
1774} 1782}
1775 1783
1776LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P) 1784LLGLSquashToFarClip::LLGLSquashToFarClip(glh::matrix4f P)
1777{ 1785{
1778 for (U32 i = 0; i < 4; i++) 1786 for (U32 i = 0; i < 4; i++)
1779 { 1787 {
@@ -1786,7 +1794,7 @@ LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P)
1786 glMatrixMode(GL_MODELVIEW); 1794 glMatrixMode(GL_MODELVIEW);
1787} 1795}
1788 1796
1789LLGLClampToFarClip::~LLGLClampToFarClip() 1797LLGLSquashToFarClip::~LLGLSquashToFarClip()
1790{ 1798{
1791 glMatrixMode(GL_PROJECTION); 1799 glMatrixMode(GL_PROJECTION);
1792 glPopMatrix(); 1800 glPopMatrix();
diff --git a/linden/indra/llrender/llgl.h b/linden/indra/llrender/llgl.h
index 00ff1e2..cc7ebff 100644
--- a/linden/indra/llrender/llgl.h
+++ b/linden/indra/llrender/llgl.h
@@ -88,6 +88,7 @@ public:
88 BOOL mHasOcclusionQuery; 88 BOOL mHasOcclusionQuery;
89 BOOL mHasPointParameters; 89 BOOL mHasPointParameters;
90 BOOL mHasDrawBuffers; 90 BOOL mHasDrawBuffers;
91 BOOL mHasDepthClamp;
91 92
92 // Other extensions. 93 // Other extensions.
93 BOOL mHasAnisotropic; 94 BOOL mHasAnisotropic;
@@ -306,11 +307,11 @@ private:
306 leaves this class. 307 leaves this class.
307 Does not stack. 308 Does not stack.
308*/ 309*/
309class LLGLClampToFarClip 310class LLGLSquashToFarClip
310{ 311{
311public: 312public:
312 LLGLClampToFarClip(glh::matrix4f projection); 313 LLGLSquashToFarClip(glh::matrix4f projection);
313 ~LLGLClampToFarClip(); 314 ~LLGLSquashToFarClip();
314}; 315};
315 316
316/* 317/*
diff --git a/linden/indra/llrender/llglheaders.h b/linden/indra/llrender/llglheaders.h
index c7178a5..9e3ae9d 100644
--- a/linden/indra/llrender/llglheaders.h
+++ b/linden/indra/llrender/llglheaders.h
@@ -819,5 +819,15 @@ extern void glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
819 819
820#endif // LL_MESA / LL_WINDOWS / LL_DARWIN 820#endif // LL_MESA / LL_WINDOWS / LL_DARWIN
821 821
822// Even when GL_ARB_depth_clamp is available in the driver, the (correct)
823// headers, and therefore GL_DEPTH_CLAMP might not be defined.
824// In that case GL_DEPTH_CLAMP_NV should be defined, but why not just
825// use the known numeric.
826//
827// To avoid #ifdef's in the code. Just define this here.
828#ifndef GL_DEPTH_CLAMP
829// Probably (still) called GL_DEPTH_CLAMP_NV.
830#define GL_DEPTH_CLAMP 0x864F
831#endif
822 832
823#endif // LL_LLGLHEADERS_H 833#endif // LL_LLGLHEADERS_H
diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp
index 66ef4c6..b3da7fd 100644
--- a/linden/indra/llui/lllineeditor.cpp
+++ b/linden/indra/llui/lllineeditor.cpp
@@ -96,23 +96,23 @@ static LLRegisterWidget<LLLineEditor> r1("line_editor");
96class LineChatTranslationReceiver : public LLTranslate::TranslationReceiver 96class LineChatTranslationReceiver : public LLTranslate::TranslationReceiver
97{ 97{
98public : 98public :
99 LineChatTranslationReceiver(const std::string &toLang, LLLineEditor* line): LLTranslate::TranslationReceiver("", toLang), 99 LineChatTranslationReceiver(const std::string &toLang, LLLineEditor* line, const S32 start, const S32 len):
100 m_line(line) 100 LLTranslate::TranslationReceiver("", toLang),
101 m_line(line),
102 m_position(start),
103 m_origLength(len)
101 { 104 {
102 } 105 }
103 106
104 static boost::intrusive_ptr<LineChatTranslationReceiver> build(const std::string &toLang,LLLineEditor* line) 107 static boost::intrusive_ptr<LineChatTranslationReceiver> build(const std::string &toLang,LLLineEditor* line, const S32 start, const S32 len)
105 { 108 {
106 return boost::intrusive_ptr<LineChatTranslationReceiver>(new LineChatTranslationReceiver(toLang,line)); 109 return boost::intrusive_ptr<LineChatTranslationReceiver>(new LineChatTranslationReceiver(toLang, line, start, len));
107 } 110 }
108 111
109protected: 112protected:
110 void handleResponse(const std::string &translation, const std::string &detectedLanguage) 113 void handleResponse(const std::string &translation, const std::string &detectedLanguage)
111 { 114 {
112 static BOOL* rep = rebind_llcontrol<BOOL>("EmeraldTranslateReplace", &gSavedSettings, true); 115 m_line->translationReplace(translation, m_position, m_origLength);
113 if(*rep)
114 m_line->deleteSelection();
115 m_line->insert(((*rep)?"":" (") + translation + ((*rep)?"":")"),m_line->getCursor());
116 } 116 }
117 void handleFailure() 117 void handleFailure()
118 { 118 {
@@ -120,6 +120,8 @@ protected:
120 } 120 }
121private: 121private:
122 LLLineEditor* m_line; 122 LLLineEditor* m_line;
123 S32 m_position;
124 S32 m_origLength;
123}; 125};
124 126
125LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect, 127LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect,
@@ -151,6 +153,7 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect,
151 mLastSelectionY(-1), 153 mLastSelectionY(-1),
152 mLastSelectionStart(-1), 154 mLastSelectionStart(-1),
153 mLastSelectionEnd(-1), 155 mLastSelectionEnd(-1),
156 mLastContextMenuX(-1),
154 mPrevalidateFunc( prevalidate_func ), 157 mPrevalidateFunc( prevalidate_func ),
155 mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ), 158 mCursorColor( LLUI::sColorsGroup->getColor( "TextCursorColor" ) ),
156 mFgColor( LLUI::sColorsGroup->getColor( "TextFgColor" ) ), 159 mFgColor( LLUI::sColorsGroup->getColor( "TextFgColor" ) ),
@@ -172,7 +175,7 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect,
172 mImage( sImage ), 175 mImage( sImage ),
173 mReplaceNewlinesWithSpaces( TRUE ), 176 mReplaceNewlinesWithSpaces( TRUE ),
174 mSpellCheckable( FALSE ), 177 mSpellCheckable( FALSE ),
175 mShowMisspellings(FALSE) 178 mAllowTranslate(TRUE)
176{ 179{
177 llassert( max_length_bytes > 0 ); 180 llassert( max_length_bytes > 0 );
178 181
@@ -211,12 +214,6 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect,
211 } 214 }
212 mImage = sImage; 215 mImage = sImage;
213 216
214 // in other words, highlighting requires a restart
215 if (glggHunSpell->getSpellCheckHighlight())
216 {
217 mShowMisspellings = TRUE;
218 }
219
220 // make the popup menu available 217 // make the popup menu available
221 //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view); 218 //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view);
222 LLMenuGL* menu = new LLMenuGL("wot"); 219 LLMenuGL* menu = new LLMenuGL("wot");
@@ -224,46 +221,49 @@ LLLineEditor::LLLineEditor(const std::string& name, const LLRect& rect,
224 { 221 {
225 menu = new LLMenuGL(LLStringUtil::null); 222 menu = new LLMenuGL(LLStringUtil::null);
226 }*/ 223 }*/
227 menu->append(new LLMenuItemCallGL("Cut", context_cut, NULL, this)); 224
228 menu->append(new LLMenuItemCallGL("Copy", context_copy, NULL, this)); 225 menu->append(new LLMenuItemCallGL("Cut", context_cut, context_enable_cut, this));
229 menu->append(new LLMenuItemCallGL("Paste", context_paste, NULL, this)); 226 menu->append(new LLMenuItemCallGL("Copy", context_copy, context_enable_copy, this));
230 menu->append(new LLMenuItemCallGL("Delete", context_delete, NULL, this)); 227 menu->append(new LLMenuItemCallGL("Paste", context_paste, context_enable_paste, this));
231 menu->append(new LLMenuItemCallGL("Select All", context_selectall, NULL, this)); 228 menu->append(new LLMenuItemCallGL("Delete", context_delete, context_enable_delete, this));
229 menu->append(new LLMenuItemCallGL("Select All", context_selectall, context_enable_selectall, this));
230
232 menu->appendSeparator("Transep"); 231 menu->appendSeparator("Transep");
233 LLMenuGL* translatemenu = new LLMenuGL("Translate To"); 232 LLMenuGL* translatemenu = new LLMenuGL("Translate To");
234 translatemenu->setCanTearOff(FALSE); 233 translatemenu->setCanTearOff(FALSE);
235 SpellMenuBind* t=new SpellMenuBind;t->origin=this;t->word="en"; 234 SpellMenuBind* t=new SpellMenuBind;t->origin=this;t->word="en";
236 translatemenu->append(new LLMenuItemCallGL("English",translateText, NULL, t)); 235 translatemenu->append(new LLMenuItemCallGL("English", context_translate, context_enable_translate, t));
237 t=new SpellMenuBind;t->origin=this;t->word="da"; 236 t=new SpellMenuBind;t->origin=this;t->word="da";
238 translatemenu->append(new LLMenuItemCallGL("Danish",translateText, NULL, t)); 237 translatemenu->append(new LLMenuItemCallGL("Danish", context_translate, context_enable_translate, t));
239 t=new SpellMenuBind;t->origin=this;t->word="de"; 238 t=new SpellMenuBind;t->origin=this;t->word="de";
240 translatemenu->append(new LLMenuItemCallGL("Deutsch(German)",translateText, NULL, t)); 239 translatemenu->append(new LLMenuItemCallGL("Deutsch(German)", context_translate, context_enable_translate, t));
241 t=new SpellMenuBind;t->origin=this;t->word="es"; 240 t=new SpellMenuBind;t->origin=this;t->word="es";
242 translatemenu->append(new LLMenuItemCallGL("Spanish",translateText, NULL, t)); 241 translatemenu->append(new LLMenuItemCallGL("Spanish", context_translate, context_enable_translate, t));
243 t=new SpellMenuBind;t->origin=this;t->word="fr"; 242 t=new SpellMenuBind;t->origin=this;t->word="fr";
244 translatemenu->append(new LLMenuItemCallGL("French",translateText, NULL, t)); 243 translatemenu->append(new LLMenuItemCallGL("French", context_translate, context_enable_translate, t));
245 t=new SpellMenuBind;t->origin=this;t->word="it"; 244 t=new SpellMenuBind;t->origin=this;t->word="it";
246 translatemenu->append(new LLMenuItemCallGL("Italian",translateText, NULL, t)); 245 translatemenu->append(new LLMenuItemCallGL("Italian", context_translate, context_enable_translate, t));
247 t=new SpellMenuBind;t->origin=this;t->word="hu"; 246 t=new SpellMenuBind;t->origin=this;t->word="hu";
248 translatemenu->append(new LLMenuItemCallGL("Hungarian",translateText, NULL, t)); 247 translatemenu->append(new LLMenuItemCallGL("Hungarian", context_translate, context_enable_translate, t));
249 t=new SpellMenuBind;t->origin=this;t->word="nl"; 248 t=new SpellMenuBind;t->origin=this;t->word="nl";
250 translatemenu->append(new LLMenuItemCallGL("Dutch",translateText, NULL, t)); 249 translatemenu->append(new LLMenuItemCallGL("Dutch", context_translate, context_enable_translate, t));
251 t=new SpellMenuBind;t->origin=this;t->word="pl"; 250 t=new SpellMenuBind;t->origin=this;t->word="pl";
252 translatemenu->append(new LLMenuItemCallGL("Polish",translateText, NULL, t)); 251 translatemenu->append(new LLMenuItemCallGL("Polish", context_translate, context_enable_translate, t));
253 t=new SpellMenuBind;t->origin=this;t->word="pt"; 252 t=new SpellMenuBind;t->origin=this;t->word="pt";
254 translatemenu->append(new LLMenuItemCallGL("Portugese",translateText, NULL, t)); 253 translatemenu->append(new LLMenuItemCallGL("Portugese", context_translate, context_enable_translate, t));
255 t=new SpellMenuBind;t->origin=this;t->word="ru"; 254 t=new SpellMenuBind;t->origin=this;t->word="ru";
256 translatemenu->append(new LLMenuItemCallGL("Russian",translateText, NULL, t)); 255 translatemenu->append(new LLMenuItemCallGL("Russian", context_translate, context_enable_translate, t));
257 t=new SpellMenuBind;t->origin=this;t->word="tr"; 256 t=new SpellMenuBind;t->origin=this;t->word="tr";
258 translatemenu->append(new LLMenuItemCallGL("Turkish",translateText, NULL, t)); 257 translatemenu->append(new LLMenuItemCallGL("Turkish", context_translate, context_enable_translate, t));
259 t=new SpellMenuBind;t->origin=this;t->word="uk"; 258 t=new SpellMenuBind;t->origin=this;t->word="uk";
260 translatemenu->append(new LLMenuItemCallGL("Ukrainian",translateText, NULL, t)); 259 translatemenu->append(new LLMenuItemCallGL("Ukrainian", context_translate, context_enable_translate, t));
261 t=new SpellMenuBind;t->origin=this;t->word="zh"; 260 t=new SpellMenuBind;t->origin=this;t->word="zh";
262 translatemenu->append(new LLMenuItemCallGL("Chinese",translateText, NULL, t)); 261 translatemenu->append(new LLMenuItemCallGL("Chinese", context_translate, context_enable_translate, t));
263 t=new SpellMenuBind;t->origin=this;t->word="ja"; 262 t=new SpellMenuBind;t->origin=this;t->word="ja";
264 translatemenu->append(new LLMenuItemCallGL("Japanese",translateText, NULL, t)); 263 translatemenu->append(new LLMenuItemCallGL("Japanese", context_translate, context_enable_translate, t));
265 t=new SpellMenuBind;t->origin=this;t->word="ko"; 264 t=new SpellMenuBind;t->origin=this;t->word="ko";
266 translatemenu->append(new LLMenuItemCallGL("Korean",translateText, NULL, t)); 265 translatemenu->append(new LLMenuItemCallGL("Korean", context_translate, context_enable_translate, t));
266
267 menu->appendMenu(translatemenu); 267 menu->appendMenu(translatemenu);
268 menu->appendSeparator("Spelsep"); 268 menu->appendSeparator("Spelsep");
269 //menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); 269 //menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor"));
@@ -439,7 +439,7 @@ void LLLineEditor::setText(const LLStringExplicit &new_text)
439 439
440 440
441// Picks a new cursor position based on the actual screen size of text being drawn. 441// Picks a new cursor position based on the actual screen size of text being drawn.
442S32 LLLineEditor::calculateCursorFromMouse( S32 local_mouse_x ) 442S32 LLLineEditor::calculateCursorFromMouse( S32 local_mouse_x ) const
443{ 443{
444 const llwchar* wtext = mText.getWString().c_str(); 444 const llwchar* wtext = mText.getWString().c_str();
445 LLWString asterix_text; 445 LLWString asterix_text;
@@ -517,17 +517,30 @@ void LLLineEditor::deselect()
517 mIsSelecting = FALSE; 517 mIsSelecting = FALSE;
518} 518}
519 519
520BOOL LLLineEditor::context_enable_cut(void* data)
521{
522 LLLineEditor* line = (LLLineEditor*)data;
523 return (line && line->canCut());
524}
520 525
521void LLLineEditor::context_cut(void* data) 526void LLLineEditor::context_cut(void* data)
522{ 527{
523 LLLineEditor* line = (LLLineEditor*)data; 528 LLLineEditor* line = (LLLineEditor*)data;
524 if(line)line->cut(); 529 if(line)line->cut();
525} 530}
531
532BOOL LLLineEditor::context_enable_copy(void* data)
533{
534 LLLineEditor* line = (LLLineEditor*)data;
535 return (line &&line->canCopy());
536}
537
526void LLLineEditor::context_copy(void* data) 538void LLLineEditor::context_copy(void* data)
527{ 539{
528 LLLineEditor* line = (LLLineEditor*)data; 540 LLLineEditor* line = (LLLineEditor*)data;
529 if(line)line->copy(); 541 if(line)line->copy();
530} 542}
543
531void LLLineEditor::spell_correct(void* data) 544void LLLineEditor::spell_correct(void* data)
532{ 545{
533 SpellMenuBind* tempBind = (SpellMenuBind*)data; 546 SpellMenuBind* tempBind = (SpellMenuBind*)data;
@@ -539,31 +552,52 @@ void LLLineEditor::spell_correct(void* data)
539 552
540 } 553 }
541} 554}
542void LLLineEditor::translateText(void * data) 555
556BOOL LLLineEditor::context_enable_translate(void* data)
557{
558 SpellMenuBind* t = (SpellMenuBind*)data;
559 return (t && t->origin && t->origin->canTranslate());
560}
561
562void LLLineEditor::context_translate(void * data)
543{ 563{
544 SpellMenuBind* t = (SpellMenuBind*)data; 564 SpellMenuBind* t = (SpellMenuBind*)data;
545 LLLineEditor* line = t->origin; 565 LLLineEditor* line = t->origin;
546 const std::string &toLang = t->word;//LLTranslate::getTranslateLanguage(); 566 const std::string &toLang = t->word;//LLTranslate::getTranslateLanguage();
547 LLHTTPClient::ResponderPtr result = LineChatTranslationReceiver::build(toLang,line); 567
548 S32 left_pos = llmin( line->mSelectionStart, line->mSelectionEnd ); 568 bool has_text = false;
549 S32 length = abs( line->mSelectionStart - line->mSelectionEnd ); 569 S32 start, length;
550 LLTranslate::translateMessage(result,"", toLang, line->mText.getString().substr(left_pos, length)); 570 if (line->hasSelection())
571 {
572 // translate selection
573 start = llmin(line->mSelectionStart, line->mSelectionEnd);
574 length = abs(line->mSelectionEnd - line->mSelectionStart);
575 has_text = length > 0;
576 }
577 else
578 {
579 // translate one word at click position
580 S32 at = line->calculateCursorFromMouse(line->mLastContextMenuX);
581 has_text = line->getWordBoundriesAt(at, &start, &length);
582 }
583
584 if (has_text)
585 {
586 std::string to_translate = wstring_to_utf8str(line->getWText().substr(start, length));
587 LLHTTPClient::ResponderPtr result = LineChatTranslationReceiver::build(toLang, line, start, length);
588 LLTranslate::translateMessage(result,"", toLang, to_translate);
589 }
551} 590}
591
552void LLLineEditor::spell_show(void * data) 592void LLLineEditor::spell_show(void * data)
553{ 593{
554 SpellMenuBind* tempBind = (SpellMenuBind*)data; 594 SpellMenuBind* tempBind = (SpellMenuBind*)data;
555 LLLineEditor* line = tempBind->origin; 595 LLLineEditor* line = tempBind->origin;
556 596
557 if( tempBind && line) 597 if (tempBind && line)
558 { 598 {
559 if (tempBind->word == "Show Misspellings") 599 BOOL show = (tempBind->word == "Show Misspellings");
560 { 600 glggHunSpell->setSpellCheckHighlight(show);
561 line->mShowMisspellings = TRUE;
562 }
563 else
564 {
565 line->mShowMisspellings = FALSE;
566 }
567 } 601 }
568} 602}
569 603
@@ -623,18 +657,36 @@ void LLLineEditor::spell_add(void* data)
623 } 657 }
624} 658}
625 659
660BOOL LLLineEditor::context_enable_paste(void* data)
661{
662 LLLineEditor* line = (LLLineEditor*)data;
663 return (line && line->canPaste());
664}
665
626void LLLineEditor::context_paste(void* data) 666void LLLineEditor::context_paste(void* data)
627{ 667{
628 LLLineEditor* line = (LLLineEditor*)data; 668 LLLineEditor* line = (LLLineEditor*)data;
629 if(line)line->paste(); 669 if(line)line->paste();
630} 670}
631 671
672BOOL LLLineEditor::context_enable_delete(void* data)
673{
674 LLLineEditor* line = (LLLineEditor*)data;
675 return (line && line->canDoDelete());
676}
677
632void LLLineEditor::context_delete(void* data) 678void LLLineEditor::context_delete(void* data)
633{ 679{
634 LLLineEditor* line = (LLLineEditor*)data; 680 LLLineEditor* line = (LLLineEditor*)data;
635 if(line)line->doDelete(); 681 if(line)line->doDelete();
636} 682}
637 683
684BOOL LLLineEditor::context_enable_selectall(void* data)
685{
686 LLLineEditor* line = (LLLineEditor*)data;
687 return (line && line->canSelectAll());
688}
689
638void LLLineEditor::context_selectall(void* data) 690void LLLineEditor::context_selectall(void* data)
639{ 691{
640 LLLineEditor* line = (LLLineEditor*)data; 692 LLLineEditor* line = (LLLineEditor*)data;
@@ -738,7 +790,8 @@ BOOL LLLineEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
738 790
739 //setCursorAtLocalPos( x); 791 //setCursorAtLocalPos( x);
740 S32 wordStart = 0; 792 S32 wordStart = 0;
741 S32 wordEnd = calculateCursorFromMouse(x); 793 S32 wordEnd = 0;
794 S32 pos = calculateCursorFromMouse(x);
742 795
743 LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); 796 LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
744 if (menu) 797 if (menu)
@@ -761,36 +814,21 @@ BOOL LLLineEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
761 } 814 }
762 suggestionMenuItems.clear(); 815 suggestionMenuItems.clear();
763 816
764 menu->setItemVisible("Translate To", !mReadOnly);
765 menu->setItemVisible("Transep", !mReadOnly);
766
767 // spell_check="true" in xui 817 // spell_check="true" in xui
818 menu->setItemVisible("Spelsep", !mReadOnly && mSpellCheckable);
768 if (!mReadOnly && mSpellCheckable) 819 if (!mReadOnly && mSpellCheckable)
769 { 820 {
770 const LLWString& text = mText.getWString();
771
772 // search for word matches 821 // search for word matches
773 if (LLTextEditor::isPartOfWord(text[wordEnd])) 822 bool is_word_part = getWordBoundriesAt(pos, &wordStart, &wordEnd);
823 if (is_word_part)
774 { 824 {
775 // Select word the cursor is over 825 const LLWString& text = mText.getWString();
776 while ((wordEnd > 0) && LLTextEditor::isPartOfWord(text[wordEnd-1]))
777 {
778 wordEnd--;
779 }
780 wordStart = wordEnd;
781 //startSelection();
782
783 while ((wordEnd < (S32)text.length()) && LLTextEditor::isPartOfWord( text[wordEnd] ) )
784 {
785 wordEnd++;
786 }
787 std::string selectedWord(std::string(text.begin(), text.end()).substr(wordStart,wordEnd-wordStart)); 826 std::string selectedWord(std::string(text.begin(), text.end()).substr(wordStart,wordEnd-wordStart));
788 827
789 if (!glggHunSpell->isSpelledRight(selectedWord)) 828 if (!glggHunSpell->isSpelledRight(selectedWord))
790 { 829 {
791 //misspelled word here, and you have just right clicked on it! 830 //misspelled word here, and you have just right clicked on it!
792 std::vector<std::string> suggs = glggHunSpell->getSuggestionList(selectedWord); 831 std::vector<std::string> suggs = glggHunSpell->getSuggestionList(selectedWord);
793 //menu->setItemVisible("Transep",(suggs.size()>0));
794 832
795 for (int i = 0; i<(int)suggs.size() ;i++) 833 for (int i = 0; i<(int)suggs.size() ;i++)
796 { 834 {
@@ -821,7 +859,7 @@ BOOL LLLineEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
821 859
822 SpellMenuBind * tempStruct = new SpellMenuBind; 860 SpellMenuBind * tempStruct = new SpellMenuBind;
823 tempStruct->origin = this; 861 tempStruct->origin = this;
824 if (mShowMisspellings) 862 if (glggHunSpell->getSpellCheckHighlight())
825 { 863 {
826 tempStruct->word = "Hide Misspellings"; 864 tempStruct->word = "Hide Misspellings";
827 } 865 }
@@ -836,6 +874,7 @@ BOOL LLLineEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
836 menu->append(suggMenuItem); 874 menu->append(suggMenuItem);
837 } 875 }
838 876
877 mLastContextMenuX = x;
839 menu->buildDrawLabels(); 878 menu->buildDrawLabels();
840 menu->updateParent(LLMenuGL::sMenuContainer); 879 menu->updateParent(LLMenuGL::sMenuContainer);
841 LLMenuGL::showPopup(this, menu, x, y); 880 LLMenuGL::showPopup(this, menu, x, y);
@@ -1109,13 +1148,9 @@ void LLLineEditor::setSelection(S32 start, S32 end)
1109{ 1148{
1110 S32 len = mText.length(); 1149 S32 len = mText.length();
1111 1150
1112 mIsSelecting = TRUE; 1151 mSelectionStart = llclamp(start, 0, len);
1113 1152 mSelectionEnd = llclamp(end, 0, len);
1114 // JC, yes, this seems odd, but I think you have to presume a 1153 setCursor(end);
1115 // selection dragged from the end towards the start.
1116 mSelectionStart = llclamp(end, 0, len);
1117 mSelectionEnd = llclamp(start, 0, len);
1118 setCursor(start);
1119} 1154}
1120 1155
1121void LLLineEditor::setDrawAsterixes(BOOL b) 1156void LLLineEditor::setDrawAsterixes(BOOL b)
@@ -1152,6 +1187,26 @@ S32 LLLineEditor::nextWordPos(S32 cursorPos) const
1152 return cursorPos; 1187 return cursorPos;
1153} 1188}
1154 1189
1190BOOL LLLineEditor::getWordBoundriesAt(const S32 at, S32* word_begin, S32* word_length) const
1191{
1192 const LLWString& wtext = mText.getWString();
1193 S32 pos = at;
1194 if (LLTextEditor::isPartOfWord(wtext[pos]))
1195 {
1196 while ( (pos > 0) && LLTextEditor::isPartOfWord(wtext[pos - 1]) )
1197 {
1198 pos--;
1199 }
1200 *word_begin = pos;
1201 while ( (pos < (S32)wtext.length()) && LLTextEditor::isPartOfWord(wtext[pos]) )
1202 {
1203 pos++;
1204 }
1205 *word_length = pos - *word_begin;
1206 return TRUE;
1207 }
1208 return FALSE;
1209}
1155 1210
1156BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask) 1211BOOL LLLineEditor::handleSelectionKey(KEY key, MASK mask)
1157{ 1212{
@@ -1315,6 +1370,37 @@ void LLLineEditor::spellReplace(SpellMenuBind* spellData)
1315 1370
1316 1371
1317} 1372}
1373
1374void LLLineEditor::translationReplace(const std::string &translation, const S32 orig_start, const S32 orig_length)
1375{
1376 //*TODO: should probably check if the content was modified since the http query
1377 // was made, so we don't insert text in the wrong place.
1378 BOOL replace = gSavedSettings.getBOOL("EmeraldTranslateReplace");
1379 std::string text = replace ? translation : " (" + translation + ")";
1380 S32 pos = replace ? orig_start : orig_start + orig_length;
1381 if (replace)
1382 {
1383 mText.erase(orig_start, orig_length);
1384 }
1385 insert(text, pos);
1386
1387 S32 text_wlen = utf8str_to_wstring(text).length();
1388 if (hasSelection())
1389 {
1390 setSelection(pos, pos + text_wlen);
1391 }
1392 setCursor(pos + text_wlen);
1393}
1394
1395BOOL LLLineEditor::canTranslate() const
1396{
1397 // if allow_translate="true" in xui, and if other factors permit, we allow it
1398 S32 pos = calculateCursorFromMouse(mLastContextMenuX);
1399 const LLWString& wtext = getWText();
1400 bool is_word_part = (pos > -1) && LLTextEditor::isPartOfWord(wtext[pos]);
1401 return (mAllowTranslate && !mReadOnly && (is_word_part || hasSelection()));
1402}
1403
1318void LLLineEditor::insert(std::string what, S32 wher) 1404void LLLineEditor::insert(std::string what, S32 wher)
1319{ 1405{
1320 LLLineEditorRollback rollback(this); 1406 LLLineEditorRollback rollback(this);
@@ -1925,7 +2011,7 @@ void LLLineEditor::drawMisspelled(LLRect background)
1925 } 2011 }
1926 } 2012 }
1927 2013
1928 if (mShowMisspellings) 2014 if (glggHunSpell->getSpellCheckHighlight())
1929 { 2015 {
1930 for (int i =0; i<(int)misspellLocations.size(); i++) 2016 for (int i =0; i<(int)misspellLocations.size(); i++)
1931 { 2017 {
@@ -2830,6 +2916,11 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
2830 { 2916 {
2831 line_editor->setSpellCheckable(spell_checking); 2917 line_editor->setSpellCheckable(spell_checking);
2832 } 2918 }
2919 BOOL allow_translate = TRUE;
2920 if (node->getAttributeBOOL("allow_translate", allow_translate))
2921 {
2922 line_editor->setAllowTranslate(allow_translate);
2923 }
2833 2924
2834 line_editor->setColorParameters(node); 2925 line_editor->setColorParameters(node);
2835 2926
diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h
index 147b232..f9e0621 100644
--- a/linden/indra/llui/lllineeditor.h
+++ b/linden/indra/llui/lllineeditor.h
@@ -107,6 +107,8 @@ public:
107 }; 107 };
108 108
109 virtual void spellReplace(SpellMenuBind* spellData); 109 virtual void spellReplace(SpellMenuBind* spellData);
110 virtual void translationReplace(const std::string &translation, const S32 orig_start, const S32 orig_length);
111 virtual BOOL canTranslate() const;
110 virtual void insert(std::string what,S32 wher); 112 virtual void insert(std::string what,S32 wher);
111 113
112 // LLEditMenuHandler overrides 114 // LLEditMenuHandler overrides
@@ -133,15 +135,22 @@ public:
133 virtual void deselect(); 135 virtual void deselect();
134 virtual BOOL canDeselect() const; 136 virtual BOOL canDeselect() const;
135 137
138 static BOOL context_enable_cut(void* data);
136 static void context_cut(void* data); 139 static void context_cut(void* data);
140 static BOOL context_enable_copy(void* data);
137 static void context_copy(void* data); 141 static void context_copy(void* data);
138 static void spell_correct(void* data); 142 static BOOL context_enable_paste(void* data);
139 static void spell_show(void* data);
140 static void translateText(void * data);
141 static void spell_add(void* data);
142 static void context_paste(void* data); 143 static void context_paste(void* data);
144 static BOOL context_enable_delete(void* data);
143 static void context_delete(void* data); 145 static void context_delete(void* data);
146 static BOOL context_enable_selectall(void* data);
144 static void context_selectall(void* data); 147 static void context_selectall(void* data);
148 static BOOL context_enable_translate(void * data);
149 static void context_translate(void * data);
150 static void spell_correct(void* data);
151 static void spell_show(void* data);
152 static void spell_add(void* data);
153
145 std::vector<S32> getMisspelledWordsPositions(); 154 std::vector<S32> getMisspelledWordsPositions();
146 // view overrides 155 // view overrides
147 virtual void draw(); 156 virtual void draw();
@@ -199,6 +208,7 @@ public:
199 void setReadOnlyBgColor( const LLColor4& c ) { mReadOnlyBgColor = c; } 208 void setReadOnlyBgColor( const LLColor4& c ) { mReadOnlyBgColor = c; }
200 void setFocusBgColor(const LLColor4& c) { mFocusBgColor = c; } 209 void setFocusBgColor(const LLColor4& c) { mFocusBgColor = c; }
201 void setSpellCheckable(BOOL b) { mSpellCheckable = b; } 210 void setSpellCheckable(BOOL b) { mSpellCheckable = b; }
211 void setAllowTranslate(BOOL b) { mAllowTranslate = b; }
202 212
203 const LLColor4& getFgColor() const { return mFgColor; } 213 const LLColor4& getFgColor() const { return mFgColor; }
204 const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor; } 214 const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor; }
@@ -215,6 +225,7 @@ public:
215 // get the cursor position of the beginning/end of the prev/next word in the text 225 // get the cursor position of the beginning/end of the prev/next word in the text
216 S32 prevWordPos(S32 cursorPos) const; 226 S32 prevWordPos(S32 cursorPos) const;
217 S32 nextWordPos(S32 cursorPos) const; 227 S32 nextWordPos(S32 cursorPos) const;
228 BOOL getWordBoundriesAt(const S32 at, S32* word_begin, S32* word_length) const;
218 229
219 BOOL hasSelection() const { return (mSelectionStart != mSelectionEnd); } 230 BOOL hasSelection() const { return (mSelectionStart != mSelectionEnd); }
220 void startSelection(); 231 void startSelection();
@@ -261,7 +272,7 @@ private:
261 void removeChar(); 272 void removeChar();
262 void addChar(const llwchar c); 273 void addChar(const llwchar c);
263 void setCursorAtLocalPos(S32 local_mouse_x); 274 void setCursorAtLocalPos(S32 local_mouse_x);
264 S32 calculateCursorFromMouse(S32 local_mouse_x); 275 S32 calculateCursorFromMouse(S32 local_mouse_x) const;
265 S32 findPixelNearestPos(S32 cursor_offset = 0) const; 276 S32 findPixelNearestPos(S32 cursor_offset = 0) const;
266 void reportBadKeystroke(); 277 void reportBadKeystroke();
267 BOOL handleSpecialKey(KEY key, MASK mask); 278 BOOL handleSpecialKey(KEY key, MASK mask);
@@ -294,10 +305,11 @@ protected:
294 S32 mStartSpellHere; // the position of the first char on the screen, stored so we know when to update 305 S32 mStartSpellHere; // the position of the first char on the screen, stored so we know when to update
295 S32 mEndSpellHere; // the location of the last char on the screen 306 S32 mEndSpellHere; // the location of the last char on the screen
296 BOOL mSpellCheckable; // set in xui as "spell_check". Default value for a field 307 BOOL mSpellCheckable; // set in xui as "spell_check". Default value for a field
297 BOOL mShowMisspellings; // show misspellings as highlighted (initialized in the ctor)
298 LLFrameTimer mSpellTimer; 308 LLFrameTimer mSpellTimer;
299 //to keep track of what we have to remove before showing menu 309 //to keep track of what we have to remove before showing menu
300 std::vector<SpellMenuBind* > suggestionMenuItems; 310 std::vector<SpellMenuBind* > suggestionMenuItems;
311 S32 mLastContextMenuX;
312 BOOL mAllowTranslate; // set in xui as "allow_translate".
301 313
302 // line history support: 314 // line history support:
303 BOOL mHaveHistory; // flag for enabled line history 315 BOOL mHaveHistory; // flag for enabled line history
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp
index b101588..8dcb014 100644
--- a/linden/indra/llui/lltexteditor.cpp
+++ b/linden/indra/llui/lltexteditor.cpp
@@ -105,21 +105,23 @@ bool (* LLTextEditor::mSecondlifeURLcallbackRightClick)(const std::string&) =
105class TextChatTranslationReceiver : public LLTranslate::TranslationReceiver 105class TextChatTranslationReceiver : public LLTranslate::TranslationReceiver
106{ 106{
107public : 107public :
108 TextChatTranslationReceiver(const std::string &toLang, LLTextEditor* line): LLTranslate::TranslationReceiver("", toLang), 108 TextChatTranslationReceiver(const std::string &toLang, LLTextEditor* line, const S32 start, const S32 len):
109 m_line(line) 109 LLTranslate::TranslationReceiver("", toLang),
110 m_line(line),
111 m_position(start),
112 m_origLength(len)
110 { 113 {
111 } 114 }
112 115
113 static boost::intrusive_ptr<TextChatTranslationReceiver> build(const std::string &toLang,LLTextEditor* line) 116 static boost::intrusive_ptr<TextChatTranslationReceiver> build(const std::string &toLang,LLTextEditor* line, const S32 start, const S32 len)
114 { 117 {
115 return boost::intrusive_ptr<TextChatTranslationReceiver>(new TextChatTranslationReceiver(toLang,line)); 118 return boost::intrusive_ptr<TextChatTranslationReceiver>(new TextChatTranslationReceiver(toLang, line, start, len));
116 } 119 }
117 120
118protected: 121protected:
119 void handleResponse(const std::string &translation, const std::string &detectedLanguage) 122 void handleResponse(const std::string &translation, const std::string &detectedLanguage)
120 { 123 {
121 BOOL rep = gSavedSettings.getBOOL("EmeraldTranslateReplace"); 124 m_line->translationReplace(translation, m_position, m_origLength);
122 m_line->insertText((rep?"":" (") + translation +(rep?"":")"),rep);
123 } 125 }
124 void handleFailure() 126 void handleFailure()
125 { 127 {
@@ -127,6 +129,8 @@ protected:
127 } 129 }
128private: 130private:
129 LLTextEditor* m_line; 131 LLTextEditor* m_line;
132 S32 m_position;
133 S32 m_origLength;
130}; 134};
131 135
132/////////////////////////////////////////////////////////////////// 136///////////////////////////////////////////////////////////////////
@@ -321,10 +325,12 @@ LLTextEditor::LLTextEditor(
321 mMouseDownY(0), 325 mMouseDownY(0),
322 mLastSelectionX(-1), 326 mLastSelectionX(-1),
323 mLastSelectionY(-1), 327 mLastSelectionY(-1),
328 mLastContextMenuX(-1),
329 mLastContextMenuY(-1),
324 mReflowNeeded(FALSE), 330 mReflowNeeded(FALSE),
325 mScrollNeeded(FALSE), 331 mScrollNeeded(FALSE),
326 mSpellCheckable(FALSE), 332 mSpellCheckable(FALSE),
327 mShowMisspellings(FALSE) 333 mAllowTranslate(TRUE)
328{ 334{
329 mSourceID.generate(); 335 mSourceID.generate();
330 336
@@ -377,12 +383,6 @@ LLTextEditor::LLTextEditor(
377 mParseHTML=FALSE; 383 mParseHTML=FALSE;
378 mHTML.clear(); 384 mHTML.clear();
379 385
380 // in other words, highlighting requires a restart
381 if (glggHunSpell->getSpellCheckHighlight())
382 {
383 mShowMisspellings = TRUE;
384 }
385
386 // make the popup menu available 386 // make the popup menu available
387 //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view); 387 //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_texteditor.xml", parent_view);
388 LLMenuGL* menu = new LLMenuGL("wot"); 388 LLMenuGL* menu = new LLMenuGL("wot");
@@ -390,46 +390,46 @@ LLTextEditor::LLTextEditor(
390 { 390 {
391 menu = new LLMenuGL(LLStringUtil::null); 391 menu = new LLMenuGL(LLStringUtil::null);
392 }*/ 392 }*/
393 menu->append(new LLMenuItemCallGL("Cut", context_cut, NULL, this)); 393 menu->append(new LLMenuItemCallGL("Cut", context_cut, context_enable_cut, this));
394 menu->append(new LLMenuItemCallGL("Copy", context_copy, NULL, this)); 394 menu->append(new LLMenuItemCallGL("Copy", context_copy, context_enable_copy, this));
395 menu->append(new LLMenuItemCallGL("Paste", context_paste, NULL, this)); 395 menu->append(new LLMenuItemCallGL("Paste", context_paste, context_enable_paste, this));
396 menu->append(new LLMenuItemCallGL("Delete", context_delete, NULL, this)); 396 menu->append(new LLMenuItemCallGL("Delete", context_delete, context_enable_delete, this));
397 menu->append(new LLMenuItemCallGL("Select All", context_selectall, NULL, this)); 397 menu->append(new LLMenuItemCallGL("Select All", context_selectall, context_enable_selectall, this));
398 menu->appendSeparator("transep"); 398 menu->appendSeparator("Transep");
399 LLMenuGL* translatemenu = new LLMenuGL("Translate To"); 399 LLMenuGL* translatemenu = new LLMenuGL("Translate To");
400 translatemenu->setCanTearOff(FALSE); 400 translatemenu->setCanTearOff(FALSE);
401 SpellMenuBind* t=new SpellMenuBind;t->origin=this;t->word="en"; 401 SpellMenuBind* t=new SpellMenuBind;t->origin=this;t->word="en";
402 translatemenu->append(new LLMenuItemCallGL("English",translateText, NULL, t)); 402 translatemenu->append(new LLMenuItemCallGL("English", context_translate, context_enable_translate, t));
403 t=new SpellMenuBind;t->origin=this;t->word="da"; 403 t=new SpellMenuBind;t->origin=this;t->word="da";
404 translatemenu->append(new LLMenuItemCallGL("Danish",translateText, NULL, t)); 404 translatemenu->append(new LLMenuItemCallGL("Danish", context_translate, context_enable_translate, t));
405 t=new SpellMenuBind;t->origin=this;t->word="de"; 405 t=new SpellMenuBind;t->origin=this;t->word="de";
406 translatemenu->append(new LLMenuItemCallGL("Deutsch(German)",translateText, NULL, t)); 406 translatemenu->append(new LLMenuItemCallGL("Deutsch(German)", context_translate, context_enable_translate, t));
407 t=new SpellMenuBind;t->origin=this;t->word="es"; 407 t=new SpellMenuBind;t->origin=this;t->word="es";
408 translatemenu->append(new LLMenuItemCallGL("Spanish",translateText, NULL, t)); 408 translatemenu->append(new LLMenuItemCallGL("Spanish", context_translate, context_enable_translate, t));
409 t=new SpellMenuBind;t->origin=this;t->word="fr"; 409 t=new SpellMenuBind;t->origin=this;t->word="fr";
410 translatemenu->append(new LLMenuItemCallGL("French",translateText, NULL, t)); 410 translatemenu->append(new LLMenuItemCallGL("French", context_translate, context_enable_translate, t));
411 t=new SpellMenuBind;t->origin=this;t->word="it"; 411 t=new SpellMenuBind;t->origin=this;t->word="it";
412 translatemenu->append(new LLMenuItemCallGL("Italian",translateText, NULL, t)); 412 translatemenu->append(new LLMenuItemCallGL("Italian", context_translate, context_enable_translate, t));
413 t=new SpellMenuBind;t->origin=this;t->word="hu"; 413 t=new SpellMenuBind;t->origin=this;t->word="hu";
414 translatemenu->append(new LLMenuItemCallGL("Hungarian",translateText, NULL, t)); 414 translatemenu->append(new LLMenuItemCallGL("Hungarian", context_translate, context_enable_translate, t));
415 t=new SpellMenuBind;t->origin=this;t->word="nl"; 415 t=new SpellMenuBind;t->origin=this;t->word="nl";
416 translatemenu->append(new LLMenuItemCallGL("Dutch",translateText, NULL, t)); 416 translatemenu->append(new LLMenuItemCallGL("Dutch", context_translate, context_enable_translate, t));
417 t=new SpellMenuBind;t->origin=this;t->word="pl"; 417 t=new SpellMenuBind;t->origin=this;t->word="pl";
418 translatemenu->append(new LLMenuItemCallGL("Polish",translateText, NULL, t)); 418 translatemenu->append(new LLMenuItemCallGL("Polish", context_translate, context_enable_translate, t));
419 t=new SpellMenuBind;t->origin=this;t->word="pt"; 419 t=new SpellMenuBind;t->origin=this;t->word="pt";
420 translatemenu->append(new LLMenuItemCallGL("Portugese",translateText, NULL, t)); 420 translatemenu->append(new LLMenuItemCallGL("Portugese", context_translate, context_enable_translate, t));
421 t=new SpellMenuBind;t->origin=this;t->word="ru"; 421 t=new SpellMenuBind;t->origin=this;t->word="ru";
422 translatemenu->append(new LLMenuItemCallGL("Russian",translateText, NULL, t)); 422 translatemenu->append(new LLMenuItemCallGL("Russian", context_translate, context_enable_translate, t));
423 t=new SpellMenuBind;t->origin=this;t->word="tr"; 423 t=new SpellMenuBind;t->origin=this;t->word="tr";
424 translatemenu->append(new LLMenuItemCallGL("Turkish",translateText, NULL, t)); 424 translatemenu->append(new LLMenuItemCallGL("Turkish", context_translate, context_enable_translate, t));
425 t=new SpellMenuBind;t->origin=this;t->word="uk"; 425 t=new SpellMenuBind;t->origin=this;t->word="uk";
426 translatemenu->append(new LLMenuItemCallGL("Ukrainian",translateText, NULL, t)); 426 translatemenu->append(new LLMenuItemCallGL("Ukrainian", context_translate, context_enable_translate, t));
427 t=new SpellMenuBind;t->origin=this;t->word="zh"; 427 t=new SpellMenuBind;t->origin=this;t->word="zh";
428 translatemenu->append(new LLMenuItemCallGL("Chinese",translateText, NULL, t)); 428 translatemenu->append(new LLMenuItemCallGL("Chinese", context_translate, context_enable_translate, t));
429 t=new SpellMenuBind;t->origin=this;t->word="ja"; 429 t=new SpellMenuBind;t->origin=this;t->word="ja";
430 translatemenu->append(new LLMenuItemCallGL("Japanese",translateText, NULL, t)); 430 translatemenu->append(new LLMenuItemCallGL("Japanese", context_translate, context_enable_translate, t));
431 t=new SpellMenuBind;t->origin=this;t->word="ko"; 431 t=new SpellMenuBind;t->origin=this;t->word="ko";
432 translatemenu->append(new LLMenuItemCallGL("Korean",translateText, NULL, t)); 432 translatemenu->append(new LLMenuItemCallGL("Korean", context_translate, context_enable_translate, t));
433 433
434 menu->appendMenu(translatemenu); 434 menu->appendMenu(translatemenu);
435 menu->appendSeparator("Spelsep"); 435 menu->appendSeparator("Spelsep");
@@ -439,7 +439,6 @@ LLTextEditor::LLTextEditor(
439 mPopupMenuHandle = menu->getHandle(); 439 mPopupMenuHandle = menu->getHandle();
440} 440}
441 441
442
443LLTextEditor::~LLTextEditor() 442LLTextEditor::~LLTextEditor()
444{ 443{
445 gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() 444 gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit()
@@ -457,27 +456,67 @@ LLTextEditor::~LLTextEditor()
457 std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); 456 std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer());
458 LLView::deleteViewByHandle(mPopupMenuHandle); 457 LLView::deleteViewByHandle(mPopupMenuHandle);
459} 458}
459
460BOOL LLTextEditor::context_enable_cut(void* data)
461{
462 LLTextEditor* line = (LLTextEditor*)data;
463 return (line && line->canCut());
464}
465
460void LLTextEditor::context_cut(void* data) 466void LLTextEditor::context_cut(void* data)
461{ 467{
462 LLTextEditor* line = (LLTextEditor*)data; 468 LLTextEditor* line = (LLTextEditor*)data;
463 if(line)line->cut(); 469 if(line)line->cut();
464} 470}
471
472BOOL LLTextEditor::context_enable_copy(void* data)
473{
474 LLTextEditor* line = (LLTextEditor*)data;
475 return (line && line->canCopy());
476}
477
465void LLTextEditor::context_copy(void* data) 478void LLTextEditor::context_copy(void* data)
466{ 479{
467 LLTextEditor* line = (LLTextEditor*)data; 480 LLTextEditor* line = (LLTextEditor*)data;
468 if(line)line->copy(); 481 if(line)line->copy();
469} 482}
470void LLTextEditor::translateText(void * data) 483
484BOOL LLTextEditor::context_enable_translate(void * data)
485{
486 SpellMenuBind* t = (SpellMenuBind*)data;
487 return (t && t->origin && t->origin->canTranslate());
488}
489
490void LLTextEditor::context_translate(void * data)
471{ 491{
472 SpellMenuBind* t = (SpellMenuBind*)data; 492 SpellMenuBind* t = (SpellMenuBind*)data;
473 LLTextEditor* line = t->origin; 493 LLTextEditor* line = t->origin;
474 const std::string &toLang = t->word;//LLTranslate::getTranslateLanguage(); 494 const std::string &toLang = t->word;//LLTranslate::getTranslateLanguage();
475 LLHTTPClient::ResponderPtr result = TextChatTranslationReceiver::build(toLang,line);
476 495
477 S32 left_pos = llmin( line->mSelectionStart, line->mSelectionEnd ); 496 bool has_text = false;
478 S32 length = abs( line->mSelectionStart - line->mSelectionEnd ); 497 S32 start, length;
479 LLTranslate::translateMessage(result,"", toLang, line->getText().substr(left_pos, length)); 498 if (line->hasSelection())
499 {
500 // translate selection
501 start = llmin(line->mSelectionStart, line->mSelectionEnd);
502 length = abs(line->mSelectionEnd - line->mSelectionStart);
503 has_text = length > 0;
504 }
505 else
506 {
507 // translate one word as click position
508 S32 at = line->getCursorPosFromLocalCoord(line->mLastContextMenuX, line->mLastContextMenuY, TRUE);
509 has_text = line->getWordBoundriesAt(at, &start, &length);
510 }
511
512 if (has_text)
513 {
514 const std::string to_translate = wstring_to_utf8str(line->getWText().substr(start, length));
515 LLHTTPClient::ResponderPtr result = TextChatTranslationReceiver::build(toLang, line, start, length);
516 LLTranslate::translateMessage(result,"", toLang, to_translate);
517 }
480} 518}
519
481void LLTextEditor::spell_correct(void* data) 520void LLTextEditor::spell_correct(void* data)
482{ 521{
483 SpellMenuBind* tempBind = (SpellMenuBind*)data; 522 SpellMenuBind* tempBind = (SpellMenuBind*)data;
@@ -496,14 +535,8 @@ void LLTextEditor::spell_show(void * data)
496 535
497 if (tempBind && line) 536 if (tempBind && line)
498 { 537 {
499 if (tempBind->word == "Show Misspellings") 538 BOOL show = (tempBind->word == "Show Misspellings");
500 { 539 glggHunSpell->setSpellCheckHighlight(show);
501 glggHunSpell->setSpellCheckHighlight(TRUE);
502 }
503 else
504 {
505 glggHunSpell->setSpellCheckHighlight(FALSE);
506 }
507 } 540 }
508} 541}
509 542
@@ -555,16 +588,37 @@ void LLTextEditor::spell_add(void* data)
555 tempBind->origin->mPrevSpelledText.erase();//make it update 588 tempBind->origin->mPrevSpelledText.erase();//make it update
556 } 589 }
557} 590}
591
592BOOL LLTextEditor::context_enable_paste(void* data)
593{
594 LLTextEditor* line = (LLTextEditor*)data;
595 return(line && line->canPaste());
596}
597
558void LLTextEditor::context_paste(void* data) 598void LLTextEditor::context_paste(void* data)
559{ 599{
560 LLTextEditor* line = (LLTextEditor*)data; 600 LLTextEditor* line = (LLTextEditor*)data;
561 if(line)line->paste(); 601 if(line)line->paste();
562} 602}
603
604BOOL LLTextEditor::context_enable_delete(void* data)
605{
606 LLTextEditor* line = (LLTextEditor*)data;
607 return (line && line->canDoDelete());
608}
609
563void LLTextEditor::context_delete(void* data) 610void LLTextEditor::context_delete(void* data)
564{ 611{
565 LLTextEditor* line = (LLTextEditor*)data; 612 LLTextEditor* line = (LLTextEditor*)data;
566 if(line)line->doDelete(); 613 if(line)line->doDelete();
567} 614}
615
616BOOL LLTextEditor::context_enable_selectall(void* data)
617{
618 LLTextEditor* line = (LLTextEditor*)data;
619 return (line && line->canSelectAll());
620}
621
568void LLTextEditor::context_selectall(void* data) 622void LLTextEditor::context_selectall(void* data)
569{ 623{
570 LLTextEditor* line = (LLTextEditor*)data; 624 LLTextEditor* line = (LLTextEditor*)data;
@@ -947,6 +1001,26 @@ S32 LLTextEditor::nextWordPos(S32 cursorPos) const
947 return cursorPos; 1001 return cursorPos;
948} 1002}
949 1003
1004BOOL LLTextEditor::getWordBoundriesAt(const S32 at, S32* word_begin, S32* word_length) const
1005{
1006 S32 pos = at;
1007 if (isPartOfWord(mWText[pos]))
1008 {
1009 while ( (pos > 0) && isPartOfWord(mWText[pos - 1]) )
1010 {
1011 pos--;
1012 }
1013 *word_begin = pos;
1014 while ( (pos < getLength()) && isPartOfWord(mWText[pos]) )
1015 {
1016 pos++;
1017 }
1018 *word_length = pos - *word_begin;
1019 return TRUE;
1020 }
1021 return FALSE;
1022}
1023
950S32 LLTextEditor::getLineStart( S32 line ) const 1024S32 LLTextEditor::getLineStart( S32 line ) const
951{ 1025{
952 S32 num_lines = getLineCount(); 1026 S32 num_lines = getLineCount();
@@ -1439,7 +1513,8 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1439 1513
1440 //setCursorAtLocalPos( x, y, TRUE ); 1514 //setCursorAtLocalPos( x, y, TRUE );
1441 S32 wordStart = 0; 1515 S32 wordStart = 0;
1442 S32 wordEnd = getCursorPosFromLocalCoord(x,y,TRUE); 1516 S32 wordEnd = 0;
1517 S32 pos = getCursorPosFromLocalCoord(x,y,TRUE);
1443 1518
1444 LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); 1519 LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
1445 if (menu) 1520 if (menu)
@@ -1458,35 +1533,21 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1458 } 1533 }
1459 suggestionMenuItems.clear(); 1534 suggestionMenuItems.clear();
1460 1535
1461 menu->setItemVisible("Translate To", !mReadOnly);
1462 menu->setItemVisible("Transep", !mReadOnly);
1463
1464 // spell_check="true" in xui 1536 // spell_check="true" in xui
1537 menu->setItemVisible("Spelsep", !mReadOnly && mSpellCheckable);
1465 if (!mReadOnly && mSpellCheckable) 1538 if (!mReadOnly && mSpellCheckable)
1466 { 1539 {
1467 const LLWString &text = mWText; 1540 bool is_word_part = getWordBoundriesAt(pos, &wordStart, &wordEnd);
1468 1541 if (is_word_part)
1469 if (isPartOfWord(text[wordEnd]) && !mReadOnly)
1470 { 1542 {
1471 // Select word the cursor is over 1543 const LLWString &text = mWText;
1472 while ((wordEnd > 0) && isPartOfWord(text[wordEnd-1]))
1473 {
1474 wordEnd--;
1475 }
1476 wordStart = wordEnd;
1477 //startSelection();
1478
1479 while ((wordEnd < (S32)text.length()) && isPartOfWord( text[wordEnd] ) )
1480 {
1481 wordEnd++;
1482 }
1483 std::string selectedWord(std::string(text.begin(), text.end()).substr(wordStart,wordEnd-wordStart)); 1544 std::string selectedWord(std::string(text.begin(), text.end()).substr(wordStart,wordEnd-wordStart));
1545
1484 if (!glggHunSpell->isSpelledRight(selectedWord)) 1546 if (!glggHunSpell->isSpelledRight(selectedWord))
1485 { 1547 {
1486 //misspelled word here, and you have just right clicked on it! 1548 //misspelled word here, and you have just right clicked on it!
1487 std::vector<std::string> suggs = glggHunSpell->getSuggestionList(selectedWord); 1549 std::vector<std::string> suggs = glggHunSpell->getSuggestionList(selectedWord);
1488 1550
1489 //menu->setItemVisible("Transep",(suggs.size()>0));
1490 for (int i = 0; i<(int)suggs.size(); i++) 1551 for (int i = 0; i<(int)suggs.size(); i++)
1491 { 1552 {
1492 SpellMenuBind * tempStruct = new SpellMenuBind; 1553 SpellMenuBind * tempStruct = new SpellMenuBind;
@@ -1517,7 +1578,7 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1517 1578
1518 SpellMenuBind * tempStruct = new SpellMenuBind; 1579 SpellMenuBind * tempStruct = new SpellMenuBind;
1519 tempStruct->origin = this; 1580 tempStruct->origin = this;
1520 if (mShowMisspellings) 1581 if (glggHunSpell->getSpellCheckHighlight())
1521 { 1582 {
1522 tempStruct->word = "Hide Misspellings"; 1583 tempStruct->word = "Hide Misspellings";
1523 } 1584 }
@@ -1531,6 +1592,8 @@ BOOL LLTextEditor::handleRightMouseDown( S32 x, S32 y, MASK mask )
1531 suggestionMenuItems.push_back(tempStruct); 1592 suggestionMenuItems.push_back(tempStruct);
1532 menu->append(suggMenuItem); 1593 menu->append(suggMenuItem);
1533 } 1594 }
1595 mLastContextMenuX = x;
1596 mLastContextMenuY = y;
1534 menu->buildDrawLabels(); 1597 menu->buildDrawLabels();
1535 menu->updateParent(LLMenuGL::sMenuContainer); 1598 menu->updateParent(LLMenuGL::sMenuContainer);
1536 LLMenuGL::showPopup(this, menu, x, y); 1599 LLMenuGL::showPopup(this, menu, x, y);
@@ -2238,6 +2301,35 @@ void LLTextEditor::spellReplace(SpellMenuBind* spellData)
2238 needsReflow(); 2301 needsReflow();
2239} 2302}
2240 2303
2304void LLTextEditor::translationReplace(const std::string &translation, const S32 orig_start, const S32 orig_length)
2305{
2306 //*TODO: should probably check if the content was modified since the http query
2307 // was made, so we don't insert text in the wrong place.
2308 BOOL replace = gSavedSettings.getBOOL("EmeraldTranslateReplace");
2309 LLWString wtext = utf8str_to_wstring(replace ? translation : " (" + translation + ")");
2310 S32 pos = replace ? orig_start : orig_start + orig_length;
2311 if (replace)
2312 {
2313 remove(orig_start, orig_length, FALSE);
2314 }
2315 S32 inserted = insert(pos, wtext, FALSE);
2316 if (hasSelection())
2317 {
2318 mSelectionStart = llclamp(pos, 0, getLength());
2319 mSelectionEnd = llclamp(pos + inserted, mSelectionStart, getLength());
2320 }
2321 setCursorPos(pos + inserted);
2322 needsReflow();
2323}
2324
2325BOOL LLTextEditor::canTranslate() const
2326{
2327 // if allow_translate="true" in xui, and if other factors permit, we allow it
2328 S32 pos = getCursorPosFromLocalCoord(mLastContextMenuX, mLastContextMenuY, TRUE);
2329 bool is_word_part = (pos > -1) && isPartOfWord(mWText[pos]);
2330 return (mAllowTranslate && !mReadOnly && (is_word_part || hasSelection()));
2331}
2332
2241// paste from clipboard 2333// paste from clipboard
2242void LLTextEditor::paste() 2334void LLTextEditor::paste()
2243{ 2335{
@@ -3162,7 +3254,7 @@ void LLTextEditor::drawMisspelled()
3162 } 3254 }
3163 } 3255 }
3164 //draw 3256 //draw
3165 if (mShowMisspellings) 3257 if (glggHunSpell->getSpellCheckHighlight())
3166 { 3258 {
3167 for (int i = 0; i<(int)misspellLocations.size() ;i++) 3259 for (int i = 0; i<(int)misspellLocations.size() ;i++)
3168 { 3260 {
@@ -4901,6 +4993,8 @@ void LLTextEditor::setTextEditorParameters(LLXMLNodePtr node)
4901 4993
4902 node->getAttributeBOOL("spell_check", mSpellCheckable); 4994 node->getAttributeBOOL("spell_check", mSpellCheckable);
4903 4995
4996 node->getAttributeBOOL("allow_translate", mAllowTranslate);
4997
4904 LLColor4 color; 4998 LLColor4 color;
4905 if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) 4999 if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color))
4906 { 5000 {
diff --git a/linden/indra/llui/lltexteditor.h b/linden/indra/llui/lltexteditor.h
index 57a6bbd..f2a831b 100644
--- a/linden/indra/llui/lltexteditor.h
+++ b/linden/indra/llui/lltexteditor.h
@@ -136,6 +136,8 @@ public:
136 virtual BOOL canPaste() const; 136 virtual BOOL canPaste() const;
137 137
138 virtual void spellReplace(SpellMenuBind* spellData); 138 virtual void spellReplace(SpellMenuBind* spellData);
139 virtual void translationReplace(const std::string &translation, const S32 orig_start, const S32 orig_length);
140 virtual BOOL canTranslate() const;
139 141
140 virtual void updatePrimary(); 142 virtual void updatePrimary();
141 virtual void copyPrimary(); 143 virtual void copyPrimary();
@@ -148,13 +150,19 @@ public:
148 virtual BOOL canSelectAll() const; 150 virtual BOOL canSelectAll() const;
149 virtual void deselect(); 151 virtual void deselect();
150 virtual BOOL canDeselect() const; 152 virtual BOOL canDeselect() const;
151 static void context_cut(void* data);
152 153
154 static BOOL context_enable_cut(void* data);
155 static void context_cut(void* data);
156 static BOOL context_enable_copy(void* data);
153 static void context_copy(void* data); 157 static void context_copy(void* data);
158 static BOOL context_enable_paste(void* data);
154 static void context_paste(void* data); 159 static void context_paste(void* data);
160 static BOOL context_enable_delete(void* data);
155 static void context_delete(void* data); 161 static void context_delete(void* data);
162 static BOOL context_enable_selectall(void* data);
156 static void context_selectall(void* data); 163 static void context_selectall(void* data);
157 static void translateText(void * data); 164 static BOOL context_enable_translate(void * data);
165 static void context_translate(void * data);
158 static void spell_correct(void* data); 166 static void spell_correct(void* data);
159 static void spell_add(void* data); 167 static void spell_add(void* data);
160 static void spell_show(void* data); 168 static void spell_show(void* data);
@@ -352,6 +360,7 @@ public:
352 360
353 S32 prevWordPos(S32 cursorPos) const; 361 S32 prevWordPos(S32 cursorPos) const;
354 S32 nextWordPos(S32 cursorPos) const; 362 S32 nextWordPos(S32 cursorPos) const;
363 BOOL getWordBoundriesAt(const S32 at, S32* word_begin, S32* word_length) const;
355 364
356 S32 getLineCount() const { return mLineStartList.size(); } 365 S32 getLineCount() const { return mLineStartList.size(); }
357 S32 getLineStart( S32 line ) const; 366 S32 getLineStart( S32 line ) const;
@@ -527,7 +536,7 @@ private:
527 S32 spellEnd; 536 S32 spellEnd;
528 std::vector<S32> misspellLocations; // where all the mispelled words are 537 std::vector<S32> misspellLocations; // where all the mispelled words are
529 BOOL mSpellCheckable; // set in xui as "spell_check". Default value for a field 538 BOOL mSpellCheckable; // set in xui as "spell_check". Default value for a field
530 BOOL mShowMisspellings; // show misspellings as highlighted (initialized in the ctor) 539 BOOL mAllowTranslate; // set in xui as "allow_translate".
531 540
532 S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes 541 S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes
533 542
@@ -568,6 +577,8 @@ private:
568 577
569 //to keep track of what we have to remove before showing menu 578 //to keep track of what we have to remove before showing menu
570 std::vector<SpellMenuBind* > suggestionMenuItems; 579 std::vector<SpellMenuBind* > suggestionMenuItems;
580 S32 mLastContextMenuX;
581 S32 mLastContextMenuY;
571 582
572 line_list_t mLineStartList; 583 line_list_t mLineStartList;
573 BOOL mReflowNeeded; 584 BOOL mReflowNeeded;
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index dc0cf69..9260b75 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -90,6 +90,7 @@ set(viewer_SOURCE_FILES
90 impprefsfonts.cpp 90 impprefsfonts.cpp
91 jcfloater_animation_list.cpp 91 jcfloater_animation_list.cpp
92 jcfloaterareasearch.cpp 92 jcfloaterareasearch.cpp
93 kowopenregionsettings.cpp
93 lightshare.cpp 94 lightshare.cpp
94 llagent.cpp 95 llagent.cpp
95 llagentaccess.cpp 96 llagentaccess.cpp
@@ -1255,9 +1256,9 @@ add_custom_target(
1255 1256
1256if (WINDOWS) 1257if (WINDOWS)
1257 if(MSVC71) 1258 if(MSVC71)
1258 set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map /MAPINFO:LINES") 1259 set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map /MAPINFO:LINES /LARGEADDRESSAWARE")
1259 else(MSVC71) 1260 else(MSVC71)
1260 set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map") 1261 set(release_flags "/MAP:Release/${VIEWER_BINARY_NAME}.map /LARGEADDRESSAWARE")
1261 endif(MSVC71) 1262 endif(MSVC71)
1262 1263
1263 set_target_properties(${VIEWER_BINARY_NAME} 1264 set_target_properties(${VIEWER_BINARY_NAME}
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 0a27aa2..aeb5c0b 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -422,7 +422,7 @@
422 <key>Type</key> 422 <key>Type</key>
423 <string>String</string> 423 <string>String</string>
424 <key>Value</key> 424 <key>Value</key>
425 <integer>Random</integer> 425 <string>Random</string>
426 </map> 426 </map>
427 <key>LastTree</key> 427 <key>LastTree</key>
428 <map> 428 <map>
@@ -433,7 +433,7 @@
433 <key>Type</key> 433 <key>Type</key>
434 <string>String</string> 434 <string>String</string>
435 <key>Value</key> 435 <key>Value</key>
436 <integer>Random</integer> 436 <string>Random</string>
437 </map> 437 </map>
438 <key>LastSelectedGrid</key> 438 <key>LastSelectedGrid</key>
439 <map> 439 <map>
@@ -726,6 +726,17 @@
726 <key>Value</key> 726 <key>Value</key>
727 <integer>1</integer> 727 <integer>1</integer>
728 </map> 728 </map>
729 <key>RenderWaterVoidCulling</key>
730 <map>
731 <key>Comment</key>
732 <string>Cull void water objects when off-screen.</string>
733 <key>Persist</key>
734 <integer>1</integer>
735 <key>Type</key>
736 <string>Boolean</string>
737 <key>Value</key>
738 <integer>1</integer>
739 </map>
729 <key>ResetAllPreferences</key> 740 <key>ResetAllPreferences</key>
730 <map> 741 <map>
731 <key>Comment</key> 742 <key>Comment</key>
@@ -746,7 +757,7 @@
746 <key>Type</key> 757 <key>Type</key>
747 <string>Boolean</string> 758 <string>Boolean</string>
748 <key>Value</key> 759 <key>Value</key>
749 <integer>0</integer> 760 <integer>1</integer>
750 </map> 761 </map>
751 <key>RezWithLandGroup</key> 762 <key>RezWithLandGroup</key>
752 <map> 763 <map>
@@ -1168,6 +1179,20 @@
1168 <integer>1</integer> 1179 <integer>1</integer>
1169 </map> 1180 </map>
1170 1181
1182 <!-- Begin: OpenRegionInfo -->
1183
1184 <key>ToggleTeenMode</key>
1185 <map>
1186 <key>Comment</key>
1187 <string>Allow the toggle of Teen Mode via debug options</string>
1188 <key>Persist</key>
1189 <integer>0</integer>
1190 <key>Type</key>
1191 <string>Boolean</string>
1192 <key>Value</key>
1193 <integer>1</integer>
1194 </map>
1195
1171 <!-- Begin: AO--> 1196 <!-- Begin: AO-->
1172 1197
1173 <key>AOEnabled</key> 1198 <key>AOEnabled</key>
@@ -10672,7 +10697,7 @@
10672 <key>Type</key> 10697 <key>Type</key>
10673 <string>Boolean</string> 10698 <string>Boolean</string>
10674 <key>Value</key> 10699 <key>Value</key>
10675 <integer>0</integer> 10700 <integer>1</integer>
10676 </map> 10701 </map>
10677 <key>ShowTangentBasis</key> 10702 <key>ShowTangentBasis</key>
10678 <map> 10703 <map>
diff --git a/linden/indra/newview/app_settings/viewerversion.xml b/linden/indra/newview/app_settings/viewerversion.xml
index 351f86b..e482bf7 100644
--- a/linden/indra/newview/app_settings/viewerversion.xml
+++ b/linden/indra/newview/app_settings/viewerversion.xml
@@ -20,6 +20,6 @@ need to be changed manually - MC
20 <viewer version_patch="0" /> 20 <viewer version_patch="0" />
21 21
22 <!--string--> 22 <!--string-->
23 <viewer version_test="Experimental 2010.09.18" /> 23 <viewer version_test="Experimental 2010.10.02" />
24 24
25</viewer_version> 25</viewer_version>
diff --git a/linden/indra/newview/chatbar_as_cmdline.cpp b/linden/indra/newview/chatbar_as_cmdline.cpp
index 59804c0..9359444 100644
--- a/linden/indra/newview/chatbar_as_cmdline.cpp
+++ b/linden/indra/newview/chatbar_as_cmdline.cpp
@@ -16,7 +16,7 @@
16 * may be used to endorse or promote products derived from this 16 * may be used to endorse or promote products derived from this
17 * software without specific prior written permission. 17 * software without specific prior written permission.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS AS IS 19 * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS
@@ -331,7 +331,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type)
331 } 331 }
332 else if(command == *sCmdLineChatbarTeleportToCam) 332 else if(command == *sCmdLineChatbarTeleportToCam)
333 { 333 {
334 gAgent.teleportViaLocation(gAgent.getCameraPositionGlobal()); 334 gAgent.teleportViaLocationLookAt(gAgent.getCameraPositionGlobal());
335 return false; 335 return false;
336 } 336 }
337 /*else if(command == *sCmdLineChatbarUndeform) 337 /*else if(command == *sCmdLineChatbarUndeform)
diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h
index f76e7e9..a5fe351 100644
--- a/linden/indra/newview/hippoLimits.h
+++ b/linden/indra/newview/hippoLimits.h
@@ -19,7 +19,6 @@ public:
19 19
20 void setLimits(); 20 void setLimits();
21 21
22private:
23 S32 mMaxAgentGroups; 22 S32 mMaxAgentGroups;
24 23
25 F32 mMaxHeight; 24 F32 mMaxHeight;
@@ -29,6 +28,7 @@ private:
29 F32 mMinPrimScale; 28 F32 mMinPrimScale;
30 S32 mMaxLinkedPrims; 29 S32 mMaxLinkedPrims;
31 30
31private:
32 void setOpenSimLimits(); 32 void setOpenSimLimits();
33 void setSecondLifeLimits(); 33 void setSecondLifeLimits();
34}; 34};
diff --git a/linden/indra/newview/kowopenregionsettings.cpp b/linden/indra/newview/kowopenregionsettings.cpp
new file mode 100644
index 0000000..f568473
--- /dev/null
+++ b/linden/indra/newview/kowopenregionsettings.cpp
@@ -0,0 +1,162 @@
1/*
2 * @file kowopenregionsettings.cpp
3 * @brief Handler for OpenRegionInfo event queue message.
4 *
5 * Copyright (c) 2010, Patrick Sapinski
6 *
7 * The source code in this file ("Source Code") is provided to you
8 * under the terms of the GNU General Public License, version 2.0
9 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
10 * this distribution, or online at
11 * http://secondlifegrid.net/programs/open_source/licensing/gplv2
12 *
13 * There are special exceptions to the terms and conditions of the GPL as
14 * it is applied to this Source Code. View the full text of the exception
15 * in the file doc/FLOSS-exception.txt in this software distribution, or
16 * online at
17 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29#include "llhttpnode.h"
30#include "hippoLimits.h"
31#include "llfloatertools.h"
32#include "llviewercontrol.h"
33
34//DEBUG includes
35//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string
36
37class OpenRegionInfoUpdate : public LLHTTPNode
38{
39 /*virtual*/ void post(
40 LLHTTPNode::ResponsePtr response,
41 const LLSD& context,
42 const LLSD& input) const
43 {
44 if (!input.isMap() || !input.has("body"))
45 {
46 llinfos << "malformed OpenRegionInfo update!" << llendl;
47 return;
48 }
49
50 LLSD body = input["body"];
51 //llinfos << "data: " << LLSDNotationStreamer(body) << llendl;
52 //llinfos << "data: " << LLSDXMLStreamer(body) << llendl;
53
54 //set the default limits/settings for this simulator type, as limits from our
55 //previous region may not exist in this one
56 gHippoLimits->setLimits();
57
58 //limits are also reset in llviewermessage.cpp when we detect a new server
59 //version, in case the destination simulator does not support OpenRegionInfo.
60
61 BOOL limitschanged = FALSE;
62
63 if ( body.has("AllowMinimap") )
64 {
65 //IMPLEMENT ME
66 }
67 if ( body.has("AllowPhysicalPrims") )
68 {
69 //IMPLEMENT ME
70 }
71 if ( body.has("DrawDistance") )
72 {
73 //IMPLEMENT ME
74 }
75 if ( body.has("ForceDrawDistance") )
76 {
77 //IMPLEMENT ME
78 }
79 if ( body.has("LSLFunctions") )
80 {
81 //IMPLEMENT ME
82 }
83 if ( body.has("MaxDragDistance") )
84 {
85 //IMPLEMENT ME
86 }
87 if ( body.has("MinHoleSize") )
88 {
89 gHippoLimits->mMinHoleSize = body["MinHoleSize"].asReal();
90 }
91 if ( body.has("MaxHollowSize") )
92 {
93 gHippoLimits->mMaxHollow = body["MaxHollowSize"].asReal();
94 }
95 if ( body.has("MaxInventoryItemsTransfer") )
96 {
97 //IMPLEMENT ME
98 }
99 if ( body.has("MaxLinkCount") )
100 {
101 gHippoLimits->mMaxLinkedPrims = body["MaxLinkCount"].asInteger();
102 }
103 if ( body.has("MaxLinkCountPhys") )
104 {
105 //IMPLEMENT ME
106 }
107 if ( body.has("MaxPhysPrimScale") )
108 {
109 //IMPLEMENT ME
110 }
111 if ( body.has("MaxPos") )
112 {
113 //IMPLEMENT ME
114 }
115 if ( body.has("MaxPrimScale") )
116 {
117 gHippoLimits->mMaxPrimScale = body["MaxPrimScale"].asReal();
118 limitschanged = TRUE;
119 }
120 if ( body.has("MinPos") )
121 {
122 //IMPLEMENT ME
123 }
124 if ( body.has("MinPrimScale") )
125 {
126 gHippoLimits->mMinPrimScale = body["MinPrimScale"].asReal();
127 limitschanged = TRUE;
128 }
129 if ( body.has("OffsetOfUTC") )
130 {
131 //IMPLEMENT ME
132 }
133 if ( body.has("RenderWater") )
134 {
135 gSavedSettings.setBOOL("RenderWater", body["RenderWater"].asBoolean());
136 }
137 if ( body.has("SayDistance") )
138 {
139 //IMPLEMENT ME
140 }
141 if ( body.has("ShoutDistance") )
142 {
143 //IMPLEMENT ME
144 }
145 if ( body.has("ToggleTeenMode") )
146 {
147 gSavedSettings.setBOOL("ToggleTeenMode", body["ToggleTeenMode"].asBoolean());
148
149 }
150 if ( body.has("WhisperDistance") )
151 {
152 //IMPLEMENT ME
153 }
154
155 if (limitschanged)
156 gFloaterTools->updateToolsSizeLimits();
157 }
158};
159
160LLHTTPRegistration<OpenRegionInfoUpdate>
161gHTTPRegistrationOpenRegionInfoUpdate(
162 "/message/OpenRegionInfo"); \ No newline at end of file
diff --git a/linden/indra/newview/lgghunspell_wrapper.cpp b/linden/indra/newview/lgghunspell_wrapper.cpp
index f800043..aa4507c 100644
--- a/linden/indra/newview/lgghunspell_wrapper.cpp
+++ b/linden/indra/newview/lgghunspell_wrapper.cpp
@@ -72,7 +72,7 @@ static char * countryCodesraw[] = {
72 (char*)"CF",(char*)"Central African Republic", 72 (char*)"CF",(char*)"Central African Republic",
73 (char*)"CG",(char*)"Congo", 73 (char*)"CG",(char*)"Congo",
74 (char*)"CH",(char*)"Switzerland", 74 (char*)"CH",(char*)"Switzerland",
75 (char*)"CI",(char*)"Côte D'ivoire (Ivory Coast)", 75 (char*)"CI",(char*)"Côte D'ivoire (Ivory Coast)",
76 (char*)"CK",(char*)"Cook Iislands", 76 (char*)"CK",(char*)"Cook Iislands",
77 (char*)"CL",(char*)"Chile", 77 (char*)"CL",(char*)"Chile",
78 (char*)"CM",(char*)"Cameroon", 78 (char*)"CM",(char*)"Cameroon",
@@ -212,7 +212,7 @@ static char * countryCodesraw[] = {
212 (char*)"PW",(char*)"Palau", 212 (char*)"PW",(char*)"Palau",
213 (char*)"PY",(char*)"Paraguay", 213 (char*)"PY",(char*)"Paraguay",
214 (char*)"QA",(char*)"Qatar", 214 (char*)"QA",(char*)"Qatar",
215 (char*)"RE",(char*)"Réunion", 215 (char*)"RE",(char*)"Réunion",
216 (char*)"RO",(char*)"Romania", 216 (char*)"RO",(char*)"Romania",
217 (char*)"RU",(char*)"Russian Federation", 217 (char*)"RU",(char*)"Russian Federation",
218 (char*)"RW",(char*)"Rwanda", 218 (char*)"RW",(char*)"Rwanda",
@@ -333,7 +333,7 @@ static char * languageCodesraw[]={
333 (char*)"ga",(char*)"Irish", 333 (char*)"ga",(char*)"Irish",
334 (char*)"gd",(char*)"Gaelic", 334 (char*)"gd",(char*)"Gaelic",
335 (char*)"gl",(char*)"Galician", 335 (char*)"gl",(char*)"Galician",
336 (char*)"gn",(char*)"Guaraní", 336 (char*)"gn",(char*)"Guaraní",
337 (char*)"gu",(char*)"Gujarati", 337 (char*)"gu",(char*)"Gujarati",
338 (char*)"gv",(char*)"Manx", 338 (char*)"gv",(char*)"Manx",
339 (char*)"ha",(char*)"Hausa", 339 (char*)"ha",(char*)"Hausa",
@@ -456,7 +456,7 @@ static char * languageCodesraw[]={
456 (char*)"uz",(char*)"Uzbek", 456 (char*)"uz",(char*)"Uzbek",
457 (char*)"ve",(char*)"Venda", 457 (char*)"ve",(char*)"Venda",
458 (char*)"vi",(char*)"Vietnamese", 458 (char*)"vi",(char*)"Vietnamese",
459 (char*)"vo",(char*)"Volapük", 459 (char*)"vo",(char*)"Volapük",
460 (char*)"wa",(char*)"Walloon", 460 (char*)"wa",(char*)"Walloon",
461 (char*)"wo",(char*)"Wolof", 461 (char*)"wo",(char*)"Wolof",
462 (char*)"xh",(char*)"Xhosa", 462 (char*)"xh",(char*)"Xhosa",
@@ -470,10 +470,9 @@ static char * languageCodesraw[]={
470#define LANGUAGE_CODES_RAW_SIZE 368 470#define LANGUAGE_CODES_RAW_SIZE 368
471 471
472lggHunSpell_Wrapper::lggHunSpell_Wrapper() 472lggHunSpell_Wrapper::lggHunSpell_Wrapper()
473 :
474 mSpellCheckHighlight(false)
475{ 473{
476 //languageCodes(begin(languageCodesraw), end(languageCodesraw)); 474 //languageCodes(begin(languageCodesraw), end(languageCodesraw));
475 mSpellCheckHighlight = rebind_llcontrol<BOOL>("EmeraldSpellDisplay", &gSavedSettings, false);
477} 476}
478 477
479lggHunSpell_Wrapper::~lggHunSpell_Wrapper() 478lggHunSpell_Wrapper::~lggHunSpell_Wrapper()
@@ -638,8 +637,6 @@ void lggHunSpell_Wrapper::processSettings()
638 //expects everything to already be in saved settings 637 //expects everything to already be in saved settings
639 //this will also reload and read the installed dicts 638 //this will also reload and read the installed dicts
640 setNewDictionary(gSavedSettings.getString("EmeraldSpellBase")); 639 setNewDictionary(gSavedSettings.getString("EmeraldSpellBase"));
641 mSpellCheckHighlight = gSavedSettings.getBOOL("EmeraldSpellDisplay");
642
643} 640}
644 641
645void lggHunSpell_Wrapper::addDictionary(std::string additionalDictionary) 642void lggHunSpell_Wrapper::addDictionary(std::string additionalDictionary)
@@ -966,5 +963,8 @@ void lggHunSpell_Wrapper::editCustomButton()
966 963
967void lggHunSpell_Wrapper::setSpellCheckHighlight(BOOL highlight) 964void lggHunSpell_Wrapper::setSpellCheckHighlight(BOOL highlight)
968{ 965{
969 mSpellCheckHighlight = highlight; 966 if (mSpellCheckHighlight)
967 {
968 *mSpellCheckHighlight = highlight;
969 }
970} 970}
diff --git a/linden/indra/newview/lgghunspell_wrapper.h b/linden/indra/newview/lgghunspell_wrapper.h
index b5f3ddb..71b2f14 100644
--- a/linden/indra/newview/lgghunspell_wrapper.h
+++ b/linden/indra/newview/lgghunspell_wrapper.h
@@ -55,7 +55,7 @@ public:
55 std::string VEC2CSV(std::vector<std::string> vec); 55 std::string VEC2CSV(std::vector<std::string> vec);
56 56
57 void setSpellCheckHighlight(BOOL highlight); 57 void setSpellCheckHighlight(BOOL highlight);
58 BOOL getSpellCheckHighlight() { return mSpellCheckHighlight; } 58 BOOL getSpellCheckHighlight() { return mSpellCheckHighlight && *mSpellCheckHighlight; }
59 59
60private: 60private:
61 void createCustomDic(); 61 void createCustomDic();
@@ -67,7 +67,7 @@ private:
67 std::string currentBaseDic; 67 std::string currentBaseDic;
68 //std::vector<std::string> languageCodes; 68 //std::vector<std::string> languageCodes;
69 //std::vector<std::string> countryCodes; 69 //std::vector<std::string> countryCodes;
70 BOOL mSpellCheckHighlight; 70 BOOL* mSpellCheckHighlight;
71}; 71};
72 72
73extern lggHunSpell_Wrapper* glggHunSpell; // the singleton hunspell wrapper 73extern lggHunSpell_Wrapper* glggHunSpell; // the singleton hunspell wrapper
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 51b6c53..fc12f33 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -400,7 +400,8 @@ LLAgent::LLAgent() :
400 mAgentWearablesUpdateSerialNum(0), 400 mAgentWearablesUpdateSerialNum(0),
401 mWearablesLoaded(FALSE), 401 mWearablesLoaded(FALSE),
402 mTextureCacheQueryID(0), 402 mTextureCacheQueryID(0),
403 mAppearanceSerialNum(0) 403 mAppearanceSerialNum(0),
404 mbTeleportKeepsLookAt(false)
404{ 405{
405 U32 i; 406 U32 i;
406 for (i = 0; i < TOTAL_CONTROLS; i++) 407 for (i = 0; i < TOTAL_CONTROLS; i++)
@@ -536,7 +537,9 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera)
536 gMenuHolder->hideMenus(); 537 gMenuHolder->hideMenus();
537 } 538 }
538 539
539 if (change_camera && !gSavedSettings.getBOOL("FreezeTime")) 540 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
541
542 if (change_camera && !(*sFreezeTime))
540 { 543 {
541 changeCameraToDefault(); 544 changeCameraToDefault();
542 545
@@ -560,7 +563,7 @@ void LLAgent::resetView(BOOL reset_camera, BOOL change_camera)
560 } 563 }
561 564
562 565
563 if (reset_camera && !gSavedSettings.getBOOL("FreezeTime")) 566 if (reset_camera && !(*sFreezeTime))
564 { 567 {
565 if (!gViewerWindow->getLeftMouseDown() && cameraThirdPerson()) 568 if (!gViewerWindow->getLeftMouseDown() && cameraThirdPerson())
566 { 569 {
@@ -1975,7 +1978,9 @@ void LLAgent::cameraOrbitIn(const F32 meters)
1975 1978
1976 mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist; 1979 mCameraZoomFraction = (mTargetCameraDistance - meters) / camera_offset_dist;
1977 1980
1978 if (!gSavedSettings.getBOOL("FreezeTime") && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f) 1981 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
1982
1983 if (!(*sFreezeTime) && mCameraZoomFraction < MIN_ZOOM_FRACTION && meters > 0.f)
1979 { 1984 {
1980 // No need to animate, camera is already there. 1985 // No need to animate, camera is already there.
1981 changeCameraToMouselook(FALSE); 1986 changeCameraToMouselook(FALSE);
@@ -2900,7 +2905,8 @@ static const LLFloaterView::skip_list_t& get_skip_list()
2900{ 2905{
2901 static LLFloaterView::skip_list_t skip_list; 2906 static LLFloaterView::skip_list_t skip_list;
2902 skip_list.insert(LLFloaterMap::getInstance()); 2907 skip_list.insert(LLFloaterMap::getInstance());
2903 if(gSavedSettings.getBOOL("ShowStatusBarInMouselook")) 2908 static BOOL *sShowStatusBarInMouselook = rebind_llcontrol<BOOL>("ShowStatusBarInMouselook", &gSavedSettings, true);
2909 if(*sShowStatusBarInMouselook)
2904 { 2910 {
2905 skip_list.insert(LLFloaterStats::getInstance()); 2911 skip_list.insert(LLFloaterStats::getInstance());
2906 } 2912 }
@@ -6099,16 +6105,21 @@ bool LLAgent::teleportCore(bool is_local)
6099 6105
6100void LLAgent::teleportRequest( 6106void LLAgent::teleportRequest(
6101 const U64& region_handle, 6107 const U64& region_handle,
6102 const LLVector3& pos_local) 6108 const LLVector3& pos_local,
6109 bool keep_look_at)
6103{ 6110{
6104 LLViewerRegion* regionp = getRegion(); 6111 LLViewerRegion* regionp = getRegion();
6105 6112 if (!regionp)
6113 {
6114 return;
6115 }
6106 // Set last region data for teleport history 6116 // Set last region data for teleport history
6107 gAgent.setLastRegionData(regionp->getName(),gAgent.getPositionAgent()); 6117 gAgent.setLastRegionData(regionp->getName(),gAgent.getPositionAgent());
6108 6118
6109 if(regionp && teleportCore()) 6119 bool is_local = (region_handle == to_region_handle(getPositionGlobal()));
6120 if(teleportCore(is_local))
6110 { 6121 {
6111 llinfos << "TeleportRequest: '" << region_handle << "':" << pos_local 6122 llinfos << "TeleportLocationRequest: '" << region_handle << "':" << pos_local
6112 << llendl; 6123 << llendl;
6113 LLMessageSystem* msg = gMessageSystem; 6124 LLMessageSystem* msg = gMessageSystem;
6114 msg->newMessage("TeleportLocationRequest"); 6125 msg->newMessage("TeleportLocationRequest");
@@ -6119,6 +6130,10 @@ void LLAgent::teleportRequest(
6119 msg->addU64("RegionHandle", region_handle); 6130 msg->addU64("RegionHandle", region_handle);
6120 msg->addVector3("Position", pos_local); 6131 msg->addVector3("Position", pos_local);
6121 LLVector3 look_at(0,1,0); 6132 LLVector3 look_at(0,1,0);
6133 if (keep_look_at)
6134 {
6135 look_at = LLViewerCamera::getInstance()->getAtAxis();
6136 }
6122 msg->addVector3("LookAt", look_at); 6137 msg->addVector3("LookAt", look_at);
6123 sendReliableMessage(); 6138 sendReliableMessage();
6124 } 6139 }
@@ -6219,46 +6234,29 @@ void LLAgent::teleportViaLocation(const LLVector3d& pos_global)
6219 } 6234 }
6220// [/RLVa:KB] 6235// [/RLVa:KB]
6221 6236
6222 LLViewerRegion* regionp = getRegion(); 6237 U64 region_handle = to_region_handle(pos_global);
6223 LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); 6238 LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
6224 if(regionp && info) 6239 teleportRequest(region_handle, pos_local, false);
6225 { 6240}
6226 U32 x_pos;
6227 U32 y_pos;
6228 from_region_handle(info->mHandle, &x_pos, &y_pos);
6229 LLVector3 pos_local(
6230 (F32)(pos_global.mdV[VX] - x_pos),
6231 (F32)(pos_global.mdV[VY] - y_pos),
6232 (F32)(pos_global.mdV[VZ]));
6233 teleportRequest(info->mHandle, pos_local);
6234 }
6235 else if(regionp &&
6236 teleportCore(regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY])))
6237 {
6238 llwarns << "Using deprecated teleportlocationrequest." << llendl;
6239 // send the message
6240 LLMessageSystem* msg = gMessageSystem;
6241 msg->newMessageFast(_PREHASH_TeleportLocationRequest);
6242 msg->nextBlockFast(_PREHASH_AgentData);
6243 msg->addUUIDFast(_PREHASH_AgentID, getID());
6244 msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
6245 6241
6246 msg->nextBlockFast(_PREHASH_Info); 6242// Teleport to global position, but keep facing in the same direction
6247 F32 width = regionp->getWidth(); 6243void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global)
6248 LLVector3 pos(fmod((F32)pos_global.mdV[VX], width), 6244{
6249 fmod((F32)pos_global.mdV[VY], width), 6245 // RLVa stuff copied from LLAgent::teleportViaLocation
6250 (F32)pos_global.mdV[VZ]); 6246 if ( (rlv_handler_t::isEnabled()) &&
6251 F32 region_x = (F32)(pos_global.mdV[VX]); 6247 ( (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, gRlvHandler.getCurrentObject())) ||
6252 F32 region_y = (F32)(pos_global.mdV[VY]); 6248 ( (mAvatarObject.notNull()) && (mAvatarObject->mIsSitting) &&
6253 U64 region_handle = to_region_handle_global(region_x, region_y); 6249 (gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) ) )
6254 msg->addU64Fast(_PREHASH_RegionHandle, region_handle); 6250 {
6255 msg->addVector3Fast(_PREHASH_Position, pos); 6251 return;
6256 pos.mV[VX] += 1;
6257 msg->addVector3Fast(_PREHASH_LookAt, pos);
6258 sendReliableMessage();
6259 } 6252 }
6260}
6261 6253
6254 mbTeleportKeepsLookAt = true;
6255 setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction
6256 U64 region_handle = to_region_handle(pos_global);
6257 LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle));
6258 teleportRequest(region_handle, pos_local, mbTeleportKeepsLookAt);
6259}
6262 6260
6263void LLAgent::teleportHome() 6261void LLAgent::teleportHome()
6264{ 6262{
@@ -6286,7 +6284,14 @@ bool LLAgent::teleportHomeCallback( const LLSD& notification, const LLSD& respon
6286void LLAgent::setTeleportState(ETeleportState state) 6284void LLAgent::setTeleportState(ETeleportState state)
6287{ 6285{
6288 mTeleportState = state; 6286 mTeleportState = state;
6289 if (mTeleportState > TELEPORT_NONE && gSavedSettings.getBOOL("FreezeTime")) 6287 if (mTeleportState == TELEPORT_NONE)
6288 {
6289 mbTeleportKeepsLookAt = false;
6290 }
6291
6292 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
6293
6294 if (mTeleportState > TELEPORT_NONE && (*sFreezeTime))
6290 { 6295 {
6291 LLFloaterSnapshot::hide(0); 6296 LLFloaterSnapshot::hide(0);
6292 } 6297 }
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index 3a39448..f1cad9c 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -496,7 +496,8 @@ public:
496 // go to a named location home 496 // go to a named location home
497 void teleportRequest( 497 void teleportRequest(
498 const U64& region_handle, 498 const U64& region_handle,
499 const LLVector3& pos_local); 499 const LLVector3& pos_local,
500 bool keep_look_at);
500 501
501 // teleport to a landmark 502 // teleport to a landmark
502 void teleportViaLandmark(const LLUUID& landmark_id); 503 void teleportViaLandmark(const LLUUID& landmark_id);
@@ -513,6 +514,9 @@ public:
513 // deprecated. 514 // deprecated.
514 void teleportViaLocation(const LLVector3d& pos_global); 515 void teleportViaLocation(const LLVector3d& pos_global);
515 516
517 // to a global location, preserving camera rotation
518 void teleportViaLocationLookAt(const LLVector3d& pos_global);
519
516 // cancel the teleport, may or may not be allowed by server 520 // cancel the teleport, may or may not be allowed by server
517 void teleportCancel(); 521 void teleportCancel();
518 522
@@ -521,6 +525,8 @@ public:
521 525
522 const std::string getTeleportSourceSLURL() const { return mTeleportSourceSLURL; } 526 const std::string getTeleportSourceSLURL() const { return mTeleportSourceSLURL; }
523 527
528 // whether look-at resets after this teleport
529 bool getTeleportKeepsLookAt() const { return mbTeleportKeepsLookAt; }
524 530
525 // Setting the ability for this avatar to proxy for another avatar. 531 // Setting the ability for this avatar to proxy for another avatar.
526 //static void processAddModifyAbility(LLMessageSystem* msg, void**); 532 //static void processAddModifyAbility(LLMessageSystem* msg, void**);
@@ -781,6 +787,7 @@ public:
781 EDoubleTapRunMode mDoubleTapRunMode; 787 EDoubleTapRunMode mDoubleTapRunMode;
782 788
783private: 789private:
790 bool mbTeleportKeepsLookAt;
784 bool mbAlwaysRun; // should the avatar run by default rather than walk 791 bool mbAlwaysRun; // should the avatar run by default rather than walk
785 bool mbRunning; // is the avatar trying to run right now 792 bool mbRunning; // is the avatar trying to run right now
786 793
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index e54ae96..2496d13 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -1185,6 +1185,16 @@ bool LLAppViewer::cleanup()
1185 1185
1186 llinfos << "Viewer disconnected" << llendflush; 1186 llinfos << "Viewer disconnected" << llendflush;
1187 1187
1188 if (!mQuitRequested) //not doing it on quit, because the quitting voiceclient
1189 { //*might* crash imprudence TODO: fix the voiceclient instead
1190 //this deletes all your buddies
1191 LLAvatarTracker::instance().reset();
1192 }
1193
1194 //reset balance for not playing the UI-Sound
1195 //when relogging into another account
1196 gStatusBar->clearBalance();
1197
1188 if (mQuitRequested) 1198 if (mQuitRequested)
1189 { 1199 {
1190 display_cleanup(); 1200 display_cleanup();
@@ -3722,10 +3732,18 @@ void LLAppViewer::idleShutdown()
3722 else 3732 else
3723 { 3733 {
3724 mQuitRequested=true; 3734 mQuitRequested=true;
3725//awfixme
3726 forceQuit(); 3735 forceQuit();
3727 } 3736 }
3728 3737
3738
3739 static bool saved_snapshot = false;
3740 if (!saved_snapshot)
3741 {
3742 saved_snapshot = true;
3743 saveFinalSnapshot();
3744 return;
3745 }
3746
3729 // Attempt to close all floaters that might be 3747 // Attempt to close all floaters that might be
3730 // editing things. 3748 // editing things.
3731 if (gFloaterView) 3749 if (gFloaterView)
@@ -3733,6 +3751,13 @@ void LLAppViewer::idleShutdown()
3733 // application is quitting 3751 // application is quitting
3734 gFloaterView->closeAllChildren(true); 3752 gFloaterView->closeAllChildren(true);
3735 } 3753 }
3754
3755 // extra invitation to the Snapshot Floater
3756 // not to show on the loginscreen when relogging
3757 if (gSnapshotFloaterView)
3758 {
3759 gSnapshotFloaterView->closeAllChildren(true);
3760 }
3736 3761
3737 // close IM interface 3762 // close IM interface
3738 if(gIMMgr) 3763 if(gIMMgr)
@@ -3749,13 +3774,7 @@ void LLAppViewer::idleShutdown()
3749 return; 3774 return;
3750 } 3775 }
3751 3776
3752 static bool saved_snapshot = false; 3777
3753 if (!saved_snapshot)
3754 {
3755 saved_snapshot = true;
3756 saveFinalSnapshot();
3757 return;
3758 }
3759 3778
3760 const F32 SHUTDOWN_UPLOAD_SAVE_TIME = 5.f; 3779 const F32 SHUTDOWN_UPLOAD_SAVE_TIME = 5.f;
3761 3780
@@ -4149,9 +4168,10 @@ void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs)
4149 { 4168 {
4150 if(secs < 0.0f) 4169 if(secs < 0.0f)
4151 { 4170 {
4152 secs = gSavedSettings.getF32("MainloopTimeoutDefault"); 4171 static F32 *sMainloopTimeoutDefault = rebind_llcontrol<F32>("MainloopTimeoutDefault", &gSavedSettings, true);
4172 secs = *sMainloopTimeoutDefault;
4153 } 4173 }
4154 4174
4155 mMainloopTimeout->setTimeout(secs); 4175 mMainloopTimeout->setTimeout(secs);
4156 mMainloopTimeout->start(state); 4176 mMainloopTimeout->start(state);
4157 } 4177 }
@@ -4176,7 +4196,8 @@ void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs)
4176 { 4196 {
4177 if(secs < 0.0f) 4197 if(secs < 0.0f)
4178 { 4198 {
4179 secs = gSavedSettings.getF32("MainloopTimeoutDefault"); 4199 static F32 *sMainloopTimeoutDefault = rebind_llcontrol<F32>("MainloopTimeoutDefault", &gSavedSettings, true);
4200 secs = *sMainloopTimeoutDefault;
4180 } 4201 }
4181 4202
4182 mMainloopTimeout->setTimeout(secs); 4203 mMainloopTimeout->setTimeout(secs);
diff --git a/linden/indra/newview/llcallingcard.cpp b/linden/indra/newview/llcallingcard.cpp
index 155fb60..15be0eb 100644
--- a/linden/indra/newview/llcallingcard.cpp
+++ b/linden/indra/newview/llcallingcard.cpp
@@ -137,8 +137,20 @@ LLAvatarTracker::~LLAvatarTracker()
137 deleteTrackingData(); 137 deleteTrackingData();
138 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); 138 std::for_each(mObservers.begin(), mObservers.end(), DeletePointer());
139 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); 139 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
140 mObservers.erase(mObservers.begin(), mObservers.end());
141 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
140} 142}
141 143
144
145void LLAvatarTracker::reset()
146{
147 std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer());
148 mBuddyInfo.erase(mBuddyInfo.begin(), mBuddyInfo.end());
149 mModifyMask |= LLFriendObserver::REMOVE;
150 notifyObservers();
151}
152
153
142void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) 154void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name)
143{ 155{
144 deleteTrackingData(); 156 deleteTrackingData();
diff --git a/linden/indra/newview/llcallingcard.h b/linden/indra/newview/llcallingcard.h
index 0db5376..d3f53c6 100644
--- a/linden/indra/newview/llcallingcard.h
+++ b/linden/indra/newview/llcallingcard.h
@@ -86,7 +86,7 @@ class LLAvatarTracker
86{ 86{
87public: 87public:
88 static LLAvatarTracker& instance() { return sInstance; } 88 static LLAvatarTracker& instance() { return sInstance; }
89 89 void reset();
90 void track(const LLUUID& avatar_id, const std::string& name); 90 void track(const LLUUID& avatar_id, const std::string& name);
91 void untrack(const LLUUID& avatar_id); 91 void untrack(const LLUUID& avatar_id);
92 bool isTrackedAgentValid() { return mTrackedAgentValid; } 92 bool isTrackedAgentValid() { return mTrackedAgentValid; }
diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp
index 0a4ca34..a22fd8f 100644
--- a/linden/indra/newview/llchatbar.cpp
+++ b/linden/indra/newview/llchatbar.cpp
@@ -215,6 +215,7 @@ BOOL LLChatBar::handleKeyHere( KEY key, MASK mask )
215 { 215 {
216 if (mInputEditor) 216 if (mInputEditor)
217 { 217 {
218 mInputEditor->deleteSelection(); // Clean up prev completion before attempting a new one
218 std::string txt(mInputEditor->getText()); 219 std::string txt(mInputEditor->getText());
219 220
220 std::vector<LLUUID> avatar_ids; 221 std::vector<LLUUID> avatar_ids;
@@ -223,8 +224,6 @@ BOOL LLChatBar::handleKeyHere( KEY key, MASK mask )
223 224
224 if (!avatar_ids.empty() && !txt.empty()) 225 if (!avatar_ids.empty() && !txt.empty())
225 { 226 {
226 mInputEditor->deleteSelection(); // Clean up prev completion before attempting a new one
227
228 S32 cursorPos = mInputEditor->getCursor(); 227 S32 cursorPos = mInputEditor->getCursor();
229 228
230 if (mCompletionHolder.last_txt != mInputEditor->getText()) 229 if (mCompletionHolder.last_txt != mInputEditor->getText())
diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp
index 14aa38a..5a383bc 100644
--- a/linden/indra/newview/lldrawable.cpp
+++ b/linden/indra/newview/lldrawable.cpp
@@ -361,6 +361,7 @@ void LLDrawable::makeActive()
361 { 361 {
362 U32 pcode = mVObjp->getPCode(); 362 U32 pcode = mVObjp->getPCode();
363 if (pcode == LLViewerObject::LL_VO_WATER || 363 if (pcode == LLViewerObject::LL_VO_WATER ||
364 pcode == LLViewerObject::LL_VO_VOID_WATER ||
364 pcode == LLViewerObject::LL_VO_SURFACE_PATCH || 365 pcode == LLViewerObject::LL_VO_SURFACE_PATCH ||
365 pcode == LLViewerObject::LL_VO_PART_GROUP || 366 pcode == LLViewerObject::LL_VO_PART_GROUP ||
366 pcode == LLViewerObject::LL_VO_HUD_PART_GROUP || 367 pcode == LLViewerObject::LL_VO_HUD_PART_GROUP ||
diff --git a/linden/indra/newview/lldrawpool.cpp b/linden/indra/newview/lldrawpool.cpp
index e1bf1ed..3421731 100644
--- a/linden/indra/newview/lldrawpool.cpp
+++ b/linden/indra/newview/lldrawpool.cpp
@@ -95,6 +95,7 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
95 case POOL_SKY: 95 case POOL_SKY:
96 poolp = new LLDrawPoolSky(); 96 poolp = new LLDrawPoolSky();
97 break; 97 break;
98 case POOL_VOIDWATER:
98 case POOL_WATER: 99 case POOL_WATER:
99 poolp = new LLDrawPoolWater(); 100 poolp = new LLDrawPoolWater();
100 break; 101 break;
diff --git a/linden/indra/newview/lldrawpool.h b/linden/indra/newview/lldrawpool.h
index 87c3cca..f8c2ead 100644
--- a/linden/indra/newview/lldrawpool.h
+++ b/linden/indra/newview/lldrawpool.h
@@ -63,6 +63,7 @@ public:
63 POOL_BUMP, 63 POOL_BUMP,
64 POOL_INVISIBLE, 64 POOL_INVISIBLE,
65 POOL_AVATAR, 65 POOL_AVATAR,
66 POOL_VOIDWATER,
66 POOL_WATER, 67 POOL_WATER,
67 POOL_GLOW, 68 POOL_GLOW,
68 POOL_ALPHA, 69 POOL_ALPHA,
diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp
index fb7a213..93fadca 100644
--- a/linden/indra/newview/lldrawpoolbump.cpp
+++ b/linden/indra/newview/lldrawpoolbump.cpp
@@ -185,7 +185,8 @@ void LLDrawPoolBump::prerender()
185// static 185// static
186S32 LLDrawPoolBump::numBumpPasses() 186S32 LLDrawPoolBump::numBumpPasses()
187{ 187{
188 if (gSavedSettings.getBOOL("RenderObjectBump")) 188 static BOOL* sRenderObjectBump = rebind_llcontrol<BOOL>("RenderObjectBump", &gSavedSettings, true);
189 if (*sRenderObjectBump)
189 { 190 {
190 if (mVertexShaderLevel > 1) 191 if (mVertexShaderLevel > 1)
191 { 192 {
diff --git a/linden/indra/newview/lldrawpoolground.cpp b/linden/indra/newview/lldrawpoolground.cpp
index 889b494..c65524b 100644
--- a/linden/indra/newview/lldrawpoolground.cpp
+++ b/linden/indra/newview/lldrawpoolground.cpp
@@ -74,7 +74,7 @@ void LLDrawPoolGround::render(S32 pass)
74 74
75 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 75 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
76 76
77 LLGLClampToFarClip far_clip(glh_get_current_projection()); 77 LLGLSquashToFarClip far_clip(glh_get_current_projection());
78 78
79 F32 water_height = gAgent.getRegion()->getWaterHeight(); 79 F32 water_height = gAgent.getRegion()->getWaterHeight();
80 glPushMatrix(); 80 glPushMatrix();
diff --git a/linden/indra/newview/lldrawpoolsky.cpp b/linden/indra/newview/lldrawpoolsky.cpp
index f0ed380..bed1030 100644
--- a/linden/indra/newview/lldrawpoolsky.cpp
+++ b/linden/indra/newview/lldrawpoolsky.cpp
@@ -101,7 +101,7 @@ void LLDrawPoolSky::render(S32 pass)
101 101
102 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 102 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
103 103
104 LLGLClampToFarClip far_clip(glh_get_current_projection()); 104 LLGLSquashToFarClip far_clip(glh_get_current_projection());
105 105
106 LLGLEnable fog_enable( (mVertexShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); 106 LLGLEnable fog_enable( (mVertexShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0);
107 107
diff --git a/linden/indra/newview/lldrawpoolterrain.cpp b/linden/indra/newview/lldrawpoolterrain.cpp
index cac5162..d0bf2c1 100644
--- a/linden/indra/newview/lldrawpoolterrain.cpp
+++ b/linden/indra/newview/lldrawpoolterrain.cpp
@@ -207,9 +207,10 @@ void LLDrawPoolTerrain::render(S32 pass)
207 renderFull4TU(); 207 renderFull4TU();
208 } 208 }
209 } 209 }
210 210 static BOOL* sShowParcelOwners = rebind_llcontrol<BOOL>("ShowParcelOwners", &gSavedSettings, true);
211
211 // Special-case for land ownership feedback 212 // Special-case for land ownership feedback
212 if (gSavedSettings.getBOOL("ShowParcelOwners")) 213 if (*sShowParcelOwners)
213 { 214 {
214 if (mVertexShaderLevel > 1) 215 if (mVertexShaderLevel > 1)
215 { //use fullbright shader for highlighting 216 { //use fullbright shader for highlighting
diff --git a/linden/indra/newview/lldrawpooltree.cpp b/linden/indra/newview/lldrawpooltree.cpp
index 46cd2d5..e4560f2 100644
--- a/linden/indra/newview/lldrawpooltree.cpp
+++ b/linden/indra/newview/lldrawpooltree.cpp
@@ -102,7 +102,9 @@ void LLDrawPoolTree::render(S32 pass)
102 LLGLEnable test(GL_ALPHA_TEST); 102 LLGLEnable test(GL_ALPHA_TEST);
103 LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); 103 LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
104 104
105 if (gSavedSettings.getBOOL("RenderAnimateTrees")) 105 static BOOL* sRenderAnimateTrees = rebind_llcontrol<BOOL>("RenderAnimateTrees", &gSavedSettings, true);
106
107 if (*sRenderAnimateTrees)
106 { 108 {
107 renderTree(); 109 renderTree();
108 } 110 }
@@ -198,7 +200,9 @@ void LLDrawPoolTree::renderForSelect()
198 gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); 200 gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
199 gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); 201 gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
200 202
201 if (gSavedSettings.getBOOL("RenderAnimateTrees")) 203 static BOOL* sRenderAnimateTrees = rebind_llcontrol<BOOL>("RenderAnimateTrees", &gSavedSettings, true);
204
205 if (*sRenderAnimateTrees)
202 { 206 {
203 renderTree(TRUE); 207 renderTree(TRUE);
204 } 208 }
diff --git a/linden/indra/newview/lldrawpoolwater.cpp b/linden/indra/newview/lldrawpoolwater.cpp
index ce3425d..624b8a8 100644
--- a/linden/indra/newview/lldrawpoolwater.cpp
+++ b/linden/indra/newview/lldrawpoolwater.cpp
@@ -523,6 +523,7 @@ void LLDrawPoolWater::shade()
523 glColor4fv(water_color.mV); 523 glColor4fv(water_color.mV);
524 524
525 { 525 {
526 LLGLEnable depth_clamp(gGLManager.mHasDepthClamp ? GL_DEPTH_CLAMP : 0);
526 LLGLDisable cullface(GL_CULL_FACE); 527 LLGLDisable cullface(GL_CULL_FACE);
527 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); 528 for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
528 iter != mDrawFace.end(); iter++) 529 iter != mDrawFace.end(); iter++)
@@ -538,24 +539,20 @@ void LLDrawPoolWater::shade()
538 gGL.getTexUnit(diffTex)->bind(face->getTexture()); 539 gGL.getTexUnit(diffTex)->bind(face->getTexture());
539 540
540 sNeedsReflectionUpdate = TRUE; 541 sNeedsReflectionUpdate = TRUE;
541 542
542 if (water->getUseTexture()) 543 if (water->getUseTexture() || !water->getIsEdgePatch())
543 { 544 {
544 sNeedsDistortionUpdate = TRUE; 545 sNeedsDistortionUpdate = TRUE;
545 face->renderIndexed(); 546 face->renderIndexed();
546 } 547 }
548 else if (gGLManager.mHasDepthClamp)
549 {
550 face->renderIndexed();
551 }
547 else 552 else
548 { //smash background faces to far clip plane 553 {
549 if (water->getIsEdgePatch()) 554 LLGLSquashToFarClip far_clip(glh_get_current_projection());
550 { 555 face->renderIndexed();
551 LLGLClampToFarClip far_clip(glh_get_current_projection());
552 face->renderIndexed();
553 }
554 else
555 {
556 sNeedsDistortionUpdate = TRUE;
557 face->renderIndexed();
558 }
559 } 556 }
560 } 557 }
561 } 558 }
diff --git a/linden/indra/newview/lldrawpoolwlsky.cpp b/linden/indra/newview/lldrawpoolwlsky.cpp
index 6ff65c7..451d08e 100644
--- a/linden/indra/newview/lldrawpoolwlsky.cpp
+++ b/linden/indra/newview/lldrawpoolwlsky.cpp
@@ -269,7 +269,7 @@ void LLDrawPoolWLSky::render(S32 pass)
269 LLGLDepthTest depth(GL_TRUE, GL_FALSE); 269 LLGLDepthTest depth(GL_TRUE, GL_FALSE);
270 LLGLDisable clip(GL_CLIP_PLANE0); 270 LLGLDisable clip(GL_CLIP_PLANE0);
271 271
272 LLGLClampToFarClip far_clip(glh_get_current_projection()); 272 LLGLSquashToFarClip far_clip(glh_get_current_projection());
273 273
274 renderSkyHaze(camHeightLocal); 274 renderSkyHaze(camHeightLocal);
275 275
diff --git a/linden/indra/newview/llfloaterbuycurrency.cpp b/linden/indra/newview/llfloaterbuycurrency.cpp
index 07723e0..5096495 100644
--- a/linden/indra/newview/llfloaterbuycurrency.cpp
+++ b/linden/indra/newview/llfloaterbuycurrency.cpp
@@ -192,7 +192,7 @@ BOOL LLFloaterBuyCurrencyUI::canClose()
192void LLFloaterBuyCurrencyUI::onClose(bool app_quitting) 192void LLFloaterBuyCurrencyUI::onClose(bool app_quitting)
193{ 193{
194 LLFloater::onClose(app_quitting); 194 LLFloater::onClose(app_quitting);
195 destroy(); 195
196} 196}
197 197
198void LLFloaterBuyCurrencyUI::updateUI() 198void LLFloaterBuyCurrencyUI::updateUI()
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp
index e2d3f7c..c33deae 100644
--- a/linden/indra/newview/llfloaterfriends.cpp
+++ b/linden/indra/newview/llfloaterfriends.cpp
@@ -464,12 +464,13 @@ void LLPanelFriends::refreshNames(U32 changed_mask, const std::string& search_st
464 for (LLAvatarTracker::buddy_map_t::reverse_iterator bIt = all_buddies.rbegin(); 464 for (LLAvatarTracker::buddy_map_t::reverse_iterator bIt = all_buddies.rbegin();
465 bIt != all_buddies.rend(); ++bIt) 465 bIt != all_buddies.rend(); ++bIt)
466 { 466 {
467 llinfos << (*bIt).first << llendl;
468 if (gCacheName->getName((*bIt).first, firstname, lastname)) 467 if (gCacheName->getName((*bIt).first, firstname, lastname))
469 { 468 {
470 std::string test_name(firstname + " " + lastname); 469 std::string l_name(firstname);
471 LLStringUtil::toLower(test_name); 470 LLStringUtil::toLower(l_name);
472 if (test_name.find(filter) != std::string::npos) 471 std::string l_sname(lastname);
472 LLStringUtil::toLower(l_sname);
473 if (l_name.find(filter) == 0 || l_sname.find(filter) == 0)
473 { 474 {
474 temp_buddies.insert(temp_buddies.begin(), std::pair<LLUUID, LLRelationship*>((*bIt).first, (*bIt).second)); 475 temp_buddies.insert(temp_buddies.begin(), std::pair<LLUUID, LLRelationship*>((*bIt).first, (*bIt).second));
475 } 476 }
diff --git a/linden/indra/newview/llfloatergodtools.cpp b/linden/indra/newview/llfloatergodtools.cpp
index 2bbbc65..461dfe2 100644
--- a/linden/indra/newview/llfloatergodtools.cpp
+++ b/linden/indra/newview/llfloatergodtools.cpp
@@ -252,13 +252,6 @@ void LLFloaterGodTools::onTabChanged(void* data, bool from_click)
252// static 252// static
253void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg) 253void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)
254{ 254{
255 LLHost host = msg->getSender();
256 if (host != gAgent.getRegionHost())
257 {
258 // update is for a different region than the one we're in
259 return;
260 }
261
262 //const S32 SIM_NAME_BUF = 256; 255 //const S32 SIM_NAME_BUF = 256;
263 U32 region_flags; 256 U32 region_flags;
264 U8 sim_access; 257 U8 sim_access;
@@ -276,6 +269,8 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)
276 S32 redirect_grid_y; 269 S32 redirect_grid_y;
277 LLUUID cache_id; 270 LLUUID cache_id;
278 271
272 LLHost host = msg->getSender();
273
279 msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, sim_name); 274 msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, sim_name);
280 msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, estate_id); 275 msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, estate_id);
281 msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, parent_estate_id); 276 msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, parent_estate_id);
@@ -285,6 +280,15 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)
285 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, object_bonus_factor); 280 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, object_bonus_factor);
286 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, billable_factor); 281 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, billable_factor);
287 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height); 282 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height);
283
284 if (host != gAgent.getRegionHost())
285 {
286 // Update is for a different region than the one we're in.
287 // Just check for a waterheight change.
288 LLWorld::getInstance()->waterHeightRegionInfo(sim_name, water_height);
289 return;
290 }
291
288 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit); 292 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit);
289 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit); 293 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit);
290 msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_PricePerMeter, price_per_meter); 294 msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_PricePerMeter, price_per_meter);
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp
index f67340e..c0e972d 100644
--- a/linden/indra/newview/llfloatersnapshot.cpp
+++ b/linden/indra/newview/llfloatersnapshot.cpp
@@ -366,6 +366,7 @@ void LLSnapshotLivePreview::setSnapshotQuality(S32 quality)
366 { 366 {
367 mSnapshotQuality = quality; 367 mSnapshotQuality = quality;
368 gSavedSettings.setS32("SnapshotQuality", quality); 368 gSavedSettings.setS32("SnapshotQuality", quality);
369 mSnapshotUpToDate = FALSE;
369 } 370 }
370} 371}
371 372
@@ -737,7 +738,10 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
737 738
738 LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); 739 LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin();
739 LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); 740 LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion();
740 if (gSavedSettings.getBOOL("FreezeTime") && 741
742 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
743
744 if ((*sFreezeTime) &&
741 (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) 745 (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f))
742 { 746 {
743 previewp->mCameraPos = new_camera_pos; 747 previewp->mCameraPos = new_camera_pos;
@@ -777,8 +781,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
777 previewp->getWindow()->incBusyCount(); 781 previewp->getWindow()->incBusyCount();
778 previewp->mImageScaled[previewp->mCurImageIndex] = FALSE; 782 previewp->mImageScaled[previewp->mCurImageIndex] = FALSE;
779 783
780 int res = 1; 784 int res = (gSavedSettings.getBOOL("HighResSnapshot") && previewp->getSnapshotType() == SNAPSHOT_LOCAL) ? 2 : 1;
781 res = (gSavedSettings.getBOOL("HighResSnapshot") && previewp->getSnapshotType() == SNAPSHOT_LOCAL) ? 2 : 1;
782 785
783 if(gViewerWindow->rawSnapshot( 786 if(gViewerWindow->rawSnapshot(
784 previewp->mPreviewImage, 787 previewp->mPreviewImage,
@@ -891,16 +894,16 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
891 previewp->mPosTakenGlobal = gAgent.getCameraPositionGlobal(); 894 previewp->mPosTakenGlobal = gAgent.getCameraPositionGlobal();
892 previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame 895 previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame
893 } 896 }
894 previewp->getWindow()->decBusyCount(); 897 }
895 // only show fullscreen preview when in freeze frame mode 898 previewp->getWindow()->decBusyCount();
896 previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame")); 899 // only show fullscreen preview when in freeze frame mode
897 previewp->mSnapshotDelayTimer.stop(); 900 previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame"));
898 previewp->mSnapshotActive = FALSE; 901 previewp->mSnapshotDelayTimer.stop();
902 previewp->mSnapshotActive = FALSE;
899 903
900 if(!previewp->getThumbnailUpToDate()) 904 if(!previewp->getThumbnailUpToDate())
901 { 905 {
902 previewp->generateThumbnailImage() ; 906 previewp->generateThumbnailImage() ;
903 }
904 } 907 }
905 908
906 return TRUE; 909 return TRUE;
@@ -1025,7 +1028,8 @@ class LLFloaterSnapshot::Impl
1025public: 1028public:
1026 Impl() 1029 Impl()
1027 : mAvatarPauseHandles(), 1030 : mAvatarPauseHandles(),
1028 mLastToolset(NULL) 1031 mLastToolset(NULL),
1032 mAspectRatioCheckOff(false)
1029 { 1033 {
1030 } 1034 }
1031 ~Impl() 1035 ~Impl()
@@ -1064,9 +1068,6 @@ public:
1064 static void updateLayout(LLFloaterSnapshot* floater); 1068 static void updateLayout(LLFloaterSnapshot* floater);
1065 static void updateResolutionTextEntry(LLFloaterSnapshot* floater); 1069 static void updateResolutionTextEntry(LLFloaterSnapshot* floater);
1066 1070
1067 static LLHandle<LLView> sPreviewHandle;
1068 static BOOL sAspectRatioCheckOff ;
1069
1070private: 1071private:
1071 static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater); 1072 static LLSnapshotLivePreview::ESnapshotType getTypeIndex(LLFloaterSnapshot* floater);
1072 static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater); 1073 static ESnapshotFormat getFormatIndex(LLFloaterSnapshot* floater);
@@ -1079,18 +1080,14 @@ public:
1079 std::vector<LLAnimPauseRequest> mAvatarPauseHandles; 1080 std::vector<LLAnimPauseRequest> mAvatarPauseHandles;
1080 1081
1081 LLToolset* mLastToolset; 1082 LLToolset* mLastToolset;
1083 LLHandle<LLView> mPreviewHandle;
1084 bool mAspectRatioCheckOff ;
1082}; 1085};
1083 1086
1084// static 1087// static
1085LLHandle<LLView> LLFloaterSnapshot::Impl::sPreviewHandle;
1086
1087//static
1088BOOL LLFloaterSnapshot::Impl::sAspectRatioCheckOff = FALSE ;
1089
1090// static
1091LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot *floater) 1088LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot *floater)
1092{ 1089{
1093 LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)sPreviewHandle.get(); 1090 LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)floater->impl.mPreviewHandle.get();
1094 return previewp; 1091 return previewp;
1095} 1092}
1096 1093
@@ -1098,14 +1095,17 @@ LLSnapshotLivePreview* LLFloaterSnapshot::Impl::getPreviewView(LLFloaterSnapshot
1098LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater) 1095LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFloaterSnapshot* floater)
1099{ 1096{
1100 LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; 1097 LLSnapshotLivePreview::ESnapshotType index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD;
1101 LLSD value = floater->childGetValue("snapshot_type_radio"); 1098 LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio");
1102 const std::string id = value.asString(); 1099 if (snapshot_type_radio)
1103 if (id == "postcard") 1100 {
1104 index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD; 1101 const std::string id = snapshot_type_radio->getSelectedValue().asString();
1105 else if (id == "texture") 1102 if (id == "postcard")
1106 index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE; 1103 index = LLSnapshotLivePreview::SNAPSHOT_POSTCARD;
1107 else if (id == "local") 1104 else if (id == "texture")
1108 index = LLSnapshotLivePreview::SNAPSHOT_LOCAL; 1105 index = LLSnapshotLivePreview::SNAPSHOT_TEXTURE;
1106 else if (id == "local")
1107 index = LLSnapshotLivePreview::SNAPSHOT_LOCAL;
1108 }
1109 return index; 1109 return index;
1110} 1110}
1111 1111
@@ -1114,16 +1114,19 @@ LLSnapshotLivePreview::ESnapshotType LLFloaterSnapshot::Impl::getTypeIndex(LLFlo
1114LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFloaterSnapshot* floater) 1114LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFloaterSnapshot* floater)
1115{ 1115{
1116 ESnapshotFormat index = SNAPSHOT_FORMAT_PNG; 1116 ESnapshotFormat index = SNAPSHOT_FORMAT_PNG;
1117 LLSD value = floater->childGetValue("local_format_combo"); 1117 if(floater->hasChild("local_format_combo"))
1118 const std::string id = value.asString(); 1118 {
1119 if (id == "PNG") 1119 LLComboBox* local_format_combo = floater->getChild<LLComboBox>("local_format_combo");
1120 index = SNAPSHOT_FORMAT_PNG; 1120 const std::string id = local_format_combo->getSelectedItemLabel();
1121 else if (id == "JPEG") 1121 if (id == "PNG")
1122 index = SNAPSHOT_FORMAT_JPEG; 1122 index = SNAPSHOT_FORMAT_PNG;
1123 else if (id == "TGA") 1123 else if (id == "JPEG")
1124 index = SNAPSHOT_FORMAT_TGA; 1124 index = SNAPSHOT_FORMAT_JPEG;
1125 else if (id == "BMP") 1125 else if (id == "TGA")
1126 index = SNAPSHOT_FORMAT_BMP; 1126 index = SNAPSHOT_FORMAT_TGA;
1127 else if (id == "BMP")
1128 index = SNAPSHOT_FORMAT_BMP;
1129 }
1127 return index; 1130 return index;
1128} 1131}
1129 1132
@@ -1133,14 +1136,17 @@ LLFloaterSnapshot::ESnapshotFormat LLFloaterSnapshot::Impl::getFormatIndex(LLFlo
1133LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSnapshot* floater) 1136LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSnapshot* floater)
1134{ 1137{
1135 LLViewerWindow::ESnapshotType type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; 1138 LLViewerWindow::ESnapshotType type = LLViewerWindow::SNAPSHOT_TYPE_COLOR;
1136 LLSD value = floater->childGetValue("layer_types"); 1139 if(floater->hasChild("layer_types"))
1137 const std::string id = value.asString(); 1140 {
1138 if (id == "colors") 1141 LLComboBox* layer_types = floater->getChild<LLComboBox>("layer_types");
1139 type = LLViewerWindow::SNAPSHOT_TYPE_COLOR; 1142 const std::string id = layer_types->getSelectedItemLabel();
1140 else if (id == "depth") 1143 if (id == "colors")
1141 type = LLViewerWindow::SNAPSHOT_TYPE_DEPTH; 1144 type = LLViewerWindow::SNAPSHOT_TYPE_COLOR;
1142 else if (id == "objects") 1145 else if (id == "depth")
1143 type = LLViewerWindow::SNAPSHOT_TYPE_OBJECT_ID; 1146 type = LLViewerWindow::SNAPSHOT_TYPE_DEPTH;
1147 else if (id == "objects")
1148 type = LLViewerWindow::SNAPSHOT_TYPE_OBJECT_ID;
1149 }
1144 return type; 1150 return type;
1145} 1151}
1146 1152
@@ -1199,7 +1205,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
1199 iter != LLCharacter::sInstances.end(); ++iter) 1205 iter != LLCharacter::sInstances.end(); ++iter)
1200 { 1206 {
1201 avatarp = *iter; 1207 avatarp = *iter;
1202 sInstance->impl.mAvatarPauseHandles.push_back(avatarp->requestPause()); 1208 floaterp->impl.mAvatarPauseHandles.push_back(avatarp->requestPause());
1203 } 1209 }
1204 1210
1205 // freeze everything else 1211 // freeze everything else
@@ -1207,7 +1213,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
1207 1213
1208 if (LLToolMgr::getInstance()->getCurrentToolset() != gCameraToolset) 1214 if (LLToolMgr::getInstance()->getCurrentToolset() != gCameraToolset)
1209 { 1215 {
1210 sInstance->impl.mLastToolset = LLToolMgr::getInstance()->getCurrentToolset(); 1216 floaterp->impl.mLastToolset = LLToolMgr::getInstance()->getCurrentToolset();
1211 LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset); 1217 LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset);
1212 } 1218 }
1213 } 1219 }
@@ -1222,15 +1228,15 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
1222 } 1228 }
1223 1229
1224 //RN: thaw all avatars 1230 //RN: thaw all avatars
1225 sInstance->impl.mAvatarPauseHandles.clear(); 1231 floaterp->impl.mAvatarPauseHandles.clear();
1226 1232
1227 // thaw everything else 1233 // thaw everything else
1228 gSavedSettings.setBOOL("FreezeTime", FALSE); 1234 gSavedSettings.setBOOL("FreezeTime", FALSE);
1229 1235
1230 // restore last tool (e.g. pie menu, etc) 1236 // restore last tool (e.g. pie menu, etc)
1231 if (sInstance->impl.mLastToolset) 1237 if (floaterp->impl.mLastToolset)
1232 { 1238 {
1233 LLToolMgr::getInstance()->setCurrentToolset(sInstance->impl.mLastToolset); 1239 LLToolMgr::getInstance()->setCurrentToolset(floaterp->impl.mLastToolset);
1234 } 1240 }
1235 } 1241 }
1236} 1242}
@@ -1243,8 +1249,28 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp)
1243// static 1249// static
1244void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) 1250void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
1245{ 1251{
1252 std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee();
1253 floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", fee);
1254
1246 LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio"); 1255 LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio");
1247 snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType")); 1256 if (snapshot_type_radio)
1257 {
1258 snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType"));
1259
1260 const child_list_t *childs = snapshot_type_radio->getChildList();
1261 if (childs)
1262 {
1263 child_list_t::const_iterator it, end=childs->end();
1264 for (it=childs->begin(); it!=end; ++it)
1265 {
1266 LLRadioCtrl *ctrl = dynamic_cast<LLRadioCtrl*>(*it);
1267 if (ctrl && (ctrl->getName() == "texture"))
1268 {
1269 ctrl->setLabelArg("[UPLOADFEE]", fee);
1270 }
1271 }
1272 }
1273 }
1248 LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater); 1274 LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater);
1249 ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); //getFormatIndex(floater); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); 1275 ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat"); //getFormatIndex(floater); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater);
1250 LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); 1276 LLViewerWindow::ESnapshotType layer_type = getLayerType(floater);
@@ -1258,25 +1284,10 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
1258 floater->getChild<LLComboBox>("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution")); 1284 floater->getChild<LLComboBox>("local_size_combo")->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution"));
1259 floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat")); 1285 floater->getChild<LLComboBox>("local_format_combo")->selectNthItem(gSavedSettings.getS32("SnapshotFormat"));
1260 1286
1261 std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee();
1262 floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", fee);
1263
1264 if (snapshot_type_radio) {
1265 const child_list_t *childs = snapshot_type_radio->getChildList();
1266 if (childs) {
1267 child_list_t::const_iterator it, end=childs->end();
1268 for (it=childs->begin(); it!=end; ++it) {
1269 LLRadioCtrl *ctrl = dynamic_cast<LLRadioCtrl*>(*it);
1270 if (ctrl && (ctrl->getName() == "texture"))
1271 ctrl->setLabelArg("[UPLOADFEE]", fee);
1272 }
1273 }
1274 }
1275
1276 floater->childSetVisible("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE); 1287 floater->childSetVisible("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE);
1277 floater->childSetVisible("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD); 1288 floater->childSetVisible("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD);
1278 floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); 1289 floater->childSetVisible("save_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL);
1279 floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !sAspectRatioCheckOff); 1290 floater->childSetEnabled("keep_aspect_check", shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE && !floater->impl.mAspectRatioCheckOff);
1280 floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL); 1291 floater->childSetEnabled("layer_types", shot_type == LLSnapshotLivePreview::SNAPSHOT_LOCAL);
1281 if(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE) 1292 if(shot_type != LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
1282 { 1293 {
@@ -1308,7 +1319,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
1308 1319
1309 LLSnapshotLivePreview* previewp = getPreviewView(floater); 1320 LLSnapshotLivePreview* previewp = getPreviewView(floater);
1310 BOOL got_bytes = previewp && previewp->getDataSize() > 0; 1321 BOOL got_bytes = previewp && previewp->getDataSize() > 0;
1311 BOOL got_snap = previewp->getSnapshotUpToDate(); 1322 BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
1312 1323
1313 BOOL show_slider = 1324 BOOL show_slider =
1314 shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD 1325 shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD
@@ -1321,7 +1332,10 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
1321 1332
1322 LLLocale locale(LLLocale::USER_LOCALE); 1333 LLLocale locale(LLLocale::USER_LOCALE);
1323 std::string bytes_string; 1334 std::string bytes_string;
1324 LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); 1335 if (got_snap)
1336 {
1337 LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
1338 }
1325 S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); 1339 S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
1326 floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost)); 1340 floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost));
1327 floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost)); 1341 floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost));
@@ -1652,7 +1666,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde
1652 1666
1653 if(0 == index) //current window size 1667 if(0 == index) //current window size
1654 { 1668 {
1655 sAspectRatioCheckOff = TRUE ; 1669 view->impl.mAspectRatioCheckOff = true ;
1656 view->childSetEnabled("keep_aspect_check", FALSE) ; 1670 view->childSetEnabled("keep_aspect_check", FALSE) ;
1657 1671
1658 if(previewp) 1672 if(previewp)
@@ -1662,7 +1676,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde
1662 } 1676 }
1663 else if(-1 == index) //custom 1677 else if(-1 == index) //custom
1664 { 1678 {
1665 sAspectRatioCheckOff = FALSE ; 1679 view->impl.mAspectRatioCheckOff = false ;
1666 //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) 1680 //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType"))
1667 { 1681 {
1668 view->childSetEnabled("keep_aspect_check", TRUE) ; 1682 view->childSetEnabled("keep_aspect_check", TRUE) ;
@@ -1675,7 +1689,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde
1675 } 1689 }
1676 else 1690 else
1677 { 1691 {
1678 sAspectRatioCheckOff = TRUE ; 1692 view->impl.mAspectRatioCheckOff = true ;
1679 view->childSetEnabled("keep_aspect_check", FALSE) ; 1693 view->childSetEnabled("keep_aspect_check", FALSE) ;
1680 1694
1681 if(previewp) 1695 if(previewp)
@@ -1832,23 +1846,25 @@ void LLFloaterSnapshot::Impl::onCommitSnapshotFormat(LLUICtrl* ctrl, void* data)
1832void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const std::string& comboname) 1846void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const std::string& comboname)
1833{ 1847{
1834 LLComboBox* combo = floater->getChild<LLComboBox>(comboname); 1848 LLComboBox* combo = floater->getChild<LLComboBox>(comboname);
1849 if (combo)
1850 {
1851 combo->setCurrentByIndex(combo->getItemCount() - 1); // "custom" is always the last index
1835 1852
1836 combo->setCurrentByIndex(combo->getItemCount() - 1); // "custom" is always the last index 1853 if(comboname == "postcard_size_combo")
1854 {
1855 gSavedSettings.setS32("SnapshotPostcardLastResolution", combo->getCurrentIndex());
1856 }
1857 else if(comboname == "texture_size_combo")
1858 {
1859 gSavedSettings.setS32("SnapshotTextureLastResolution", combo->getCurrentIndex());
1860 }
1861 else if(comboname == "local_size_combo")
1862 {
1863 gSavedSettings.setS32("SnapshotLocalLastResolution", combo->getCurrentIndex());
1864 }
1837 1865
1838 if(comboname == "postcard_size_combo") 1866 checkAspectRatio(floater, -1); // -1 means custom
1839 {
1840 gSavedSettings.setS32("SnapshotPostcardLastResolution", combo->getCurrentIndex());
1841 } 1867 }
1842 else if(comboname == "texture_size_combo")
1843 {
1844 gSavedSettings.setS32("SnapshotTextureLastResolution", combo->getCurrentIndex());
1845 }
1846 else if(comboname == "local_size_combo")
1847 {
1848 gSavedSettings.setS32("SnapshotLocalLastResolution", combo->getCurrentIndex());
1849 }
1850
1851 checkAspectRatio(floater, -1); // -1 means custom
1852} 1868}
1853 1869
1854 1870
@@ -2015,6 +2031,7 @@ LLFloaterSnapshot::LLFloaterSnapshot()
2015 : LLFloater(std::string("Snapshot Floater")), 2031 : LLFloater(std::string("Snapshot Floater")),
2016 impl (*(new Impl)) 2032 impl (*(new Impl))
2017{ 2033{
2034 //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_snapshot.xml", FALSE);
2018} 2035}
2019 2036
2020// Destroys the object 2037// Destroys the object
@@ -2022,8 +2039,7 @@ LLFloaterSnapshot::~LLFloaterSnapshot()
2022{ 2039{
2023 if (sInstance == this) 2040 if (sInstance == this)
2024 { 2041 {
2025 LLView::deleteViewByHandle(Impl::sPreviewHandle); 2042 LLView::deleteViewByHandle(impl.mPreviewHandle);
2026 Impl::sPreviewHandle = LLHandle<LLView>();
2027 sInstance = NULL; 2043 sInstance = NULL;
2028 } 2044 }
2029 2045
@@ -2092,20 +2108,27 @@ BOOL LLFloaterSnapshot::postBuild()
2092 childSetCommitCallback("texture_size_combo", Impl::onCommitResolution, this); 2108 childSetCommitCallback("texture_size_combo", Impl::onCommitResolution, this);
2093 childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this); 2109 childSetCommitCallback("local_size_combo", Impl::onCommitResolution, this);
2094 2110
2111 gSavedSettings.setBOOL("EmeraldTemporaryUpload",FALSE);
2112 childSetValue("temp_check",FALSE);
2113
2095 // create preview window 2114 // create preview window
2096 LLRect full_screen_rect = sInstance->getRootView()->getRect(); 2115 LLRect full_screen_rect = getRootView()->getRect();
2097 LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(full_screen_rect); 2116 LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(full_screen_rect);
2098 sInstance->getRootView()->removeChild(gSnapshotFloaterView); 2117 LLView* parent_view = gSnapshotFloaterView->getParent();
2118
2119 parent_view->removeChild(gSnapshotFloaterView);
2099 // make sure preview is below snapshot floater 2120 // make sure preview is below snapshot floater
2100 sInstance->getRootView()->addChild(previewp); 2121 parent_view->addChild(previewp);
2101 sInstance->getRootView()->addChild(gSnapshotFloaterView); 2122 parent_view->addChild(gSnapshotFloaterView);
2102 2123
2103 gSavedSettings.setBOOL("EmeraldTemporaryUpload",FALSE); 2124 impl.mPreviewHandle = previewp->getHandle();
2104 childSetValue("temp_check",FALSE);
2105 2125
2106 Impl::sPreviewHandle = previewp->getHandle(); 2126 //move snapshot floater to special purpose snapshotfloaterview
2127 //gFloaterView->removeChild(this);
2128 //gSnapshotFloaterView->addChild(this);
2107 2129
2108 impl.updateControls(this); 2130 impl.updateControls(this);
2131 impl.updateLayout(this);
2109 2132
2110 return TRUE; 2133 return TRUE;
2111} 2134}
@@ -2282,6 +2305,9 @@ void LLFloaterSnapshot::hide(void*)
2282//static 2305//static
2283void LLFloaterSnapshot::update() 2306void LLFloaterSnapshot::update()
2284{ 2307{
2308 if (!sInstance)
2309 return;
2310
2285 BOOL changed = FALSE; 2311 BOOL changed = FALSE;
2286 for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin(); 2312 for (std::set<LLSnapshotLivePreview*>::iterator iter = LLSnapshotLivePreview::sList.begin();
2287 iter != LLSnapshotLivePreview::sList.end(); ++iter) 2313 iter != LLSnapshotLivePreview::sList.end(); ++iter)
@@ -2311,8 +2337,10 @@ LLSnapshotFloaterView::~LLSnapshotFloaterView()
2311 2337
2312BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_parent) 2338BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
2313{ 2339{
2340 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
2341
2314 // use default handler when not in freeze-frame mode 2342 // use default handler when not in freeze-frame mode
2315 if(!gSavedSettings.getBOOL("FreezeTime")) 2343 if(!(*sFreezeTime))
2316 { 2344 {
2317 return LLFloaterView::handleKey(key, mask, called_from_parent); 2345 return LLFloaterView::handleKey(key, mask, called_from_parent);
2318 } 2346 }
@@ -2332,8 +2360,9 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren
2332 2360
2333BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) 2361BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask)
2334{ 2362{
2363 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
2335 // use default handler when not in freeze-frame mode 2364 // use default handler when not in freeze-frame mode
2336 if(!gSavedSettings.getBOOL("FreezeTime")) 2365 if(!(*sFreezeTime))
2337 { 2366 {
2338 return LLFloaterView::handleMouseDown(x, y, mask); 2367 return LLFloaterView::handleMouseDown(x, y, mask);
2339 } 2368 }
@@ -2347,8 +2376,9 @@ BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask)
2347 2376
2348BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) 2377BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask)
2349{ 2378{
2379 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
2350 // use default handler when not in freeze-frame mode 2380 // use default handler when not in freeze-frame mode
2351 if(!gSavedSettings.getBOOL("FreezeTime")) 2381 if(!(*sFreezeTime))
2352 { 2382 {
2353 return LLFloaterView::handleMouseUp(x, y, mask); 2383 return LLFloaterView::handleMouseUp(x, y, mask);
2354 } 2384 }
@@ -2362,8 +2392,9 @@ BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask)
2362 2392
2363BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) 2393BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask)
2364{ 2394{
2395 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
2365 // use default handler when not in freeze-frame mode 2396 // use default handler when not in freeze-frame mode
2366 if(!gSavedSettings.getBOOL("FreezeTime")) 2397 if(!(*sFreezeTime))
2367 { 2398 {
2368 return LLFloaterView::handleHover(x, y, mask); 2399 return LLFloaterView::handleHover(x, y, mask);
2369 } 2400 }
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 7a9efcb..f6f09b1 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -1056,7 +1056,9 @@ void click_apply_to_selection(void* user)
1056 1056
1057void commit_select_tool(LLUICtrl *ctrl, void *data) 1057void commit_select_tool(LLUICtrl *ctrl, void *data)
1058{ 1058{
1059 S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); 1059 static BOOL* sShowParcelOwners = rebind_llcontrol<BOOL>("ShowParcelOwners", &gSavedSettings, true);
1060
1061 S32 show_owners = *sShowParcelOwners;
1060 gFloaterTools->setEditTool(data); 1062 gFloaterTools->setEditTool(data);
1061 gSavedSettings.setBOOL("ShowParcelOwners", show_owners); 1063 gSavedSettings.setBOOL("ShowParcelOwners", show_owners);
1062} 1064}
diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp
index 16c0aa9..ce2b2b4 100644
--- a/linden/indra/newview/llfolderview.cpp
+++ b/linden/indra/newview/llfolderview.cpp
@@ -2893,7 +2893,9 @@ const std::string LLFolderView::getFilterSubString(BOOL trim)
2893void LLFolderView::filter( LLInventoryFilter& filter ) 2893void LLFolderView::filter( LLInventoryFilter& filter )
2894{ 2894{
2895 LLFastTimer t2(LLFastTimer::FTM_FILTER); 2895 LLFastTimer t2(LLFastTimer::FTM_FILTER);
2896 filter.setFilterCount(llclamp(gSavedSettings.getS32("FilterItemsPerFrame"), 1, 5000)); 2896 static S32 *sFilterItemsPerFrame = rebind_llcontrol<S32>("FilterItemsPerFrame", &gSavedSettings, true);
2897
2898 filter.setFilterCount(llclamp(*sFilterItemsPerFrame, 1, 5000));
2897 2899
2898 if (getCompletedFilterGeneration() < filter.getCurrentGeneration()) 2900 if (getCompletedFilterGeneration() < filter.getCurrentGeneration())
2899 { 2901 {
@@ -3264,8 +3266,10 @@ void LLFolderView::draw()
3264 setShowSingleSelection(FALSE); 3266 setShowSingleSelection(FALSE);
3265 } 3267 }
3266 3268
3269 static F32 *sTypeAheadTimeout = rebind_llcontrol<F32>("TypeAheadTimeout", &gSavedSettings, true);
3270
3267 3271
3268 if (mSearchTimer.getElapsedTimeF32() > gSavedSettings.getF32("TypeAheadTimeout") || !mSearchString.size()) 3272 if (mSearchTimer.getElapsedTimeF32() > *sTypeAheadTimeout || !mSearchString.size())
3269 { 3273 {
3270 mSearchString.clear(); 3274 mSearchString.clear();
3271 } 3275 }
@@ -3995,8 +3999,11 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char)
3995 LLMenuGL::sMenuContainer->hideMenus(); 3999 LLMenuGL::sMenuContainer->hideMenus();
3996 } 4000 }
3997 4001
4002 static F32 *sTypeAheadTimeout = rebind_llcontrol<F32>("TypeAheadTimeout", &gSavedSettings, true);
4003
4004
3998 //do text search 4005 //do text search
3999 if (mSearchTimer.getElapsedTimeF32() > gSavedSettings.getF32("TypeAheadTimeout")) 4006 if (mSearchTimer.getElapsedTimeF32() > *sTypeAheadTimeout)
4000 { 4007 {
4001 mSearchString.clear(); 4008 mSearchString.clear();
4002 } 4009 }
@@ -4340,10 +4347,10 @@ void LLFolderView::doIdle()
4340{ 4347{
4341 LLFastTimer t2(LLFastTimer::FTM_INVENTORY); 4348 LLFastTimer t2(LLFastTimer::FTM_INVENTORY);
4342 4349
4343 BOOL debug_filters = gSavedSettings.getBOOL("DebugInventoryFilters"); 4350 static BOOL* debug_filters = rebind_llcontrol<BOOL>("DebugInventoryFilters", &gSavedSettings, true);
4344 if (debug_filters != getDebugFilters()) 4351 if (*debug_filters != getDebugFilters())
4345 { 4352 {
4346 mDebugFilters = debug_filters; 4353 mDebugFilters = *debug_filters;
4347 arrangeAll(); 4354 arrangeAll();
4348 } 4355 }
4349 4356
diff --git a/linden/indra/newview/llgroupnotify.cpp b/linden/indra/newview/llgroupnotify.cpp
index d906633..1b00dfb 100644
--- a/linden/indra/newview/llgroupnotify.cpp
+++ b/linden/indra/newview/llgroupnotify.cpp
@@ -115,7 +115,10 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
115 setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); 115 setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
116 setBackgroundVisible(TRUE); 116 setBackgroundVisible(TRUE);
117 setBackgroundOpaque(TRUE); 117 setBackgroundOpaque(TRUE);
118 setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); 118
119 static LLColor4* sGroupNotifyBoxColor = rebind_llcontrol<LLColor4>("GroupNotifyBoxColor", &gColors, true);
120
121 setBackgroundColor( (*sGroupNotifyBoxColor) );
119 122
120 LLIconCtrl* icon; 123 LLIconCtrl* icon;
121 LLTextEditor* text; 124 LLTextEditor* text;
@@ -133,7 +136,10 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
133 setFontStyle(LLFontGL::DROP_SHADOW_SOFT); 136 setFontStyle(LLFontGL::DROP_SHADOW_SOFT);
134 setBorderVisible(FALSE); 137 setBorderVisible(FALSE);
135 setColor( gColors.getColor("GroupNotifyTextColor") ); 138 setColor( gColors.getColor("GroupNotifyTextColor") );
136 setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") ); 139
140 static LLColor4* sGroupNotifyBoxColor = rebind_llcontrol<LLColor4>("GroupNotifyBoxColor", &gColors, true);
141
142 setBackgroundColor( (*sGroupNotifyBoxColor) );
137 } 143 }
138 }; 144 };
139 145
diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp
index 58d2c6a..2c0431b 100644
--- a/linden/indra/newview/llhudeffectlookat.cpp
+++ b/linden/indra/newview/llhudeffectlookat.cpp
@@ -299,14 +299,14 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys)
299 299
300 300
301 bool is_self = source_avatar->isSelf(); 301 bool is_self = source_avatar->isSelf();
302 bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); 302 static BOOL *sPrivateLookAtTarget = rebind_llcontrol<BOOL>("PrivateLookAtTarget", &gSavedSettings, true);
303 if (!is_self) //imprudence TODO: find out why this happens at all and fix there 303 if (!is_self) //imprudence TODO: find out why this happens at all and fix there
304 { 304 {
305 LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL; 305 LL_DEBUGS("HUDEffect")<< "Non-self Avatar HUDEffectLookAt message for ID: " << source_avatar->getID().asString() << LL_ENDL;
306 markDead(); 306 markDead();
307 return; 307 return;
308 } 308 }
309 else if (is_private && target_type != LOOKAT_TARGET_AUTO_LISTEN) 309 else if (*sPrivateLookAtTarget && target_type != LOOKAT_TARGET_AUTO_LISTEN)
310 { 310 {
311 //this mimicks "do nothing" 311 //this mimicks "do nothing"
312 target_type = LOOKAT_TARGET_AUTO_LISTEN; 312 target_type = LOOKAT_TARGET_AUTO_LISTEN;
@@ -574,7 +574,8 @@ void LLHUDEffectLookAt::render()
574 } gGL.end(); 574 } gGL.end();
575 gGL.popMatrix(); 575 gGL.popMatrix();
576 576
577 if( gSavedSettings.getBOOL("ShowLookAtNames") ) 577 static BOOL *sEmeraldShowLookAtNames = rebind_llcontrol<BOOL>("ShowLookAtNames", &gSavedSettings, true);
578 if (*sEmeraldShowLookAtNames)
578 { 579 {
579 const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); 580 const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL );
580 LLGLEnable color_mat(GL_COLOR_MATERIAL); 581 LLGLEnable color_mat(GL_COLOR_MATERIAL);
diff --git a/linden/indra/newview/llhudeffecttrail.cpp b/linden/indra/newview/llhudeffecttrail.cpp
index 08f4c78..1b0f3b3 100644
--- a/linden/indra/newview/llhudeffecttrail.cpp
+++ b/linden/indra/newview/llhudeffecttrail.cpp
@@ -181,7 +181,9 @@ void LLHUDEffectSpiral::triggerLocal()
181{ 181{
182 mKillTime = mTimer.getElapsedTimeF32() + mDuration; 182 mKillTime = mTimer.getElapsedTimeF32() + mDuration;
183 183
184 BOOL show_beam = gSavedSettings.getBOOL("ShowSelectionBeam"); 184 static BOOL* sShowSelectionBeam = rebind_llcontrol<BOOL>("ShowSelectionBeam", &gSavedSettings, true);
185
186 BOOL show_beam = *sShowSelectionBeam;
185 187
186 LLColor4 color; 188 LLColor4 color;
187 color.setVec(mColor); 189 color.setVec(mColor);
@@ -278,10 +280,12 @@ void LLHUDEffectSpiral::render()
278{ 280{
279 F32 time = mTimer.getElapsedTimeF32(); 281 F32 time = mTimer.getElapsedTimeF32();
280 282
283 static BOOL* sShowSelectionBeam = rebind_llcontrol<BOOL>("ShowSelectionBeam", &gSavedSettings, true);
284
281 if ((!mSourceObject.isNull() && mSourceObject->isDead()) || 285 if ((!mSourceObject.isNull() && mSourceObject->isDead()) ||
282 (!mTargetObject.isNull() && mTargetObject->isDead()) || 286 (!mTargetObject.isNull() && mTargetObject->isDead()) ||
283 mKillTime < time || 287 mKillTime < time ||
284 (!mPartSourcep.isNull() && !gSavedSettings.getBOOL("ShowSelectionBeam")) ) 288 (!mPartSourcep.isNull() && !*sShowSelectionBeam) )
285 { 289 {
286 markDead(); 290 markDead();
287 return; 291 return;
diff --git a/linden/indra/newview/llhudtext.cpp b/linden/indra/newview/llhudtext.cpp
index 661a786..7d9f7f9 100644
--- a/linden/indra/newview/llhudtext.cpp
+++ b/linden/indra/newview/llhudtext.cpp
@@ -292,9 +292,14 @@ void LLHUDText::renderText(BOOL for_select)
292 // *TODO: cache this image 292 // *TODO: cache this image
293 LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); 293 LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
294 294
295 static LLColor4* sBackgroundChatColor = rebind_llcontrol<LLColor4>("BackgroundChatColor", &gSavedSettings, true);
296
295 // *TODO: make this a per-text setting 297 // *TODO: make this a per-text setting
296 LLColor4 bg_color = gSavedSettings.getColor4("BackgroundChatColor"); 298 LLColor4 bg_color = *sBackgroundChatColor;
297 bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); 299
300 static F32* sChatBubbleOpacity = rebind_llcontrol<F32>("ChatBubbleOpacity", &gSavedSettings, true);
301
302 bg_color.setAlpha(*sChatBubbleOpacity * alpha_factor);
298 303
299 const S32 border_height = 16; 304 const S32 border_height = 16;
300 const S32 border_width = 16; 305 const S32 border_width = 16;
@@ -394,7 +399,7 @@ void LLHUDText::renderText(BOOL for_select)
394 { 399 {
395 LLUI::pushMatrix(); 400 LLUI::pushMatrix();
396 { 401 {
397 gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); 402 gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], *sChatBubbleOpacity * alpha_factor);
398 LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec; 403 LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec;
399 LLVector3 label_offset = height_vec - label_height; 404 LLVector3 label_offset = height_vec - label_height;
400 LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]); 405 LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]);
diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp
index 12a26f9..a6eaeb3 100644
--- a/linden/indra/newview/llimview.cpp
+++ b/linden/indra/newview/llimview.cpp
@@ -548,19 +548,13 @@ LLColor4 get_extended_text_color(const LLUUID session_id, const LLUUID other_par
548{ 548{
549 if (gSavedSettings.getBOOL("HighlightOwnNameInIM") && (other_partecipant_id != LLUUID::null)) 549 if (gSavedSettings.getBOOL("HighlightOwnNameInIM") && (other_partecipant_id != LLUUID::null))
550 { 550 {
551 LLDynamicArray<LLGroupData>::iterator i; 551 if (LLFloaterChat::isOwnNameInText(msg))
552 for (i = gAgent.mGroups.begin(); i != gAgent.mGroups.end(); i++) 552 return gSavedSettings.getColor4("OwnNameChatColor");
553 {
554 if (i->mID == session_id)
555 {
556 if (LLFloaterChat::isOwnNameInText(msg))
557 return gSavedSettings.getColor4("OwnNameChatColor");
558 else
559 break;
560 }
561 }
562 } 553 }
563 554
555 if (gSavedSettings.getBOOL("HighlightFriendsChat") && is_agent_friend(other_partecipant_id))
556 return gSavedSettings.getColor4("FriendsChatColor");
557
564 return defaultColor; 558 return defaultColor;
565} 559}
566 560
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp
index 30b0a4a..0f999fc 100644
--- a/linden/indra/newview/llinventorybridge.cpp
+++ b/linden/indra/newview/llinventorybridge.cpp
@@ -3107,7 +3107,27 @@ void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
3107 } 3107 }
3108 items.push_back(std::string("Edit WindLight Settings")); 3108 items.push_back(std::string("Edit WindLight Settings"));
3109 } 3109 }
3110 else
3111 {
3112 items.push_back(std::string("Open"));
3113 }
3110 items.push_back(std::string("Properties")); 3114 items.push_back(std::string("Properties"));
3115
3116 // RLVa stuff copied from LLInvFVBridge::buildContextMenu
3117 // [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c
3118 if (rlv_handler_t::isEnabled())
3119 {
3120 LLInventoryObject* pItem = (mInventoryPanel->getModel()) ? mInventoryPanel->getModel()->getObject(mUUID) : NULL;
3121 if ( (pItem) &&
3122 ( ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))) ||
3123 ((LLAssetType::AT_LSL_TEXT == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT))) ||
3124 ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) )
3125 {
3126 disabled_items.push_back(std::string("Open"));
3127 }
3128 }
3129 // [/RLVa:KB]
3130
3111 getClipboardEntries(true, items, disabled_items, flags); 3131 getClipboardEntries(true, items, disabled_items, flags);
3112 } 3132 }
3113 hideContextEntries(menu, items, disabled_items); 3133 hideContextEntries(menu, items, disabled_items);
diff --git a/linden/indra/newview/llmediaremotectrl.cpp b/linden/indra/newview/llmediaremotectrl.cpp
index f2ec414..67cb758 100644
--- a/linden/indra/newview/llmediaremotectrl.cpp
+++ b/linden/indra/newview/llmediaremotectrl.cpp
@@ -151,8 +151,11 @@ void LLMediaRemoteCtrl::enableMediaButtons()
151 bool play_music_enabled = false; 151 bool play_music_enabled = false;
152 bool stop_music_enabled = false; 152 bool stop_music_enabled = false;
153 bool media_show_pause = false; 153 bool media_show_pause = false;
154 LLColor4 music_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); 154
155 LLColor4 media_icon_color = LLUI::sColorsGroup->getColor( "IconDisabledColor" ); 155 static LLColor4* sIconDisabledColor = rebind_llcontrol<LLColor4>("IconDisabledColor", &gColors, true);
156
157 LLColor4 music_icon_color = (*sIconDisabledColor).getValue();
158 LLColor4 media_icon_color = (*sIconDisabledColor).getValue();
156 std::string media_type = "none/none"; 159 std::string media_type = "none/none";
157 160
158 // Put this in xui file 161 // Put this in xui file
@@ -161,7 +164,7 @@ void LLMediaRemoteCtrl::enableMediaButtons()
161 164
162 if (gSavedSettings.getBOOL("AudioStreamingVideo")) 165 if (gSavedSettings.getBOOL("AudioStreamingVideo"))
163 { 166 {
164 if ( parcel && parcel->getMediaURL()[0]) 167 if ( parcel && !parcel->getMediaURL().empty())
165 { 168 {
166 // Set the tooltip 169 // Set the tooltip
167 // Put this text into xui file 170 // Put this text into xui file
@@ -197,10 +200,10 @@ void LLMediaRemoteCtrl::enableMediaButtons()
197 } 200 }
198 } 201 }
199 } 202 }
203
200 if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop) 204 if (gSavedSettings.getBOOL("AudioStreamingMusic") && gAudiop)
201 { 205 {
202 206 if ( parcel && !parcel->getMusicURL().empty())
203 if ( parcel && parcel->getMusicURL()[0])
204 { 207 {
205 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" ); 208 music_icon_color = LLUI::sColorsGroup->getColor( "IconEnabledColor" );
206 209
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp
index 8f7dd03..8a12ff3 100644
--- a/linden/indra/newview/llnetmap.cpp
+++ b/linden/indra/newview/llnetmap.cpp
@@ -350,11 +350,21 @@ void LLNetMap::draw()
350 F32 min_pick_dist = mDotRadius * MIN_PICK_SCALE; 350 F32 min_pick_dist = mDotRadius * MIN_PICK_SCALE;
351 351
352 // Draw avatars 352 // Draw avatars
353 LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); 353 static LLColor4* sMapAvatar = rebind_llcontrol<LLColor4>("MapAvatar", &gColors, true);
354 LLColor4 friend_color = gColors.getColor( "MapFriend" ); 354 LLColor4 avatar_color = (*sMapAvatar).getValue();
355 LLColor4 muted_color = gColors.getColor( "MapMuted" ); 355
356 LLColor4 selected_color = gColors.getColor( "MapSelected" ); 356 static LLColor4* sMapFriend = rebind_llcontrol<LLColor4>("MapFriend", &gColors, true);
357 LLColor4 imp_dev_color = gColors.getColor( "MapImpDev" ); 357 LLColor4 friend_color = (*sMapFriend).getValue();
358
359 static LLColor4* sMapMuted = rebind_llcontrol<LLColor4>("MapMuted", &gColors, true);
360 LLColor4 muted_color = (*sMapMuted).getValue();
361
362 static LLColor4* sMapSelected = rebind_llcontrol<LLColor4>("MapSelected", &gColors, true);
363 LLColor4 selected_color = (*sMapSelected).getValue();
364
365 static LLColor4* sMapImpDev = rebind_llcontrol<LLColor4>("MapImpDev", &gColors, true);
366 LLColor4 imp_dev_color = (*sMapImpDev).getValue();
367
358 LLColor4 glyph_color; 368 LLColor4 glyph_color;
359 int selected = -1; 369 int selected = -1;
360 370
diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp
index ef57aaf..1a7b247 100644
--- a/linden/indra/newview/llnotify.cpp
+++ b/linden/indra/newview/llnotify.cpp
@@ -227,7 +227,10 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification,
227 227
228 caution_box->setFontStyle(LLFontGL::BOLD); 228 caution_box->setFontStyle(LLFontGL::BOLD);
229 caution_box->setColor(gColors.getColor("NotifyCautionWarnColor")); 229 caution_box->setColor(gColors.getColor("NotifyCautionWarnColor"));
230 caution_box->setBackgroundColor(gColors.getColor("NotifyCautionBoxColor")); 230
231 static LLColor4* sNotifyCautionBoxColor = rebind_llcontrol<LLColor4>("NotifyCautionBoxColor", &gColors, true);
232
233 caution_box->setBackgroundColor((*sNotifyCautionBoxColor));
231 caution_box->setBorderVisible(FALSE); 234 caution_box->setBorderVisible(FALSE);
232 caution_box->setWrappedText(notification->getMessage()); 235 caution_box->setWrappedText(notification->getMessage());
233 236
@@ -485,7 +488,10 @@ void LLNotifyBox::drawBackground() const
485 { 488 {
486 gGL.getTexUnit(0)->bind(imagep->getImage()); 489 gGL.getTexUnit(0)->bind(imagep->getImage());
487 // set proper background color depending on whether notify box is a caution or not 490 // set proper background color depending on whether notify box is a caution or not
488 LLColor4 color = mIsCaution? gColors.getColor("NotifyCautionBoxColor") : gColors.getColor("NotifyBoxColor"); 491 static LLColor4* sNotifyCautionBoxColor = rebind_llcontrol<LLColor4>("NotifyCautionBoxColor", &gColors, true);
492 static LLColor4* sNotifyBoxColor = rebind_llcontrol<LLColor4>("NotifyBoxColor", &gColors, true);
493
494 LLColor4 color = mIsCaution? (*sNotifyCautionBoxColor) : (*sNotifyBoxColor);
489 if(gFocusMgr.childHasKeyboardFocus( this )) 495 if(gFocusMgr.childHasKeyboardFocus( this ))
490 { 496 {
491 const S32 focus_width = 2; 497 const S32 focus_width = 2;
@@ -500,9 +506,9 @@ void LLNotifyBox::drawBackground() const
500 gl_segmented_rect_2d_tex(0, getRect().getHeight(), getRect().getWidth(), 0, imagep->getTextureWidth(), imagep->getTextureHeight(), 16, mIsTip ? ROUNDED_RECT_TOP : ROUNDED_RECT_BOTTOM); 506 gl_segmented_rect_2d_tex(0, getRect().getHeight(), getRect().getWidth(), 0, imagep->getTextureWidth(), imagep->getTextureHeight(), 16, mIsTip ? ROUNDED_RECT_TOP : ROUNDED_RECT_BOTTOM);
501 507
502 if( mIsCaution ) 508 if( mIsCaution )
503 color = gColors.getColor("NotifyCautionBoxColor"); 509 color = (*sNotifyCautionBoxColor);
504 else 510 else
505 color = gColors.getColor("NotifyBoxColor"); 511 color = (*sNotifyBoxColor);
506 512
507 gGL.color4fv(color.mV); 513 gGL.color4fv(color.mV);
508 gl_segmented_rect_2d_tex(1, getRect().getHeight()-1, getRect().getWidth()-1, 1, imagep->getTextureWidth(), imagep->getTextureHeight(), 16, mIsTip ? ROUNDED_RECT_TOP : ROUNDED_RECT_BOTTOM); 514 gl_segmented_rect_2d_tex(1, getRect().getHeight()-1, getRect().getWidth()-1, 1, imagep->getTextureWidth(), imagep->getTextureHeight(), 16, mIsTip ? ROUNDED_RECT_TOP : ROUNDED_RECT_BOTTOM);
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp
index 6191a01..14ae3ff 100644
--- a/linden/indra/newview/lloverlaybar.cpp
+++ b/linden/indra/newview/lloverlaybar.cpp
@@ -359,19 +359,22 @@ void LLOverlayBar::refresh()
359 // update "remotes" 359 // update "remotes"
360 childSetVisible("media_remote_container", TRUE); 360 childSetVisible("media_remote_container", TRUE);
361 childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled()); 361 childSetVisible("voice_remote_container", LLVoiceClient::voiceEnabled());
362 childSetVisible("windlight_remote_container", gSavedSettings.getBOOL("EnableWindlightRemote")); 362 static BOOL *sEnableWindlightRemote = rebind_llcontrol<BOOL>("EnableWindlightRemote", &gSavedSettings, true);
363 childSetVisible("ao_remote_container", gSavedSettings.getBOOL("EnableAORemote")); 363 childSetVisible("windlight_remote_container", (*sEnableWindlightRemote));
364 static BOOL *sEnableAORemote = rebind_llcontrol<BOOL>("EnableAORemote", &gSavedSettings, true);
365 childSetVisible("ao_remote_container", (*sEnableAORemote));
364 childSetVisible("state_buttons", TRUE); 366 childSetVisible("state_buttons", TRUE);
365 } 367 }
366 368
369 static BOOL *sChatVisible = rebind_llcontrol<BOOL>("ChatVisible", &gSavedSettings, true);
367 // always let user toggle into and out of chatbar 370 // always let user toggle into and out of chatbar
368 childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible")); 371 childSetVisible("chat_bar", *sChatVisible);//gSavedSettings.getBOOL("ChatVisible"));
372
369 373
370 if (buttons_changed) 374 if (buttons_changed)
371 { 375 {
372 layoutButtons(); 376 layoutButtons();
373 } 377 }
374
375} 378}
376 379
377//----------------------------------------------------------------------- 380//-----------------------------------------------------------------------
diff --git a/linden/indra/newview/llpanelaudiovolume.cpp b/linden/indra/newview/llpanelaudiovolume.cpp
index 5045e8f..bb10f80 100644
--- a/linden/indra/newview/llpanelaudiovolume.cpp
+++ b/linden/indra/newview/llpanelaudiovolume.cpp
@@ -67,8 +67,9 @@ LLPanelAudioVolume::~LLPanelAudioVolume ()
67// 67//
68void LLPanelAudioVolume::draw() 68void LLPanelAudioVolume::draw()
69{ 69{
70 BOOL mute = gSavedSettings.getBOOL("MuteAudio"); 70
71 bool enable = mute ? false : true; 71 static BOOL* sMuteAudio = rebind_llcontrol<BOOL>("MuteAudio", &gSavedSettings, true);
72 bool enable = (*sMuteAudio) ? false : true;
72 childSetEnabled("Music Volume", enable); 73 childSetEnabled("Music Volume", enable);
73 childSetEnabled("Media Volume", enable); 74 childSetEnabled("Media Volume", enable);
74 childSetEnabled("Voice Volume", enable); 75 childSetEnabled("Voice Volume", enable);
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index 33f4cd6..e88a16a 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -1499,13 +1499,15 @@ void LLPanelAvatar::resetGroupList()
1499 row["columns"][0]["width"] = 0; 1499 row["columns"][0]["width"] = 0;
1500 if (group_data.mListInProfile) 1500 if (group_data.mListInProfile)
1501 { 1501 {
1502 static LLColor4 *sScrollUnselectedColor = rebind_llcontrol<LLColor4>("ScrollUnselectedColor", LLUI::sColorsGroup, true);
1502 row["columns"][0]["value"] = group_string; 1503 row["columns"][0]["value"] = group_string;
1503 row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue(); 1504 row["columns"][0]["color"] = (*sScrollUnselectedColor).getValue();
1504 } 1505 }
1505 else 1506 else
1506 { 1507 {
1508 static LLColor4 *sScrollReadOnlyColor = rebind_llcontrol<LLColor4>("ScrollReadOnlyColor", LLUI::sColorsGroup, true);
1507 row["columns"][0]["value"] = group_string + " " + getString("HiddenLabel"); 1509 row["columns"][0]["value"] = group_string + " " + getString("HiddenLabel");
1508 row["columns"][0]["color"] = gColors.getColor("ScrollReadOnlyColor").getValue(); 1510 row["columns"][0]["color"] = (*sScrollReadOnlyColor).getValue();
1509 } 1511 }
1510 group_list->addElement(row); 1512 group_list->addElement(row);
1511 } 1513 }
@@ -2063,13 +2065,15 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
2063 // Set normal color if not found or if group is visible in profile 2065 // Set normal color if not found or if group is visible in profile
2064 if (!group_data || group_data->mListInProfile) 2066 if (!group_data || group_data->mListInProfile)
2065 { 2067 {
2068 static LLColor4 *sScrollUnselectedColor = rebind_llcontrol<LLColor4>("ScrollUnselectedColor", LLUI::sColorsGroup, true);
2066 row["columns"][0]["value"] = group_string; 2069 row["columns"][0]["value"] = group_string;
2067 row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue(); 2070 row["columns"][0]["color"] = (*sScrollUnselectedColor).getValue();
2068 } 2071 }
2069 else 2072 else
2070 { 2073 {
2074 static LLColor4 *sScrollReadOnlyColor = rebind_llcontrol<LLColor4>("ScrollReadOnlyColor", LLUI::sColorsGroup, true);
2071 row["columns"][0]["value"] = group_string + " " + self->getString("HiddenLabel"); 2075 row["columns"][0]["value"] = group_string + " " + self->getString("HiddenLabel");
2072 row["columns"][0]["color"] = gColors.getColor("ScrollReadOnlyColor").getValue(); 2076 row["columns"][0]["color"] = (*sScrollReadOnlyColor).getValue();
2073 } 2077 }
2074 if (group_list) 2078 if (group_list)
2075 { 2079 {
diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp
index b2313f6..e17ba2b 100644
--- a/linden/indra/newview/llpaneldisplay.cpp
+++ b/linden/indra/newview/llpaneldisplay.cpp
@@ -325,8 +325,9 @@ BOOL LLPanelDisplay::postBuild()
325 mLightingText = getChild<LLTextBox>("LightingDetailText"); 325 mLightingText = getChild<LLTextBox>("LightingDetailText");
326 mMeshDetailText = getChild<LLTextBox>("MeshDetailText"); 326 mMeshDetailText = getChild<LLTextBox>("MeshDetailText");
327 327
328 childSetValue("toggle_windlight_control", gSavedSettings.getBOOL("EnableWindlightRemote")); 328 static BOOL* sEnableWindlightRemote = rebind_llcontrol<BOOL>("EnableWindlightRemote", &gSavedSettings, true);
329 mWLControl = gSavedSettings.getBOOL("EnableWindlightRemote"); 329 childSetValue("toggle_windlight_control", (*sEnableWindlightRemote));
330 mWLControl = (*sEnableWindlightRemote);
330 331
331 refresh(); 332 refresh();
332 333
@@ -387,7 +388,8 @@ void LLPanelDisplay::refresh()
387 mCustomSettings = gSavedSettings.getBOOL("RenderCustomSettings"); 388 mCustomSettings = gSavedSettings.getBOOL("RenderCustomSettings");
388 389
389 // shader settings 390 // shader settings
390 mBumpShiny = gSavedSettings.getBOOL("RenderObjectBump"); 391 static BOOL* sRenderObjectBump = rebind_llcontrol<BOOL>("RenderObjectBump", &gSavedSettings, true);
392 mBumpShiny = *sRenderObjectBump;
391 mShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable"); 393 mShaderEnable = gSavedSettings.getBOOL("VertexShaderEnable");
392 mWindLight = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); 394 mWindLight = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
393 mReflections = gSavedSettings.getBOOL("RenderWaterReflections"); 395 mReflections = gSavedSettings.getBOOL("RenderWaterReflections");
@@ -418,7 +420,8 @@ void LLPanelDisplay::refresh()
418 mTerrainDetail = gSavedSettings.getS32("RenderTerrainDetail"); 420 mTerrainDetail = gSavedSettings.getS32("RenderTerrainDetail");
419 421
420 // windlight remote 422 // windlight remote
421 mWLControl = gSavedSettings.getBOOL("EnableWindlightRemote"); 423 static BOOL* sEnableWindlightRemote = rebind_llcontrol<BOOL>("EnableWindlightRemote", &gSavedSettings, true);
424 mWLControl = (*sEnableWindlightRemote);
422 425
423 // max avatar count 426 // max avatar count
424 mAvatarMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible"); 427 mAvatarMaxVisible = gSavedSettings.getS32("RenderAvatarMaxVisible");
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp
index cb0416e..aa62b34 100644
--- a/linden/indra/newview/llprefsadvanced.cpp
+++ b/linden/indra/newview/llprefsadvanced.cpp
@@ -83,8 +83,10 @@ BOOL LLPrefsAdvanced::postBuild()
83{ 83{
84 childSetValue("disable_log_screen_check", gSavedSettings.getBOOL("DisableLoginLogoutScreens")); 84 childSetValue("disable_log_screen_check", gSavedSettings.getBOOL("DisableLoginLogoutScreens"));
85 childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens")); 85 childSetValue("disable_tp_screen_check", gSavedSettings.getBOOL("DisableTeleportScreens"));
86 childSetValue("client_name_tag_check", gSavedSettings.getBOOL("ShowClientNameTag")); 86 static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true);
87 childSetValue("client_name_color_check", gSavedSettings.getBOOL("ShowClientColor")); 87 childSetValue("client_name_tag_check", (*sShowClientNameTag));
88 static BOOL* sShowClientColor = rebind_llcontrol<BOOL>("ShowClientColor", &gSavedSettings, true);
89 childSetValue("client_name_color_check", (*sShowClientColor));
88 childSetValue("client_name_hover_check", gSavedSettings.getBOOL("ShowClientNameHoverTip")); 90 childSetValue("client_name_hover_check", gSavedSettings.getBOOL("ShowClientNameHoverTip"));
89 childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers")); 91 childSetValue("client_name_tag_broadcast_check", gSavedSettings.getBOOL("ShowMyClientTagToOthers"));
90 childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP")); 92 childSetValue("http_texture_check", gSavedSettings.getBOOL("ImagePipelineUseHTTP"));
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp
index b4614b8..6ebc880 100644
--- a/linden/indra/newview/llprefschat.cpp
+++ b/linden/indra/newview/llprefschat.cpp
@@ -140,9 +140,10 @@ void LLPrefsChatImpl::refreshValues()
140 mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim"); 140 mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim");
141 mChatChannel = gSavedSettings.getBOOL("ChatChannelSelect"); 141 mChatChannel = gSavedSettings.getBOOL("ChatChannelSelect");
142 mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity"); 142 mConsoleOpacity = gSavedSettings.getF32("ConsoleBackgroundOpacity");
143 mBubbleOpacity = gSavedSettings.getF32("ChatBubbleOpacity");
144 mTranslateLanguage = gSavedSettings.getString("TranslateLanguage"); 143 mTranslateLanguage = gSavedSettings.getString("TranslateLanguage");
145 mTranslateChat = gSavedSettings.getBOOL("TranslateChat"); 144 mTranslateChat = gSavedSettings.getBOOL("TranslateChat");
145 static F32* sChatBubbleOpacity = rebind_llcontrol<F32>("ChatBubbleOpacity", &gSavedSettings, true);
146 mBubbleOpacity = *sChatBubbleOpacity;
146} 147}
147 148
148void LLPrefsChatImpl::cancel() 149void LLPrefsChatImpl::cancel()
diff --git a/linden/indra/newview/llpreviewlandmark.cpp b/linden/indra/newview/llpreviewlandmark.cpp
index 07addad..a8a510f 100644
--- a/linden/indra/newview/llpreviewlandmark.cpp
+++ b/linden/indra/newview/llpreviewlandmark.cpp
@@ -89,10 +89,12 @@ LLPreviewLandmark::LLPreviewLandmark(const std::string& name,
89 inv_item), 89 inv_item),
90 mLandmark( NULL ) 90 mLandmark( NULL )
91{ 91{
92
93 mFactoryMap["place_details_panel"] = LLCallbackMap(LLPreviewLandmark::createPlaceDetail, this); 92 mFactoryMap["place_details_panel"] = LLCallbackMap(LLPreviewLandmark::createPlaceDetail, this);
94 if (show_keep_discard) 93 if (show_keep_discard)
95 { 94 {
95 // Move the notification in llviewermessage in the if/else there please.
96 // This class is no more called if show_keep_discard != TRUE -- Ele
97
96 // Decided against this, a text notification is a better fix for this -- McCabe 98 // Decided against this, a text notification is a better fix for this -- McCabe
97 //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_new_landmark.xml", &getFactoryMap()); 99 //LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_new_landmark.xml", &getFactoryMap());
98 //childSetAction("Discard btn",onDiscardBtn,this); 100 //childSetAction("Discard btn",onDiscardBtn,this);
diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp
index 31b537c..c1d5ff3 100644
--- a/linden/indra/newview/llspatialpartition.cpp
+++ b/linden/indra/newview/llspatialpartition.cpp
@@ -1302,7 +1302,11 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
1302{ 1302{
1303 if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1) 1303 if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1)
1304 { 1304 {
1305 if (earlyFail(camera, this)) 1305 static LLCachedControl<BOOL> render_water_void_culling("RenderWaterVoidCulling", TRUE);
1306 // Don't cull hole/edge water, unless RenderWaterVoidCulling is set and we have the GL_ARB_depth_clamp extension.
1307 if ((mSpatialPartition->mDrawableType == LLPipeline::RENDER_TYPE_VOIDWATER &&
1308 !(render_water_void_culling && gGLManager.mHasDepthClamp)) ||
1309 earlyFail(camera, this))
1306 { 1310 {
1307 setState(LLSpatialGroup::DISCARD_QUERY); 1311 setState(LLSpatialGroup::DISCARD_QUERY);
1308 assert_states_valid(this); 1312 assert_states_valid(this);
@@ -1324,11 +1328,28 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
1324 buildOcclusion(); 1328 buildOcclusion();
1325 } 1329 }
1326 1330
1331 // Depth clamp all water to avoid it being culled as a result of being
1332 // behind the far clip plane, and in the case of edge water to avoid
1333 // it being culled while still visible.
1334 bool const use_depth_clamp =
1335 gGLManager.mHasDepthClamp &&
1336 (mSpatialPartition->mDrawableType == LLPipeline::RENDER_TYPE_WATER ||
1337 mSpatialPartition->mDrawableType == LLPipeline::RENDER_TYPE_VOIDWATER);
1338 if (use_depth_clamp)
1339 {
1340 glEnable(GL_DEPTH_CLAMP);
1341 }
1342
1327 glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mOcclusionQuery); 1343 glBeginQueryARB(GL_SAMPLES_PASSED_ARB, mOcclusionQuery);
1328 glVertexPointer(3, GL_FLOAT, 0, mOcclusionVerts); 1344 glVertexPointer(3, GL_FLOAT, 0, mOcclusionVerts);
1329 glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, 1345 glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
1330 GL_UNSIGNED_BYTE, get_box_fan_indices(camera, mBounds[0])); 1346 GL_UNSIGNED_BYTE, get_box_fan_indices(camera, mBounds[0]));
1331 glEndQueryARB(GL_SAMPLES_PASSED_ARB); 1347 glEndQueryARB(GL_SAMPLES_PASSED_ARB);
1348
1349 if (use_depth_clamp)
1350 {
1351 glDisable(GL_DEPTH_CLAMP);
1352 }
1332 } 1353 }
1333 1354
1334 setState(LLSpatialGroup::QUERY_PENDING); 1355 setState(LLSpatialGroup::QUERY_PENDING);
@@ -2280,9 +2301,10 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE)
2280 gGL.color4f(0.5f,0.5f,0.5f,1.0f); 2301 gGL.color4f(0.5f,0.5f,0.5f,1.0f);
2281 break; 2302 break;
2282 case LLViewerObject::LL_VO_PART_GROUP: 2303 case LLViewerObject::LL_VO_PART_GROUP:
2283 case LLViewerObject::LL_VO_HUD_PART_GROUP: 2304 case LLViewerObject::LL_VO_HUD_PART_GROUP:
2284 gGL.color4f(0,0,1,1); 2305 gGL.color4f(0,0,1,1);
2285 break; 2306 break;
2307 case LLViewerObject::LL_VO_VOID_WATER:
2286 case LLViewerObject::LL_VO_WATER: 2308 case LLViewerObject::LL_VO_WATER:
2287 gGL.color4f(0,0.5f,1,1); 2309 gGL.color4f(0,0.5f,1,1);
2288 break; 2310 break;
diff --git a/linden/indra/newview/llspatialpartition.h b/linden/indra/newview/llspatialpartition.h
index df96152..be0163b 100644
--- a/linden/indra/newview/llspatialpartition.h
+++ b/linden/indra/newview/llspatialpartition.h
@@ -481,7 +481,6 @@ private:
481 drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES]; 481 drawinfo_list_t mRenderMap[LLRenderPass::NUM_RENDER_TYPES];
482}; 482};
483 483
484
485//spatial partition for water (implemented in LLVOWater.cpp) 484//spatial partition for water (implemented in LLVOWater.cpp)
486class LLWaterPartition : public LLSpatialPartition 485class LLWaterPartition : public LLSpatialPartition
487{ 486{
@@ -491,6 +490,13 @@ public:
491 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { } 490 virtual void addGeometryCount(LLSpatialGroup* group, U32 &vertex_count, U32& index_count) { }
492}; 491};
493 492
493//spatial partition for hole and edge water (implemented in LLVOWater.cpp)
494class LLVoidWaterPartition : public LLWaterPartition
495{
496public:
497 LLVoidWaterPartition();
498};
499
494//spatial partition for terrain (impelmented in LLVOSurfacePatch.cpp) 500//spatial partition for terrain (impelmented in LLVOSurfacePatch.cpp)
495class LLTerrainPartition : public LLSpatialPartition 501class LLTerrainPartition : public LLSpatialPartition
496{ 502{
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 4fd4daa..b70253e 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -193,6 +193,10 @@
193 193
194#include "llfloaterteleporthistory.h" 194#include "llfloaterteleporthistory.h"
195 195
196#if LL_DARWIN
197#include <Security/Security.h>
198#endif
199
196#if LL_LIBXUL_ENABLED 200#if LL_LIBXUL_ENABLED
197#include "llmozlib.h" 201#include "llmozlib.h"
198#endif // LL_LIBXUL_ENABLED 202#endif // LL_LIBXUL_ENABLED
@@ -1938,7 +1942,9 @@ bool idle_startup()
1938 LLFloaterActiveSpeakers::showInstance(); 1942 LLFloaterActiveSpeakers::showInstance();
1939 } 1943 }
1940 1944
1941 if (gSavedSettings.getBOOL("BeaconsEnabled")) 1945 static BOOL* sBeaconsEnabled = rebind_llcontrol<BOOL>("BeaconsEnabled", &gSavedSettings, true);
1946
1947 if (*sBeaconsEnabled)
1942 { 1948 {
1943 LLFloaterBeacons::showInstance(); 1949 LLFloaterBeacons::showInstance();
1944 } 1950 }
diff --git a/linden/indra/newview/llstatgraph.cpp b/linden/indra/newview/llstatgraph.cpp
index 26b7494..ace1731 100644
--- a/linden/indra/newview/llstatgraph.cpp
+++ b/linden/indra/newview/llstatgraph.cpp
@@ -109,7 +109,9 @@ void LLStatGraph::draw()
109 // gColors.getColor("ColorDropShadow"), 109 // gColors.getColor("ColorDropShadow"),
110 // (S32) gSavedSettings.getF32("DropShadowFloater") ); 110 // (S32) gSavedSettings.getF32("DropShadowFloater") );
111 111
112 color = gColors.getColor( "MenuDefaultBgColor" ); 112 static LLColor4* sMenuDefaultBgColor = rebind_llcontrol<LLColor4>("MenuDefaultBgColor", &gColors, true);
113 color = (*sMenuDefaultBgColor).getValue();
114
113 gGL.color4fv(color.mV); 115 gGL.color4fv(color.mV);
114 gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE); 116 gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE);
115 117
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index 366363b..fbb99f0 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -227,12 +227,15 @@ void LLStatusBar::draw()
227{ 227{
228 refresh(); 228 refresh();
229 229
230 /*static LLColor4* sColorDropShadow = rebind_llcontrol<LLColor4>("ColorDropShadow", LLUI::sColorsGroup, true);
231 static S32* sDropShadowFloater = rebind_llcontrol<S32>("DropShadowFloater", LLUI::sConfigGroup, true);
232
230 if (isBackgroundVisible()) 233 if (isBackgroundVisible())
231 { 234 {
232 gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, 235 gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
233 LLUI::sColorsGroup->getColor("ColorDropShadow"), 236 (*sColorDropShadow),
234 LLUI::sConfigGroup->getS32("DropShadowFloater") ); 237 (*sDropShadowFloater) );
235 } 238 }*/
236 LLPanel::draw(); 239 LLPanel::draw();
237} 240}
238 241
diff --git a/linden/indra/newview/llstatusbar.h b/linden/indra/newview/llstatusbar.h
index 92be319..9ed067f 100644
--- a/linden/indra/newview/llstatusbar.h
+++ b/linden/indra/newview/llstatusbar.h
@@ -121,7 +121,8 @@ public:
121 S32 getSquareMetersCommitted() const; 121 S32 getSquareMetersCommitted() const;
122 S32 getSquareMetersLeft() const; 122 S32 getSquareMetersLeft() const;
123 LLRegionDetails mRegionDetails; 123 LLRegionDetails mRegionDetails;
124 124
125 void clearBalance() { mBalance = 0; }
125private: 126private:
126 static void onCommitSearch(LLUICtrl*, void* data); 127 static void onCommitSearch(LLUICtrl*, void* data);
127 static void onClickSearch(void* data); 128 static void onClickSearch(void* data);
diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp
index a27f0e2..caaba05 100644
--- a/linden/indra/newview/llsurface.cpp
+++ b/linden/indra/newview/llsurface.cpp
@@ -1167,8 +1167,13 @@ void LLSurface::setWaterHeight(F32 height)
1167 if (!mWaterObjp.isNull()) 1167 if (!mWaterObjp.isNull())
1168 { 1168 {
1169 LLVector3 water_pos_region = mWaterObjp->getPositionRegion(); 1169 LLVector3 water_pos_region = mWaterObjp->getPositionRegion();
1170 bool changed = water_pos_region.mV[VZ] != height;
1170 water_pos_region.mV[VZ] = height; 1171 water_pos_region.mV[VZ] = height;
1171 mWaterObjp->setPositionRegion(water_pos_region); 1172 mWaterObjp->setPositionRegion(water_pos_region);
1173 if (changed)
1174 {
1175 LLWorld::getInstance()->updateWaterObjects();
1176 }
1172 } 1177 }
1173 else 1178 else
1174 { 1179 {
diff --git a/linden/indra/newview/lltexturefetch.cpp b/linden/indra/newview/lltexturefetch.cpp
index 2184478..5cad14c 100644
--- a/linden/indra/newview/lltexturefetch.cpp
+++ b/linden/indra/newview/lltexturefetch.cpp
@@ -750,7 +750,9 @@ bool LLTextureFetchWorker::doWork(S32 param)
750 750
751 if (mState == LOAD_FROM_NETWORK) 751 if (mState == LOAD_FROM_NETWORK)
752 { 752 {
753 bool get_url = gSavedSettings.getBOOL("ImagePipelineUseHTTP"); 753 static BOOL* sImagePipelineUseHTTP = rebind_llcontrol<BOOL>("ImagePipelineUseHTTP", &gSavedSettings, true);
754
755 bool get_url = *sImagePipelineUseHTTP;
754 if (!mUrl.empty()) get_url = false; 756 if (!mUrl.empty()) get_url = false;
755// if (mHost != LLHost::invalid) get_url = false; 757// if (mHost != LLHost::invalid) get_url = false;
756 if ( get_url && mCanUseHTTP && mUrl.empty())//get http url. 758 if ( get_url && mCanUseHTTP && mUrl.empty())//get http url.
diff --git a/linden/indra/newview/lltoolfocus.cpp b/linden/indra/newview/lltoolfocus.cpp
index 351c02b..ae0cd1e 100644
--- a/linden/indra/newview/lltoolfocus.cpp
+++ b/linden/indra/newview/lltoolfocus.cpp
@@ -216,10 +216,12 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
216 gAgent.setFocusGlobal(pick_info); 216 gAgent.setFocusGlobal(pick_info);
217 } 217 }
218 218
219 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
220
219 if (!(pick_info.mKeyMask & MASK_ALT) && 221 if (!(pick_info.mKeyMask & MASK_ALT) &&
220 gAgent.cameraThirdPerson() && 222 gAgent.cameraThirdPerson() &&
221 gViewerWindow->getLeftMouseDown() && 223 gViewerWindow->getLeftMouseDown() &&
222 !gSavedSettings.getBOOL("FreezeTime") && 224 !(*sFreezeTime) &&
223 (hit_obj == gAgent.getAvatarObject() || 225 (hit_obj == gAgent.getAvatarObject() ||
224 (hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf()))) 226 (hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->isSelf())))
225 { 227 {
diff --git a/linden/indra/newview/llvieweraudio.cpp b/linden/indra/newview/llvieweraudio.cpp
index f043fb5..672836d 100644
--- a/linden/indra/newview/llvieweraudio.cpp
+++ b/linden/indra/newview/llvieweraudio.cpp
@@ -114,10 +114,14 @@ void init_audio()
114 114
115void audio_update_volume(bool force_update) 115void audio_update_volume(bool force_update)
116{ 116{
117 F32 master_volume = gSavedSettings.getF32("AudioLevelMaster");
118 bool wind_muted = gSavedSettings.getBOOL("MuteWind");
119 bool mute_audio = gSavedSettings.getBOOL("MuteAudio");
120 117
118 static BOOL* sMuteAudio = rebind_llcontrol<BOOL>("MuteAudio", &gSavedSettings, true);
119 static BOOL* sMuteWind = rebind_llcontrol<BOOL>("MuteWind", &gSavedSettings, true);
120 static F32 *sAudioLevelMaster = rebind_llcontrol<F32>("AudioLevelMaster", &gSavedSettings, true);
121
122 F32 master_volume = (*sAudioLevelMaster);
123 bool wind_muted = (*sMuteWind);
124 BOOL mute_audio = (*sMuteAudio);
121 if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized"))) 125 if (!gViewerWindow->getActive() && (gSavedSettings.getBOOL("MuteWhenMinimized")))
122 { 126 {
123 mute_audio = TRUE; 127 mute_audio = TRUE;
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp
index ad186d5..5316337 100644
--- a/linden/indra/newview/llviewerdisplay.cpp
+++ b/linden/indra/newview/llviewerdisplay.cpp
@@ -602,7 +602,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
602 gFrameStats.start(LLFrameStats::UPDATE_CULL); 602 gFrameStats.start(LLFrameStats::UPDATE_CULL);
603 S32 water_clip = 0; 603 S32 water_clip = 0;
604 if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT) > 1) && 604 if ((LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT) > 1) &&
605 gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER)) 605 (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER) ||
606 gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_VOIDWATER)))
606 { 607 {
607 if (LLViewerCamera::getInstance()->cameraUnderWater()) 608 if (LLViewerCamera::getInstance()->cameraUnderWater())
608 { 609 {
diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp
index 703d233..cb02b09 100644
--- a/linden/indra/newview/llviewerimagelist.cpp
+++ b/linden/indra/newview/llviewerimagelist.cpp
@@ -156,7 +156,7 @@ void LLViewerImageList::doPreloadImages()
156 image->setAddressMode(LLTexUnit::TAM_WRAP); 156 image->setAddressMode(LLTexUnit::TAM_WRAP);
157 mImagePreloads.insert(image); 157 mImagePreloads.insert(image);
158 } 158 }
159 image = getImage(DEFAULT_WATER_NORMAL, MIPMAP_YES, IMMEDIATE_YES); 159 image = getImageFromFile(DEFAULT_WATER_NORMAL.asString()+".j2c", MIPMAP_YES, IMMEDIATE_YES,0,0,DEFAULT_WATER_NORMAL);
160 if (image) 160 if (image)
161 { 161 {
162 image->setAddressMode(LLTexUnit::TAM_WRAP); 162 image->setAddressMode(LLTexUnit::TAM_WRAP);
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index fd6e842..6ec7e46 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -457,6 +457,7 @@ void dump_inventory(void*);
457void edit_ui(void*); 457void edit_ui(void*);
458void toggle_visibility(void*); 458void toggle_visibility(void*);
459BOOL get_visibility(void*); 459BOOL get_visibility(void*);
460void reload_linden_balance(void*);
460 461
461// Avatar Pie menu 462// Avatar Pie menu
462void request_friendship(const LLUUID& agent_id); 463void request_friendship(const LLUUID& agent_id);
@@ -678,6 +679,8 @@ void init_menus()
678 gMenuHolder->childSetLabelArg("ImportUpload", "[UPLOADFEE]", fee); 679 gMenuHolder->childSetLabelArg("ImportUpload", "[UPLOADFEE]", fee);
679 gMenuHolder->childSetLabelArg("Buy and Sell L$...", "[CURRENCY]", 680 gMenuHolder->childSetLabelArg("Buy and Sell L$...", "[CURRENCY]",
680 gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); 681 gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
682 gMenuHolder->childSetLabelArg("Reload Balance", "[CURRENCY]",
683 gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
681 684
682 gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE); 685 gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE);
683 gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE); 686 gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE);
@@ -1060,6 +1063,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
1060{ 1063{
1061 menu->append(new LLMenuItemCheckGL("Use default system color picker", menu_toggle_control, NULL, menu_check_control, (void*)"UseDefaultColorPicker")); 1064 menu->append(new LLMenuItemCheckGL("Use default system color picker", menu_toggle_control, NULL, menu_check_control, (void*)"UseDefaultColorPicker"));
1062 menu->append(new LLMenuItemCheckGL("Show search panel in overlay bar", menu_toggle_control, NULL, menu_check_control, (void*)"ShowSearchBar")); 1065 menu->append(new LLMenuItemCheckGL("Show search panel in overlay bar", menu_toggle_control, NULL, menu_check_control, (void*)"ShowSearchBar"));
1066 menu->append(new LLMenuItemCallGL("Reload L$ balance", &reload_linden_balance, NULL, NULL, 'B', MASK_CONTROL | MASK_ALT));
1063 menu->appendSeparator(); 1067 menu->appendSeparator();
1064 1068
1065 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test)); 1069 menu->append(new LLMenuItemCallGL("Web Browser Test", &handle_web_browser_test));
@@ -1560,6 +1564,7 @@ void cleanup_menus()
1560{ 1564{
1561 LL_DEBUGS("AFK") << "cleanup_menus start" << LL_ENDL; 1565 LL_DEBUGS("AFK") << "cleanup_menus start" << LL_ENDL;
1562 sMenus.clear(); 1566 sMenus.clear();
1567 LLMenuGL::sMenuContainer = NULL;
1563 1568
1564 delete gMenuParcelObserver; 1569 delete gMenuParcelObserver;
1565 gMenuParcelObserver = NULL; 1570 gMenuParcelObserver = NULL;
@@ -2576,9 +2581,9 @@ bool handle_go_to_callback(const LLSD& notification, const LLSD& response)
2576 2581
2577 if (action == "teleport") 2582 if (action == "teleport")
2578 { 2583 {
2579 LLVector3d hips_offset(0.0f, 0.0f, 1.2f); 2584 pos.mdV[VZ] += gAgent.getAvatarObject()->getPelvisToFoot() + 0.2f;
2580 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); 2585 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2581 gAgent.teleportViaLocation(pos + hips_offset); 2586 gAgent.teleportViaLocationLookAt(pos);
2582 } 2587 }
2583 else if (action == "move") 2588 else if (action == "move")
2584 { 2589 {
@@ -5830,6 +5835,11 @@ class LLObjectEnableSitOrStand : public view_listener_t
5830 } 5835 }
5831}; 5836};
5832 5837
5838void reload_linden_balance(void*)
5839{
5840 LLStatusBar::sendMoneyBalanceRequest();
5841}
5842
5833void edit_ui(void*) 5843void edit_ui(void*)
5834{ 5844{
5835 LLFloater::setEditModeEnabled(!LLFloater::getEditModeEnabled()); 5845 LLFloater::setEditModeEnabled(!LLFloater::getEditModeEnabled());
@@ -7137,11 +7147,16 @@ void handle_test_female(void*)
7137 7147
7138void handle_toggle_pg(void*) 7148void handle_toggle_pg(void*)
7139{ 7149{
7140 gAgent.setTeen( !gAgent.isTeen() ); 7150 if(gSavedSettings.getBOOL("ToggleTeenMode"))
7141 7151 {
7142 LLFloaterWorldMap::reloadIcons(NULL); 7152 gAgent.setTeen( !gAgent.isTeen() );
7143 7153 LLFloaterWorldMap::reloadIcons(NULL);
7144 llinfos << "PG status set to " << (S32)gAgent.isTeen() << llendl; 7154 llinfos << "PG status set to " << (S32)gAgent.isTeen() << llendl;
7155 }
7156 else
7157 {
7158 llinfos << "Teen mode cannot be toggled on this region" << llendl;
7159 }
7145} 7160}
7146 7161
7147void handle_dump_attachments(void*) 7162void handle_dump_attachments(void*)
@@ -7504,7 +7519,9 @@ class LLViewEnableMouselook : public view_listener_t
7504 { 7519 {
7505 // You can't go directly from customize avatar to mouselook. 7520 // You can't go directly from customize avatar to mouselook.
7506 // TODO: write code with appropriate dialogs to handle this transition. 7521 // TODO: write code with appropriate dialogs to handle this transition.
7507 bool new_value = (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && !gSavedSettings.getBOOL("FreezeTime")); 7522 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
7523
7524 bool new_value = (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && !(*sFreezeTime));
7508 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 7525 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
7509 return true; 7526 return true;
7510 } 7527 }
@@ -9459,7 +9476,17 @@ class LLAdvancedToggleEditableUI : public view_listener_t
9459// become a menu_item_check. Need to add check_edit_ui(void*) 9476// become a menu_item_check. Need to add check_edit_ui(void*)
9460// or functional equivalent to do that. 9477// or functional equivalent to do that.
9461 9478
9462 9479/////////////////////
9480// Reload L$ balance //
9481/////////////////////
9482class LLAdvancedReloadBalance : public view_listener_t
9483{
9484 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
9485 {
9486 reload_linden_balance(NULL);
9487 return true;
9488 }
9489};
9463 9490
9464///////////////////// 9491/////////////////////
9465// DUMP SELECT MGR // 9492// DUMP SELECT MGR //
@@ -11276,6 +11303,7 @@ void initialize_menus()
11276 // Advanced > UI 11303 // Advanced > UI
11277 addMenu(new LLAdvancedWebBrowserTest(), "Advanced.WebBrowserTest"); 11304 addMenu(new LLAdvancedWebBrowserTest(), "Advanced.WebBrowserTest");
11278 addMenu(new LLAdvancedToggleEditableUI(), "Advanced.ToggleEditableUI"); 11305 addMenu(new LLAdvancedToggleEditableUI(), "Advanced.ToggleEditableUI");
11306 addMenu(new LLAdvancedReloadBalance(), "Advanced.ReloadBalance");
11279 //addMenu(new LLAdvancedCheckEditableUI(), "Advanced.CheckEditableUI"); 11307 //addMenu(new LLAdvancedCheckEditableUI(), "Advanced.CheckEditableUI");
11280 addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr"); 11308 addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr");
11281 addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory"); 11309 addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory");
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index bfd1045..52113ce 100755
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -922,7 +922,8 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
922 } 922 }
923 break; 923 break;
924 case LLAssetType::AT_LANDMARK: 924 case LLAssetType::AT_LANDMARK:
925 open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); 925 if (!show_keep_discard)
926 open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), FALSE, LLUUID::null, FALSE);
926 break; 927 break;
927 case LLAssetType::AT_TEXTURE: 928 case LLAssetType::AT_TEXTURE:
928 open_texture(*it, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE); 929 open_texture(*it, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
@@ -2716,43 +2717,46 @@ void process_decline_callingcard(LLMessageSystem* msg, void**)
2716class ChatTranslationReceiver : public LLTranslate::TranslationReceiver 2717class ChatTranslationReceiver : public LLTranslate::TranslationReceiver
2717{ 2718{
2718public : 2719public :
2719 ChatTranslationReceiver(const std::string &fromLang, const std::string &toLang, LLChat *chat, 2720 ChatTranslationReceiver(const std::string &fromLang, const std::string &toLang, const LLChat &chat,
2720 const BOOL history) 2721 const std::string &orig_mesg, const BOOL history)
2721 : LLTranslate::TranslationReceiver(fromLang, toLang), 2722 : LLTranslate::TranslationReceiver(fromLang, toLang),
2722 m_chat(chat), 2723 m_chat(chat),
2724 m_origMesg(orig_mesg),
2723 m_history(history) 2725 m_history(history)
2724 { 2726 {
2725 } 2727 }
2726 2728
2727 static boost::intrusive_ptr<ChatTranslationReceiver> build(const std::string &fromLang, const std::string &toLang, LLChat *chat, const BOOL history) 2729 static boost::intrusive_ptr<ChatTranslationReceiver> build(const std::string &fromLang, const std::string &toLang, const LLChat &chat, const std::string &orig_mesg, const BOOL history)
2728 { 2730 {
2729 return boost::intrusive_ptr<ChatTranslationReceiver>(new ChatTranslationReceiver(fromLang, toLang, chat, history)); 2731 return boost::intrusive_ptr<ChatTranslationReceiver>(new ChatTranslationReceiver(fromLang, toLang, chat, orig_mesg, history));
2730 } 2732 }
2731 2733
2732protected: 2734protected:
2733 void handleResponse(const std::string &translation, const std::string &detectedLanguage) 2735 void handleResponse(const std::string &translation, const std::string &detected_language)
2734 { 2736 {
2735 if (m_toLang != detectedLanguage) 2737 // filter out non-interesting responeses
2736 m_chat->mText += " (" + translation + ")"; 2738 if ( !translation.empty()
2737 2739 && (m_toLang != detected_language)
2738 add_floater_chat(*m_chat, m_history); 2740 && (LLStringUtil::compareInsensitive(translation, m_origMesg) != 0) )
2741 {
2742 m_chat.mText += " (" + translation + ")";
2743 }
2739 2744
2740 delete m_chat; 2745 add_floater_chat(m_chat, m_history);
2741 } 2746 }
2742 2747
2743 void handleFailure() 2748 void handleFailure()
2744 { 2749 {
2745 LLTranslate::TranslationReceiver::handleFailure(); 2750 LLTranslate::TranslationReceiver::handleFailure();
2746 2751
2747 m_chat->mText += " (?)"; 2752 m_chat.mText += " (?)";
2748
2749 add_floater_chat(*m_chat, m_history);
2750 2753
2751 delete m_chat; 2754 add_floater_chat(m_chat, m_history);
2752 } 2755 }
2753 2756
2754private: 2757private:
2755 LLChat *m_chat; 2758 LLChat m_chat;
2759 std::string m_origMesg;
2756 const BOOL m_history; 2760 const BOOL m_history;
2757}; 2761};
2758 2762
@@ -2770,9 +2774,9 @@ void add_floater_chat(const LLChat &chat, const BOOL history)
2770 } 2774 }
2771} 2775}
2772 2776
2773void check_translate_chat(const std::string &mesg, LLChat &chat, const BOOL history) 2777void check_translate_chat(const std::string &mesg, const LLChat &chat, const BOOL history)
2774{ 2778{
2775 const bool translate = LLUI::sConfigGroup->getBOOL("TranslateChat"); 2779 const bool translate = gSavedSettings.getBOOL("TranslateChat");
2776 2780
2777 if (translate && chat.mSourceType != CHAT_SOURCE_SYSTEM) 2781 if (translate && chat.mSourceType != CHAT_SOURCE_SYSTEM)
2778 { 2782 {
@@ -2780,9 +2784,8 @@ void check_translate_chat(const std::string &mesg, LLChat &chat, const BOOL hist
2780 // SVC-4879 2784 // SVC-4879
2781 const std::string &fromLang = ""; 2785 const std::string &fromLang = "";
2782 const std::string &toLang = LLTranslate::getTranslateLanguage(); 2786 const std::string &toLang = LLTranslate::getTranslateLanguage();
2783 LLChat *newChat = new LLChat(chat);
2784 2787
2785 LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(fromLang, toLang, newChat, history); 2788 LLHTTPClient::ResponderPtr result = ChatTranslationReceiver::build(fromLang, toLang, chat, mesg, history);
2786 LLTranslate::translateMessage(result, fromLang, toLang, mesg); 2789 LLTranslate::translateMessage(result, fromLang, toLang, mesg);
2787 } 2790 }
2788 else 2791 else
@@ -2961,8 +2964,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
2961 std::string prefix = mesg.substr(0, 4); 2964 std::string prefix = mesg.substr(0, 4);
2962 if (prefix == "/me " || prefix == "/me'") 2965 if (prefix == "/me " || prefix == "/me'")
2963 { 2966 {
2964 chat.mText = from_name; 2967 const std::string spacer = mesg.substr(3,1);
2965 chat.mText += mesg.substr(3); 2968 mesg = mesg.substr(4);
2969 chat.mText = from_name + spacer + mesg;
2966 ircstyle = TRUE; 2970 ircstyle = TRUE;
2967 } 2971 }
2968 else 2972 else
@@ -3022,7 +3026,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3022 3026
3023 if (!is_muted && !is_busy) 3027 if (!is_muted && !is_busy)
3024 { 3028 {
3025 visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles"); 3029 static BOOL* sUseChatBubbles = rebind_llcontrol<BOOL>("UseChatBubbles", &gSavedSettings, true);
3030 visible_in_chat_bubble = *sUseChatBubbles;
3026 ((LLVOAvatar*)chatter)->addChat(chat); 3031 ((LLVOAvatar*)chatter)->addChat(chat);
3027 } 3032 }
3028 } 3033 }
@@ -3540,6 +3545,12 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3540 3545
3541 if( is_teleport ) 3546 if( is_teleport )
3542 { 3547 {
3548 if (gAgent.getTeleportKeepsLookAt())
3549 {
3550 // *NOTE: the LookAt data we get from the sim here doesn't
3551 // seem to be useful, so get it from the camera instead.
3552 look_at = LLViewerCamera::getInstance()->getAtAxis();
3553 }
3543 // Force the camera back onto the agent, don't animate. 3554 // Force the camera back onto the agent, don't animate.
3544 gAgent.setFocusOnAvatar(TRUE, FALSE); 3555 gAgent.setFocusOnAvatar(TRUE, FALSE);
3545 gAgent.slamLookAt(look_at); 3556 gAgent.slamLookAt(look_at);
@@ -3601,7 +3612,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
3601 { 3612 {
3602 LLTracker::stopTracking(NULL); 3613 LLTracker::stopTracking(NULL);
3603 } 3614 }
3604 else if ( is_teleport ) 3615 else if ( is_teleport && !gAgent.getTeleportKeepsLookAt() )
3605 { 3616 {
3606 //look at the beacon 3617 //look at the beacon
3607 LLVector3 global_agent_pos = agent_pos; 3618 LLVector3 global_agent_pos = agent_pos;
diff --git a/linden/indra/newview/llviewermessage.h b/linden/indra/newview/llviewermessage.h
index 1a6c03b..11a3554 100644
--- a/linden/indra/newview/llviewermessage.h
+++ b/linden/indra/newview/llviewermessage.h
@@ -76,7 +76,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data);
76void process_chat_from_simulator(LLMessageSystem *mesgsys, void **user_data); 76void process_chat_from_simulator(LLMessageSystem *mesgsys, void **user_data);
77 77
78void add_floater_chat(const LLChat &chat, const BOOL history); 78void add_floater_chat(const LLChat &chat, const BOOL history);
79void check_translate_chat(const std::string &mesg, LLChat &chat, const BOOL history); 79void check_translate_chat(const std::string &mesg, const LLChat &chat, const BOOL history);
80 80
81//void process_agent_to_new_region(LLMessageSystem *mesgsys, void **user_data); 81//void process_agent_to_new_region(LLMessageSystem *mesgsys, void **user_data);
82void send_agent_update(BOOL force_send, BOOL send_reliable = FALSE); 82void send_agent_update(BOOL force_send, BOOL send_reliable = FALSE);
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp
index a854583..cbd0472 100644
--- a/linden/indra/newview/llviewerobject.cpp
+++ b/linden/indra/newview/llviewerobject.cpp
@@ -144,6 +144,8 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
144 res = new LLVOSurfacePatch(id, pcode, regionp); break; 144 res = new LLVOSurfacePatch(id, pcode, regionp); break;
145 case LL_VO_SKY: 145 case LL_VO_SKY:
146 res = new LLVOSky(id, pcode, regionp); break; 146 res = new LLVOSky(id, pcode, regionp); break;
147 case LL_VO_VOID_WATER:
148 res = new LLVOVoidWater(id, pcode, regionp); break;
147 case LL_VO_WATER: 149 case LL_VO_WATER:
148 res = new LLVOWater(id, pcode, regionp); break; 150 res = new LLVOWater(id, pcode, regionp); break;
149 case LL_VO_GROUND: 151 case LL_VO_GROUND:
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 7f8bd63..33e8da2 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -506,14 +506,14 @@ public:
506 { 506 {
507 LL_VO_CLOUDS = LL_PCODE_APP | 0x20, 507 LL_VO_CLOUDS = LL_PCODE_APP | 0x20,
508 LL_VO_SURFACE_PATCH = LL_PCODE_APP | 0x30, 508 LL_VO_SURFACE_PATCH = LL_PCODE_APP | 0x30,
509 //LL_VO_STARS = LL_PCODE_APP | 0x40, 509 LL_VO_WL_SKY = LL_PCODE_APP | 0x40,
510 LL_VO_SQUARE_TORUS = LL_PCODE_APP | 0x50, 510 LL_VO_SQUARE_TORUS = LL_PCODE_APP | 0x50,
511 LL_VO_SKY = LL_PCODE_APP | 0x60, 511 LL_VO_SKY = LL_PCODE_APP | 0x60,
512 LL_VO_WATER = LL_PCODE_APP | 0x70, 512 LL_VO_VOID_WATER = LL_PCODE_APP | 0x70,
513 LL_VO_GROUND = LL_PCODE_APP | 0x80, 513 LL_VO_WATER = LL_PCODE_APP | 0x80,
514 LL_VO_PART_GROUP = LL_PCODE_APP | 0x90, 514 LL_VO_GROUND = LL_PCODE_APP | 0x90,
515 LL_VO_TRIANGLE_TORUS = LL_PCODE_APP | 0xa0, 515 LL_VO_PART_GROUP = LL_PCODE_APP | 0xa0,
516 LL_VO_WL_SKY = LL_PCODE_APP | 0xb0, // should this be moved to 0x40? 516 LL_VO_TRIANGLE_TORUS = LL_PCODE_APP | 0xb0,
517 LL_VO_HUD_PART_GROUP = LL_PCODE_APP | 0xc0, 517 LL_VO_HUD_PART_GROUP = LL_PCODE_APP | 0xc0,
518 } EVOType; 518 } EVOType;
519 519
@@ -713,8 +713,8 @@ public:
713class LLStaticViewerObject : public LLViewerObject 713class LLStaticViewerObject : public LLViewerObject
714{ 714{
715public: 715public:
716 LLStaticViewerObject(const LLUUID& id, const LLPCode type, LLViewerRegion* regionp, BOOL is_global = FALSE) 716 LLStaticViewerObject(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp, BOOL is_global = FALSE)
717 : LLViewerObject(id,type,regionp, is_global) 717 : LLViewerObject(id, pcode, regionp, is_global)
718 { } 718 { }
719 719
720 virtual void updateDrawable(BOOL force_damped); 720 virtual void updateDrawable(BOOL force_damped);
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp
index bfb248b..78ce247 100644
--- a/linden/indra/newview/llviewerobjectlist.cpp
+++ b/linden/indra/newview/llviewerobjectlist.cpp
@@ -698,7 +698,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
698 } 698 }
699 } 699 }
700 700
701 if (gSavedSettings.getBOOL("FreezeTime")) 701 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
702
703 if ((*sFreezeTime))
702 { 704 {
703 for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin(); 705 for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin();
704 iter != idle_list.end(); iter++) 706 iter != idle_list.end(); iter++)
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 4257f70..4fd3bfb 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -215,6 +215,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
215 //MUST MATCH declaration of eObjectPartitions 215 //MUST MATCH declaration of eObjectPartitions
216 mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD 216 mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD
217 mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN 217 mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN
218 mObjectPartition.push_back(new LLVoidWaterPartition()); //PARTITION_VOIDWATER
218 mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER 219 mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER
219 mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE 220 mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE
220 mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE 221 mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE
diff --git a/linden/indra/newview/llviewerregion.h b/linden/indra/newview/llviewerregion.h
index b0a98a9..09280a5 100644
--- a/linden/indra/newview/llviewerregion.h
+++ b/linden/indra/newview/llviewerregion.h
@@ -75,6 +75,7 @@ public:
75 { 75 {
76 PARTITION_HUD=0, 76 PARTITION_HUD=0,
77 PARTITION_TERRAIN, 77 PARTITION_TERRAIN,
78 PARTITION_VOIDWATER,
78 PARTITION_WATER, 79 PARTITION_WATER,
79 PARTITION_TREE, 80 PARTITION_TREE,
80 PARTITION_PARTICLE, 81 PARTITION_PARTICLE,
diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp
index 93e69ca..607f871 100644
--- a/linden/indra/newview/llviewerstats.cpp
+++ b/linden/indra/newview/llviewerstats.cpp
@@ -533,7 +533,8 @@ void update_statistics(U32 frame_count)
533 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); 533 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable"));
534 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); 534 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail"));
535 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); 535 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip"));
536 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); 536 static BOOL* sUseChatBubbles = rebind_llcontrol<BOOL>("UseChatBubbles", &gSavedSettings, true);
537 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)*sUseChatBubbles);
537#if 0 // 1.9.2 538#if 0 // 1.9.2
538 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject")); 539 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject"));
539 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); 540 LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar"));
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index eb8977c..3a68f0f 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -298,7 +298,9 @@ public:
298 U32 ypos = 64; 298 U32 ypos = 64;
299 const U32 y_inc = 20; 299 const U32 y_inc = 20;
300 300
301 if (gSavedSettings.getBOOL("DebugShowTime")) 301 static BOOL *sDebugShowTime = rebind_llcontrol<BOOL>("DebugShowTime", &gSavedSettings, true);
302
303 if(*sDebugShowTime)
302 { 304 {
303 const U32 y_inc2 = 15; 305 const U32 y_inc2 = 15;
304 for (std::map<S32,LLFrameTimer>::reverse_iterator iter = gDebugTimers.rbegin(); 306 for (std::map<S32,LLFrameTimer>::reverse_iterator iter = gDebugTimers.rbegin();
@@ -513,8 +515,10 @@ public:
513 addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3])); 515 addText(xpos, ypos, llformat("%d %d %d %d", color[0], color[1], color[2], color[3]));
514 ypos += y_inc; 516 ypos += y_inc;
515 } 517 }
518 static BOOL* sBeaconsEnabled = rebind_llcontrol<BOOL>("BeaconsEnabled", &gSavedSettings, true);
519
516 // only display these messages if we are actually rendering beacons at this moment 520 // only display these messages if we are actually rendering beacons at this moment
517 if (LLPipeline::getRenderBeacons(NULL) && gSavedSettings.getBOOL("BeaconsEnabled")) 521 if (LLPipeline::getRenderBeacons(NULL) && *sBeaconsEnabled)
518 { 522 {
519 if (LLPipeline::getRenderParticleBeacons(NULL)) 523 if (LLPipeline::getRenderParticleBeacons(NULL))
520 { 524 {
@@ -1303,6 +1307,11 @@ LLViewerWindow::LLViewerWindow(
1303 gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE); 1307 gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE);
1304 } 1308 }
1305 1309
1310 if (!gGLManager.mHasDepthClamp)
1311 {
1312 LL_INFOS("RenderInit") << "Missing feature GL_ARB_depth_clamp. Void water might disappear in rare cases." << LL_ENDL;
1313 }
1314
1306 // If we crashed while initializng GL stuff last time, disable certain features 1315 // If we crashed while initializng GL stuff last time, disable certain features
1307 if (gSavedSettings.getBOOL("RenderInitError")) 1316 if (gSavedSettings.getBOOL("RenderInitError"))
1308 { 1317 {
@@ -2043,7 +2052,9 @@ void LLViewerWindow::draw()
2043 //S32 screen_x, screen_y; 2052 //S32 screen_x, screen_y;
2044 2053
2045 // HACK for timecode debugging 2054 // HACK for timecode debugging
2046 if (gSavedSettings.getBOOL("DisplayTimecode")) 2055 static BOOL* sDisplayTimecode = rebind_llcontrol<BOOL>("DisplayTimecode", &gSavedSettings, true);
2056
2057 if (*sDisplayTimecode)
2047 { 2058 {
2048 // draw timecode block 2059 // draw timecode block
2049 std::string text; 2060 std::string text;
@@ -2504,7 +2515,9 @@ BOOL LLViewerWindow::handlePerFrameHover()
2504 2515
2505 LLVector2 mouse_vel; 2516 LLVector2 mouse_vel;
2506 2517
2507 if (gSavedSettings.getBOOL("MouseSmooth")) 2518 static BOOL* sMouseSmooth = rebind_llcontrol<BOOL>("MouseSmooth", &gSavedSettings, true);
2519
2520 if (*sMouseSmooth)
2508 { 2521 {
2509 static F32 fdx = 0.f; 2522 static F32 fdx = 0.f;
2510 static F32 fdy = 0.f; 2523 static F32 fdy = 0.f;
@@ -2659,7 +2672,9 @@ BOOL LLViewerWindow::handlePerFrameHover()
2659 // Show a new tool tip (or update one that is alrady shown) 2672 // Show a new tool tip (or update one that is alrady shown)
2660 BOOL tool_tip_handled = FALSE; 2673 BOOL tool_tip_handled = FALSE;
2661 std::string tool_tip_msg; 2674 std::string tool_tip_msg;
2662 F32 tooltip_delay = gSavedSettings.getF32( "ToolTipDelay" ); 2675 static F32 *sToolTipDelay = rebind_llcontrol<F32>("ToolTipDelay", &gSavedSettings, true);
2676
2677 F32 tooltip_delay = (*sToolTipDelay);
2663 //HACK: hack for tool-based tooltips which need to pop up more quickly 2678 //HACK: hack for tool-based tooltips which need to pop up more quickly
2664 //Also for show xui names as tooltips debug mode 2679 //Also for show xui names as tooltips debug mode
2665 if ((mouse_captor && !mouse_captor->isView()) || LLUI::sShowXUINames) 2680 if ((mouse_captor && !mouse_captor->isView()) || LLUI::sShowXUINames)
@@ -2710,9 +2725,10 @@ BOOL LLViewerWindow::handlePerFrameHover()
2710 { 2725 {
2711 mToolTip->setVisible( tooltip_vis ); 2726 mToolTip->setVisible( tooltip_vis );
2712 } 2727 }
2713 } 2728 }
2729 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
2714 2730
2715 if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !gSavedSettings.getBOOL("FreezeTime")) 2731 if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !(*sFreezeTime))
2716 { 2732 {
2717 LLMouseHandler *captor = gFocusMgr.getMouseCapture(); 2733 LLMouseHandler *captor = gFocusMgr.getMouseCapture();
2718 // With the null, inspect, or drag and drop tool, don't muck 2734 // With the null, inspect, or drag and drop tool, don't muck
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 2c42a27..6e16ea3 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -3457,13 +3457,19 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3457 } 3457 }
3458 3458
3459 const F32 time_visible = mTimeVisible.getElapsedTimeF32(); 3459 const F32 time_visible = mTimeVisible.getElapsedTimeF32();
3460 const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds 3460
3461 const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds 3461 static F32* sRenderNameShowTime = rebind_llcontrol<F32>("RenderNameShowTime", &gSavedSettings, true);
3462 static F32* sRenderNameFadeDuration = rebind_llcontrol<F32>("RenderNameFadeDuration", &gSavedSettings, true);
3463
3464
3465 const F32 NAME_SHOW_TIME = *sRenderNameShowTime; // seconds
3466 const F32 FADE_DURATION = *sRenderNameFadeDuration; // seconds
3462// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b 3467// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b
3463 bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); 3468 bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
3464// [/RLVa:KB] 3469// [/RLVa:KB]
3465 BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; 3470 BOOL visible_avatar = isVisible() || mNeedsAnimUpdate;
3466 BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); 3471 static BOOL* sUseChatBubbles = rebind_llcontrol<BOOL>("UseChatBubbles", &gSavedSettings, true);
3472 BOOL visible_chat = *sUseChatBubbles && (mChats.size() || mTyping);
3467 BOOL render_name = visible_chat || 3473 BOOL render_name = visible_chat ||
3468 (visible_avatar && 3474 (visible_avatar &&
3469// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h 3475// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h
@@ -3505,6 +3511,9 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3505 mRenderGroupTitles = sRenderGroupTitles; 3511 mRenderGroupTitles = sRenderGroupTitles;
3506 new_name = TRUE; 3512 new_name = TRUE;
3507 } 3513 }
3514
3515 static LLColor4* sAvatarNameColor = rebind_llcontrol<LLColor4>("AvatarNameColor", &gColors, true);
3516
3508 std::string client; 3517 std::string client;
3509 // First Calculate Alpha 3518 // First Calculate Alpha
3510 // If alpha > 0, create mNameText if necessary, otherwise delete it 3519 // If alpha > 0, create mNameText if necessary, otherwise delete it
@@ -3545,7 +3554,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3545 new_name = TRUE; 3554 new_name = TRUE;
3546 } 3555 }
3547 3556
3548 LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); 3557 LLColor4 avatar_name_color = (*sAvatarNameColor);
3549 LLColor4 client_color = avatar_name_color; 3558 LLColor4 client_color = avatar_name_color;
3550 3559
3551 if(!mIsSelf) //don't know your own client ? 3560 if(!mIsSelf) //don't know your own client ?
@@ -3560,11 +3569,14 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3560 // Set your own name to the Imprudence color -- MC 3569 // Set your own name to the Imprudence color -- MC
3561 client_color = LLColor4(0.79f,0.44f,0.88f); 3570 client_color = LLColor4(0.79f,0.44f,0.88f);
3562 } 3571 }
3563 if (gSavedSettings.getBOOL("ShowClientColor")) 3572
3573 static BOOL* sShowClientColor = rebind_llcontrol<BOOL>("ShowClientColor", &gSavedSettings, true);
3574 static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true);
3575 if (*sShowClientColor)
3564 { 3576 {
3565 avatar_name_color = client_color; 3577 avatar_name_color = client_color;
3566 } 3578 }
3567 if (!gSavedSettings.getBOOL("ShowClientNameTag")) 3579 if (!(*sShowClientNameTag))
3568 { 3580 {
3569 client.clear(); 3581 client.clear();
3570 } 3582 }
@@ -3657,7 +3669,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3657 3669
3658 BOOL need_comma = FALSE; 3670 BOOL need_comma = FALSE;
3659 3671
3660 bool show_client = client.length() != 0 && gSavedSettings.getBOOL("ShowClientNameTag"); 3672 static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true);
3673 bool show_client = client.length() != 0 && (*sShowClientNameTag);
3661 if (is_away || is_muted || is_busy || show_client) 3674 if (is_away || is_muted || is_busy || show_client)
3662 { 3675 {
3663 line += " ("; 3676 line += " (";
@@ -3726,7 +3739,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3726 std::deque<LLChat>::iterator chat_iter = mChats.begin(); 3739 std::deque<LLChat>::iterator chat_iter = mChats.begin();
3727 mNameText->clearString(); 3740 mNameText->clearString();
3728 3741
3729 LLColor4 new_chat = gColors.getColor( "AvatarNameColor" ); 3742 LLColor4 new_chat = (*sAvatarNameColor);
3730 LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); 3743 LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
3731 LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); 3744 LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
3732 if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) 3745 if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
@@ -3788,7 +3801,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3788 } 3801 }
3789 else 3802 else
3790 { 3803 {
3791 if (gSavedSettings.getBOOL("SmallAvatarNames")) 3804 static BOOL* sSmallAvatarNames = rebind_llcontrol<BOOL>("SmallAvatarNames", &gSavedSettings, true);
3805 if (*sSmallAvatarNames)
3792 { 3806 {
3793 mNameText->setFont(LLFontGL::getFontSansSerif()); 3807 mNameText->setFont(LLFontGL::getFontSansSerif());
3794 } 3808 }
@@ -7332,7 +7346,8 @@ BOOL LLVOAvatar::updateIsFullyLoaded()
7332 7346
7333BOOL LLVOAvatar::isFullyLoaded() 7347BOOL LLVOAvatar::isFullyLoaded()
7334{ 7348{
7335 if (gSavedSettings.getBOOL("RenderUnloadedAvatar")) 7349 static BOOL* sRenderUnloadedAvatar = rebind_llcontrol<BOOL>("RenderUnloadedAvatar", &gSavedSettings, true);
7350 if (*sRenderUnloadedAvatar)
7336 return TRUE; 7351 return TRUE;
7337 else 7352 else
7338 return mFullyLoaded; 7353 return mFullyLoaded;
@@ -7410,7 +7425,6 @@ LLGLuint LLVOAvatar::getScratchTexName( LLGLenum format, U32* texture_bytes )
7410 { 7425 {
7411 case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break; 7426 case GL_LUMINANCE: components = 1; internal_format = GL_LUMINANCE8; break;
7412 case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break; 7427 case GL_ALPHA: components = 1; internal_format = GL_ALPHA8; break;
7413 case GL_COLOR_INDEX: components = 1; internal_format = GL_COLOR_INDEX8_EXT; break;
7414 case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break; 7428 case GL_LUMINANCE_ALPHA: components = 2; internal_format = GL_LUMINANCE8_ALPHA8; break;
7415 case GL_RGB: components = 3; internal_format = GL_RGB8; break; 7429 case GL_RGB: components = 3; internal_format = GL_RGB8; break;
7416 case GL_RGBA: components = 4; internal_format = GL_RGBA8; break; 7430 case GL_RGBA: components = 4; internal_format = GL_RGBA8; break;
diff --git a/linden/indra/newview/llvograss.cpp b/linden/indra/newview/llvograss.cpp
index 08f2717..f738872 100644
--- a/linden/indra/newview/llvograss.cpp
+++ b/linden/indra/newview/llvograss.cpp
@@ -108,7 +108,9 @@ void LLVOGrass::updateSpecies()
108 SpeciesMap::const_iterator it = sSpeciesTable.begin(); 108 SpeciesMap::const_iterator it = sSpeciesTable.begin();
109 mSpecies = (*it).first; 109 mSpecies = (*it).first;
110 } 110 }
111 setTEImage(0, gImageList.getImageFromFile(sSpeciesTable[mSpecies]->mTextureName)); 111
112 LLViewerImage* grass_image = gImageList.getImageFromFile(sSpeciesTable[mSpecies]->mTextureName, TRUE, TRUE, 0, 0, sSpeciesTable[mSpecies]->mTextureID);
113 setTEImage(0, grass_image);
112} 114}
113 115
114 116
@@ -162,13 +164,17 @@ void LLVOGrass::initClass()
162 164
163 GrassSpeciesData* newGrass = new GrassSpeciesData(); 165 GrassSpeciesData* newGrass = new GrassSpeciesData();
164 166
165
166 std::string textureName; 167 std::string textureName;
167 168
168 static LLStdStringHandle texture_name_string = LLXmlTree::addAttributeString("texture_name"); 169 static LLStdStringHandle texture_name_string = LLXmlTree::addAttributeString("texture_name");
169 success &= grass_def->getFastAttributeString(texture_name_string, textureName); 170 success &= grass_def->getFastAttributeString(texture_name_string, textureName);
170 newGrass->mTextureName = textureName; 171 newGrass->mTextureName = textureName;
171 172
173 std::string textureID;
174 static LLStdStringHandle texture_id = LLXmlTree::addAttributeString("texture_id");
175 success &= grass_def->getFastAttributeString(texture_id, textureID);
176 newGrass->mTextureID = LLUUID(textureID);
177
172 static LLStdStringHandle blade_sizex_string = LLXmlTree::addAttributeString("blade_size_x"); 178 static LLStdStringHandle blade_sizex_string = LLXmlTree::addAttributeString("blade_size_x");
173 success &= grass_def->getFastAttributeF32(blade_sizex_string, F32_val); 179 success &= grass_def->getFastAttributeF32(blade_sizex_string, F32_val);
174 newGrass->mBladeSizeX = F32_val; 180 newGrass->mBladeSizeX = F32_val;
diff --git a/linden/indra/newview/llvograss.h b/linden/indra/newview/llvograss.h
index 682fbdb..25fa04c 100644
--- a/linden/indra/newview/llvograss.h
+++ b/linden/indra/newview/llvograss.h
@@ -128,7 +128,7 @@ private:
128 void updateSpecies(); 128 void updateSpecies();
129 F32 mLastHeight; // For cheap update hack 129 F32 mLastHeight; // For cheap update hack
130 S32 mNumBlades; 130 S32 mNumBlades;
131 131// LLPointer<LLViewerImage> mGrassImage;
132 static SpeciesMap sSpeciesTable; 132 static SpeciesMap sSpeciesTable;
133}; 133};
134#endif // LL_VO_GRASS_ 134#endif // LL_VO_GRASS_
diff --git a/linden/indra/newview/llvoiceremotectrl.cpp b/linden/indra/newview/llvoiceremotectrl.cpp
index 1681e96..d11424b 100644
--- a/linden/indra/newview/llvoiceremotectrl.cpp
+++ b/linden/indra/newview/llvoiceremotectrl.cpp
@@ -114,14 +114,16 @@ void LLVoiceRemoteCtrl::draw()
114 LLFloaterActiveSpeakers::getInstance()->onClose(false); 114 LLFloaterActiveSpeakers::getInstance()->onClose(false);
115 mVoiceLastActive = voice_active; 115 mVoiceLastActive = voice_active;
116 116
117 static BOOL *sPTTCurrentlyEnabled = rebind_llcontrol<BOOL>("PTTCurrentlyEnabled", &gSavedSettings, true);
118
117 // propagate ptt state to button display, 119 // propagate ptt state to button display,
118 if (!mTalkBtn->hasMouseCapture()) 120 if (!mTalkBtn->hasMouseCapture())
119 { 121 {
120 // not in push to talk mode, or push to talk is active means I'm talking 122 // not in push to talk mode, or push to talk is active means I'm talking
121 mTalkBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled") || gVoiceClient->getUserPTTState()); 123 mTalkBtn->setToggleState(!(*sPTTCurrentlyEnabled) || gVoiceClient->getUserPTTState());
122 } 124 }
123 mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD())); 125 mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD()));
124 mTalkLockBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled")); 126 mTalkLockBtn->setToggleState(!(*sPTTCurrentlyEnabled));
125 127
126 std::string talk_blip_image; 128 std::string talk_blip_image;
127 if (gVoiceClient->getIsSpeaking(gAgent.getID())) 129 if (gVoiceClient->getIsSpeaking(gAgent.getID()))
diff --git a/linden/indra/newview/llvosky.cpp b/linden/indra/newview/llvosky.cpp
index fb9c258..8639b60 100644
--- a/linden/indra/newview/llvosky.cpp
+++ b/linden/indra/newview/llvosky.cpp
@@ -1027,7 +1027,10 @@ void LLVOSky::calcAtmospherics(void)
1027 1027
1028 // Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio 1028 // Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio
1029 // between sunlight and point lights in windlight to normalize point lights. 1029 // between sunlight and point lights in windlight to normalize point lights.
1030 F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f); 1030
1031 static F32 *sRenderSunDynamicRange = rebind_llcontrol<F32>("RenderSunDynamicRange", &gSavedSettings, true);
1032
1033 F32 sun_dynamic_range = llmax((*sRenderSunDynamicRange), 0.0001f);
1031 LLWLParamManager::instance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp); 1034 LLWLParamManager::instance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp);
1032 1035
1033 mSunDiffuse = vary_SunlightColor; 1036 mSunDiffuse = vary_SunlightColor;
diff --git a/linden/indra/newview/llvosurfacepatch.cpp b/linden/indra/newview/llvosurfacepatch.cpp
index d86f758..1671880 100644
--- a/linden/indra/newview/llvosurfacepatch.cpp
+++ b/linden/indra/newview/llvosurfacepatch.cpp
@@ -86,7 +86,7 @@ public:
86//============================================================================ 86//============================================================================
87 87
88LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 88LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
89 : LLStaticViewerObject(id, LL_VO_SURFACE_PATCH, regionp), 89 : LLStaticViewerObject(id, pcode, regionp),
90 mDirtiedPatch(FALSE), 90 mDirtiedPatch(FALSE),
91 mPool(NULL), 91 mPool(NULL),
92 mBaseComp(0), 92 mBaseComp(0),
diff --git a/linden/indra/newview/llvotree.cpp b/linden/indra/newview/llvotree.cpp
index 208086f..6a59253 100644
--- a/linden/indra/newview/llvotree.cpp
+++ b/linden/indra/newview/llvotree.cpp
@@ -324,7 +324,7 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys,
324 // 324 //
325 // Load Species-Specific data 325 // Load Species-Specific data
326 // 326 //
327 mTreeImagep = gImageList.getImageFromFile(sSpeciesTable[mSpecies]->mTextureName); 327 mTreeImagep = gImageList.getImageFromFile(sSpeciesTable[mSpecies]->mTextureName, TRUE, TRUE, 0, 0, sSpeciesTable[mSpecies]->mTextureID);
328 if (mTreeImagep) 328 if (mTreeImagep)
329 { 329 {
330 gGL.getTexUnit(0)->bind(mTreeImagep.get()); 330 gGL.getTexUnit(0)->bind(mTreeImagep.get());
@@ -359,8 +359,10 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
359 { 359 {
360 return TRUE; 360 return TRUE;
361 } 361 }
362
363 static BOOL* sRenderAnimateTrees = rebind_llcontrol<BOOL>("RenderAnimateTrees", &gSavedSettings, true);
362 364
363 if (gSavedSettings.getBOOL("RenderAnimateTrees")) 365 if (*sRenderAnimateTrees)
364 { 366 {
365 F32 mass_inv; 367 F32 mass_inv;
366 368
@@ -403,7 +405,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
403 } 405 }
404 } 406 }
405 407
406 if (!gSavedSettings.getBOOL("RenderAnimateTrees")) 408 if (!*sRenderAnimateTrees)
407 { 409 {
408 if (mReferenceBuffer.isNull()) 410 if (mReferenceBuffer.isNull())
409 { 411 {
@@ -548,8 +550,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
548 max_indices += sLODIndexCount[lod]; 550 max_indices += sLODIndexCount[lod];
549 max_vertices += sLODVertexCount[lod]; 551 max_vertices += sLODVertexCount[lod];
550 } 552 }
551 553 static BOOL* sRenderAnimateTrees = rebind_llcontrol<BOOL>("RenderAnimateTrees", &gSavedSettings, true);
552 mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, gSavedSettings.getBOOL("RenderAnimateTrees") ? GL_STATIC_DRAW_ARB : 0); 554 mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, *sRenderAnimateTrees ? GL_STATIC_DRAW_ARB : 0);
553 mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE); 555 mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE);
554 556
555 LLStrider<LLVector3> vertices; 557 LLStrider<LLVector3> vertices;
@@ -852,8 +854,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
852 llassert(vertex_count == max_vertices); 854 llassert(vertex_count == max_vertices);
853 llassert(index_count == max_indices); 855 llassert(index_count == max_indices);
854 } 856 }
855 857 static BOOL* sRenderAnimateTrees = rebind_llcontrol<BOOL>("RenderAnimateTrees", &gSavedSettings, true);
856 if (gSavedSettings.getBOOL("RenderAnimateTrees")) 858 if (*sRenderAnimateTrees)
857 { 859 {
858 mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer; 860 mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer;
859 } 861 }
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index 5f7327d..bed3e13 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -2231,8 +2231,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
2231 std::vector<LLFace*> alpha_faces; 2231 std::vector<LLFace*> alpha_faces;
2232 U32 useage = group->mSpatialPartition->mBufferUsage; 2232 U32 useage = group->mSpatialPartition->mBufferUsage;
2233 2233
2234 U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); 2234
2235 U32 max_total = (gSavedSettings.getS32("RenderMaxNodeSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); 2235 static S32* sRenderMaxVBOSize = rebind_llcontrol<S32>("RenderMaxVBOSize", &gSavedSettings, true);
2236 static S32* sRenderMaxNodeSize = rebind_llcontrol<S32>("RenderMaxNodeSize", &gSavedSettings, true);
2237
2238
2239 U32 max_vertices = ((*sRenderMaxVBOSize)*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask);
2240 U32 max_total = ((*sRenderMaxNodeSize)*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask);
2236 max_vertices = llmin(max_vertices, (U32) 65535); 2241 max_vertices = llmin(max_vertices, (U32) 65535);
2237 2242
2238 U32 cur_total = 0; 2243 U32 cur_total = 0;
@@ -2505,8 +2510,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
2505 2510
2506void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort) 2511void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort)
2507{ 2512{
2513 static S32* sRenderMaxVBOSize = rebind_llcontrol<S32>("RenderMaxVBOSize", &gSavedSettings, true);
2508 //calculate maximum number of vertices to store in a single buffer 2514 //calculate maximum number of vertices to store in a single buffer
2509 U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); 2515 U32 max_vertices = ((*sRenderMaxVBOSize)*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask);
2510 max_vertices = llmin(max_vertices, (U32) 65535); 2516 max_vertices = llmin(max_vertices, (U32) 65535);
2511 2517
2512 if (!distance_sort) 2518 if (!distance_sort)
diff --git a/linden/indra/newview/llvowater.cpp b/linden/indra/newview/llvowater.cpp
index 5b6a949..c66295a 100644
--- a/linden/indra/newview/llvowater.cpp
+++ b/linden/indra/newview/llvowater.cpp
@@ -70,7 +70,7 @@ const F32 WAVE_STEP_INV = (1. / WAVE_STEP);
70 70
71 71
72LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) 72LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
73: LLStaticViewerObject(id, LL_VO_WATER, regionp) 73: LLStaticViewerObject(id, pcode, regionp)
74{ 74{
75 // Terrain must draw during selection passes so it can block objects behind it. 75 // Terrain must draw during selection passes so it can block objects behind it.
76 mbCanSelect = FALSE; 76 mbCanSelect = FALSE;
@@ -78,9 +78,9 @@ LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regi
78 78
79 mUseTexture = TRUE; 79 mUseTexture = TRUE;
80 mIsEdgePatch = FALSE; 80 mIsEdgePatch = FALSE;
81 mRenderType = LLPipeline::RENDER_TYPE_WATER;
81} 82}
82 83
83
84void LLVOWater::markDead() 84void LLVOWater::markDead()
85{ 85{
86 LLViewerObject::markDead(); 86 LLViewerObject::markDead();
@@ -123,7 +123,7 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline)
123{ 123{
124 pipeline->allocDrawable(this); 124 pipeline->allocDrawable(this);
125 mDrawable->setLit(FALSE); 125 mDrawable->setLit(FALSE);
126 mDrawable->setRenderType(LLPipeline::RENDER_TYPE_WATER); 126 mDrawable->setRenderType(mRenderType);
127 127
128 LLDrawPoolWater *pool = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER); 128 LLDrawPoolWater *pool = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER);
129 129
@@ -271,8 +271,13 @@ void LLVOWater::updateSpatialExtents(LLVector3 &newMin, LLVector3& newMax)
271} 271}
272 272
273U32 LLVOWater::getPartitionType() const 273U32 LLVOWater::getPartitionType() const
274{ 274{
275 return LLViewerRegion::PARTITION_WATER; 275 return LLViewerRegion::PARTITION_WATER;
276}
277
278U32 LLVOVoidWater::getPartitionType() const
279{
280 return LLViewerRegion::PARTITION_VOIDWATER;
276} 281}
277 282
278LLWaterPartition::LLWaterPartition() 283LLWaterPartition::LLWaterPartition()
@@ -283,3 +288,9 @@ LLWaterPartition::LLWaterPartition()
283 mDrawableType = LLPipeline::RENDER_TYPE_WATER; 288 mDrawableType = LLPipeline::RENDER_TYPE_WATER;
284 mPartitionType = LLViewerRegion::PARTITION_WATER; 289 mPartitionType = LLViewerRegion::PARTITION_WATER;
285} 290}
291
292LLVoidWaterPartition::LLVoidWaterPartition()
293{
294 mDrawableType = LLPipeline::RENDER_TYPE_VOIDWATER;
295 mPartitionType = LLViewerRegion::PARTITION_VOIDWATER;
296}
diff --git a/linden/indra/newview/llvowater.h b/linden/indra/newview/llvowater.h
index 9c33e74..55ce6d7 100644
--- a/linden/indra/newview/llvowater.h
+++ b/linden/indra/newview/llvowater.h
@@ -35,6 +35,7 @@
35 35
36#include "llviewerobject.h" 36#include "llviewerobject.h"
37#include "llviewerimage.h" 37#include "llviewerimage.h"
38#include "pipeline.h"
38#include "v2math.h" 39#include "v2math.h"
39 40
40const U32 N_RES = 16; //32 // number of subdivisions of wave tile 41const U32 N_RES = 16; //32 // number of subdivisions of wave tile
@@ -71,7 +72,7 @@ public:
71 /*virtual*/ void updateTextures(); 72 /*virtual*/ void updateTextures();
72 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area 73 /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area
73 74
74 virtual U32 getPartitionType() const; 75 /*virtual*/ U32 getPartitionType() const;
75 76
76 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. 77 /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate.
77 78
@@ -83,6 +84,18 @@ public:
83protected: 84protected:
84 BOOL mUseTexture; 85 BOOL mUseTexture;
85 BOOL mIsEdgePatch; 86 BOOL mIsEdgePatch;
87 LLPipeline::LLRenderTypeMask mRenderType;
88};
89
90class LLVOVoidWater : public LLVOWater
91{
92public:
93 LLVOVoidWater(LLUUID const& id, LLPCode pcode, LLViewerRegion* regionp) : LLVOWater(id, pcode, regionp)
94 {
95 mRenderType = LLPipeline::RENDER_TYPE_VOIDWATER;
96 }
97
98 /*virtual*/ U32 getPartitionType() const;
86}; 99};
87 100
88#endif // LL_VOSURFACEPATCH_H 101#endif // LL_VOSURFACEPATCH_H
diff --git a/linden/indra/newview/llvowlsky.cpp b/linden/indra/newview/llvowlsky.cpp
index abd25e6..96bd62e 100644
--- a/linden/indra/newview/llvowlsky.cpp
+++ b/linden/indra/newview/llvowlsky.cpp
@@ -334,7 +334,9 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
334 } 334 }
335 335
336 { 336 {
337 const U32 max_buffer_bytes = gSavedSettings.getS32("RenderMaxVBOSize")*1024; 337 static S32* sRenderMaxVBOSize = rebind_llcontrol<S32>("RenderMaxVBOSize", &gSavedSettings, true);
338
339 const U32 max_buffer_bytes = (*sRenderMaxVBOSize)*1024;
338 const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK; 340 const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK;
339 const U32 max_verts = max_buffer_bytes / LLVertexBuffer::calcStride(data_mask); 341 const U32 max_verts = max_buffer_bytes / LLVertexBuffer::calcStride(data_mask);
340 342
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp
index 90ab49b..ca8ce2d 100644
--- a/linden/indra/newview/llworld.cpp
+++ b/linden/indra/newview/llworld.cpp
@@ -61,6 +61,12 @@
61#include "llappviewer.h" // for do_disconnect() 61#include "llappviewer.h" // for do_disconnect()
62 62
63#include "hippoLimits.h" 63#include "hippoLimits.h"
64
65#include <deque>
66#include <queue>
67#include <map>
68#include <cstring>
69
64// 70//
65// Globals 71// Globals
66// 72//
@@ -661,7 +667,8 @@ void LLWorld::updateParticles()
661 667
662void LLWorld::updateClouds(const F32 dt) 668void LLWorld::updateClouds(const F32 dt)
663{ 669{
664 if (gSavedSettings.getBOOL("FreezeTime") || 670 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
671 if ((*sFreezeTime) ||
665 !gSavedSettings.getBOOL("SkyUseClassicClouds")) 672 !gSavedSettings.getBOOL("SkyUseClassicClouds"))
666 { 673 {
667 // don't move clouds in snapshot mode 674 // don't move clouds in snapshot mode
@@ -810,10 +817,69 @@ F32 LLWorld::getLandFarClip() const
810 817
811void LLWorld::setLandFarClip(const F32 far_clip) 818void LLWorld::setLandFarClip(const F32 far_clip)
812{ 819{
820 static S32 const rwidth = (S32)REGION_WIDTH_U32;
821 S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth;
822 S32 const n2 = (llceil(far_clip) - 1) / rwidth;
823 bool need_water_objects_update = n1 != n2;
824
813 mLandFarClip = far_clip; 825 mLandFarClip = far_clip;
826
827 if (need_water_objects_update)
828 {
829 updateWaterObjects();
830 }
814} 831}
815 832
833// Some region that we're connected to, but not the one we're in, gave us
834// a (possibly) new water height. Update it in our local copy.
835void LLWorld::waterHeightRegionInfo(std::string const& sim_name, F32 water_height)
836{
837 for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter)
838 {
839 if ((*iter)->getName() == sim_name)
840 {
841 (*iter)->setWaterHeight(water_height);
842 break;
843 }
844 }
845}
816 846
847// There are three types of water objects:
848// Region water objects: the water in a region.
849// Hole water objects: water in the void but within current draw distance.
850// Edge water objects: the water outside the draw distance, up till the horizon.
851//
852// For example:
853//
854// -----------------------horizon-------------------------
855// | | | |
856// | Edge Water | | |
857// | | | |
858// | | | |
859// | | | |
860// | | | |
861// | | rwidth | |
862// | | <-----> | |
863// -------------------------------------------------------
864// | |Hole |other| | |
865// | |Water|reg. | | |
866// | |-----------------| |
867// | |other|cur. |<--> | |
868// | |reg. | reg.| \__|_ draw distance |
869// | |-----------------| |
870// | | | |<--->| |
871// | | | | \__|_ range |
872// -------------------------------------------------------
873// | |<----width------>|<--horizon ext.->|
874// | | | |
875// | | | |
876// | | | |
877// | | | |
878// | | | |
879// | | | |
880// | | | |
881// -------------------------------------------------------
882//
817void LLWorld::updateWaterObjects() 883void LLWorld::updateWaterObjects()
818{ 884{
819 if (!gAgent.getRegion()) 885 if (!gAgent.getRegion())
@@ -826,128 +892,265 @@ void LLWorld::updateWaterObjects()
826 return; 892 return;
827 } 893 }
828 894
829 // First, determine the min and max "box" of water objects 895 // Region width in meters.
830 S32 min_x = 0; 896 S32 const rwidth = (S32)REGION_WIDTH_U32;
831 S32 min_y = 0; 897
832 S32 max_x = 0; 898 // The distance we might see into the void
833 S32 max_y = 0; 899 // when standing on the edge of a region, in meters.
900 S32 const draw_distance = llceil(mLandFarClip);
901
902 // We can only have "holes" in the water (where there no region) if we
903 // can have existing regions around it. Taking into account that this
904 // code is only executed when we enter a region, and not when we walk
905 // around in it, we (only) need to take into account regions that fall
906 // within the draw_distance.
907 //
908 // Set 'range' to draw_distance, rounded up to the nearest multiple of rwidth.
909 S32 const nsims = (draw_distance + rwidth - 1) / rwidth;
910 S32 const range = nsims * rwidth;
911
912 // Get South-West corner of current region.
913 LLViewerRegion const* regionp = gAgent.getRegion();
834 U32 region_x, region_y; 914 U32 region_x, region_y;
835
836 S32 rwidth = 256;
837
838 // We only want to fill in water for stuff that's near us, say, within 256 or 512m
839 S32 range = LLViewerCamera::getInstance()->getFar() > 256.f ? 512 : 256;
840
841 LLViewerRegion* regionp = gAgent.getRegion();
842 from_region_handle(regionp->getHandle(), &region_x, &region_y); 915 from_region_handle(regionp->getHandle(), &region_x, &region_y);
843 916
844 min_x = (S32)region_x - range; 917 // The min. and max. coordinates of the South-West corners of the Hole water objects.
845 min_y = (S32)region_y - range; 918 S32 const min_x = (S32)region_x - range;
846 max_x = (S32)region_x + range; 919 S32 const min_y = (S32)region_y - range;
847 max_y = (S32)region_y + range; 920 S32 const max_x = (S32)region_x + range;
921 S32 const max_y = (S32)region_y + range;
922
923 // Attempt to determine a sensible water height for all the
924 // Hole Water objects.
925 //
926 // It make little sense to try to guess what the best water
927 // height should be when that isn't completely obvious: if it's
928 // impossible to satisfy every region's water height without
929 // getting a jump in the water height.
930 //
931 // In order to keep the reasoning simple, we assume something
932 // logical as a group of connected regions, where the coastline
933 // is at the outer edge. Anything more complex that would "break"
934 // under such an assumption would probably break anyway (would
935 // depend on terrain editing and existing mega prims, say, if
936 // anything would make sense at all).
937 //
938 // So, what we do is find all connected regions within the
939 // draw distance that border void, and then pick the lowest
940 // water height of those (coast) regions.
941 S32 const n = 2 * nsims + 1;
942 S32 const origin = nsims + nsims * n;
943 std::vector<F32> water_heights(n * n);
944 std::vector<U8> checked(n * n, 0); // index = nx + ny * n + origin;
945 U8 const region_bit = 1;
946 U8 const hole_bit = 2;
947 U8 const bordering_hole_bit = 4;
948 U8 const bordering_edge_bit = 8;
949 // Use the legacy waterheight for the Edge water in the case
950 // that we don't find any Hole water at all.
951 F32 water_height = DEFAULT_WATER_HEIGHT;
952 int max_count = 0;
953 LL_DEBUGS("WaterHeight") << "Current region: " << regionp->getName() << "; water height: " << regionp->getWaterHeight() << " m." << LL_ENDL;
954 std::map<S32, int> water_height_counts;
955 typedef std::queue<std::pair<S32, S32>, std::deque<std::pair<S32, S32> > > nxny_pairs_type;
956 nxny_pairs_type nxny_pairs;
957 nxny_pairs.push(nxny_pairs_type::value_type(0, 0));
958 water_heights[origin] = regionp->getWaterHeight();
959 checked[origin] = region_bit;
960 // For debugging purposes.
961 int number_of_connected_regions = 1;
962 int uninitialized_regions = 0;
963 int bordering_hole = 0;
964 int bordering_edge = 0;
965 while(!nxny_pairs.empty())
966 {
967 S32 const nx = nxny_pairs.front().first;
968 S32 const ny = nxny_pairs.front().second;
969 LL_DEBUGS("WaterHeight") << "nx,ny = " << nx << "," << ny << LL_ENDL;
970 S32 const index = nx + ny * n + origin;
971 nxny_pairs.pop();
972 for (S32 dir = 0; dir < 4; ++dir)
973 {
974 S32 const cnx = nx + gDirAxes[dir][0];
975 S32 const cny = ny + gDirAxes[dir][1];
976 LL_DEBUGS("WaterHeight") << "dir = " << dir << "; cnx,cny = " << cnx << "," << cny << LL_ENDL;
977 S32 const cindex = cnx + cny * n + origin;
978 bool is_hole = false;
979 bool is_edge = false;
980 LLViewerRegion* new_region_found = NULL;
981 if (cnx < -nsims || cnx > nsims ||
982 cny < -nsims || cny > nsims)
983 {
984 LL_DEBUGS("WaterHeight") << " Edge Water!" << LL_ENDL;
985 // Bumped into Edge water object.
986 is_edge = true;
987 }
988 else if (checked[cindex])
989 {
990 LL_DEBUGS("WaterHeight") << " Already checked before!" << LL_ENDL;
991 // Already checked.
992 is_hole = (checked[cindex] & hole_bit);
993 }
994 else
995 {
996 S32 x = (S32)region_x + cnx * rwidth;
997 S32 y = (S32)region_y + cny * rwidth;
998 U64 region_handle = to_region_handle(x, y);
999 new_region_found = getRegionFromHandle(region_handle);
1000 is_hole = !new_region_found;
1001 checked[cindex] = is_hole ? hole_bit : region_bit;
1002 }
1003 if (is_hole)
1004 {
1005 // This was a region that borders at least one 'hole'.
1006 // Count the found coastline.
1007 F32 new_water_height = water_heights[index];
1008 LL_DEBUGS("WaterHeight") << " This is void; counting coastline with water height of " << new_water_height << LL_ENDL;
1009 S32 new_water_height_cm = llround(new_water_height * 100);
1010 int count = (water_height_counts[new_water_height_cm] += 1);
1011 // Just use the lowest water height: this is mainly about the horizon water,
1012 // and whatever we do, we don't want it to be possible to look under the water
1013 // when looking in the distance: it is better to make a step downwards in water
1014 // height when going away from the avie than a step upwards. However, since
1015 // everyone is used to DEFAULT_WATER_HEIGHT, don't allow a single region
1016 // to drag the water level below DEFAULT_WATER_HEIGHT on it's own.
1017 if (bordering_hole == 0 || // First time we get here.
1018 (new_water_height >= DEFAULT_WATER_HEIGHT &&
1019 new_water_height < water_height) ||
1020 (new_water_height < DEFAULT_WATER_HEIGHT &&
1021 count > max_count)
1022 )
1023 {
1024 water_height = new_water_height;
1025 }
1026 if (count > max_count)
1027 {
1028 max_count = count;
1029 }
1030 if (!(checked[index] & bordering_hole_bit))
1031 {
1032 checked[index] |= bordering_hole_bit;
1033 ++bordering_hole;
1034 }
1035 }
1036 else if (is_edge && !(checked[index] & bordering_edge_bit))
1037 {
1038 checked[index] |= bordering_edge_bit;
1039 ++bordering_edge;
1040 }
1041 if (!new_region_found)
1042 {
1043 // Dead end, there is no region here.
1044 continue;
1045 }
1046 // Found a new connected region.
1047 ++number_of_connected_regions;
1048 if (new_region_found->getName().empty())
1049 {
1050 // Uninitialized LLViewerRegion, don't use it's water height.
1051 LL_DEBUGS("WaterHeight") << " Uninitialized region." << LL_ENDL;
1052 ++uninitialized_regions;
1053 continue;
1054 }
1055 nxny_pairs.push(nxny_pairs_type::value_type(cnx, cny));
1056 water_heights[cindex] = new_region_found->getWaterHeight();
1057 LL_DEBUGS("WaterHeight") << " Found a new region (name: " << new_region_found->getName() << "; water height: " << water_heights[cindex] << " m)!" << LL_ENDL;
1058 }
1059 }
1060 llinfos << "Number of connected regions: " << number_of_connected_regions << " (" << uninitialized_regions <<
1061 " uninitialized); number of regions bordering Hole water: " << bordering_hole <<
1062 "; number of regions bordering Edge water: " << bordering_edge << llendl;
1063 llinfos << "Coastline count (height, count): ";
1064 bool first = true;
1065 for (std::map<S32, int>::iterator iter = water_height_counts.begin(); iter != water_height_counts.end(); ++iter)
1066 {
1067 if (!first) llcont << ", ";
1068 llcont << "(" << (iter->first / 100.f) << ", " << iter->second << ")";
1069 first = false;
1070 }
1071 llcont << llendl;
1072 llinfos << "Water height used for Hole and Edge water objects: " << water_height << llendl;
848 1073
849 F32 height = 0.f; 1074 // Update all Region water objects.
850 1075 for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter)
851 for (region_list_t::iterator iter = mRegionList.begin();
852 iter != mRegionList.end(); ++iter)
853 { 1076 {
854 LLViewerRegion* regionp = *iter; 1077 LLViewerRegion* regionp = *iter;
855 LLVOWater* waterp = regionp->getLand().getWaterObj(); 1078 LLVOWater* waterp = regionp->getLand().getWaterObj();
856 height += regionp->getWaterHeight();
857 if (waterp) 1079 if (waterp)
858 { 1080 {
859 gObjectList.updateActive(waterp); 1081 gObjectList.updateActive(waterp);
860 } 1082 }
861 } 1083 }
862 1084
1085 // Clean up all existing Hole water objects.
863 for (std::list<LLVOWater*>::iterator iter = mHoleWaterObjects.begin(); 1086 for (std::list<LLVOWater*>::iterator iter = mHoleWaterObjects.begin();
864 iter != mHoleWaterObjects.end(); ++ iter) 1087 iter != mHoleWaterObjects.end(); ++iter)
865 { 1088 {
866 LLVOWater* waterp = *iter; 1089 LLVOWater* waterp = *iter;
867 gObjectList.killObject(waterp); 1090 gObjectList.killObject(waterp);
868 } 1091 }
869 mHoleWaterObjects.clear(); 1092 mHoleWaterObjects.clear();
870 1093
871 // Now, get a list of the holes 1094 // Let the Edge and Hole water boxes be 1024 meter high so that they
872 S32 x, y; 1095 // are never too small to be drawn (A LL_VO_*_WATER box has water
873 for (x = min_x; x <= max_x; x += rwidth) 1096 // rendered on it's bottom surface only), and put their bottom at
1097 // the current regions water height.
1098 F32 const box_height = 1024;
1099 F32 const water_center_z = water_height + box_height / 2;
1100
1101 // Create new Hole water objects within 'range' where there is no region.
1102 for (S32 x = min_x; x <= max_x; x += rwidth)
874 { 1103 {
875 for (y = min_y; y <= max_y; y += rwidth) 1104 for (S32 y = min_y; y <= max_y; y += rwidth)
876 { 1105 {
877 U64 region_handle = to_region_handle(x, y); 1106 U64 region_handle = to_region_handle(x, y);
878 if (!getRegionFromHandle(region_handle)) 1107 if (!getRegionFromHandle(region_handle))
879 { 1108 {
880 LLVOWater* waterp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, gAgent.getRegion()); 1109 LLVOWater* waterp = (LLVOWater*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER, gAgent.getRegion());
881 waterp->setUseTexture(FALSE); 1110 waterp->setUseTexture(FALSE);
882 waterp->setPositionGlobal(LLVector3d(x + rwidth/2, 1111 waterp->setPositionGlobal(LLVector3d(x + rwidth / 2, y + rwidth / 2, water_center_z));
883 y + rwidth/2, 1112 waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, box_height));
884 256.f+DEFAULT_WATER_HEIGHT));
885 waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, 512.f));
886 gPipeline.createObject(waterp); 1113 gPipeline.createObject(waterp);
887 mHoleWaterObjects.push_back(waterp); 1114 mHoleWaterObjects.push_back(waterp);
888 } 1115 }
889 } 1116 }
890 } 1117 }
891 1118
892 // Update edge water objects 1119 // Center of the region.
893 S32 wx, wy; 1120 S32 const center_x = region_x + rwidth / 2;
894 S32 center_x, center_y; 1121 S32 const center_y = region_y + rwidth / 2;
895 wx = (max_x - min_x) + rwidth; 1122 // Width of the area with Hole water objects.
896 wy = (max_y - min_y) + rwidth; 1123 S32 const width = rwidth + 2 * range;
897 center_x = min_x + (wx >> 1); 1124 S32 const horizon_extend = 2048 + 512 - range; // Legacy value.
898 center_y = min_y + (wy >> 1); 1125 // The overlap is needed to get rid of sky pixels being visible between the
899 1126 // Edge and Hole water object at greater distances (due to floating point
900 S32 add_boundary[4] = { 1127 // round off errors).
901 512 - (max_x - region_x), 1128 S32 const edge_hole_overlap = 1; // Twice the actual overlap.
902 512 - (max_y - region_y), 1129
903 512 - (region_x - min_x), 1130 for (S32 dir = 0; dir < 8; ++dir)
904 512 - (region_y - min_y) };
905
906 S32 dir;
907 for (dir = 0; dir < 8; dir++)
908 { 1131 {
909 S32 dim[2] = { 0 }; 1132 // Size of the Edge water objects.
910 switch (gDirAxes[dir][0]) 1133 S32 const dim_x = (gDirAxes[dir][0] == 0) ? width : (horizon_extend + edge_hole_overlap);
911 { 1134 S32 const dim_y = (gDirAxes[dir][1] == 0) ? width : (horizon_extend + edge_hole_overlap);
912 case -1: dim[0] = add_boundary[2]; break; 1135 // And their position.
913 case 0: dim[0] = wx; break; 1136 S32 const water_center_x = center_x + (width + horizon_extend) / 2 * gDirAxes[dir][0];
914 default: dim[0] = add_boundary[0]; break; 1137 S32 const water_center_y = center_y + (width + horizon_extend) / 2 * gDirAxes[dir][1];
915 }
916 switch (gDirAxes[dir][1])
917 {
918 case -1: dim[1] = add_boundary[3]; break;
919 case 0: dim[1] = wy; break;
920 default: dim[1] = add_boundary[1]; break;
921 }
922 1138
923 // Resize and reshape the water objects
924 const S32 water_center_x = center_x + llround((wx + dim[0]) * 0.5f * gDirAxes[dir][0]);
925 const S32 water_center_y = center_y + llround((wy + dim[1]) * 0.5f * gDirAxes[dir][1]);
926
927 LLVOWater* waterp = mEdgeWaterObjects[dir]; 1139 LLVOWater* waterp = mEdgeWaterObjects[dir];
928 if (!waterp || waterp->isDead()) 1140 if (!waterp || waterp->isDead())
929 { 1141 {
930 // The edge water objects can be dead because they're attached to the region that the 1142 // The edge water objects can be dead because they're attached to the region that the
931 // agent was in when they were originally created. 1143 // agent was in when they were originally created.
932 mEdgeWaterObjects[dir] = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, 1144 mEdgeWaterObjects[dir] = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER, gAgent.getRegion());
933 gAgent.getRegion());
934 waterp = mEdgeWaterObjects[dir]; 1145 waterp = mEdgeWaterObjects[dir];
935 waterp->setUseTexture(FALSE); 1146 waterp->setUseTexture(FALSE);
936 waterp->setIsEdgePatch(TRUE); 1147 waterp->setIsEdgePatch(TRUE); // Mark that this is edge water and not hole water.
937 gPipeline.createObject(waterp); 1148 gPipeline.createObject(waterp);
938 } 1149 }
939 1150
940 waterp->setRegion(gAgent.getRegion()); 1151 waterp->setRegion(gAgent.getRegion());
941 LLVector3d water_pos(water_center_x, water_center_y, 1152 LLVector3d water_pos(water_center_x, water_center_y, water_center_z);
942 DEFAULT_WATER_HEIGHT+256.f); 1153 LLVector3 water_scale((F32) dim_x, (F32) dim_y, box_height);
943 LLVector3 water_scale((F32) dim[0], (F32) dim[1], 512.f);
944
945 //stretch out to horizon
946 water_scale.mV[0] += fabsf(2048.f * gDirAxes[dir][0]);
947 water_scale.mV[1] += fabsf(2048.f * gDirAxes[dir][1]);
948
949 water_pos.mdV[0] += 1024.f * gDirAxes[dir][0];
950 water_pos.mdV[1] += 1024.f * gDirAxes[dir][1];
951 1154
952 waterp->setPositionGlobal(water_pos); 1155 waterp->setPositionGlobal(water_pos);
953 waterp->setScale(water_scale); 1156 waterp->setScale(water_scale);
diff --git a/linden/indra/newview/llworld.h b/linden/indra/newview/llworld.h
index 46aefd9..2c5815c 100644
--- a/linden/indra/newview/llworld.h
+++ b/linden/indra/newview/llworld.h
@@ -142,6 +142,7 @@ public:
142 142
143 LLViewerImage *getDefaultWaterTexture(); 143 LLViewerImage *getDefaultWaterTexture();
144 void updateWaterObjects(); 144 void updateWaterObjects();
145 void waterHeightRegionInfo(std::string const& sim_name, F32 water_height);
145 void shiftRegions(const LLVector3& offset); 146 void shiftRegions(const LLVector3& offset);
146 147
147 void setSpaceTimeUSec(const U64 space_time_usec); 148 void setSpaceTimeUSec(const U64 space_time_usec);
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index f10aca5..0ca94dc 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -1014,8 +1014,8 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
1014 { 1014 {
1015 return 0; 1015 return 0;
1016 } 1016 }
1017 1017 static BOOL sRenderDelayCreation = gSavedSettings.getBOOL("RenderDelayCreation");
1018 if (gSavedSettings.getBOOL("RenderDelayCreation")) 1018 if (sRenderDelayCreation)
1019 { 1019 {
1020 mCreateQ.push_back(vobj); 1020 mCreateQ.push_back(vobj);
1021 } 1021 }
@@ -1078,7 +1078,9 @@ void LLPipeline::createObject(LLViewerObject* vobj)
1078 1078
1079 markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE); 1079 markRebuild(drawablep, LLDrawable::REBUILD_ALL, TRUE);
1080 1080
1081 if (drawablep->getVOVolume() && gSavedSettings.getBOOL("RenderAnimateRes")) 1081 static BOOL sRenderAnimateRes = gSavedSettings.getBOOL("RenderAnimateRes");
1082
1083 if (drawablep->getVOVolume() && sRenderAnimateRes)
1082 { 1084 {
1083 // fun animated res 1085 // fun animated res
1084 drawablep->updateXform(TRUE); 1086 drawablep->updateXform(TRUE);
@@ -1117,7 +1119,8 @@ void LLPipeline::resetFrameStats()
1117//external functions for asynchronous updating 1119//external functions for asynchronous updating
1118void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep) 1120void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep)
1119{ 1121{
1120 if (gSavedSettings.getBOOL("FreezeTime")) 1122 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
1123 if ((*sFreezeTime))
1121 { 1124 {
1122 return; 1125 return;
1123 } 1126 }
@@ -1147,7 +1150,8 @@ void LLPipeline::updateMoveDampedAsync(LLDrawable* drawablep)
1147 1150
1148void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep) 1151void LLPipeline::updateMoveNormalAsync(LLDrawable* drawablep)
1149{ 1152{
1150 if (gSavedSettings.getBOOL("FreezeTime")) 1153 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
1154 if ((*sFreezeTime))
1151 { 1155 {
1152 return; 1156 return;
1153 } 1157 }
@@ -1200,7 +1204,8 @@ void LLPipeline::updateMove()
1200 LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE); 1204 LLFastTimer t(LLFastTimer::FTM_UPDATE_MOVE);
1201 LLMemType mt(LLMemType::MTYPE_PIPELINE); 1205 LLMemType mt(LLMemType::MTYPE_PIPELINE);
1202 1206
1203 if (gSavedSettings.getBOOL("FreezeTime")) 1207 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
1208 if ((*sFreezeTime))
1204 { 1209 {
1205 return; 1210 return;
1206 } 1211 }
@@ -1833,11 +1838,12 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f
1833void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) 1838void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result)
1834{ 1839{
1835 const U32 face_mask = (1 << LLPipeline::RENDER_TYPE_AVATAR) | 1840 const U32 face_mask = (1 << LLPipeline::RENDER_TYPE_AVATAR) |
1836 (1 << LLPipeline::RENDER_TYPE_GROUND) | 1841 (1 << LLPipeline::RENDER_TYPE_GROUND) |
1837 (1 << LLPipeline::RENDER_TYPE_TERRAIN) | 1842 (1 << LLPipeline::RENDER_TYPE_TERRAIN) |
1838 (1 << LLPipeline::RENDER_TYPE_TREE) | 1843 (1 << LLPipeline::RENDER_TYPE_TREE) |
1839 (1 << LLPipeline::RENDER_TYPE_SKY) | 1844 (1 << LLPipeline::RENDER_TYPE_SKY) |
1840 (1 << LLPipeline::RENDER_TYPE_WATER); 1845 (1 << LLPipeline::RENDER_TYPE_VOIDWATER) |
1846 (1 << LLPipeline::RENDER_TYPE_WATER);
1841 1847
1842 if (mRenderTypeMask & face_mask) 1848 if (mRenderTypeMask & face_mask)
1843 { 1849 {
@@ -2294,8 +2300,10 @@ void LLPipeline::postSort(LLCamera& camera)
2294 std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater()); 2300 std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
2295 } 2301 }
2296 2302
2303 static BOOL* sBeaconsEnabled = rebind_llcontrol<BOOL>("BeaconsEnabled", &gSavedSettings, true);
2304
2297 // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus 2305 // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus
2298 if (gSavedSettings.getBOOL("BeaconsEnabled") && !sShadowRender) 2306 if (*sBeaconsEnabled && !sShadowRender)
2299 { 2307 {
2300 if (sRenderScriptedTouchBeacons) 2308 if (sRenderScriptedTouchBeacons)
2301 { 2309 {
@@ -4436,6 +4444,11 @@ void LLPipeline::toggleRenderType(U32 type)
4436{ 4444{
4437 U32 bit = (1<<type); 4445 U32 bit = (1<<type);
4438 gPipeline.mRenderTypeMask ^= bit; 4446 gPipeline.mRenderTypeMask ^= bit;
4447 if (type == RENDER_TYPE_WATER)
4448 {
4449 bit = (1 << RENDER_TYPE_VOIDWATER);
4450 gPipeline.mRenderTypeMask ^= bit;
4451 }
4439} 4452}
4440 4453
4441//static 4454//static
@@ -5744,18 +5757,19 @@ void LLPipeline::renderDeferredLighting()
5744 LLGLDisable stencil(GL_STENCIL_TEST); 5757 LLGLDisable stencil(GL_STENCIL_TEST);
5745 5758
5746 U32 render_mask = mRenderTypeMask; 5759 U32 render_mask = mRenderTypeMask;
5747 mRenderTypeMask = mRenderTypeMask & 5760 mRenderTypeMask = mRenderTypeMask &
5748 ((1 << LLPipeline::RENDER_TYPE_SKY) | 5761 ((1 << LLPipeline::RENDER_TYPE_SKY) |
5749 (1 << LLPipeline::RENDER_TYPE_CLOUDS) | 5762 (1 << LLPipeline::RENDER_TYPE_CLOUDS) |
5750 (1 << LLPipeline::RENDER_TYPE_WL_SKY) | 5763 (1 << LLPipeline::RENDER_TYPE_WL_SKY) |
5751 (1 << LLPipeline::RENDER_TYPE_ALPHA) | 5764 (1 << LLPipeline::RENDER_TYPE_ALPHA) |
5752 (1 << LLPipeline::RENDER_TYPE_AVATAR) | 5765 (1 << LLPipeline::RENDER_TYPE_AVATAR) |
5753 (1 << LLPipeline::RENDER_TYPE_WATER) | 5766 (1 << LLPipeline::RENDER_TYPE_VOIDWATER) |
5754 (1 << LLPipeline::RENDER_TYPE_FULLBRIGHT) | 5767 (1 << LLPipeline::RENDER_TYPE_WATER) |
5755 (1 << LLPipeline::RENDER_TYPE_VOLUME) | 5768 (1 << LLPipeline::RENDER_TYPE_FULLBRIGHT) |
5756 (1 << LLPipeline::RENDER_TYPE_GLOW) | 5769 (1 << LLPipeline::RENDER_TYPE_VOLUME) |
5757 (1 << LLPipeline::RENDER_TYPE_BUMP)); 5770 (1 << LLPipeline::RENDER_TYPE_GLOW) |
5758 5771 (1 << LLPipeline::RENDER_TYPE_BUMP));
5772
5759 renderGeomPostDeferred(*LLViewerCamera::getInstance()); 5773 renderGeomPostDeferred(*LLViewerCamera::getInstance());
5760 mRenderTypeMask = render_mask; 5774 mRenderTypeMask = render_mask;
5761 } 5775 }
@@ -5910,10 +5924,11 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
5910 5924
5911 if (LLDrawPoolWater::sNeedsDistortionUpdate) 5925 if (LLDrawPoolWater::sNeedsDistortionUpdate)
5912 { 5926 {
5913 mRenderTypeMask &= ~((1<<LLPipeline::RENDER_TYPE_WATER) | 5927 mRenderTypeMask &= ~((1<<LLPipeline::RENDER_TYPE_WATER) |
5914 (1<<LLPipeline::RENDER_TYPE_GROUND) | 5928 (1<<LLPipeline::RENDER_TYPE_VOIDWATER) |
5915 (1<<LLPipeline::RENDER_TYPE_SKY) | 5929 (1<<LLPipeline::RENDER_TYPE_GROUND) |
5916 (1<<LLPipeline::RENDER_TYPE_CLOUDS)); 5930 (1<<LLPipeline::RENDER_TYPE_SKY) |
5931 (1<<LLPipeline::RENDER_TYPE_CLOUDS));
5917 5932
5918 if (gSavedSettings.getBOOL("RenderWaterReflections")) 5933 if (gSavedSettings.getBOOL("RenderWaterReflections"))
5919 { //mask out selected geometry based on reflection detail 5934 { //mask out selected geometry based on reflection detail
@@ -5955,8 +5970,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
5955 if (last_update) 5970 if (last_update)
5956 { 5971 {
5957 camera.setFar(camera_in.getFar()); 5972 camera.setFar(camera_in.getFar());
5958 mRenderTypeMask = type_mask & (~(1<<LLPipeline::RENDER_TYPE_WATER) | 5973 mRenderTypeMask = type_mask & ~((1<<LLPipeline::RENDER_TYPE_WATER) |
5959 (1<<LLPipeline::RENDER_TYPE_GROUND)); 5974 (1<<LLPipeline::RENDER_TYPE_VOIDWATER) |
5975 (1<<LLPipeline::RENDER_TYPE_GROUND));
5960 stop_glerror(); 5976 stop_glerror();
5961 5977
5962 LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE; 5978 LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE;
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index 1a32b30..3f3309a 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -314,8 +314,9 @@ public:
314 RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR, 314 RENDER_TYPE_AVATAR = LLDrawPool::POOL_AVATAR,
315 RENDER_TYPE_TREE = LLDrawPool::POOL_TREE, 315 RENDER_TYPE_TREE = LLDrawPool::POOL_TREE,
316 RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE, 316 RENDER_TYPE_INVISIBLE = LLDrawPool::POOL_INVISIBLE,
317 RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER,
317 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, 318 RENDER_TYPE_WATER = LLDrawPool::POOL_WATER,
318 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, 319 RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA,
319 RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, 320 RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW,
320 321
321 // Following are object types (only used in drawable mRenderType) 322 // Following are object types (only used in drawable mRenderType)
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 fffab6c..66d78bd 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
@@ -1554,6 +1554,11 @@
1554 <on_check control="ShowSearchBar" /> 1554 <on_check control="ShowSearchBar" />
1555 </menu_item_check> 1555 </menu_item_check>
1556 1556
1557 <menu_item_call name="Reload Balance" label="Reload [CURRENCY] balance" shortcut="control|alt|B">
1558 <on_click function="Advanced.ReloadBalance" userdata="" />
1559 </menu_item_call>
1560
1561
1557 <menu_item_separator /> 1562 <menu_item_separator />
1558 1563
1559 <menu_item_call name="Web Browser Test" label="Web Browser Test"> 1564 <menu_item_call name="Web Browser Test" label="Web Browser Test">
@@ -1803,7 +1808,7 @@
1803 <menu_item_call name="Test Female" label="Test Female"> 1808 <menu_item_call name="Test Female" label="Test Female">
1804 <on_click function="Advanced.TestFemale" userdata="" /> 1809 <on_click function="Advanced.TestFemale" userdata="" />
1805 </menu_item_call> 1810 </menu_item_call>
1806 <menu_item_call name="Toggle PG" label="Toggle PG"> 1811 <menu_item_call name="Toggle PG" label="Toggle Teen Mode">
1807 <on_click function="Advanced.TogglePG" userdata="" /> 1812 <on_click function="Advanced.TogglePG" userdata="" />
1808 </menu_item_call> 1813 </menu_item_call>
1809 <menu_item_check name="Allow Select Avatar" 1814 <menu_item_check name="Allow Select Avatar"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
index dda5e4d..96f3f77 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml
@@ -58,7 +58,8 @@
58 bevel_style="in" border_style="line" border_thickness="1" 58 bevel_style="in" border_style="line" border_thickness="1"
59 max_length="31" mouse_opaque="true" 59 max_length="31" mouse_opaque="true"
60 handle_edit_keys_directly="true" 60 handle_edit_keys_directly="true"
61 select_all_on_focus_received="true" /> 61 select_all_on_focus_received="true"
62 allow_translate="false" />
62 63
63 64
64 <!-- LAST NAME --> 65 <!-- LAST NAME -->
@@ -77,7 +78,8 @@
77 bevel_style="in" border_style="line" border_thickness="1" 78 bevel_style="in" border_style="line" border_thickness="1"
78 max_length="31" mouse_opaque="true" 79 max_length="31" mouse_opaque="true"
79 handle_edit_keys_directly="true" 80 handle_edit_keys_directly="true"
80 select_all_on_focus_received="true" /> 81 select_all_on_focus_received="true"
82 allow_translate="false" />
81 83
82 84
83 <!-- PASSWORD --> 85 <!-- PASSWORD -->
@@ -96,7 +98,8 @@
96 bevel_style="in" border_style="line" border_thickness="1" 98 bevel_style="in" border_style="line" border_thickness="1"
97 max_length="16" mouse_opaque="true" 99 max_length="16" mouse_opaque="true"
98 handle_edit_keys_directly="true" 100 handle_edit_keys_directly="true"
99 select_all_on_focus_received="true" /> 101 select_all_on_focus_received="true"
102 allow_translate="false" />
100 <check_box name="remember_check" label="Remember password" 103 <check_box name="remember_check" label="Remember password"
101 bottom_delta="-24" left_delta="0" height="16" width="140" 104 bottom_delta="-24" left_delta="0" height="16" width="140"
102 follows="left|bottom" font="SansSerifSmall" control_name="RememberPassword" 105 follows="left|bottom" font="SansSerifSmall" control_name="RememberPassword"