diff options
author | Oz Linden <oz@lindenlab.com> | 2014-12-15 12:34:18 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2014-12-15 12:34:18 -0500 |
commit | dab5acd972c05b4c9d23d5dfb46afe9eff6c9567 (patch) | |
tree | 6f3b1ca79eefbc2b232a5da809359eefcf59ecfb /indra/newview | |
parent | eb5c0dd32a7f4e4a603fe88cfa5f18c30725d11a (diff) | |
parent | 6d48db868f7459fcf5f0e89d830a844e409d4163 (diff) |
merge changes for 3.7.22-release
Diffstat (limited to 'indra/newview')
24 files changed, 316 insertions, 470 deletions
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index c6cff55cf7..a4de059bbc 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -3.7.21 +3.7.23 diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index bc63d07d72..767fad016c 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -40,4 +40,10 @@ mat4 getSkinnedTransform() ret[3] = vec4(0,0,0,1); return ret; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = matrixPalette[0]; + vec4 dummy2 = matrixPalette[44]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 57129c3bd1..6cd38d8ef5 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -63,5 +63,14 @@ mat4 getObjectSkinnedTransform() ret[3] = vec4(trans, 1.0); return ret; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + mat3 dummy1 = matrixPalette[0]; + vec3 dummy2 = translationPalette[0]; + mat3 dummy3 = matrixPalette[51]; + vec3 dummy4 = translationPalette[51]; +#endif + } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index a4f54dff70..5264d6e1b4 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -132,5 +132,11 @@ void main() col.y *= col.y; frag_color = col; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec3 dummy1 = kern[0]; + vec3 dummy2 = kern[3]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 236567219b..1a464fec5d 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -161,4 +161,12 @@ void main() frag_color.rgb = out_col; frag_color.a = 0.0; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec4 dummy1 = light[0]; + vec4 dummy2 = light_col[0]; + vec4 dummy3 = light[LIGHT_COUNT-1]; + vec4 dummy4 = light_col[LIGHT_COUNT-1]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 0e6ab80d4d..c08e9d361a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -127,13 +127,17 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) vec4 ret = texture2DLod(projectionMap, tc, lod); ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -311,19 +315,17 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - stc /= stc.w; + if (stc.z > 0.0) { - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 96f9628424..018ced4cad 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -99,4 +99,10 @@ void main() col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z; frag_color.rgb = col; + +#ifdef IS_AMD_CARD + // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts. + vec2 dummy1 = kern[0]; + vec2 dummy2 = kern[31]; +#endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 8d8a6c9dde..f50635a139 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -130,15 +130,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -322,19 +326,14 @@ void main() if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index c20e00163c..94bd07bec6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); - - vec2 dist = tc-vec2(0.5); + ret.rgb = srgb_to_linear(ret.rgb); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float det = min(lod/(proj_lod*0.5), 1.0); + + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -334,25 +338,21 @@ void main() vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - stc /= stc.w; if (stc.z > 0.0) { - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } } - //not sure why, but this line prevents MATBUG-194 col = max(col, vec3(0.0)); diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 7689b72d20..92e1ac95a6 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col) vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); + ret.rgb = srgb_to_linear(ret.rgb); - vec2 dist = tc-vec2(0.5); + vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - float det = max(1.0-lod/(proj_lod*0.5), 0.0); + float det = min(lod/(proj_lod*0.5), 1.0); - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); + float d = min(dist.x, dist.y); + + d *= min(1, d * (proj_lod - lod)); + + float edge = 0.25*det; + + ret *= clamp(d/edge, 0.0, 1.0); return ret; } @@ -336,19 +340,14 @@ void main() if (stc.z > 0.0) { - stc.xy /= stc.w; - - float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0); - - //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); + stc /= stc.w; if (stc.x < 1.0 && stc.y < 1.0 && stc.x > 0.0 && stc.y > 0.0) { - col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb; + col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity; } } } diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index 988058aad3..aad5dbae7d 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -84,7 +84,7 @@ callWindowUnfocus(); } -- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender { if (!runMainLoop()) { diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 393bd70382..ef121cd910 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1624,7 +1624,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* { F32 w = weight[j][k]; - idx[k] = llclamp((S32) floorf(w), 0, 63); + idx[k] = llclamp((S32) floorf(w), 0, JOINT_COUNT-1); + wght[k] = w - floorf(w); scale += wght[k]; } diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index a1246e31d9..af84aea6a6 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -77,10 +77,7 @@ const char FEATURE_TABLE_VER_FILENAME[] = "featuretable%s.%s.txt"; #endif #if 0 // consuming code in #if 0 below -const char GPU_TABLE_FILENAME[] = "gpu_table.txt"; #endif -const char GPU_TABLE_VER_FILENAME[] = "gpu_table.%s.txt"; - LLFeatureInfo::LLFeatureInfo(const std::string& name, const BOOL available, const F32 level) : mValid(TRUE), mName(name), mAvailable(available), mRecommendedLevel(level) { @@ -430,6 +427,7 @@ bool LLFeatureManager::loadGPUClass() { //couldn't bench, use GLVersion #if LL_DARWIN //GLVersion is misleading on OSX, just default to class 3 if we can't bench + LL_WARNS() << "Unable to get an accurate benchmark; defaulting to class 3" << LL_ENDL; mGPUClass = GPU_CLASS_3; #else if (gGLManager.mGLVersion < 2.f) @@ -454,23 +452,31 @@ bool LLFeatureManager::loadGPUClass() } #endif } - else if (gbps < 5.f) + else if (gGLManager.mGLVersion <= 2.f) + { + mGPUClass = GPU_CLASS_0; + } + else if (gGLManager.mGLVersion <= 3.f) + { + mGPUClass = GPU_CLASS_1; + } + else if (gbps <= 5.f) { mGPUClass = GPU_CLASS_0; } - else if (gbps < 10.f) + else if (gbps <= 8.f) { mGPUClass = GPU_CLASS_1; } - else if (gbps < 20.f) + else if (gbps <= 16.f) { mGPUClass = GPU_CLASS_2; } - else if (gbps < 40.f) + else if (gbps <= 40.f) { mGPUClass = GPU_CLASS_3; } - else if (gbps < 80.f) + else if (gbps <= 80.f) { mGPUClass = GPU_CLASS_4; } @@ -478,195 +484,15 @@ bool LLFeatureManager::loadGPUClass() { mGPUClass = GPU_CLASS_5; } - + // defaults mGPUString = gGLManager.getRawGLString(); mGPUSupported = TRUE; -#if 0 - // first table is in the app dir - std::string app_path = gDirUtilp->getAppRODataDir(); - app_path += gDirUtilp->getDirDelimiter(); - app_path += GPU_TABLE_FILENAME; - - // second table is downloaded with HTTP - std::string http_filename = llformat(GPU_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str()); - std::string http_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, http_filename); - - // use HTTP table if it exists - std::string path; - bool parse_ok = false; - if (gDirUtilp->fileExists(http_path)) - { - parse_ok = parseGPUTable(http_path); - if (!parse_ok) - { - // the HTTP table failed to parse, so delete it - LLFile::remove(http_path); - LL_WARNS("RenderInit") << "Removed invalid gpu table '" << http_path << "'" << LL_ENDL; - } - } - - if (!parse_ok) - { - parse_ok = parseGPUTable(app_path); - } -#endif - return true; // indicates that the file parsed correctly, not that the gpu was recognized + return true; // indicates that a gpu value was established } -bool LLFeatureManager::parseGPUTable(std::string filename) -{ - llifstream file; - - LL_INFOS("RenderInit") << "Attempting to parse GPU table from " << filename << LL_ENDL; - file.open(filename); - - if (file) - { - const char recognizer[] = "//GPU_TABLE"; - char first_line[MAX_STRING]; - file.getline(first_line, MAX_STRING); - if (0 != strncmp(first_line, recognizer, strlen(recognizer))) - { - LL_WARNS("RenderInit") << "Invalid GPU table: " << filename << "!" << LL_ENDL; - return false; - } - } - else - { - LL_WARNS("RenderInit") << "Unable to open GPU table: " << filename << "!" << LL_ENDL; - return false; - } - - std::string rawRenderer = gGLManager.getRawGLString(); - std::string renderer = rawRenderer; - for (std::string::iterator i = renderer.begin(); i != renderer.end(); ++i) - { - *i = tolower(*i); - } - -#if LL_EXPORT_GPU_TABLE - llofstream json; - json.open("gpu_table.json"); - - json << "var gpu_table = [" << std::endl; -#endif - - bool gpuFound; - U32 lineNumber; - for (gpuFound = false, lineNumber = 0; !gpuFound && !file.eof(); lineNumber++) - { - char buffer[MAX_STRING]; /*Flawfinder: ignore*/ - buffer[0] = 0; - - file.getline(buffer, MAX_STRING); - - if (strlen(buffer) >= 2 && /*Flawfinder: ignore*/ - buffer[0] == '/' && - buffer[1] == '/') - { - // This is a comment. - continue; - } - - if (strlen(buffer) == 0) /*Flawfinder: ignore*/ - { - // This is a blank line - continue; - } - - // setup the tokenizer - std::string buf(buffer); - std::string cls, label, expr, supported, stats_based, expected_gl_version; - boost_tokenizer tokens(buf, boost::char_separator<char>("\t\n")); - boost_tokenizer::iterator token_iter = tokens.begin(); - - // grab the label, pseudo regular expression, and class - if(token_iter != tokens.end()) - { - label = *token_iter++; - } - if(token_iter != tokens.end()) - { - expr = *token_iter++; - } - if(token_iter != tokens.end()) - { - cls = *token_iter++; - } - if(token_iter != tokens.end()) - { - supported = *token_iter++; - } - if (token_iter != tokens.end()) - { - stats_based = *token_iter++; - } - if (token_iter != tokens.end()) - { - expected_gl_version = *token_iter++; - } - - if (label.empty() || expr.empty() || cls.empty() || supported.empty()) - { - LL_WARNS("RenderInit") << "invald gpu_table.txt:" << lineNumber << ": '" << buffer << "'" << LL_ENDL; - continue; - } -#if LL_EXPORT_GPU_TABLE - json << "{'label' : '" << label << "',\n" << - "'regexp' : '" << expr << "',\n" << - "'class' : '" << cls << "',\n" << - "'supported' : '" << supported << "',\n" << - "'stats_based' : " << stats_based << ",\n" << - "'gl_version' : " << expected_gl_version << "\n},\n"; -#endif - - for (U32 i = 0; i < expr.length(); i++) /*Flawfinder: ignore*/ - { - expr[i] = tolower(expr[i]); - } - - // run the regular expression against the renderer - boost::regex re(expr.c_str()); - if(boost::regex_search(renderer, re)) - { - // if we found it, stop! -#if !LL_EXPORT_GPU_TABLE - gpuFound = true; -#endif - mGPUString = label; - mGPUClass = (EGPUClass) strtol(cls.c_str(), NULL, 10); - mGPUSupported = (BOOL) strtol(supported.c_str(), NULL, 10); - sscanf(expected_gl_version.c_str(), "%f", &mExpectedGLVersion); - } - } -#if LL_EXPORT_GPU_TABLE - json << "];\n\n"; - json.close(); -#endif - file.close(); - - if ( gpuFound ) - { - LL_INFOS("RenderInit") << "GPU '" << rawRenderer << "' recognized as '" << mGPUString << "'" << LL_ENDL; - if (!mGPUSupported) - { - LL_INFOS("RenderInit") << "GPU '" << mGPUString << "' is not supported." << LL_ENDL; - } - } - else - { - LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL; - } - -#if LL_DARWIN // never go over "Mid" settings by default on OS X - mGPUClass = llmin(mGPUClass, GPU_CLASS_2); -#endif - return true; -} - // responder saves table into file class LLHTTPFeatureTableResponder : public LLHTTPClient::Responder { @@ -747,26 +573,11 @@ void fetch_feature_table(std::string table) LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path)); } -void fetch_gpu_table(std::string table) -{ - const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable"); - - const std::string filename = llformat(table.c_str(), LLVersionInfo::getVersion().c_str()); - - const std::string url = base + "/" + filename; - - const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename); - - LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL; - - LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path)); -} // fetch table(s) from a website (S3) void LLFeatureManager::fetchHTTPTables() { fetch_feature_table(FEATURE_TABLE_VER_FILENAME); - fetch_gpu_table(GPU_TABLE_VER_FILENAME); } diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 95141b241d..69078ccc21 100755 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -162,9 +162,6 @@ protected: bool parseFeatureTable(std::string filename); ///< @returns TRUE is file parsed correctly, FALSE if not - bool parseGPUTable(std::string filename); - ///< @returns true if file parsed correctly, false if not - does not reflect whether or not the gpu was recognized - void initBaseMask(); diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 5debf71744..ef50594feb 100755 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -600,6 +600,9 @@ std::vector<std::string>* LLFilePicker::navOpenFilterProc(ELoadFilter filter) // allowedv->push_back("slg"); break; #endif + case FFLOAD_XML: + allowedv->push_back("xml"); + break; case FFLOAD_RAW: allowedv->push_back("raw"); break; @@ -702,7 +705,14 @@ bool LLFilePicker::doNavSaveDialog(ESaveFilter filter, const std::string& filena creator = "\?\?\?\?"; extension = "slg"; break; -#endif +#endif + + case FFSAVE_XML: + type = "\?\?\?\?"; + creator = "\?\?\?\?"; + extension = "xml"; + break; + case FFSAVE_RAW: type = "\?\?\?\?"; creator = "\?\?\?\?"; @@ -1100,6 +1110,12 @@ static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker) return filtername; } +static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker) +{ + return add_simple_pattern_filter_to_gtkchooser(picker, "*.xml", + LLTrans::getString("xml_files") + " (*.xml)"); +} + static std::string add_collada_filter_to_gtkchooser(GtkWindow *picker) { return add_simple_pattern_filter_to_gtkchooser(picker, "*.dae", @@ -1293,6 +1309,9 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) case FFLOAD_ANIM: filtername = add_anim_filter_to_gtkchooser(picker); break; + case FFLOAD_XML: + filtername = add_xml_filter_to_gtkchooser(picker); + break; case FFLOAD_COLLADA: filtername = add_collada_filter_to_gtkchooser(picker); break; diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp index b715896264..b75660ea00 100644 --- a/indra/newview/llflickrconnect.cpp +++ b/indra/newview/llflickrconnect.cpp @@ -400,7 +400,7 @@ void LLFlickrConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std:: } else { - llwarns << "Image to upload is not a PNG or JPEG" << llendl; + LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL; return; } diff --git a/indra/newview/llfloatergroupbulkban.cpp b/indra/newview/llfloatergroupbulkban.cpp index 54a2283b13..44074047a7 100644 --- a/indra/newview/llfloatergroupbulkban.cpp +++ b/indra/newview/llfloatergroupbulkban.cpp @@ -101,7 +101,7 @@ void LLFloaterGroupBulkBan::showForGroup(const LLUUID& group_id, uuid_vec_t* age // Make sure group_id isn't null if (group_id.isNull()) { - llwarns << "LLFloaterGroupInvite::showForGroup with null group_id!" << llendl; + LL_WARNS() << "LLFloaterGroupInvite::showForGroup with null group_id!" << LL_ENDL; return; } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 9574691fee..c80dec0e75 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -881,13 +881,14 @@ void LLViewerObjectList::renderObjectBeacons() F32 gpu_benchmark() { - if (!gGLManager.mHasShaderObjects) - { //don't bother benchmarking the fixed function + if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery) + { // don't bother benchmarking the fixed function + // or venerable drivers which don't support accurate timing anyway + // and are likely to be correctly identified by the GPU table already. return -1.f; } - - if (gBenchmarkProgram.mProgramObject == 0) + if (gBenchmarkProgram.mProgramObject == 0) { LLViewerShaderMgr::instance()->initAttribsAndUniforms(); @@ -920,7 +921,10 @@ F32 gpu_benchmark() //number of samples to take const S32 samples = 64; - LLGLSLShader::initProfile(); + if (gGLManager.mHasTimerQuery) + { + LLGLSLShader::initProfile(); + } LLRenderTarget dest[count]; U32 source[count]; @@ -964,16 +968,16 @@ F32 gpu_benchmark() v[0].set(-1,1,0); v[1].set(-1,-3,0); v[2].set(3,1,0); + buff->flush(); gBenchmarkProgram.bind(); - buff->setBuffer(LLVertexBuffer::MAP_VERTEX); - - //wait for any previoius GL commands to finish - glFinish(); bool busted_finish = false; + buff->setBuffer(LLVertexBuffer::MAP_VERTEX); + glFinish(); + for (S32 c = -1; c < samples; ++c) { LLTimer timer; @@ -1013,6 +1017,7 @@ F32 gpu_benchmark() if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f) { //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored busted_finish = true; + LL_WARNS() << "GPU Benchmark detected GL driver with broken glFinish implementation." << LL_ENDL; } else { @@ -1023,10 +1028,12 @@ F32 gpu_benchmark() gBenchmarkProgram.unbind(); - LLGLSLShader::finishProfile(false); - - LLImageGL::deleteTextures(count, source); + if (gGLManager.mHasTimerQuery) + { + LLGLSLShader::finishProfile(false); + } + LLImageGL::deleteTextures(count, source); std::sort(results.begin(), results.end()); @@ -1037,27 +1044,20 @@ F32 gpu_benchmark() #if LL_DARWIN if (gbps > 512.f) { - LL_INFOS() << "Memory bandwidth is improbably high and likely incorrect." << LL_ENDL; + LL_WARNS() << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL; //OSX is probably lying, discard result gbps = -1.f; } #endif - if (gGLManager.mHasTimerQuery) - { - F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; - F32 seconds = ms/1000.f; + F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; + F32 seconds = ms/1000.f; - F64 samples_drawn = res*res*count*samples; - F32 samples_sec = (samples_drawn/1000000000.0)/seconds; - gbps = samples_sec*8; + F64 samples_drawn = res*res*count*samples; + F32 samples_sec = (samples_drawn/1000000000.0)/seconds; + gbps = samples_sec*8; - LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL; - } - else - { - LL_INFOS() << "ARB_timer_query unavailable." << LL_ENDL; - } + LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL; return gbps; } diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 06e517a861..cadbc16f1e 100755 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -1022,7 +1022,7 @@ void LLLoadHistoryThread::run() { loadHistory(mFileName, mMessages, mLoadParams); int count = mMessages->size(); - llinfos << "mMessages->size(): " << count << llendl; + LL_INFOS() << "mMessages->size(): " << count << LL_ENDL; setFinished(); } } diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 25d4c12b8d..f172aa0955 100755 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1240,10 +1240,10 @@ LLQuaternion LLManipRotate::dragUnconstrained( S32 x, S32 y ) F32 dist_from_sphere_center = sqrt(delta_x * delta_x + delta_y * delta_y); LLVector3 axis = mMouseDown % mMouseCur; + F32 angle = atan2(sqrtf(axis * axis), mMouseDown * mMouseCur); axis.normVec(); - F32 angle = acos(mMouseDown * mMouseCur); LLQuaternion sphere_rot( angle, axis ); - + if (is_approx_zero(1.f - mMouseDown * mMouseCur)) { return LLQuaternion::DEFAULT; @@ -1636,9 +1636,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) mInSnapRegime = FALSE; } - angle = acos(mMouseCur * mMouseDown); - - F32 dir = (mMouseDown % mMouseCur) * constraint_axis; // cross product + LLVector3 cross_product = mMouseDown % mMouseCur; + angle = atan2(sqrtf(cross_product * cross_product), mMouseCur * mMouseDown); + F32 dir = cross_product * constraint_axis; // cross product if( dir < 0.f ) { angle *= -1.f; diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index 1eafc5bd64..76792cc6fd 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -387,7 +387,7 @@ void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids) } else { - llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl; + LL_WARNS() << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << LL_ENDL; names.push_back("(Unknown)"); } } diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 236ad861a5..e662a05dfc 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -492,7 +492,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids) } else { - llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl; + LL_WARNS() << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << LL_ENDL; names.push_back("(Unknown)"); } } diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp index 7088558b83..e983bc883f 100644 --- a/indra/newview/lltwitterconnect.cpp +++ b/indra/newview/lltwitterconnect.cpp @@ -397,7 +397,7 @@ void LLTwitterConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std: } else { - llwarns << "Image to upload is not a PNG or JPEG" << llendl; + LL_WARNS() << "Image to upload is not a PNG or JPEG" << LL_ENDL; return; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d6fb6a5235..7bf90ef79e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -453,7 +453,10 @@ public: mCharacter = character; BOOL success = true; - if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; } + if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) + { + success = false; + } if ( success ) { @@ -808,14 +811,14 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c //------------------------------------------------------------------------ LLVOAvatar::~LLVOAvatar() { - if (!mFullyLoaded) - { + if (!mFullyLoaded) + { debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); - } - else - { + } + else + { debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); - } + } logPendingPhases(); @@ -969,10 +972,11 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts) iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* inst = (LLVOAvatar*) *iter; - if (!inst) - continue; - S32 rez_status = inst->getRezzedStatus(); - counts[rez_status]++; + if (inst) + { + S32 rez_status = inst->getRezzedStatus(); + counts[rez_status]++; + } } } @@ -1342,38 +1346,36 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) { LLViewerJointAttachment* attachment = iter->second; - if (!attachment->getValid()) - { - continue ; - } - - for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); - attachment_iter != attachment->mAttachedObjects.end(); - ++attachment_iter) + if (attachment->getValid()) { - const LLViewerObject* attached_object = (*attachment_iter); - if (attached_object && !attached_object->isHUDAttachment()) + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) { - LLDrawable* drawable = attached_object->mDrawable; - if (drawable && !drawable->isState(LLDrawable::RIGGED)) + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isHUDAttachment()) { - LLSpatialBridge* bridge = drawable->getSpatialBridge(); - if (bridge) + LLDrawable* drawable = attached_object->mDrawable; + if (drawable && !drawable->isState(LLDrawable::RIGGED)) { - const LLVector4a* ext = bridge->getSpatialExtents(); - LLVector4a distance; - distance.setSub(ext[1], ext[0]); - LLVector4a max_span(max_attachment_span); + LLSpatialBridge* bridge = drawable->getSpatialBridge(); + if (bridge) + { + const LLVector4a* ext = bridge->getSpatialExtents(); + LLVector4a distance; + distance.setSub(ext[1], ext[0]); + LLVector4a max_span(max_attachment_span); - S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; + S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7; - // Only add the prim to spatial extents calculations if it isn't a megaprim. - // max_attachment_span calculated at the start of the function - // (currently 5 times our max prim size) - if (lt == 0x7) - { - update_min_max(newMin,newMax,ext[0]); - update_min_max(newMin,newMax,ext[1]); + // Only add the prim to spatial extents calculations if it isn't a megaprim. + // max_attachment_span calculated at the start of the function + // (currently 5 times our max prim size) + if (lt == 0x7) + { + update_min_max(newMin,newMax,ext[0]); + update_min_max(newMin,newMax,ext[1]); + } } } } @@ -1950,7 +1952,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, if (has_name && getNVPair("FirstName")) { mDebugExistenceTimer.reset(); - debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); + debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); } if(retval & LLViewerObject::INVALID_UPDATE) @@ -1962,9 +1964,6 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, } } - //LL_INFOS() << getRotation() << LL_ENDL; - //LL_INFOS() << getPosition() << LL_ENDL; - return retval; } @@ -1980,7 +1979,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU result = gTextureList.findImage(uuid); } if (!result) -{ + { const std::string url = getImageURL(te,uuid); if (url.empty()) @@ -3324,7 +3323,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) removeAnimationData("Walk Speed"); } mMotionController.setTimeStep(time_step); -// LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL; + // LL_INFOS() << "Setting timestep to " << time_quantum * pixel_area_scale << LL_ENDL; } if (getParent() && !mIsSitting) @@ -3465,7 +3464,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) fwdDir.normalize(); } } - } LLQuaternion root_rotation = mRoot->getWorldMatrix().quaternion(); @@ -3581,10 +3579,14 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // update animations if (mSpecialRenderMode == 1) // Animation Preview + { updateMotions(LLCharacter::FORCE_UPDATE); + } else + { updateMotions(LLCharacter::NORMAL_UPDATE); - + } + // update head position updateHeadOffset(); @@ -3681,10 +3683,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) //mesh vertices need to be reskinned mNeedsSkin = TRUE; - - - - return TRUE; } //----------------------------------------------------------------------------- @@ -3964,13 +3962,13 @@ U32 LLVOAvatar::renderSkinned() if (face) { LLVertexBuffer* vb = face->getVertexBuffer(); - if (vb) - { - vb->flush(); + if (vb) + { + vb->flush(); + } } } } - } else { mNeedsSkin = FALSE; @@ -4150,7 +4148,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) { LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); if (hair_mesh) - { + { num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); } first_pass = FALSE; @@ -5202,8 +5200,8 @@ BOOL LLVOAvatar::loadSkeletonNode () { if (!LLAvatarAppearance::loadSkeletonNode()) { - return FALSE; - } + return FALSE; + } // ATTACHMENTS { @@ -5954,27 +5952,24 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const break; // Do nothing } - /* switch(type) - case LLWearableType::WT_SHIRT: - indicator_te = TEX_UPPER_SHIRT; */ for (LLAvatarAppearanceDictionary::Textures::const_iterator tex_iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); tex_iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++tex_iter) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_iter->second; if (texture_dict->mWearableType == type) - { + { // Thus, you must check to see if the corresponding baked texture is defined. // NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing // this works for detecting a skirt (most important), but is ineffective at any piece of clothing that // gets baked into a texture that always exists (upper or lower). if (texture_dict->mIsUsedByBakedTexture) - { + { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); - } + } return FALSE; - } + } } return FALSE; } @@ -6044,7 +6039,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) } else if (global_color == mTexEyeColor) { -// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; + // LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); @@ -6104,9 +6099,9 @@ void LLVOAvatar::updateRezzedStatusTimers() { // load level has decreased. start phase timers for higher load levels. for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) - { + { startPhase("load_" + LLVOAvatar::rezStatusToString(i)); - } + } } else if (rez_status > mLastRezzedStatus) { @@ -6115,16 +6110,15 @@ void LLVOAvatar::updateRezzedStatusTimers() { stopPhase("load_" + LLVOAvatar::rezStatusToString(i)); stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false); - } + } if (rez_status == 3) - { + { // "fully loaded", mark any pending appearance change complete. selfStopPhase("update_appearance_from_cof"); selfStopPhase("wear_inventory_category", false); selfStopPhase("process_initial_wearables_update", false); } } - mLastRezzedStatus = rez_status; } } @@ -6186,7 +6180,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) void LLVOAvatar::logPendingPhases() { if (!isAgentAvatarValid()) - { + { return; } @@ -6202,14 +6196,14 @@ void LLVOAvatar::logPendingPhases() if (!completed) { logMetricsTimerRecord(phase_name, elapsed, completed); - } + } } } - } +} //static void LLVOAvatar::logPendingPhasesAllAvatars() - { +{ for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -6220,14 +6214,14 @@ void LLVOAvatar::logPendingPhasesAllAvatars() } inst->logPendingPhases(); } - } +} void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed) - { +{ if (!isAgentAvatarValid()) - { + { return; - } + } LLSD record; record["timer_name"] = phase_name; @@ -6236,10 +6230,10 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse record["completed"] = completed; U32 grid_x(0), grid_y(0); if (getRegion()) - { + { record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion()); grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); - } + } record["grid_x"] = LLSD::Integer(grid_x); record["grid_y"] = LLSD::Integer(grid_y); record["is_using_server_bakes"] = true; @@ -6300,8 +6294,8 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE); - if (!mPreviousFullyLoaded && !loading && mFullyLoaded) - { + if (!mPreviousFullyLoaded && !loading && mFullyLoaded) + { debugAvatarRezTime("AvatarRezNotification","fully loaded"); } @@ -6357,9 +6351,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) LLAvatarJointMesh* mesh = (*iter); if (mesh) { - { - mesh->setColor(color); - } + mesh->setColor(color); } } } @@ -6459,7 +6451,7 @@ void LLVOAvatar::updateMeshTextures() LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() ) - { + { LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID); mBakedTextureDatas[i].mIsUsed = TRUE; @@ -6468,12 +6460,12 @@ void LLVOAvatar::updateMeshTextures() avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( baked_img ); - } + } } } else if (!isUsingLocalAppearance() && is_layer_baked[i]) @@ -6502,9 +6494,9 @@ void LLVOAvatar::updateMeshTextures() baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); - // this could add paused texture callbacks - mLoadedCallbacksPaused |= paused; - checkTextureLoading(); + // this could add paused texture callbacks + mLoadedCallbacksPaused |= paused; + checkTextureLoading(); } } else if (layerset && isUsingLocalAppearance()) @@ -6523,7 +6515,7 @@ void LLVOAvatar::updateMeshTextures() if (mesh) { mesh->setLayerSet( layerset ); - } + } } } else @@ -6545,7 +6537,7 @@ void LLVOAvatar::updateMeshTextures() { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( color ); mesh->setTexture( hair_img ); } @@ -6641,13 +6633,13 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin(); iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter) -{ + { const LLMaskedMorph* maskedMorph = (*iter); LLPolyMorphTarget* morph_target = dynamic_cast<LLPolyMorphTarget*>(maskedMorph->mMorphTarget); if (morph_target) - { + { morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); -} + } } } @@ -6946,9 +6938,9 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, outfile.open(fullpath, LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) - { - return; - } + { + return; + } else { LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << LL_ENDL; @@ -6983,7 +6975,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str()); } apr_file_printf(file, "</textures>\n"); - } +} void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) { @@ -7512,12 +7504,12 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( image_baked ); - } + } } } @@ -7541,14 +7533,13 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( LLColor4::white ); } } } } } - dirtyMesh(); } @@ -7560,7 +7551,7 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, file_num_type::iterator it = file_nums.find(prefix); S32 num = 0; if (it != file_nums.end()) -{ + { num = it->second; } file_nums[prefix] = num+1; @@ -7593,65 +7584,58 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLAPRFile outfile; std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - outfile.open(fullpath, LL_APR_WB ); - apr_file_t* file = outfile.getFileHandle(); - if (!file) - { - return; - } - else + if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB )) { + apr_file_t* file = outfile.getFileHandle(); LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL; - } - - apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); - apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); - apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); - if (group_by_wearables) - { - for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) - { - const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); - apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); + apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" ); + apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" ); + apr_file_printf( file, "\n\t<archetype name=\"???\">\n" ); - for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + if (group_by_wearables) { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - if( (viewer_param->getWearableType() == type) && - (viewer_param->isTweakable() ) ) + for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) { - dump_visual_param(file, viewer_param, viewer_param->getWeight()); - } - } + const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); + apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); - for (U8 te = 0; te < TEX_NUM_INDICES; te++) - { - if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) - { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + if( (viewer_param->getWearableType() == type) && + (viewer_param->isTweakable() ) ) + { + dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } + } + + for (U8 te = 0; te < TEX_NUM_INDICES; te++) + { + if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) + { + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) + { + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + } + } } } } - } - } - else - { - // Just dump all params sequentially. - for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + else { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - dump_visual_param(file, viewer_param, viewer_param->getWeight()); - } + // Just dump all params sequentially. + for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) + { + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } - for (U8 te = 0; te < TEX_NUM_INDICES; te++) - { + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { // MULTIPLE_WEARABLES: extend to multiple wearables? LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); @@ -7663,18 +7647,17 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } } } + apr_file_printf( file, "\t</archetype>\n" ); + apr_file_printf( file, "\n</linden_genepool>\n" ); + bool ultra_verbose = false; + if (isSelf() && ultra_verbose) + { + // show the cloned params inside the wearables as well. + gAgentAvatarp->dumpWearableInfo(outfile); + } + outfile.close(); } - apr_file_printf( file, "\t</archetype>\n" ); - apr_file_printf( file, "\n</linden_genepool>\n" ); - - bool ultra_verbose = false; - if (isSelf() && ultra_verbose) - { - // show the cloned params inside the wearables as well. - gAgentAvatarp->dumpWearableInfo(outfile); - } - // File will close when handle goes out of scope } @@ -7788,7 +7771,7 @@ void LLVOAvatar::startAppearanceAnimation() // virtual void LLVOAvatar::removeMissingBakedTextures() - { +{ } //virtual @@ -8042,7 +8025,6 @@ void LLVOAvatar::calculateUpdateRenderCost() } } } - } // Diagnostic output to identify all avatar-related textures. @@ -8054,9 +8036,8 @@ void LLVOAvatar::calculateUpdateRenderCost() for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) { LLUUID image_id = it->first; - if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - continue; - if (all_textures.find(image_id) == all_textures.end()) + if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + && (all_textures.find(image_id) == all_textures.end())) { // attachment texture not previously seen. LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; @@ -8122,15 +8103,17 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high) // static BOOL LLVOAvatar::isIndexLocalTexture(ETextureIndex index) { - if (index < 0 || index >= TEX_NUM_INDICES) return false; - return LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsLocalTexture; + return (index < 0 || index >= TEX_NUM_INDICES) + ? false + : LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsLocalTexture; } // static BOOL LLVOAvatar::isIndexBakedTexture(ETextureIndex index) { - if (index < 0 || index >= TEX_NUM_INDICES) return false; - return LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsBakedTexture; + return (index < 0 || index >= TEX_NUM_INDICES) + ? false + : LLAvatarAppearanceDictionary::getInstance()->getTexture(index)->mIsBakedTexture; } const std::string LLVOAvatar::getBakedStatusForPrintout() const @@ -8180,7 +8163,7 @@ BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U { return FALSE; } - + if( !getImage( te, index ) ) { LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL; |