--- linden-orig\indra\newview\lltextureview.cpp 2007-05-14 16:47:26.000000000 +0200 +++ linden\indra\newview\lltextureview.cpp 2007-05-20 00:49:17.984375000 +0200 @@ -396,45 +396,59 @@ S32 max_total_mem = (LLViewerImage::sMaxTotalTextureMem >> 20); F32 discard_bias = LLViewerImage::sDesiredDiscardBias; S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f); + + // LLGLEnable tex(GL_TEXTURE_2D); + //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; F32 text_color[] = {1.f, 1.f, 1.f, 0.75f}; std::string text; - text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB Discard Bias: %.2f", + text = llformat("Memory: Texures: %d/%d MB GL-Bound: %d/%d MB Discard Bias: %.2f", total_mem, max_total_mem, bound_mem, max_bound_mem, discard_bias); - LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*3, + LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*4, text_color, LLFontGL::LEFT, LLFontGL::TOP); //---------------------------------------------------------------------------- - S32 bar_left = 380; - S32 bar_width = 200; - S32 top = line_height*3 - 2; - S32 bottom = top - 6; + F32 bar_total_scale = 1.5f; // bar display up to 150% total + S32 bar_left = 440; + S32 bar_width = 100; + S32 bar_width_100 = llfloor((F32)bar_width / bar_total_scale); // 100% fill indicator (bar scale scale goes to 150%) + S32 bar_top = line_height*4 - 2; + S32 bar_bottom = bar_top - line_height + 5; + S32 top = bar_top; S32 left = bar_left; - S32 right = left + bar_width; - - F32 bar_scale = (F32)bar_width / (max_bound_mem * 1.5f); + S32 fill = bar_left; + S32 bottom = bar_bottom; + F32 bar_scale = 0; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - gGL.color4f(0.5f, 0.5f, 0.5f, 0.75f); - gl_rect_2d(left, top, right, bottom); + //-------------------------------------- - left = bar_left; - right = left + llfloor(bound_mem * bar_scale); - if (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale)) + // dimensions/values for total_memory bar + bar_scale = (F32)bar_width / (max_total_mem * bar_total_scale); + left += 20; + top = bar_top; + bottom = bar_bottom; + fill = left + llfloor(total_mem * bar_scale); + + // draw tex-memory bar container + gGL.color4f(0.25f, 0.25f, 0.25f, 0.75f); + gl_rect_2d(left, top, left+bar_width_100, bottom); + + // draw bar fill + if (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale)) { gGL.color4f(0.f, 1.f, 0.f, 0.75f); } - else if (bound_mem < max_bound_mem) + else if (total_mem < max_total_mem) { gGL.color4f(1.f, 1.f, 0.f, 0.75f); } @@ -442,19 +456,30 @@ { gGL.color4f(1.f, 0.f, 0.f, 0.75f); } - gl_rect_2d(left, top, right, bottom); + gl_rect_2d(left, top, fill, bottom); + left = left + bar_width; - bar_scale = (F32)bar_width / (max_total_mem * 1.5f); - - top = bottom - 2; - bottom = top - 6; - left = bar_left; - right = left + llfloor(total_mem * bar_scale); - if (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale)) + + //-------------------------------------- + + // dimensions for bound-mem + bar_scale = (F32)bar_width / (max_bound_mem * bar_total_scale); + top = bar_top; + left += 20; + bottom = bar_bottom; + fill = left + llfloor(bound_mem * bar_scale); + fill = llclamp(fill, left, left + bar_width); // HACK: avoid bar overshooting for bogus bound_mem calculations + + // draw bound-mem bar container + gGL.color4f(0.25f, 0.25f, 0.25f, 0.75f); + gl_rect_2d(left, top, left+bar_width_100, bottom); + + // draw bar fill + if (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale)) { gGL.color4f(0.f, 1.f, 0.f, 0.75f); } - else if (total_mem < max_total_mem) + else if (bound_mem < max_bound_mem) { gGL.color4f(1.f, 1.f, 0.f, 0.75f); } @@ -461,7 +486,8 @@ { gGL.color4f(1.f, 0.f, 0.f, 0.75f); } - gl_rect_2d(left, top, right, bottom); + gl_rect_2d(left, top, fill, bottom); + left = left + bar_width; //---------------------------------------------------------------------------- @@ -477,7 +501,7 @@ LLImageWorker::sCount, LLImageWorker::getWorkerThread()->getNumDeletes(), LLImageRaw::sRawImageCount); - LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*2, + LLFontGL::sMonospace->renderUTF8(text, 0, 0, line_height*3, text_color, LLFontGL::LEFT, LLFontGL::TOP); S32 dx1 = 0; @@ -493,6 +517,7 @@ text_color, LLFontGL::LEFT, LLFontGL::TOP); dx1 += 8; } + if (mTextureView->mOrderFetch) { LLFontGL::sMonospace->renderUTF8(title_string1b, 0, title_x1+dx1, line_height, @@ -521,8 +546,9 @@ LLRect LLGLTexMemBar::getRequiredRect() { + S32 line_height = (S32)(LLFontGL::sMonospace->getLineHeight() + .5f); LLRect rect; - rect.mTop = 8; + rect.mTop = line_height*3 - 4; return rect; }