diff options
author | Jonathan Yap <jhwelch@gmail.com> | 2014-12-01 13:55:12 -0500 |
---|---|---|
committer | Jonathan Yap <jhwelch@gmail.com> | 2014-12-01 13:55:12 -0500 |
commit | 3e9c3b36960fd17cba9114bc2e4564208346b92e (patch) | |
tree | e491a4fa2aa1aa81914a024e45b1cf0535c600eb /indra/newview | |
parent | e510c786d9b5eea96b9331596c77a79b239de809 (diff) | |
parent | c71cf9cf23ff7a9928695367e9b62db3bed38ed7 (diff) |
STORM-2082 merge
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llavatarrenderinfoaccountant.cpp | 29 | ||||
-rwxr-xr-x | indra/newview/llviewerobject.cpp | 17 | ||||
-rwxr-xr-x | indra/newview/llviewerobject.h | 1 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 87 |
5 files changed, 68 insertions, 77 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 17b43901a9..31890ca205 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9911,17 +9911,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>RenderAutoMuteFunctions</key> - <map> - <key>Comment</key> - <string>Developing feature to render some avatars using simple impostors or colored silhouettes. (Set to 7 for all functionality)</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>U32</string> - <key>Value</key> - <real>0</real> - </map> <key>RenderAutoMuteLogging</key> <map> <key>Comment</key> diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 38e153137c..ca2674bf94 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -335,35 +335,6 @@ void LLAvatarRenderInfoAccountant::idle() // We scanned all the regions, reset the request timer. sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); } - - static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0); - static U32 prev_render_auto_mute_functions = (U32) -1; - if (prev_render_auto_mute_functions != render_auto_mute_functions) - { - prev_render_auto_mute_functions = render_auto_mute_functions; - - // Adjust menus - BOOL show_items = (BOOL)(render_auto_mute_functions & 0x04); - gMenuAvatarOther->setItemVisible( std::string("Normal"), show_items); - gMenuAvatarOther->setItemVisible( std::string("Always use impostor"), show_items); - gMenuAvatarOther->setItemVisible( std::string("Never use impostor"), show_items); - gMenuAvatarOther->setItemVisible( std::string("Impostor seperator"), show_items); - - gMenuAttachmentOther->setItemVisible( std::string("Normal"), show_items); - gMenuAttachmentOther->setItemVisible( std::string("Always use impostor"), show_items); - gMenuAttachmentOther->setItemVisible( std::string("Never use impostor"), show_items); - gMenuAttachmentOther->setItemVisible( std::string("Impostor seperator"), show_items); - - if (!show_items) - { // Turning off visual muting - for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) - { // Make sure all AVs have the setting cleared - LLVOAvatar* inst = (LLVOAvatar*) *iter; - inst->setCachedVisualMute(false); - } - } - } } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 4f992fc184..2f6283c8d0 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4926,12 +4926,7 @@ void LLViewerObject::setDebugText(const std::string &utf8text) if (!mText) { - mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); - mText->setFont(LLFontGL::getFontSansSerif()); - mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); - mText->setMaxLines(-1); - mText->setSourceObject(this); - mText->setOnHUDAttachment(isHUDAttachment()); + initDebugTextHud(); } mText->setColor(LLColor4::white); mText->setString(utf8text); @@ -4940,6 +4935,16 @@ void LLViewerObject::setDebugText(const std::string &utf8text) updateText(); } +void LLViewerObject::initDebugTextHud() +{ + mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); + mText->setFont(LLFontGL::getFontSansSerif()); + mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); + mText->setMaxLines(-1); + mText->setSourceObject(this); + mText->setOnHUDAttachment(isHUDAttachment()); +} + void LLViewerObject::setIcon(LLViewerTexture* icon_image) { if (!mIcon) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index bab107cc57..e7ae0af32a 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -398,6 +398,7 @@ public: void setCanSelect(BOOL canSelect); + void initDebugTextHud(); void setDebugText(const std::string &utf8text); void setIcon(LLViewerTexture* icon_image); void clearIcon(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e0128463f3..3a83943209 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7953,57 +7953,82 @@ void LLVOAvatar::idleUpdateRenderCost() { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO)) { - std::string render_info_text; - F32 worst_ratio = 0.f; - F32 red_level = 0.f; - F32 green_level = 0.f; + std::string info_line; + F32 red_level; + F32 green_level; + LLColor4 info_color; + LLFontGL::StyleFlags info_style; + + if ( !mText ) + { + initDebugTextHud(); + } + else + { + mText->clearString(); // clear debug text + } static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); - render_info_text.append(llformat("%.1f KB%s", mAttachmentGeometryBytes/1024.f, - (max_attachment_bytes > 0 && mAttachmentGeometryBytes > max_attachment_bytes) ? "!" : "")); - + info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this { - if ((mAttachmentGeometryBytes/(F32)max_attachment_bytes) > worst_ratio) - { - worst_ratio = mAttachmentGeometryBytes/(F32)max_attachment_bytes; - green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f); - red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f); - } + green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f); + red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f); + info_color.set(red_level, green_level, 0.0, 1.0); + info_style = ( mAttachmentGeometryBytes > max_attachment_bytes + ? LLFontGL::BOLD : LLFontGL::NORMAL ); + } + else + { + info_color.setToWhite(); + info_style = LLFontGL::NORMAL; } + LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; + mText->addLine(info_line, info_color); static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0); - render_info_text.append(llformat(" %.2f m^2%s", mAttachmentSurfaceArea, - (max_attachment_area > 0 && mAttachmentSurfaceArea > max_attachment_area) ? "!" : "")); + info_line = llformat("%.2f m^2", mAttachmentSurfaceArea); if (max_attachment_area != 0) // zero means don't care, so don't bother coloring based on this { - if ((mAttachmentSurfaceArea/max_attachment_area) > worst_ratio) - { - worst_ratio = mAttachmentSurfaceArea/max_attachment_area; - green_level = 1.f-llclamp((mAttachmentSurfaceArea-max_attachment_area)/max_attachment_area, 0.f, 1.f); - red_level = llmin(mAttachmentSurfaceArea/max_attachment_area, 1.f); - } + green_level = 1.f-llclamp((mAttachmentSurfaceArea-max_attachment_area)/max_attachment_area, 0.f, 1.f); + red_level = llmin(mAttachmentSurfaceArea/max_attachment_area, 1.f); + info_color.set(red_level, green_level, 0.0, 1.0); + info_style = ( max_attachment_area > mAttachmentSurfaceArea + ? LLFontGL::BOLD : LLFontGL::NORMAL ); + + } + else + { + info_color.setToWhite(); + info_style = LLFontGL::NORMAL; } + LL_DEBUGS() << "adding max area " << info_line << LL_ENDL; + mText->addLine(info_line, info_color, info_style); calculateUpdateRenderCost(); // Update mVisualComplexity if needed static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); - render_info_text.append(llformat(" %d%s", mVisualComplexity, - (max_render_cost > 0 && mVisualComplexity > max_render_cost) ? "!" : "")); + info_line = llformat("%d arc", mVisualComplexity); if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this { - if (((F32)mVisualComplexity/(F32)max_render_cost) > worst_ratio) - { - worst_ratio = (F32)mVisualComplexity/(F32)max_render_cost; - green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f); - red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f); - } + green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f); + red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f); + info_color.set(red_level, green_level, 0.0, 1.0); + info_style = ( mVisualComplexity > max_render_cost + ? LLFontGL::BOLD : LLFontGL::NORMAL ); + + } + else + { + info_color.setToWhite(); + info_style = LLFontGL::NORMAL; } + LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; + mText->addLine(info_line, info_color, info_style); - setDebugText(render_info_text); - mText->setColor(worst_ratio != 0.f ? LLColor4(red_level,green_level,0,1) : LLColor4::green); + updateText(); // corrects position } } |