From a7e72ceb32b038f03a2a5cd853149b5ee42c0f8d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 7 Nov 2013 18:19:34 +0100 Subject: [PATCH 01/15] AIFile bug fixes. Compare with errno instead of rc. Make sure errno is preserved. --- indra/llcommon/aifile.cpp | 13 +++++++------ indra/llcommon/llfile.cpp | 33 ++++++++++++++++++++++++++++----- indra/llcommon/llfile.h | 6 ++++++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/aifile.cpp b/indra/llcommon/aifile.cpp index c963f5109..cd2ade77a 100644 --- a/indra/llcommon/aifile.cpp +++ b/indra/llcommon/aifile.cpp @@ -61,8 +61,8 @@ AIFile::~AIFile() //static void AIFile::mkdir(std::string const& dirname, int perms) { - int rc = LLFile::mkdir(dirname, perms); - if (rc < 0 && rc != EEXIST) + int rc = LLFile::mkdir_nowarn(dirname, perms); + if (rc < 0 && errno != EEXIST) { THROW_ERROR("AIFile_mkdir_Failed_to_create_DIRNAME", AIArgs("[DIRNAME]", dirname)); } @@ -71,8 +71,8 @@ void AIFile::mkdir(std::string const& dirname, int perms) //static void AIFile::rmdir(std::string const& dirname) { - int rc = LLFile::rmdir(dirname); - if (rc < 0 && rc != ENOENT) + int rc = LLFile::rmdir_nowarn(dirname); + if (rc < 0 && errno != ENOENT) { THROW_ERROR("AIFile_rmdir_Failed_to_remove_DIRNAME", AIArgs("[DIRNAME]", dirname)); } @@ -101,7 +101,8 @@ void AIFile::close(LLFILE* file) //static void AIFile::remove(std::string const& filename) { - if (LLFile::remove(filename) < 0) + int rc = LLFile::remove_nowarn(filename); + if (rc < 0 && errno != ENOENT) { THROW_ERROR("AIFile_remove_Failed_to_remove_FILENAME", AIArgs("[FILENAME]", filename)); } @@ -110,7 +111,7 @@ void AIFile::remove(std::string const& filename) //static void AIFile::rename(std::string const& filename, std::string const& newname) { - if (LLFile::rename(filename, newname) < 0) + if (LLFile::rename_nowarn(filename, newname) < 0) { THROW_ERROR("AIFile_rename_Failed_to_rename_FILE_to_NEWFILE", AIArgs("[FILE]", filename)("[NEWFILE]", newname)); } diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index 4a34ffaf9..686a516b9 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -174,7 +174,7 @@ int warnif(const std::string& desc, const std::string& filename, int rc, int acc } // static -int LLFile::mkdir(const std::string& dirname, int perms) +int LLFile::mkdir_nowarn(const std::string& dirname, int perms) { #if LL_WINDOWS // permissions are ignored on Windows @@ -184,13 +184,19 @@ int LLFile::mkdir(const std::string& dirname, int perms) #else int rc = ::mkdir(dirname.c_str(), (mode_t)perms); #endif + return rc; +} + +int LLFile::mkdir(const std::string& dirname, int perms) +{ + int rc = LLFile::mkdir_nowarn(dirname, perms); // We often use mkdir() to ensure the existence of a directory that might // already exist. Don't spam the log if it does. return warnif("mkdir", dirname, rc, EEXIST); } // static -int LLFile::rmdir(const std::string& dirname) +int LLFile::rmdir_nowarn(const std::string& dirname) { #if LL_WINDOWS // permissions are ignored on Windows @@ -200,6 +206,12 @@ int LLFile::rmdir(const std::string& dirname) #else int rc = ::rmdir(dirname.c_str()); #endif + return rc; +} + +int LLFile::rmdir(const std::string& dirname) +{ + int rc = LLFile::rmdir_nowarn(dirname); return warnif("rmdir", dirname, rc); } @@ -241,8 +253,7 @@ int LLFile::close(LLFILE * file) return ret_value; } - -int LLFile::remove(const std::string& filename) +int LLFile::remove_nowarn(const std::string& filename) { #if LL_WINDOWS std::string utf8filename = filename; @@ -251,10 +262,16 @@ int LLFile::remove(const std::string& filename) #else int rc = ::remove(filename.c_str()); #endif + return rc; +} + +int LLFile::remove(const std::string& filename) +{ + int rc = LLFile::remove_nowarn(filename); return warnif("remove", filename, rc); } -int LLFile::rename(const std::string& filename, const std::string& newname) +int LLFile::rename_nowarn(const std::string& filename, const std::string& newname) { #if LL_WINDOWS std::string utf8filename = filename; @@ -265,6 +282,12 @@ int LLFile::rename(const std::string& filename, const std::string& newname) #else int rc = ::rename(filename.c_str(),newname.c_str()); #endif + return rc; +} + +int LLFile::rename(const std::string& filename, const std::string& newname) +{ + int rc = LLFile::rename_nowarn(filename, newname); return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc); } diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 1f5514f3e..cc990f6ab 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -68,6 +68,12 @@ public: static int close(LLFILE * file); + // Singu extension: the same as below, but doesn't print a warning as to leave errno alone. + static int mkdir_nowarn(const std::string& filename, int perms); + static int rmdir_nowarn(const std::string& filename); + static int remove_nowarn(const std::string& filename); + static int rename_nowarn(const std::string& filename, const std::string& newname); + // perms is a permissions mask like 0777 or 0700. In most cases it will // be overridden by the user's umask. It is ignored on Windows. static int mkdir(const std::string& filename, int perms = 0700); From 0d1c98b5f7ce13c02eb983d4bc7108a775bc0005 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 8 Nov 2013 02:03:21 -0600 Subject: [PATCH 02/15] Fix shadow dithering. It's still pretty ugly tho, but looks okay if ssao is enabled. May add random kern in the future. --- .../shaders/class1/deferred/alphaF.glsl | 20 ++++++++++--------- .../shaders/class1/deferred/materialF.glsl | 17 +++++++++------- .../shaders/class2/deferred/sunLightF.glsl | 12 ++++++----- .../class2/deferred/sunLightSSAOF.glsl | 6 ++++-- indra/newview/pipeline.cpp | 2 +- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 1aa3261fe..24b159bad 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -60,6 +60,7 @@ uniform sampler2DShadow shadowMap0; uniform sampler2DShadow shadowMap1; uniform sampler2DShadow shadowMap2; uniform sampler2DShadow shadowMap3; +uniform sampler2D noiseMap; uniform vec2 shadow_res; @@ -198,12 +199,13 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec } #if HAS_SHADOW -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) +float pcfShadow(sampler2DShadow shadowMap, vec4 stc, vec2 pos_screen) { stc.xyz /= stc.w; stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*shadow_res.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here + + stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/shadow_res.x); + //stc.x = floor(stc.x*shadow_res.x + fract(stc.y*shadow_res.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -451,14 +453,14 @@ vec3 fullbrightScaleSoftClip(vec3 light) void main() { - vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; - frag *= screen_res; vec4 pos = vec4(vary_position, 1.0); float shadow = 1.0; #if HAS_SHADOW + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + frag *= screen_res; vec4 spos = pos; if (spos.z > -shadow_clip.w) @@ -478,7 +480,7 @@ void main() float w = 1.0; w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; + shadow += pcfShadow(shadowMap3, lpos,frag.xy)*w; weight += w; shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); } @@ -490,7 +492,7 @@ void main() float w = 1.0; w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; + shadow += pcfShadow(shadowMap2, lpos,frag.xy)*w; weight += w; } @@ -501,7 +503,7 @@ void main() float w = 1.0; w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; + shadow += pcfShadow(shadowMap1, lpos,frag.xy)*w; weight += w; } @@ -512,7 +514,7 @@ void main() float w = 1.0; w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - shadow += pcfShadow(shadowMap0, lpos)*w; + shadow += pcfShadow(shadowMap0, lpos,frag.xy)*w; weight += w; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 04f17e853..a3e754899 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -82,18 +82,20 @@ uniform sampler2DShadow shadowMap0; uniform sampler2DShadow shadowMap1; uniform sampler2DShadow shadowMap2; uniform sampler2DShadow shadowMap3; +uniform sampler2D noiseMap; uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; uniform vec2 shadow_res; uniform float shadow_bias; -float pcfShadow(sampler2DShadow shadowMap, vec4 stc) +float pcfShadow(sampler2DShadow shadowMap, vec4 stc, vec2 pos_screen) { stc.xyz /= stc.w; stc.z += shadow_bias; - - stc.x = floor(stc.x*shadow_res.x + fract(stc.y*shadow_res.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here + + stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/shadow_res.x); + //stc.x = floor(stc.x*shadow_res.x + fract(stc.y*shadow_res.y*12345))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -598,6 +600,7 @@ void main() vec3 pos = vary_position; #if HAS_SUN_SHADOW + vec2 frag = vary_fragcoord.xy; float shadow = 0.0; vec4 spos = vec4(pos,1.0); @@ -617,7 +620,7 @@ void main() float w = 1.0; w -= max(spos.z-far_split.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap3, lpos)*w; + shadow += pcfShadow(shadowMap3, lpos,frag.xy)*w; weight += w; shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); } @@ -629,7 +632,7 @@ void main() float w = 1.0; w -= max(spos.z-far_split.y, 0.0)/transition_domain.y; w -= max(near_split.z-spos.z, 0.0)/transition_domain.z; - shadow += pcfShadow(shadowMap2, lpos)*w; + shadow += pcfShadow(shadowMap2, lpos,frag.xy)*w; weight += w; } @@ -640,7 +643,7 @@ void main() float w = 1.0; w -= max(spos.z-far_split.x, 0.0)/transition_domain.x; w -= max(near_split.y-spos.z, 0.0)/transition_domain.y; - shadow += pcfShadow(shadowMap1, lpos)*w; + shadow += pcfShadow(shadowMap1, lpos,frag.xy)*w; weight += w; } @@ -651,7 +654,7 @@ void main() float w = 1.0; w -= max(near_split.x-spos.z, 0.0)/transition_domain.x; - shadow += pcfShadow(shadowMap0, lpos)*w; + shadow += pcfShadow(shadowMap0, lpos,frag.xy)*w; weight += w; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 18f601f1b..64c1c8251 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -41,7 +41,7 @@ uniform sampler2DShadow shadowMap2; uniform sampler2DShadow shadowMap3; uniform sampler2DShadow shadowMap4; uniform sampler2DShadow shadowMap5; - +uniform sampler2D noiseMap; // Inputs uniform mat4 shadow_matrix[6]; @@ -100,15 +100,16 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen) stc.xyz /= stc.w; stc.z += shadow_bias; - stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*0.666666666))/shadow_res.x; // add some jitter to X sample pos according to Y to disguise the snapping going on here + stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/shadow_res.x); + //stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*0.666666666))/shadow_res.x; // add some chaotic jitter to X sample pos according to Y to disguise the snapping going on here float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; shadow += shadow2D(shadowMap, stc.xyz+vec3(2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; shadow += shadow2D(shadowMap, stc.xyz+vec3(1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; - shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; + shadow += shadow2D(shadowMap, stc.xyz+vec3(-1.0/shadow_res.x, 1.5/shadow_res.y, 0.0)).x; + shadow += shadow2D(shadowMap, stc.xyz+vec3(-2.0/shadow_res.x, -1.5/shadow_res.y, 0.0)).x; return shadow*0.2; @@ -118,7 +119,8 @@ float pcfSpotShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_scr { stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - stc.x = floor(proj_shadow_res.x * stc.x + fract(pos_screen.y*0.666666666)) / proj_shadow_res.x; // snap + stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/proj_shadow_res.x); + //stc.x = floor(proj_shadow_res.x * stc.x + fract(pos_screen.y*0.666666666)) / proj_shadow_res.x; // snap float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index c6d13db8e..09a7a766b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -156,7 +156,8 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_screen) stc.xyz /= stc.w; stc.z += shadow_bias; - stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*0.666666666))/shadow_res.x; + stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/shadow_res.x); + //stc.x = floor(stc.x*shadow_res.x + fract(pos_screen.y*0.666666666))/shadow_res.x; float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; @@ -173,7 +174,8 @@ float pcfSpotShadow(sampler2DShadow shadowMap, vec4 stc, float scl, vec2 pos_scr { stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - stc.x = floor(proj_shadow_res.x * stc.x + fract(pos_screen.y*0.666666666)) / proj_shadow_res.x; // snap + stc.x += (((texture2D(noiseMap, pos_screen/128.0).x)-.5)/proj_shadow_res.x); + //stc.x = floor(proj_shadow_res.x * stc.x + fract(pos_screen.y*0.666666666)) / proj_shadow_res.x; // snap float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 23192c52a..18ba87865 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -9642,7 +9642,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera renderMaskedObjects(LLRenderPass::PASS_ALPHA_MASK, mask, TRUE, TRUE); renderMaskedObjects(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, mask, TRUE, TRUE); gDeferredShadowAlphaMaskProgram.setMinimumAlpha(0.598f); - //renderObjects(LLRenderPass::PASS_ALPHA, mask, TRUE, TRUE); + renderObjects(LLRenderPass::PASS_ALPHA, mask, TRUE, TRUE); mask = mask & ~LLVertexBuffer::MAP_TEXTURE_INDEX; From 5f9c6f1b089f69c76eafd03815bcd38dfafb752e Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 9 Nov 2013 15:42:29 +0100 Subject: [PATCH 03/15] AIAlert fixup. --- indra/llcommon/aialert.cpp | 7 +++++++ indra/llcommon/aialert.h | 16 ++++++++++++---- indra/llui/llnotifications.cpp | 22 ++-------------------- indra/llui/llnotificationsutil.cpp | 27 ++++++++++++++++++++++++++- indra/llui/llnotificationsutil.h | 6 +++++- 5 files changed, 52 insertions(+), 26 deletions(-) diff --git a/indra/llcommon/aialert.cpp b/indra/llcommon/aialert.cpp index f3d4f5af3..587a206bc 100644 --- a/indra/llcommon/aialert.cpp +++ b/indra/llcommon/aialert.cpp @@ -35,6 +35,13 @@ namespace AIAlert { +Error::Error(Prefix const& prefix, modal_nt type, + Error const& alert) : mLines(alert.mLines), mModal(type) +{ + if (alert.mModal == modal) mModal = modal; + if (prefix) mLines.push_front(Line(prefix)); +} + Error::Error(Prefix const& prefix, modal_nt type, std::string const& xml_desc, AIArgs const& args) : mModal(type) { diff --git a/indra/llcommon/aialert.h b/indra/llcommon/aialert.h index 574426a9f..4d3704cfb 100644 --- a/indra/llcommon/aialert.h +++ b/indra/llcommon/aialert.h @@ -231,6 +231,9 @@ class LL_COMMON_API Error : public std::exception lines_type const& lines(void) const { return mLines; } bool is_modal(void) const { return mModal == modal; } + // Existing alert, just add a prefix and turn alert into modal if appropriate. + Error(Prefix const& prefix, modal_nt type, Error const& alert); + // A string with zero or more replacements. Error(Prefix const& prefix, modal_nt type, std::string const& xml_desc, AIArgs const& args = AIArgs()); @@ -269,28 +272,33 @@ class LL_COMMON_API ErrorCode : public Error // Accessor. int getCode(void) const { return mCode; } + // Just an Error with a code. + ErrorCode(Prefix const& prefix, modal_nt type, int code, + Error const& alert) : + Error(prefix, type, alert), mCode(code) { } + // A string with zero or more replacements. ErrorCode(Prefix const& prefix, modal_nt type, int code, std::string const& xml_desc, AIArgs const& args = AIArgs()) : - Error(prefix, modal, xml_desc, args) { } + Error(prefix, type, xml_desc, args), mCode(code) { } // Same as above bit prepending the message with the text of another alert. ErrorCode(Prefix const& prefix, modal_nt type, int code, Error const& alert, std::string const& xml_desc, AIArgs const& args = AIArgs()) : - Error(prefix, modal, alert, xml_desc, args) { } + Error(prefix, type, alert, xml_desc, args), mCode(code) { } // Same as above but appending the message with the text of another alert. // (no args) ErrorCode(Prefix const& prefix, modal_nt type, int code, std::string const& xml_desc, Error const& alert) : - Error(prefix, modal, xml_desc, alert) { } + Error(prefix, type, xml_desc, alert), mCode(code) { } // (with args) ErrorCode(Prefix const& prefix, modal_nt type, int code, std::string const& xml_desc, AIArgs const& args, Error const& alert) : - Error(prefix, modal, xml_desc, args, alert) { } + Error(prefix, type, xml_desc, args, alert), mCode(code) { } }; } // namespace AIAlert diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 73dd99109..b8fab0994 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1480,29 +1480,11 @@ LLNotificationPtr LLNotifications::add(const LLNotification::Params& p) return pNotif; } +namespace AIAlert { std::string text(Error const& error, int suppress_mask = 0); } LLNotificationPtr LLNotifications::add(AIAlert::Error const& error, int type, unsigned int suppress_mask) { - std::string alert_text; - bool suppress_newlines = false; - bool last_was_prefix = false; - for (AIAlert::Error::lines_type::const_iterator line = error.lines().begin(); line != error.lines().end(); ++line) - { - // Even if a line is suppressed, we print its leading newline if requested, but never more than one. - if (!suppress_newlines && line->prepend_newline()) - { - alert_text += '\n'; - suppress_newlines = true; - } - if (!line->suppressed(suppress_mask)) - { - if (last_was_prefix) alert_text += ' '; // The translation system strips off spaces... add them back. - alert_text += LLTrans::getString(line->getXmlDesc(), line->args()); - suppress_newlines = false; - last_was_prefix = line->is_prefix(); - } - } LLSD substitutions = LLSD::emptyMap(); - substitutions["[PAYLOAD]"] = alert_text; + substitutions["[PAYLOAD]"] = AIAlert::text(error, suppress_mask); return add(LLNotification::Params((type == AIAlert::modal || error.is_modal()) ? "AIAlertModal" : "AIAlert").substitutions(substitutions)); } diff --git a/indra/llui/llnotificationsutil.cpp b/indra/llui/llnotificationsutil.cpp index 134a5c267..4c24b511e 100644 --- a/indra/llui/llnotificationsutil.cpp +++ b/indra/llui/llnotificationsutil.cpp @@ -25,6 +25,7 @@ #include "linden_common.h" #include "llnotificationsutil.h" +#include "lltrans.h" #include "llnotifications.h" #include "llsd.h" @@ -33,7 +34,7 @@ namespace AIAlert { -LLNotificationPtr add(Error const& error, modal_nt type, unsigned int suppress_mask) +LLNotificationPtr add(Error const& error, unsigned int suppress_mask, modal_nt type) { return LLNotifications::instance().add(error, type, suppress_mask); } @@ -68,6 +69,30 @@ LLNotificationPtr add(std::string const& xml_desc, AIArgs const& args, Error con return LLNotifications::instance().add(Error(Prefix(), type, xml_desc, args, error), type, suppress_mask); } +std::string text(Error const& error, int suppress_mask) +{ + std::string alert_text; + bool suppress_newlines = false; + bool last_was_prefix = false; + for (Error::lines_type::const_iterator line = error.lines().begin(); line != error.lines().end(); ++line) + { + // Even if a line is suppressed, we print its leading newline if requested, but never more than one. + if (!suppress_newlines && line->prepend_newline()) + { + alert_text += '\n'; + suppress_newlines = true; + } + if (!line->suppressed(suppress_mask)) + { + if (last_was_prefix) alert_text += ' '; // The translation system strips off spaces... add them back. + alert_text += LLTrans::getString(line->getXmlDesc(), line->args()); + suppress_newlines = false; + last_was_prefix = line->is_prefix(); + } + } + return alert_text; +} + } // namespace AIAlert LLNotificationPtr LLNotificationsUtil::add(const std::string& name) diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h index fb0fb1ba4..893d2269c 100644 --- a/indra/llui/llnotificationsutil.h +++ b/indra/llui/llnotificationsutil.h @@ -64,7 +64,7 @@ namespace AIAlert // Just show the caught alert error. LLNotificationPtr add(Error const& error, - modal_nt type = not_modal, unsigned int suppress_mask = 0); + unsigned int suppress_mask = 0, modal_nt type = not_modal); // Short cuts for enforcing modal alerts. inline LLNotificationPtr add_modal(std::string const& xml_desc) { return add(xml_desc, modal); } @@ -73,6 +73,10 @@ namespace AIAlert inline LLNotificationPtr add_modal(Error const& error, std::string const& xml_desc, AIArgs const& args, unsigned int suppress_mask = 0) { return add(error, xml_desc, args, suppress_mask, modal); } inline LLNotificationPtr add_modal(std::string const& xml_desc, Error const& error, unsigned int suppress_mask = 0) { return add(xml_desc, error, suppress_mask, modal); } inline LLNotificationPtr add_modal(std::string const& xml_desc, AIArgs const& args, Error const& error, unsigned int suppress_mask = 0) { return add(xml_desc, args, error, suppress_mask, modal); } + inline LLNotificationPtr add_modal(Error const& error, unsigned int suppress_mask = 0) { return add(error, suppress_mask, modal); } + + // Return the full, translated, texted of the alert (possibly suppressing certain output). + std::string text(Error const& error, int suppress_mask = 0); } namespace LLNotificationsUtil From 297cd58295f0cf7437afa90c152b9b6bd6f34a86 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 9 Nov 2013 22:23:48 -0600 Subject: [PATCH 04/15] Revert upstream change to particle index accounting. (Fixes flicker issues) --- indra/newview/llviewerpartsim.cpp | 1 - indra/newview/llvopartgroup.cpp | 32 +++++++++++++++---------------- indra/newview/llvopartgroup.h | 6 +++--- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 660e48f22..8f07858cf 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -656,7 +656,6 @@ void LLViewerPartSim::updateSimulation() static LLFrameTimer update_timer; //reset VBO cursor - LLVOPartGroup::sVBSlotCursor = 0; const F32 dt = llmin(update_timer.getElapsedTimeAndResetF32(), 0.1f); diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index d9d3f2e18..11e8caa66 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -55,18 +55,18 @@ const F32 MAX_PART_LIFETIME = 120.f; extern U64 gFrameTime; LLPointer LLVOPartGroup::sVB = NULL; -/*S32 LLVOPartGroup::sVBSlotFree[]; -S32* LLVOPartGroup::sVBSlotCursor = NULL;*/ -S32 LLVOPartGroup::sVBSlotCursor = 0; +S32 LLVOPartGroup::sVBSlotFree[]; +S32* LLVOPartGroup::sVBSlotCursor = NULL; +//S32 LLVOPartGroup::sVBSlotCursor = 0; void LLVOPartGroup::initClass() { - /*for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i) + for (S32 i = 0; i < LL_MAX_PARTICLE_COUNT; ++i) { sVBSlotFree[i] = i; } - sVBSlotCursor = sVBSlotFree;*/ + sVBSlotCursor = sVBSlotFree; } //static @@ -131,22 +131,22 @@ void LLVOPartGroup::destroyGL() //static S32 LLVOPartGroup::findAvailableVBSlot() { - if (sVBSlotCursor >= /*sVBSlotFree+*/LL_MAX_PARTICLE_COUNT) + if (sVBSlotCursor >= sVBSlotFree+LL_MAX_PARTICLE_COUNT) { //no more available slots return -1; } - /*S32 ret = *sVBSlotCursor; + S32 ret = *sVBSlotCursor; sVBSlotCursor++; - return ret;*/ + return ret; - return sVBSlotCursor++; + //return sVBSlotCursor++; } bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) { - /*while (start < end) + while (start < end) { if (*start == idx) { //not allocated (in free list) @@ -156,14 +156,14 @@ bool ll_is_part_idx_allocated(S32 idx, S32* start, S32* end) } //allocated (not in free list) - return true;*/ - return false; + return true; + //return false; } //static void LLVOPartGroup::freeVBSlot(S32 idx) { - /*llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); + llassert(idx < LL_MAX_PARTICLE_COUNT && idx >= 0); llassert(sVBSlotCursor > sVBSlotFree); llassert(ll_is_part_idx_allocated(idx, sVBSlotCursor, sVBSlotFree+LL_MAX_PARTICLE_COUNT)); @@ -171,7 +171,7 @@ void LLVOPartGroup::freeVBSlot(S32 idx) { sVBSlotCursor--; *sVBSlotCursor = idx; - }*/ + } } LLVOPartGroup::LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) @@ -881,7 +881,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) LLFace* facep = *i; LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject(); - //if (!facep->isState(LLFace::PARTICLE)) + if (!facep->isState(LLFace::PARTICLE)) { //set the indices of this face S32 idx = LLVOPartGroup::findAvailableVBSlot(); if (idx >= 0) @@ -890,7 +890,7 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) facep->setIndicesIndex(idx*6); facep->setVertexBuffer(LLVOPartGroup::sVB); facep->setPoolType(LLDrawPool::POOL_ALPHA); - //facep->setState(LLFace::PARTICLE); + facep->setState(LLFace::PARTICLE); } else { diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index 7e3e220a7..7647fe992 100644 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -48,9 +48,9 @@ public: //vertex buffer for holding all particles static LLPointer sVB; - /*static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT]; - static S32* sVBSlotCursor;*/ - static S32 sVBSlotCursor; + static S32 sVBSlotFree[LL_MAX_PARTICLE_COUNT]; + static S32* sVBSlotCursor; + //static S32 sVBSlotCursor; static void initClass(); static void restoreGL(); From a510af94809baf363f6e6b3096edf2e7bdee72de Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 10 Nov 2013 02:46:23 -0500 Subject: [PATCH 05/15] [LLScrollColumnHeader] Fix icons disappearing in certain states, such as click. --- indra/llui/llscrolllistcolumn.cpp | 4 ++-- indra/llui/llscrolllistcolumn.h | 2 +- indra/llui/llscrolllistctrl.cpp | 27 +++++++++++++++------------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index 6353528c4..f03f407d8 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -40,8 +40,8 @@ const S32 MIN_COLUMN_WIDTH = 20; //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- -LLScrollColumnHeader::LLScrollColumnHeader(const std::string& name, const LLRect& rect, LLScrollListColumn* column) -: LLButton(name, rect, "square_btn_32x128.tga", "square_btn_selected_32x128.tga", LLStringUtil::null, NULL, LLFontGL::getFontSansSerifSmall()), +LLScrollColumnHeader::LLScrollColumnHeader(const std::string& name, const LLRect& rect, LLScrollListColumn* column, const std::string& unselected_image_name, const std::string& selected_image_name) +: LLButton(name, rect, unselected_image_name, selected_image_name, LLStringUtil::null, NULL, LLFontGL::getFontSansSerifSmall()), mColumn(column), mHasResizableElement(FALSE) { diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index 2026e075c..d76aedf55 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -40,7 +40,7 @@ class LLScrollListCtrl; class LLScrollColumnHeader : public LLButton { public: - LLScrollColumnHeader(const std::string& name, const LLRect& rect, LLScrollListColumn* column); + LLScrollColumnHeader(const std::string& name, const LLRect& rect, LLScrollListColumn* column, const std::string& unselected_image_name = "square_btn_32x128.tga", const std::string& selected_image_name = "square_btn_selected_32x128.tga"); ~LLScrollColumnHeader(); /*virtual*/ void draw(); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index f76b21762..62eba0e97 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2848,24 +2848,27 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params LLRect temp_rect = LLRect(left,top+mHeadingHeight,right,top); - new_column->mHeader = new LLScrollColumnHeader("btn_" + name, temp_rect, new_column); - new_column->mHeader->setToolTip(column_params.tool_tip()); - new_column->mHeader->setTabStop(false); - new_column->mHeader->setVisible(mDisplayColumnHeaders); - - if(column_params.header.image.isProvided()) + if (column_params.header.image.isProvided()) { - new_column->mHeader->setImages(column_params.header.image, column_params.header.image); - } - else if(column_params.header.image_overlay.isProvided()) - { - new_column->mHeader->setImageOverlay(column_params.header.image_overlay); + new_column->mHeader = new LLScrollColumnHeader("btn_" + name, temp_rect, new_column, column_params.header.image, column_params.header.image); } else { - new_column->mHeader->setLabel(column_params.header.label()); + new_column->mHeader = new LLScrollColumnHeader("btn_" + name, temp_rect, new_column); + if (column_params.header.image_overlay.isProvided()) + { + new_column->mHeader->setImageOverlay(column_params.header.image_overlay); + } + else + { + new_column->mHeader->setLabel(column_params.header.label()); + } } + new_column->mHeader->setToolTip(column_params.tool_tip()); + new_column->mHeader->setTabStop(false); + new_column->mHeader->setVisible(mDisplayColumnHeaders); + addChild(new_column->mHeader); sendChildToFront(mScrollbar); From be7c33e3c7eb19ee104e7cb327c9d35a7db69cc3 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 10 Nov 2013 02:49:10 -0500 Subject: [PATCH 06/15] [LLScrollColumnHeader] Fix the ImageOverlay icons being overwritten every draw and thus destroying our image_overlay parameter! Seriously, whose idea was that? Ignore space changes and this will be a lot easier for all of us. --- indra/llui/llscrolllistcolumn.cpp | 30 +++++++++++++++++------------- indra/llui/llscrolllistcolumn.h | 3 +++ indra/llui/llscrolllistctrl.cpp | 2 ++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index f03f407d8..59c991512 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -43,6 +43,7 @@ const S32 MIN_COLUMN_WIDTH = 20; LLScrollColumnHeader::LLScrollColumnHeader(const std::string& name, const LLRect& rect, LLScrollListColumn* column, const std::string& unselected_image_name, const std::string& selected_image_name) : LLButton(name, rect, unselected_image_name, selected_image_name, LLStringUtil::null, NULL, LLFontGL::getFontSansSerifSmall()), mColumn(column), + mDrawArrow(true), mHasResizableElement(FALSE) { setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this, _2)); @@ -65,20 +66,23 @@ LLScrollColumnHeader::~LLScrollColumnHeader() void LLScrollColumnHeader::draw() { - std::string sort_column = mColumn->mParentCtrl->getSortColumnName(); - BOOL draw_arrow = !mColumn->mLabel.empty() - && mColumn->mParentCtrl->isSorted() - // check for indirect sorting column as well as column's sorting name - && (sort_column == mColumn->mSortingColumn || sort_column == mColumn->mName); + if (mDrawArrow) + { + std::string sort_column = mColumn->mParentCtrl->getSortColumnName(); + BOOL draw_arrow = !mColumn->mLabel.empty() + && mColumn->mParentCtrl->isSorted() + // check for indirect sorting column as well as column's sorting name + && (sort_column == mColumn->mSortingColumn || sort_column == mColumn->mName); - BOOL is_ascending = mColumn->mParentCtrl->getSortAscending(); - if (draw_arrow) - { - setImageOverlay(is_ascending ? "up_arrow.tga" : "down_arrow.tga", LLFontGL::RIGHT, LLColor4::white); - } - else - { - setImageOverlay(LLUUID::null); + BOOL is_ascending = mColumn->mParentCtrl->getSortAscending(); + if (draw_arrow) + { + setImageOverlay(is_ascending ? "up_arrow.tga" : "down_arrow.tga", LLFontGL::RIGHT, LLColor4::white); + } + else + { + setImageOverlay(LLUUID::null); + } } // Draw children diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index d76aedf55..c7cea5976 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -51,6 +51,8 @@ public: /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); LLScrollListColumn* getColumn() { return mColumn; } + // Singu Note: Toggles drawing the sort arrow altogether + void setDrawArrow(bool draw_arrow) { mDrawArrow = draw_arrow; } void setHasResizableElement(BOOL resizable); void updateResizeBars(); BOOL canResize(); @@ -60,6 +62,7 @@ public: private: LLScrollListColumn* mColumn; + bool mDrawArrow; LLResizeBar* mResizeBar; BOOL mHasResizableElement; }; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 62eba0e97..bae86672c 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2851,6 +2851,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params if (column_params.header.image.isProvided()) { new_column->mHeader = new LLScrollColumnHeader("btn_" + name, temp_rect, new_column, column_params.header.image, column_params.header.image); + new_column->mHeader->setDrawArrow(false); } else { @@ -2858,6 +2859,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params if (column_params.header.image_overlay.isProvided()) { new_column->mHeader->setImageOverlay(column_params.header.image_overlay); + new_column->mHeader->setDrawArrow(false); } else { From 91ed289a931f1b7237f3ce59ae2064f2e95abe35 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 10 Nov 2013 02:51:30 -0500 Subject: [PATCH 07/15] [Warnings] Fix signed/unsigned mismatch in llpartdata.cpp --- indra/llmessage/llpartdata.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 41a0310ce..a89fba530 100644 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -294,14 +294,14 @@ BOOL LLPartSysData::unpack(LLDataPacker &dp) //skip to LLPartData block U8 feh = 0; - for (U32 i = 0; i < size; ++i) + for (S32 i = 0; i < size; ++i) { dp.unpackU8(feh, "whippang"); } dp.unpackS32(size, "partsize"); //skip LLPartData block - for (U32 i = 0; i < size; ++i) + for (S32 i = 0; i < size; ++i) { dp.unpackU8(feh, "whippang"); } From 69f2203d11de7d49c204c07b6b547f350b2652b9 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 10 Nov 2013 13:05:58 -0500 Subject: [PATCH 08/15] The rest of the french updates from Nomade Zhao --- .../skins/default/xui/fr/panel_preferences_ascent_chat.xml | 1 + indra/newview/skins/default/xui/fr/panel_preferences_voice.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml index 41c80ba67..c08e8086d 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml @@ -40,6 +40,7 @@ + diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml b/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml index 16a485bae..b228a2b74 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml @@ -2,7 +2,7 @@ Le chat vocal n'est pas disponible - + Ecouter depuis la position de la caméra Ecouter depuis la position de l'avatar From 943f77eed02a77dcc8f896df784cc26f71179af7 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 10 Nov 2013 19:12:20 -0500 Subject: [PATCH 09/15] Fix the UI Warnings in LLFloaterModelPreview Adds the green check and red x icons Adds Price Breakdown text to the mesh upload floater, quite useful! Removes useless ui element references in only code Comments out ui element references in only code that we don't have and don't have a clear place --- indra/newview/llfloatermodelpreview.cpp | 13 +++++-------- .../skins/default/textures/green_checkmark.png | Bin 0 -> 414 bytes indra/newview/skins/default/textures/red_x.png | Bin 0 -> 624 bytes .../default/xui/en-us/floater_model_preview.xml | 5 ++++- 4 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 indra/newview/skins/default/textures/green_checkmark.png create mode 100644 indra/newview/skins/default/textures/red_x.png diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 3520b56e1..1902f115d 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -726,8 +726,10 @@ void LLFloaterModelPreview::draw() } } + /* Singu Note: Dummy views and what for? childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost)); childSetTextArg("description_label", "[TEXTURES]", llformat("%d", mModelPreview->mTextureSet.size())); + */ if (mModelPreview) { @@ -1155,7 +1157,7 @@ void LLFloaterModelPreview::initDecompControls() mDecompParams[param[i].mName] = LLSD(param[i].mDefault.mBool); //llinfos << "Type: boolean, Default: " << (param[i].mDefault.mBool ? "True" : "False") << llendl; - LLCheckBoxCtrl* check_box = getChild(name); + LLCheckBoxCtrl* check_box = findChild(name); if (check_box) { check_box->setValue(param[i].mDefault.mBool); @@ -3710,7 +3712,6 @@ void LLModelPreview::loadModelCallback(S32 lod) mLoading = false; if (mFMP) { - mFMP->getChild("confirm_checkbox")->set(FALSE); if (!mBaseModel.empty()) { if (mFMP->getChild("description_form")->getValue().asString().empty()) @@ -4193,7 +4194,9 @@ void LLModelPreview::updateStatusMessages() } } + /* Singu Note: Dummy views and what for? mFMP->childSetTextArg("submeshes_info", "[SUBMESHES]", llformat("%d", total_submeshes[LLModel::LOD_HIGH])); + */ std::string mesh_status_na = mFMP->getString("mesh_status_na"); @@ -5524,12 +5527,6 @@ void LLModelPreview::setPreviewLOD(S32 lod) combo_box->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order mFMP->childSetText("lod_file_" + lod_name[mPreviewLOD], mLODFile[mPreviewLOD]); - LLComboBox* combo_box2 = mFMP->getChild("preview_lod_combo2"); - combo_box2->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order - - LLComboBox* combo_box3 = mFMP->getChild("preview_lod_combo3"); - combo_box3->setCurrentByIndex((NUM_LOD-1)-mPreviewLOD); // combo box list of lods is in reverse order - LLColor4 highlight_color = LLUI::sColorsGroup->getColor("MeshImportTableHighlightColor"); LLColor4 normal_color = LLUI::sColorsGroup->getColor("MeshImportTableNormalColor"); diff --git a/indra/newview/skins/default/textures/green_checkmark.png b/indra/newview/skins/default/textures/green_checkmark.png new file mode 100644 index 0000000000000000000000000000000000000000..d2a5b348dc2cacf8506311b03287d71a75a913b9 GIT binary patch literal 414 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8>Hwb*S8aVwZ9Oe*9WCu-32iGitw|i(hML+@(pt+IwMvDw znt8RuWV9ABX?1gHEo9bO%BY<#rfs37?X93Sk40+&hgP|uw!5NsxQw=olGbcitv*hz z4sLB{Wo=tk?HDO-M`djj4Q*>xZ6gh>IV@U}*|l1Ev^^BHRxtek|9?+=VL8wlnk7Mg z!9XrifFbCMLOW1Xi>HfYNX4y?b2r7B40v2GZb@Ymos%ANq5A)SZr)uJZfxH?xhyoJ ze|_}ExpM>}J<=K?G#D(Hx0=o3Ja>~}xBQQ-&y;HJ?RY-VXY2FmAjJ@kmwdOX=bn1H zV(|>e@6!*5ChiK-w0>|(f5XN9AqU!&1Lp0ze43?%b(1*n2f^omnBBGu-ecln_#mXX V#{Z_pDWH28JYD@<);T3K0RT$>qxt{< literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/red_x.png b/indra/newview/skins/default/textures/red_x.png new file mode 100644 index 0000000000000000000000000000000000000000..a61202f09bd654c50e2706748b7302670fdcf289 GIT binary patch literal 624 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8Zvj3buD=-=%+1WcGcf4t>V9KjIN{*%gMq=`&d%D(($>cM zF9X9_Q?mnh_7>*mhwL481O?vG(z3U+IpXYm($@Af1B0=#v758wZfEC<`i6(>9M=2$ zTUwZ}^7mUB8r%^QeA3?WilI?QMCcL!09Qwcr!q3Fp+Rc`0#=6v*w|P*IoRpz>xcMw zpRu(K_Vw1&)4QT?aLC?qlb_GBz<|%Zyb<1B>jM1_J2@H|8XmT{UlSI7$=KM@-rmv9 z?h_mP2?u*8dwT-|gO6O?#~huWNJyMBGOdq|_H=V`a0*1A^JcU5hH+i}^hE&{&>A%i*$biT7 zauC;+H+#R|tA1}Q{QG}>o0$to;rutrFXd)Fi04T9r Server: [SIM] + + Price Breakdown: Streaming: [CURRENCY] [STREAMING] Physics: [CURRENCY] [PHYSICS] Instances: [CURRENCY] [INSTANCES] Textures: [CURRENCY] [TEXTURES] Model: [CURRENCY] [MODEL] + + left="5" bottom_delta="-18" height="16" width="615"> [STATUS] From 3430a31e9d7b78ecc968e04feb7394adf70d0934 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Mon, 11 Nov 2013 11:50:07 +0100 Subject: [PATCH 10/15] Fixed fetching inventory when UseHTTPInventory is disabled --- indra/newview/llviewerinventory.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index de52941d1..7194711a6 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -655,13 +655,16 @@ bool LLViewerInventoryCategory::fetch() { llwarns << "agent region is null" << llendl; } - if (!url.empty()) //Capability found. Build up LLSD and use it. + if (!url.empty() && gSavedSettings.getBOOL("UseHTTPInventory")) //Capability found and HTTP inventory enabled. Build up LLSD and use it. { LLInventoryModelBackgroundFetch::instance().start(mUUID, false); } else - { //Deprecated, but if we don't have a capability, use the old system. - llinfos << "FetchInventoryDescendents2 capability not found. Using deprecated UDP message." << llendl; + { //We don't have a capability or the use of HTTP inventory is disabled, use the old system. + if (gSavedSettings.getBOOL("UseHTTPInventory")) + { + llinfos << "FetchInventoryDescendents2 capability not found. Using UDP message." << llendl; + } LLMessageSystem* msg = gMessageSystem; msg->newMessage("FetchInventoryDescendents"); msg->nextBlock("AgentData"); From 32ecf444bdf898667868903923fa57429d10d94f Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 11 Nov 2013 17:48:54 -0600 Subject: [PATCH 11/15] Attempt to resolve shader compilation errors on osx since it's particularly picky. --- .../shaders/class1/deferred/attachmentShadowV.glsl | 4 ---- .../shaders/class1/deferred/fullbrightF.glsl | 6 ++++-- .../shaders/class1/deferred/materialF.glsl | 2 +- .../shaders/class1/deferred/materialV.glsl | 10 +++++++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl index 3f90600ac..4f49f9a72 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl @@ -41,10 +41,6 @@ void main() vec4 p = projection_matrix * vec4(pos, 1.0); -#if !DEPTH_CLAMP p.z = max(p.z, -p.w+0.01); gl_Position = p; -#else - gl_Position = p; -#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 469b26497..58c18b4d9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -169,10 +169,12 @@ void main() #ifndef HAS_ALPHA_MASK color.a = fogged.a; #endif -#elif !HAS_ALPHA_MASK +#else +#ifndef HAS_ALPHA_MASK color.a = final_alpha; #endif -#if HAS_ALPHA_MASK +#endif +#ifdef HAS_ALPHA_MASK color.a = 0.0; #endif diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index a3e754899..fe8fda374 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -83,6 +83,7 @@ uniform sampler2DShadow shadowMap1; uniform sampler2DShadow shadowMap2; uniform sampler2DShadow shadowMap3; uniform sampler2D noiseMap; +VARYING vec2 vary_fragcoord; uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; @@ -135,7 +136,6 @@ uniform mat3 env_mat; uniform mat3 ssao_effect_mat; uniform vec3 sun_dir; -VARYING vec2 vary_fragcoord; VARYING vec3 vary_position; diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl index 393d1e69d..95c741050 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl @@ -44,6 +44,10 @@ uniform mat4 modelview_matrix; #endif VARYING vec3 vary_position; +#if HAS_SUN_SHADOW +VARYING vec2 vary_fragcoord; +uniform vec2 screen_res; +#endif #endif @@ -138,7 +142,11 @@ vary_normal = n; #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) #if !HAS_SKIN - vary_position = (modelview_matrix*vec4(position.xyz, 1.0)).xyz; + vec3 pos = (modelview_matrix*vec4(position.xyz, 1.0)).xyz; + vary_position = pos; +#endif +#if HAS_SUN_SHADOW + vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; #endif #endif } From 203ae9dfa3bae86a90e21ffed99059729632a68b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 11 Nov 2013 18:56:16 -0600 Subject: [PATCH 12/15] Fix uninitialized variable warning in alphaF.glsl. Also made USE_VERTEX_COLOR actually work if FOR_IMPOSTOR is set. --- .../app_settings/shaders/class1/deferred/alphaF.glsl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 24b159bad..6a2117ad6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -534,8 +534,6 @@ void main() #endif #ifdef FOR_IMPOSTOR - vec4 color; - color.rgb = diff.rgb; #ifdef USE_VERTEX_COLOR float final_alpha = diff.a * vertex_color.a; @@ -550,6 +548,7 @@ void main() { discard; } + vec4 color = vec4(diff.rgb,final_alpha); #else #ifdef USE_VERTEX_COLOR @@ -578,10 +577,7 @@ void main() final_da = min(final_da, 1.0f); final_da = pow(final_da, 1.0/1.3); - vec4 color = vec4(0,0,0,0); - - color.rgb = atmosAmbient(color.rgb); - color.a = final_alpha; + vec4 color = vec4(getAmblitColor(),final_alpha); float ambient = abs(da); ambient *= 0.5; From d678735cf67be71e3f8c494d398e2bf550a1f063 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 12 Nov 2013 02:00:21 -0500 Subject: [PATCH 13/15] Code cleanup in pie menu Cleaned up hover logic and slice from x and y code duplication (Best viewed without space changes) --- indra/llui/llmenugl.cpp | 119 +++++++++++----------------------------- indra/llui/llmenugl.h | 2 + 2 files changed, 33 insertions(+), 88 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 19f348e9b..dc1f18464 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3713,6 +3713,7 @@ LLPieMenu::LLPieMenu(const std::string& name, const std::string& label) : LLContextMenu(name, label), mFirstMouseDown(FALSE), mUseInfiniteRadius(FALSE), + mHoverIndex(-1), mHoverThisFrame(FALSE), mOuterRingAlpha(1.f), mCurRadius(0.f), @@ -3749,11 +3750,13 @@ BOOL LLPieMenu::handleHover( S32 x, S32 y, MASK mask ) mHoverThisFrame = TRUE; - LLMenuItemGL* item = pieItemFromXY( x, y ); + S32 index = mHoverIndex; + mHoverIndex = pieItemIndexFromXY(x, y); + BOOL handled = handleHoverOver(pieItemFromIndex(mHoverIndex), x, y); - if (item && item->getEnabled() && item != mHoverItem) + if (mHoverItem && mHoverIndex != index) { - switch(pieItemIndexFromXY(x, y)) + switch(mHoverIndex) { case 0: make_ui_sound("UISndPieMenuSliceHighlight0"); @@ -3784,7 +3787,7 @@ BOOL LLPieMenu::handleHover( S32 x, S32 y, MASK mask ) break; } } - return handleHoverOver(item, x, y); + return handled; } BOOL LLPieMenu::handleMouseDown( S32 x, S32 y, MASK mask ) @@ -3799,11 +3802,6 @@ BOOL LLPieMenu::handleMouseDown( S32 x, S32 y, MASK mask ) // to make sure it's within the item's rectangle handled = item->handleMouseDown( 0, 0, mask ); } - else if (!mRightMouseDown) - { - // call hidemenus to make sure transient selections get cleared - ((LLMenuHolderGL*)getParent())->hideMenus(); - } // always handle mouse down as mouse up will close open menus return TRUE; @@ -3891,7 +3889,7 @@ BOOL LLPieMenu::handleMouseUp( S32 x, S32 y, MASK mask ) else if (!mRightMouseDown) { // call hidemenus to make sure transient selections get cleared - ((LLMenuHolderGL*)getParent())->hideMenus(); + sMenuContainer->hideMenus(); } if (handled) @@ -3929,6 +3927,7 @@ void LLPieMenu::draw() { mHoverItem->setHighlight(FALSE); mHoverItem = NULL; + mHoverIndex = -1; } F32 width = (F32) getRect().getWidth(); @@ -3962,22 +3961,16 @@ void LLPieMenu::draw() gl_washer_2d( mCurRadius, (F32) PIE_CENTER_SIZE, steps, bg_color, outer_color ); // selected wedge - item_list_t::iterator item_iter; - S32 i = 0; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) + if (mHoverItem) { - if ((*item_iter)->getHighlight()) - { - F32 arc_size = F_PI * 0.25f; + F32 arc_size = F_PI * 0.25f; - F32 start_radians = (i * arc_size) - (arc_size * 0.5f); - F32 end_radians = start_radians + arc_size; + F32 start_radians = (mHoverIndex * arc_size) - (arc_size * 0.5f); + F32 end_radians = start_radians + arc_size; - LLColor4 outer_color = selected_color; - outer_color.mV[VALPHA] *= mOuterRingAlpha; - gl_washer_segment_2d( mCurRadius, (F32)PIE_CENTER_SIZE, start_radians, end_radians, steps / 8, selected_color, outer_color ); - } - i++; + LLColor4 outer_color = selected_color; + outer_color.mV[VALPHA] *= mOuterRingAlpha; + gl_washer_segment_2d( mCurRadius, (F32)PIE_CENTER_SIZE, start_radians, end_radians, steps / 8, selected_color, outer_color ); } LLUI::setLineWidth( line_width ); @@ -4004,38 +3997,10 @@ void LLPieMenu::draw() LLView::draw(); } -void LLPieMenu::drawBackground(LLMenuItemGL* itemp, LLColor4& color) +// virtual +void LLPieMenu::drawBackground(LLMenuItemGL*, LLColor4&) { - F32 width = (F32) getRect().getWidth(); - F32 height = (F32) getRect().getHeight(); - F32 center_x = width/2; - F32 center_y = height/2; - S32 steps = 100; - - gGL.color4fv( color.mV ); - gGL.pushUIMatrix(); - { - gGL.translateUI(center_x - itemp->getRect().mLeft, center_y - itemp->getRect().mBottom, 0.f); - - item_list_t::iterator item_iter; - S32 i = 0; - for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) - { - if ((*item_iter) == itemp) - { - F32 arc_size = F_PI * 0.25f; - - F32 start_radians = (i * arc_size) - (arc_size * 0.5f); - F32 end_radians = start_radians + arc_size; - - LLColor4 outer_color = color; - outer_color.mV[VALPHA] *= mOuterRingAlpha; - gl_washer_segment_2d( mCurRadius, (F32)PIE_CENTER_SIZE, start_radians, end_radians, steps / 8, color, outer_color ); - } - i++; - } - } - gGL.popUIMatrix(); + // Selection is drawn in our draw call, do nothing here and override base drawing rectangles. } // virtual @@ -4107,13 +4072,15 @@ void LLPieMenu::arrange() LLMenuItemGL *LLPieMenu::pieItemFromXY(S32 x, S32 y) { - // We might have shifted this menu on draw. If so, we need - // to shift over mouseup events until we get a hover event. - //x += mShiftHoriz; - //y += mShiftVert; + return pieItemFromIndex(pieItemIndexFromXY(x, y)); +} +S32 LLPieMenu::pieItemIndexFromXY(S32 x, S32 y) +{ // An arc of the pie menu is 45 degrees const F32 ARC_DEG = 45.f; + + // correct for non-square pixels S32 delta_x = x - getRect().getWidth() / 2; S32 delta_y = y - getRect().getHeight() / 2; @@ -4121,14 +4088,14 @@ LLMenuItemGL *LLPieMenu::pieItemFromXY(S32 x, S32 y) S32 dist_squared = delta_x*delta_x + delta_y*delta_y; if (dist_squared < PIE_CENTER_SIZE*PIE_CENTER_SIZE) { - return NULL; + return -1; } // infinite radius is only used with right clicks S32 radius = llmax( getRect().getWidth()/2, getRect().getHeight()/2 ); if (!(mUseInfiniteRadius && mRightMouseDown) && dist_squared > radius * radius) { - return NULL; + return -1; } F32 angle = RAD_TO_DEG * (F32) atan2((F32)delta_y, (F32)delta_x); @@ -4140,8 +4107,11 @@ LLMenuItemGL *LLPieMenu::pieItemFromXY(S32 x, S32 y) // make sure we're only using positive angles if (angle < 0.f) angle += 360.f; - S32 which = S32( angle / ARC_DEG ); + return S32( angle / ARC_DEG ); +} +LLMenuItemGL* LLPieMenu::pieItemFromIndex(S32 which) +{ if (0 <= which && which < (S32)mItems.size() ) { item_list_t::iterator item_iter; @@ -4161,33 +4131,6 @@ LLMenuItemGL *LLPieMenu::pieItemFromXY(S32 x, S32 y) return NULL; } -S32 LLPieMenu::pieItemIndexFromXY(S32 x, S32 y) -{ - // An arc of the pie menu is 45 degrees - const F32 ARC_DEG = 45.f; - // correct for non-square pixels - S32 delta_x = x - getRect().getWidth() / 2; - S32 delta_y = y - getRect().getHeight() / 2; - - // circle safe zone in the center - if (delta_x*delta_x + delta_y*delta_y < PIE_CENTER_SIZE*PIE_CENTER_SIZE) - { - return -1; - } - - F32 angle = RAD_TO_DEG * (F32) atan2((F32)delta_y, (F32)delta_x); - - // rotate marks CCW so that east = [0, ARC_DEG) instead of - // [-ARC_DEG/2, ARC_DEG/2) - angle += ARC_DEG / 2.f; - - // make sure we're only using positive angles - if (angle < 0.f) angle += 360.f; - - S32 which = S32( angle / ARC_DEG ); - return which; -} - // virtual void LLPieMenu::show(S32 x, S32 y, bool mouse_down) diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index cac496497..9fd6868b7 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -759,10 +759,12 @@ public: private: LLMenuItemGL *pieItemFromXY(S32 x, S32 y); + LLMenuItemGL* pieItemFromIndex(S32 which); S32 pieItemIndexFromXY(S32 x, S32 y); BOOL mFirstMouseDown; // true from show until mouse up BOOL mUseInfiniteRadius; // allow picking pie menu items anywhere outside of center circle + S32 mHoverIndex; BOOL mHoverThisFrame; LLFrameTimer mShrinkBorderTimer; F32 mOuterRingAlpha; // for rendering pie menus as both bounded and unbounded From 2e7d80e9ba165e2fa9a450a0c3bf9c750bce4cf0 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 12 Nov 2013 02:02:16 -0500 Subject: [PATCH 14/15] Let shift-left-clicking in the middle of subpiemenus move back to the parent piemenu! --- indra/llui/llmenugl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index dc1f18464..deebb57e9 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3888,6 +3888,19 @@ BOOL LLPieMenu::handleMouseUp( S32 x, S32 y, MASK mask ) } else if (!mRightMouseDown) { + // if shift is held, click is in the view, and a parent menu exists, go back up + if (mask & MASK_SHIFT && pointInView(x, y)) + { + if (LLMenuItemGL* branch = getParentMenuItem()) + { + if (LLContextMenu* parent = dynamic_cast(branch->getParent())) + { + hide(); + parent->show(LLMenuHolderGL::sContextMenuSpawnPos.mX, LLMenuHolderGL::sContextMenuSpawnPos.mY, false); + return true; + } + } + } // call hidemenus to make sure transient selections get cleared sMenuContainer->hideMenus(); } From 29a07f4b5c27da19488bc94aedb13fafd157bab9 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 12 Nov 2013 03:03:20 -0500 Subject: [PATCH 15/15] Actually fix the french translations (codepage borks yay) Thanks Nomade --- .../skins/default/xui/fr/panel_preferences_ascent_chat.xml | 6 +++--- .../skins/default/xui/fr/panel_preferences_voice.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml index c08e8086d..ea042b726 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml @@ -40,11 +40,11 @@ - + - + @@ -95,7 +95,7 @@ Et aussi : #n Pour le nom classique, #d Pour le Display, #r Pour la SLURL de vô - Excepté ceux venant de : + Excepté ceux venant de : diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml b/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml index b228a2b74..720d0678e 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_voice.xml @@ -2,11 +2,11 @@ Le chat vocal n'est pas disponible - + Ecouter depuis la position de la caméra Ecouter depuis la position de l'avatar - Entendre la voice de maniere égale pour tout le monde. + Entendre la voice de maniere égale pour tout le monde. Appuyer pour parler