Various performance improvements in frequently visited areas
parent
d1d8bb0a99
commit
f8ee277229
|
|
@ -109,6 +109,11 @@ LLHUDNameTag::LLHUDNameTag(const U8 type)
|
|||
{
|
||||
LLPointer<LLHUDNameTag> ptr(this);
|
||||
sTextObjects.insert(ptr);
|
||||
|
||||
// <FS:Ansariel> Performance improvement
|
||||
mRoundedRectImg = LLUI::getUIImage("Rounded_Rect");
|
||||
mRoundedRectTopImg = LLUI::getUIImage("Rounded_Rect_Top");
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
LLHUDNameTag::~LLHUDNameTag()
|
||||
|
|
@ -278,11 +283,19 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
|||
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
|
||||
|
||||
// *TODO: cache this image
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Rect");
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Rect");
|
||||
|
||||
// *TODO: make this a per-text setting
|
||||
LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
|
||||
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
|
||||
//LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
|
||||
//bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
|
||||
|
||||
static LLUIColor s_bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
|
||||
static LLCachedControl<F32> chatBubbleOpacity(gSavedSettings, "ChatBubbleOpacity");
|
||||
LLColor4 bg_color = s_bg_color.get();
|
||||
F32 color_alpha = chatBubbleOpacity * alpha_factor;
|
||||
bg_color.setAlpha(color_alpha);
|
||||
// </FS:Ansariel>
|
||||
|
||||
// scale screen size of borders down
|
||||
//RN: for now, text on hud objects is never occluded
|
||||
|
|
@ -309,17 +322,27 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
|||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
LLRect screen_rect;
|
||||
screen_rect.setCenterAndSize(0, static_cast<S32>(lltrunc(-mHeight / 2 + mOffsetY)), static_cast<S32>(lltrunc(mWidth)), static_cast<S32>(lltrunc(mHeight)));
|
||||
imagep->draw3D(render_position, x_pixel_vec, y_pixel_vec, screen_rect, bg_color);
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//imagep->draw3D(render_position, x_pixel_vec, y_pixel_vec, screen_rect, bg_color);
|
||||
mRoundedRectImg->draw3D(render_position, x_pixel_vec, y_pixel_vec, screen_rect, bg_color);
|
||||
// </FS:Ansariel>
|
||||
if (mLabelSegments.size())
|
||||
{
|
||||
LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top");
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top");
|
||||
LLRect label_top_rect = screen_rect;
|
||||
const S32 label_height = llround((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
|
||||
label_top_rect.mBottom = label_top_rect.mTop - label_height;
|
||||
LLColor4 label_top_color = text_color;
|
||||
label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor;
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor;
|
||||
label_top_color.mV[VALPHA] = color_alpha;
|
||||
// </FS:Ansariel>
|
||||
|
||||
rect_top_image->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color);
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//rect_top_image->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color);
|
||||
mRoundedRectTopImg->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color);
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
F32 y_offset = (F32)mOffsetY;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "lluiimage.h"
|
||||
|
||||
class LLDrawable;
|
||||
class LLHUDNameTag;
|
||||
|
||||
|
|
@ -178,6 +180,11 @@ private:
|
|||
// static std::vector<LLPointer<LLHUDNameTag> > sVisibleHUDTextObjects;
|
||||
typedef std::set<LLPointer<LLHUDNameTag> >::iterator TextObjectIterator;
|
||||
typedef std::vector<LLPointer<LLHUDNameTag> >::iterator VisibleTextObjectIterator;
|
||||
|
||||
// <FS:Ansariel> Performance improvement
|
||||
LLUIImagePtr mRoundedRectImg;
|
||||
LLUIImagePtr mRoundedRectTopImg;
|
||||
// </FS:Ansariel>
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -151,11 +151,18 @@ void LLHUDText::renderText()
|
|||
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
|
||||
|
||||
// *TODO: cache this image
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
|
||||
|
||||
// *TODO: make this a per-text setting
|
||||
LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
|
||||
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
|
||||
//bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
|
||||
static LLUIColor s_bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
|
||||
static LLCachedControl<F32> chatBubbleOpacity(gSavedSettings, "ChatBubbleOpacity");
|
||||
LLColor4 bg_color = s_bg_color.get();
|
||||
bg_color.setAlpha(chatBubbleOpacity * alpha_factor);
|
||||
// </FS:Ansariel>
|
||||
|
||||
const S32 border_height = 16;
|
||||
const S32 border_width = 16;
|
||||
|
|
|
|||
|
|
@ -453,15 +453,25 @@ F32 LLPhysicsMotion::calculateAcceleration_local(const F32 velocity_local)
|
|||
BOOL LLPhysicsMotionController::onUpdate(F32 time, U8* joint_mask)
|
||||
{
|
||||
// Skip if disabled globally.
|
||||
if (!gSavedSettings.getBOOL("AvatarPhysics"))
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//if (!gSavedSettings.getBOOL("AvatarPhysics"))
|
||||
static LLCachedControl<bool> avatar_physics(gSavedSettings, "AvatarPhysics");
|
||||
if (!avatar_physics)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL update_visuals = FALSE;
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//for (motion_vec_t::iterator iter = mMotions.begin();
|
||||
// iter != mMotions.end();
|
||||
// ++iter)
|
||||
motion_vec_t::iterator motions_end_it = mMotions.end();
|
||||
for (motion_vec_t::iterator iter = mMotions.begin();
|
||||
iter != mMotions.end();
|
||||
iter != motions_end_it;
|
||||
++iter)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
LLPhysicsMotion *motion = (*iter);
|
||||
update_visuals |= motion->onUpdate(time);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,11 @@ void LLTracker::stopTracking(void* userdata)
|
|||
// static virtual
|
||||
void LLTracker::drawHUDArrow()
|
||||
{
|
||||
if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return;
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return;
|
||||
static LLCachedControl<bool> renderTrackerBeacon(gSavedSettings, "RenderTrackerBeacon");
|
||||
if (!renderTrackerBeacon) return;
|
||||
// </FS:Ansariel>
|
||||
|
||||
if (gViewerWindow->getProgressView()->getVisible()) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -2423,7 +2423,10 @@ void LLViewerMediaImpl::updateJavascriptObject()
|
|||
if ( mMediaSource )
|
||||
{
|
||||
// flag to expose this information to internal browser or not.
|
||||
bool enable = gSavedSettings.getBOOL("BrowserEnableJSObject");
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//bool enable = gSavedSettings.getBOOL("BrowserEnableJSObject");
|
||||
static LLCachedControl<bool> enable(gSavedSettings, "BrowserEnableJSObject");
|
||||
// </FS:Ansariel>
|
||||
|
||||
if(!enable)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1037,7 +1037,11 @@ void LLVOSky::calcAtmospherics(void)
|
|||
|
||||
// Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio
|
||||
// between sunlight and point lights in windlight to normalize point lights.
|
||||
F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f);
|
||||
// <FS:Ansariel> Performance improvement
|
||||
//F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f);
|
||||
static LLCachedControl<F32> renderSunDynamicRange(gSavedSettings, "RenderSunDynamicRange");
|
||||
F32 sun_dynamic_range = llmax(renderSunDynamicRange(), 0.0001f);
|
||||
// </FS:Ansariel>
|
||||
LLWLParamManager::getInstance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp);
|
||||
|
||||
mSunDiffuse = vary_SunlightColor;
|
||||
|
|
|
|||
Loading…
Reference in New Issue