llrender and lldir merge. Removed duplicate assets from skins. cleaned up skin textures.xml files to only include changes from default.
@@ -258,6 +258,10 @@ A. Or use FXAA_GREEN_AS_LUMA.
|
||||
#define FXAA_GLSL_130 0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#ifndef FXAA_GLSL_400
|
||||
#define FXAA_GLSL_400 0
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#ifndef FXAA_HLSL_3
|
||||
#define FXAA_HLSL_3 0
|
||||
#endif
|
||||
@@ -344,8 +348,8 @@ A. Or use FXAA_GREEN_AS_LUMA.
|
||||
// 1 = API supports gather4 on alpha channel.
|
||||
// 0 = API does not support gather4 on alpha channel.
|
||||
//
|
||||
#if (FXAA_GLSL_130 == 0)
|
||||
#define FXAA_GATHER4_ALPHA 0
|
||||
#if (FXAA_GLSL_400 == 1)
|
||||
#define FXAA_GATHER4_ALPHA 1
|
||||
#endif
|
||||
#if (FXAA_HLSL_5 == 1)
|
||||
#define FXAA_GATHER4_ALPHA 1
|
||||
@@ -654,7 +658,7 @@ NOTE the other tuning knobs are now in the shader function inputs!
|
||||
API PORTING
|
||||
|
||||
============================================================================*/
|
||||
#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
|
||||
#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1) || (FXAA_GLSL_400 == 1)
|
||||
#define FxaaBool bool
|
||||
#define FxaaDiscard discard
|
||||
#define FxaaFloat float
|
||||
@@ -716,6 +720,16 @@ NOTE the other tuning knobs are now in the shader function inputs!
|
||||
#endif
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_GLSL_400 == 1)
|
||||
// Requires "#version 400" or better
|
||||
#define FxaaTexTop(t, p) textureLod(t, p, 0.0)
|
||||
#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
|
||||
#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
|
||||
#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
|
||||
#define FxaaTexGreen4(t, p) textureGather(t, p, 1)
|
||||
#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
|
||||
#endif
|
||||
/*--------------------------------------------------------------------------*/
|
||||
#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
|
||||
#define FxaaInt2 float2
|
||||
#define FxaaTex sampler2D
|
||||
|
||||
@@ -652,7 +652,7 @@ bool LLAppViewer::init()
|
||||
|
||||
// set skin search path to default, will be overridden later
|
||||
// this allows simple skinned file lookups to work
|
||||
gDirUtilp->setSkinFolder("default");
|
||||
gDirUtilp->setSkinFolder("default", "en-us");
|
||||
|
||||
initLogging();
|
||||
|
||||
@@ -725,16 +725,20 @@ bool LLAppViewer::init()
|
||||
LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ;
|
||||
|
||||
// Load art UUID information, don't require these strings to be declared in code.
|
||||
std::string colors_base_filename = gDirUtilp->findSkinnedFilename("colors_base.xml");
|
||||
LL_DEBUGS("InitInfo") << "Loading base colors from " << colors_base_filename << LL_ENDL;
|
||||
gColors.loadFromFileLegacy(colors_base_filename, FALSE, TYPE_COL4U);
|
||||
|
||||
// Load overrides from user colors file
|
||||
std::string user_colors_filename = gDirUtilp->findSkinnedFilename("colors.xml");
|
||||
LL_DEBUGS("InitInfo") << "Loading user colors from " << user_colors_filename << LL_ENDL;
|
||||
if (gColors.loadFromFileLegacy(user_colors_filename, FALSE, TYPE_COL4U) == 0)
|
||||
for(auto& colors_base_filename : gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors_base.xml", LLDir::ALL_SKINS))
|
||||
{
|
||||
LL_DEBUGS("InitInfo") << "Cannot load user colors from " << user_colors_filename << LL_ENDL;
|
||||
LL_DEBUGS("InitInfo") << "Loading colors from " << colors_base_filename << LL_ENDL;
|
||||
gColors.loadFromFileLegacy(colors_base_filename, FALSE, TYPE_COL4U);
|
||||
}
|
||||
// Load overrides from user colors file
|
||||
for (auto& colors_base_filename : gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS))
|
||||
{
|
||||
gColors.loadFromFileLegacy(colors_base_filename, FALSE, TYPE_COL4U);
|
||||
LL_DEBUGS("InitInfo") << "Loading user colors from " << colors_base_filename << LL_ENDL;
|
||||
if (gColors.loadFromFileLegacy(colors_base_filename, FALSE, TYPE_COL4U) == 0)
|
||||
{
|
||||
LL_DEBUGS("InitInfo") << "Cannot load user colors from " << colors_base_filename << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
// Widget construction depends on LLUI being initialized
|
||||
@@ -747,6 +751,11 @@ bool LLAppViewer::init()
|
||||
&LLUI::getScaleFactor());
|
||||
LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ;
|
||||
|
||||
// NOW LLUI::getLanguage() should work. gDirUtilp must know the language
|
||||
// for this session ASAP so all the file-loading commands that follow,
|
||||
// that use findSkinnedFilenames(), will include the localized files.
|
||||
gDirUtilp->setSkinFolder(gDirUtilp->getSkinFolder(), LLUI::getLanguage());
|
||||
|
||||
LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set
|
||||
|
||||
// Setup LLTrans after LLUI::initClass has been called.
|
||||
@@ -2411,7 +2420,11 @@ bool LLAppViewer::initConfiguration()
|
||||
const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent");
|
||||
if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString())
|
||||
{
|
||||
gDirUtilp->setSkinFolder(skinfolder->getValue().asString());
|
||||
// Examining "Language" may not suffice -- see LLUI::getLanguage()
|
||||
// logic. Unfortunately LLUI::getLanguage() doesn't yet do us much
|
||||
// good because we haven't yet called LLUI::initClass().
|
||||
gDirUtilp->setSkinFolder(skinfolder->getValue().asString(),
|
||||
gSavedSettings.getString("Language"));
|
||||
}
|
||||
|
||||
// XUI:translate
|
||||
|
||||
@@ -194,7 +194,7 @@ void LLConsole::draw()
|
||||
// draw remaining lines
|
||||
F32 y_pos = 0.f;
|
||||
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
|
||||
|
||||
static const LLCachedControl<F32> console_background_opacity("ConsoleBackgroundOpacity");
|
||||
F32 console_opacity = llclamp(console_background_opacity.get(), 0.f, 1.f);
|
||||
|
||||
@@ -421,7 +421,7 @@ void LLFastTimerView::draw()
|
||||
S32 left, top, right, bottom;
|
||||
S32 x, y, barw, barh, dx, dy;
|
||||
S32 texth;
|
||||
LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("Rounded_Square");
|
||||
|
||||
// Draw the window background
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
@@ -884,7 +884,8 @@ void LLFastTimerView::draw()
|
||||
gGL.color4fv(color.mV);
|
||||
F32 start_fragment = llclamp((F32)(left - sublevel_left[level]) / (F32)sublevel_dx[level], 0.f, 1.f);
|
||||
F32 end_fragment = llclamp((F32)(right - sublevel_left[level]) / (F32)sublevel_dx[level], 0.f, 1.f);
|
||||
gl_segmented_rect_2d_fragment_tex(sublevel_left[level], top - level + scale_offset, sublevel_right[level], bottom + level - scale_offset, box_imagep->getTextureWidth(), box_imagep->getTextureHeight(), 16, start_fragment, end_fragment);
|
||||
LLRect rect(sublevel_left[level], top - level + scale_offset, sublevel_right[level], bottom + level - scale_offset);
|
||||
gl_segmented_rect_2d_fragment_tex(rect, box_imagep->getTextureWidth(), box_imagep->getTextureHeight(), 16, start_fragment, end_fragment);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style)
|
||||
void LLFolderViewItem::initClass()
|
||||
{
|
||||
sArrowImage = LLUI::getUIImage("folder_arrow.tga");
|
||||
sBoxImage = LLUI::getUIImage("rounded_square.tga");
|
||||
sBoxImage = LLUI::getUIImage("Rounded_Square");
|
||||
}
|
||||
|
||||
//static
|
||||
|
||||
@@ -803,8 +803,8 @@ void LLHoverView::draw()
|
||||
return;
|
||||
}
|
||||
|
||||
LLUIImagePtr box_imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga");
|
||||
LLUIImagePtr box_imagep = LLUI::getUIImage("Rounded_Square");
|
||||
LLUIImagePtr shadow_imagep = LLUI::getUIImage("Rounded_Square_Soft");
|
||||
|
||||
const LLFontGL* fontp = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF_SMALL);
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ LLHUDNameTag::LLHUDNameTag(const U8 type)
|
||||
{
|
||||
LLPointer<LLHUDNameTag> ptr(this);
|
||||
sTextObjects.insert(ptr);
|
||||
mBubbleImage = LLUI::getUIImage("Rounded_Rect.png");
|
||||
mBubbleImage = LLUI::getUIImage("Rounded_Rect");
|
||||
}
|
||||
|
||||
LLHUDNameTag::~LLHUDNameTag()
|
||||
@@ -304,29 +304,14 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
||||
|
||||
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
|
||||
|
||||
LLUIImagePtr imagep = mBubbleImage;
|
||||
|
||||
// *TODO: make this a per-text setting
|
||||
static const LLCachedControl<LLColor4> background_chat_color("BackgroundChatColor", LLColor4(0,0,0,1.f));
|
||||
static const LLCachedControl<F32> chat_bubble_opacity("ChatBubbleOpacity", .5);
|
||||
LLColor4 bg_color = background_chat_color;
|
||||
bg_color.setAlpha(chat_bubble_opacity.get() * alpha_factor);
|
||||
|
||||
// maybe a no-op?
|
||||
//const S32 border_height = 16;
|
||||
//const S32 border_width = 16;
|
||||
const S32 border_height = 8;
|
||||
const S32 border_width = 8;
|
||||
|
||||
// *TODO move this into helper function
|
||||
F32 border_scale = 1.f;
|
||||
|
||||
if (border_height * 2 > mHeight)
|
||||
{
|
||||
border_scale = (F32)mHeight / ((F32)border_height * 2.f);
|
||||
}
|
||||
if (border_width * 2 > mWidth)
|
||||
{
|
||||
border_scale = llmin(border_scale, (F32)mWidth / ((F32)border_width * 2.f));
|
||||
}
|
||||
|
||||
// scale screen size of borders down
|
||||
//RN: for now, text on hud objects is never occluded
|
||||
@@ -336,34 +321,42 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
||||
|
||||
LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
|
||||
|
||||
LLVector2 border_scale_vec((F32)border_width / (F32)mBubbleImage->getTextureWidth(), (F32)border_height / (F32)mBubbleImage->getTextureHeight());
|
||||
LLVector3 width_vec = mWidth * x_pixel_vec;
|
||||
LLVector3 height_vec = mHeight * y_pixel_vec;
|
||||
LLVector3 scaled_border_width = (F32)llfloor(border_scale * (F32)border_width) * x_pixel_vec;
|
||||
LLVector3 scaled_border_height = (F32)llfloor(border_scale * (F32)border_height) * y_pixel_vec;
|
||||
|
||||
mRadius = (width_vec + height_vec).magVec() * 0.5f;
|
||||
|
||||
LLCoordGL screen_pos;
|
||||
LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE);
|
||||
|
||||
LLVector2 screen_offset;
|
||||
// if (!mUseBubble)
|
||||
// {
|
||||
// screen_offset = mPositionOffset;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
screen_offset = updateScreenPos(mPositionOffset);
|
||||
// }
|
||||
LLVector2 screen_offset = updateScreenPos(mPositionOffset);
|
||||
|
||||
LLVector3 render_position = mPositionAgent
|
||||
+ (x_pixel_vec * screen_offset.mV[VX])
|
||||
+ (y_pixel_vec * screen_offset.mV[VY]);
|
||||
|
||||
// if (mUseBubble)
|
||||
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);
|
||||
if (mLabelSegments.size())
|
||||
{
|
||||
LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top");
|
||||
LLRect label_top_rect = screen_rect;
|
||||
const S32 label_height = ll_round((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] = chat_bubble_opacity * alpha_factor;
|
||||
|
||||
rect_top_image->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color);
|
||||
}
|
||||
|
||||
BOOL outside_width = llabs(mPositionOffset.mV[VX]) > mWidth * 0.5f;
|
||||
BOOL outside_height = llabs(mPositionOffset.mV[VY] + (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.5f : 0.f)) > mHeight * (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.75f : 0.5f);
|
||||
|
||||
// draw line segments pointing to parent object
|
||||
if (!mOffscreen && (outside_width || outside_height))
|
||||
{
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLVector3 bg_pos = render_position
|
||||
@@ -371,46 +364,9 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
||||
- (width_vec / 2.f)
|
||||
- (height_vec);
|
||||
LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]);
|
||||
|
||||
if (for_select)
|
||||
|
||||
/*LLUI::pushMatrix();
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
S32 name = mSourceObject->mGLName;
|
||||
LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name);
|
||||
gGL.color4ubv(coloru.mV);
|
||||
gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
|
||||
LLUI::popMatrix();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(mBubbleImage->getImage());
|
||||
|
||||
gGL.color4fv(bg_color.mV);
|
||||
gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
|
||||
|
||||
if ( mLabelSegments.size())
|
||||
{
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], chat_bubble_opacity * alpha_factor);
|
||||
LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec;
|
||||
LLVector3 label_offset = height_vec - label_height;
|
||||
LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]);
|
||||
gl_segmented_rect_3d_tex_top(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, label_height);
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL outside_width = llabs(mPositionOffset.mV[VX]) > mWidth * 0.5f;
|
||||
BOOL outside_height = llabs(mPositionOffset.mV[VY] + (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.5f : 0.f)) > mHeight * (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.75f : 0.5f);
|
||||
|
||||
// draw line segments pointing to parent object
|
||||
if (!mOffscreen && (outside_width || outside_height))
|
||||
{
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
gGL.color4fv(bg_color.mV);
|
||||
LLVector3 target_pos = -1.f * (mPositionOffset.mV[VX] * x_pixel_vec + mPositionOffset.mV[VY] * y_pixel_vec);
|
||||
target_pos += (width_vec / 2.f);
|
||||
@@ -419,67 +375,65 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
||||
target_pos -= 6.f * y_pixel_vec;
|
||||
LLUI::translate(target_pos.mV[VX], target_pos.mV[VY], target_pos.mV[VZ]);
|
||||
gl_segmented_rect_3d_tex(border_scale_vec, 3.f * x_pixel_vec, 3.f * y_pixel_vec, 6.f * x_pixel_vec, 6.f * y_pixel_vec);
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
}
|
||||
LLUI::popMatrix();*/
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
LLGLDepthTest gls_depth(mZCompare ? GL_TRUE : GL_FALSE, GL_FALSE);
|
||||
|
||||
LLVector3 box_center_offset;
|
||||
box_center_offset = (width_vec * 0.5f) + (height_vec * 0.5f);
|
||||
LLUI::translate(box_center_offset.mV[VX], box_center_offset.mV[VY], box_center_offset.mV[VZ]);
|
||||
gGL.color4fv(bg_color.mV);
|
||||
LLUI::setLineWidth(2.0);
|
||||
gGL.begin(LLRender::LINES);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
LLGLDepthTest gls_depth(mZCompare ? GL_TRUE : GL_FALSE, GL_FALSE);
|
||||
|
||||
LLVector3 box_center_offset;
|
||||
box_center_offset = (width_vec * 0.5f) + (height_vec * 0.5f);
|
||||
LLUI::translate(box_center_offset.mV[VX], box_center_offset.mV[VY], box_center_offset.mV[VZ]);
|
||||
gGL.color4fv(bg_color.mV);
|
||||
LLUI::setLineWidth(2.0);
|
||||
gGL.begin(LLRender::LINES);
|
||||
{
|
||||
if (outside_width)
|
||||
{
|
||||
if (outside_width)
|
||||
LLVector3 vert;
|
||||
// draw line in x then y
|
||||
if (mPositionOffset.mV[VX] < 0.f)
|
||||
{
|
||||
LLVector3 vert;
|
||||
// draw line in x then y
|
||||
if (mPositionOffset.mV[VX] < 0.f)
|
||||
{
|
||||
// start at right edge
|
||||
vert = width_vec * 0.5f;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
// start at left edge
|
||||
vert = width_vec * -0.5f;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
vert = -mPositionOffset.mV[VX] * x_pixel_vec;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
vert -= mPositionOffset.mV[VY] * y_pixel_vec;
|
||||
vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero);
|
||||
// start at right edge
|
||||
vert = width_vec * 0.5f;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVector3 vert;
|
||||
// draw line in y then x
|
||||
if (mPositionOffset.mV[VY] < 0.f)
|
||||
{
|
||||
// start at top edge
|
||||
vert = (height_vec * 0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
// start at bottom edge
|
||||
vert = (height_vec * -0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
vert = -mPositionOffset.mV[VY] * y_pixel_vec - mPositionOffset.mV[VX] * x_pixel_vec;
|
||||
vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero);
|
||||
// start at left edge
|
||||
vert = width_vec * -0.5f;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
vert = -mPositionOffset.mV[VX] * x_pixel_vec;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
vert -= mPositionOffset.mV[VY] * y_pixel_vec;
|
||||
vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVector3 vert;
|
||||
// draw line in y then x
|
||||
if (mPositionOffset.mV[VY] < 0.f)
|
||||
{
|
||||
// start at top edge
|
||||
vert = (height_vec * 0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
// start at bottom edge
|
||||
vert = (height_vec * -0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
vert = -mPositionOffset.mV[VY] * y_pixel_vec - mPositionOffset.mV[VX] * x_pixel_vec;
|
||||
vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
gGL.end();
|
||||
LLUI::setLineWidth(1.0);
|
||||
|
||||
}
|
||||
gGL.end();
|
||||
LLUI::setLineWidth(1.0);
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ void LLHUDText::renderText()
|
||||
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
|
||||
|
||||
// *TODO: cache this image
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
|
||||
|
||||
// *TODO: make this a per-text setting
|
||||
static const LLCachedControl<LLColor4> background_chat_color("BackgroundChatColor", LLColor4(0,0,0,1.f));
|
||||
|
||||
@@ -456,7 +456,7 @@ void LLManip::renderXYZ(const LLVector3 &vec)
|
||||
|
||||
gGL.pushMatrix();
|
||||
{
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
|
||||
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
|
||||
gViewerWindow->setup2DRender();
|
||||
const LLVector2& display_scale = gViewerWindow->getDisplayScale();
|
||||
gGL.scalef(display_scale.mV[VX], display_scale.mV[VY], 1.f);
|
||||
|
||||
@@ -595,15 +595,9 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
|
||||
//
|
||||
void LLMediaCtrl::navigateToLocalPage( const std::string& subdir, const std::string& filename_in )
|
||||
{
|
||||
std::string language = LLUI::getLanguage();
|
||||
std::string filename(gDirUtilp->add(subdir, filename_in));
|
||||
std::string expanded_filename = gDirUtilp->findSkinnedFilename("html", filename);
|
||||
|
||||
std::string expanded_filename = gDirUtilp->findSkinnedFilename("html", language, filename);
|
||||
|
||||
if (expanded_filename.empty() && language != "en-us")
|
||||
{
|
||||
expanded_filename = gDirUtilp->findSkinnedFilename("html", "en-us", filename);
|
||||
}
|
||||
if(expanded_filename.empty())
|
||||
{
|
||||
LL_WARNS() << "File " << filename << "not found" << LL_ENDL;
|
||||
|
||||
@@ -497,7 +497,7 @@ void LLNotifyBox::draw()
|
||||
|
||||
void LLNotifyBox::drawBackground() const
|
||||
{
|
||||
if (LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"))
|
||||
if (LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"))
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(imagep->getImage());
|
||||
// set proper background color depending on whether notify box is a caution or not
|
||||
|
||||
@@ -495,6 +495,7 @@ void LLViewerShaderMgr::setShaders()
|
||||
//Flag base shader objects for deletion
|
||||
//Don't worry-- they won't be deleted until no programs refrence them.
|
||||
unloadShaderObjects();
|
||||
cleanupShaderSources();
|
||||
}
|
||||
|
||||
if (gViewerWindow)
|
||||
@@ -513,11 +514,7 @@ void LLViewerShaderMgr::setShaders()
|
||||
|
||||
void LLViewerShaderMgr::unloadShaders()
|
||||
{
|
||||
//Instead of manually unloading, shaders are now automatically accumulated in a list.
|
||||
//Simply iterate and unload.
|
||||
std::vector<LLGLSLShader *> &shader_list = LLShaderMgr::getGlobalShaderList();
|
||||
for(std::vector<LLGLSLShader *>::iterator it=shader_list.begin();it!=shader_list.end();++it)
|
||||
(*it)->unload();
|
||||
LLShaderMgr::unloadShaders();
|
||||
|
||||
for (S32 i = 0; i < SHADER_COUNT; i++)
|
||||
mVertexShaderLevel[i] = 0;
|
||||
@@ -530,15 +527,6 @@ void LLViewerShaderMgr::unloadShaders()
|
||||
LLPipeline::sRenderGlow = FALSE;
|
||||
}
|
||||
|
||||
void LLViewerShaderMgr::unloadShaderObjects()
|
||||
{
|
||||
std::multimap<std::string, LLShaderMgr::CachedObjectInfo >::iterator it = mShaderObjects.begin();
|
||||
for (; it != mShaderObjects.end(); ++it)
|
||||
if (it->second.mHandle)
|
||||
glDeleteObjectARB(it->second.mHandle);
|
||||
mShaderObjects.clear();
|
||||
}
|
||||
|
||||
BOOL LLViewerShaderMgr::loadBasicShaders()
|
||||
{
|
||||
// Load basic dependency shaders first
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
void initAttribsAndUniforms(void);
|
||||
void setShaders();
|
||||
void unloadShaders();
|
||||
void unloadShaderObjects();
|
||||
S32 getVertexShaderLevel(S32 type);
|
||||
BOOL loadBasicShaders();
|
||||
BOOL loadShadersEffects();
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "llviewerstats.h"
|
||||
#include "pipeline.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llxuiparser.h"
|
||||
#include "llagent.h"
|
||||
#include "llviewerdisplay.h"
|
||||
#include "llflexibleobject.h"
|
||||
@@ -200,7 +201,7 @@ void LLViewerTextureList::doPreloadImages()
|
||||
|
||||
static std::string get_texture_list_name()
|
||||
{
|
||||
return std::string("texture_list_") + gSavedSettings.getString("LoginLocation") + ".xml";
|
||||
return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "texture_list_" + gSavedSettings.getString("LoginLocation") + ".xml");
|
||||
}
|
||||
|
||||
void LLViewerTextureList::doPrefetchImages()
|
||||
@@ -213,13 +214,22 @@ void LLViewerTextureList::doPrefetchImages()
|
||||
|
||||
// Pre-fetch textures from last logout
|
||||
LLSD imagelist;
|
||||
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, get_texture_list_name());
|
||||
std::string filename = get_texture_list_name();
|
||||
llifstream file;
|
||||
file.open(filename);
|
||||
file.open(filename.c_str());
|
||||
if (file.is_open())
|
||||
{
|
||||
LLSDSerialize::fromXML(imagelist, file);
|
||||
if ( ! LLSDSerialize::fromXML(imagelist, file) )
|
||||
{
|
||||
file.close();
|
||||
LL_WARNS() << "XML parse error reading texture list '" << filename << "'" << LL_ENDL;
|
||||
LL_WARNS() << "Removing invalid texture list '" << filename << "'" << LL_ENDL;
|
||||
LLFile::remove(filename);
|
||||
return;
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
S32 texture_count = 0;
|
||||
for (LLSD::array_iterator iter = imagelist.beginArray();
|
||||
iter != imagelist.endArray(); ++iter)
|
||||
{
|
||||
@@ -233,10 +243,12 @@ void LLViewerTextureList::doPrefetchImages()
|
||||
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(uuid, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, texture_type);
|
||||
if (image)
|
||||
{
|
||||
texture_count += 1;
|
||||
image->addTextureStats((F32)pixel_area);
|
||||
}
|
||||
}
|
||||
}
|
||||
LL_DEBUGS() << "fetched " << texture_count << " images from " << filename << LL_ENDL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -597,22 +609,44 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image)
|
||||
assert_main_thread();
|
||||
llassert_always(mInitialized) ;
|
||||
llassert(image);
|
||||
if (!image->isInImageList())
|
||||
{
|
||||
LL_INFOS() << "RefCount: " << image->getNumRefs() << LL_ENDL ;
|
||||
uuid_map_t::iterator iter = mUUIDMap.find(image->getID());
|
||||
if(iter == mUUIDMap.end() || iter->second != image)
|
||||
{
|
||||
LL_INFOS() << "Image is not in mUUIDMap!" << LL_ENDL ;
|
||||
}
|
||||
LL_ERRS() << "LLViewerTextureList::removeImageFromList - Image not in list" << LL_ENDL;
|
||||
}
|
||||
|
||||
S32 count = mImageList.erase(image) ;
|
||||
if(count != 1)
|
||||
S32 count = 0;
|
||||
if (image->isInImageList())
|
||||
{
|
||||
LL_INFOS() << image->getID() << LL_ENDL ;
|
||||
LL_ERRS() << "Error happens when remove image from mImageList: " << count << LL_ENDL ;
|
||||
count = mImageList.erase(image) ;
|
||||
if(count != 1)
|
||||
{
|
||||
LL_INFOS() << "Image " << image->getID()
|
||||
<< " had mInImageList set but mImageList.erase() returned " << count
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // Something is wrong, image is expected in list or callers should check first
|
||||
LL_INFOS() << "Calling removeImageFromList() for " << image->getID()
|
||||
<< " but doesn't have mInImageList set"
|
||||
<< " ref count is " << image->getNumRefs()
|
||||
<< LL_ENDL;
|
||||
uuid_map_t::iterator iter = mUUIDMap.find(image->getID());
|
||||
if(iter == mUUIDMap.end())
|
||||
{
|
||||
LL_INFOS() << "Image " << image->getID() << " is also not in mUUIDMap!" << LL_ENDL ;
|
||||
}
|
||||
else if (iter->second != image)
|
||||
{
|
||||
LL_INFOS() << "Image " << image->getID() << " was in mUUIDMap but with different pointer" << LL_ENDL ;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS() << "Image " << image->getID() << " was in mUUIDMap with same pointer" << LL_ENDL ;
|
||||
}
|
||||
count = mImageList.erase(image) ;
|
||||
if(count != 0)
|
||||
{ // it was in the list already?
|
||||
LL_WARNS() << "Image " << image->getID()
|
||||
<< " had mInImageList false but mImageList.erase() returned " << count
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
image->setInImageList(FALSE) ;
|
||||
@@ -1540,28 +1574,31 @@ LLUIImagePtr LLUIImageList::getUIImage(const std::string& image_name, S32 priori
|
||||
}
|
||||
|
||||
LLUIImagePtr LLUIImageList::loadUIImageByName(const std::string& name, const std::string& filename,
|
||||
BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority )
|
||||
BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority,
|
||||
LLUIImage::EScaleStyle scale_style)
|
||||
{
|
||||
if (boost_priority == LLGLTexture::BOOST_NONE)
|
||||
{
|
||||
boost_priority = LLGLTexture::BOOST_UI;
|
||||
}
|
||||
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTextureFromFile(filename, MIPMAP_NO, boost_priority);
|
||||
return loadUIImage(imagep, name, use_mips, scale_rect, clip_rect);
|
||||
return loadUIImage(imagep, name, use_mips, scale_rect, clip_rect, scale_style);
|
||||
}
|
||||
|
||||
LLUIImagePtr LLUIImageList::loadUIImageByID(const LLUUID& id,
|
||||
BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority)
|
||||
BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLViewerTexture::EBoostLevel boost_priority,
|
||||
LLUIImage::EScaleStyle scale_style)
|
||||
{
|
||||
if (boost_priority == LLGLTexture::BOOST_NONE)
|
||||
{
|
||||
boost_priority = LLGLTexture::BOOST_UI;
|
||||
}
|
||||
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(id, MIPMAP_NO, boost_priority);
|
||||
return loadUIImage(imagep, id.asString(), use_mips, scale_rect, clip_rect);
|
||||
return loadUIImage(imagep, id.asString(), use_mips, scale_rect, clip_rect, scale_style);
|
||||
}
|
||||
|
||||
LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect)
|
||||
LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect,
|
||||
LLUIImage::EScaleStyle scale_style)
|
||||
{
|
||||
if (!imagep) return NULL;
|
||||
|
||||
@@ -1574,6 +1611,7 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st
|
||||
imagep->setNoDelete();
|
||||
|
||||
LLUIImagePtr new_imagep = new LLUIImage(name, imagep);
|
||||
new_imagep->setScaleStyle(scale_style);
|
||||
mUIImages.insert(std::make_pair(name, new_imagep));
|
||||
mUITextureList.push_back(imagep);
|
||||
|
||||
@@ -1592,7 +1630,7 @@ LLUIImagePtr LLUIImageList::loadUIImage(LLViewerFetchedTexture* imagep, const st
|
||||
return new_imagep;
|
||||
}
|
||||
|
||||
LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect)
|
||||
LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLUIImage::EScaleStyle scale_style)
|
||||
{
|
||||
// look for existing image
|
||||
uuid_ui_image_map_t::iterator found_it = mUIImages.find(name);
|
||||
@@ -1602,7 +1640,7 @@ LLUIImagePtr LLUIImageList::preloadUIImage(const std::string& name, const std::s
|
||||
LL_ERRS() << "UI Image " << name << " already loaded." << LL_ENDL;
|
||||
}
|
||||
|
||||
return loadUIImageByName(name, filename, use_mips, scale_rect, clip_rect);
|
||||
return loadUIImageByName(name, filename, use_mips, scale_rect, clip_rect, LLGLTexture::BOOST_UI, scale_style);
|
||||
}
|
||||
|
||||
//static
|
||||
@@ -1662,20 +1700,37 @@ void LLUIImageList::onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_v
|
||||
}
|
||||
}
|
||||
|
||||
/*struct UIImageDeclaration : public LLInitParam::Block<UIImageDeclaration>
|
||||
namespace LLInitParam
|
||||
{
|
||||
Mandatory<std::string> name;
|
||||
Optional<std::string> file_name;
|
||||
Optional<bool> preload;
|
||||
Optional<LLRect> scale;
|
||||
Optional<bool> use_mips;
|
||||
template<>
|
||||
struct TypeValues<LLUIImage::EScaleStyle> : public TypeValuesHelper<LLUIImage::EScaleStyle>
|
||||
{
|
||||
static void declareValues()
|
||||
{
|
||||
declare("scale_inner", LLUIImage::SCALE_INNER);
|
||||
declare("scale_outer", LLUIImage::SCALE_OUTER);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
struct UIImageDeclaration : public LLInitParam::Block<UIImageDeclaration>
|
||||
{
|
||||
Mandatory<std::string> name;
|
||||
Optional<std::string> file_name;
|
||||
Optional<bool> preload;
|
||||
Optional<LLRect> scale;
|
||||
Optional<LLRect> clip;
|
||||
Optional<bool> use_mips;
|
||||
Optional<LLUIImage::EScaleStyle> scale_type;
|
||||
|
||||
UIImageDeclaration()
|
||||
: name("name"),
|
||||
file_name("file_name"),
|
||||
preload("preload", false),
|
||||
scale("scale"),
|
||||
use_mips("use_mips", false)
|
||||
clip("clip"),
|
||||
use_mips("use_mips", false),
|
||||
scale_type("scale_type", LLUIImage::SCALE_INNER)
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -1692,49 +1747,43 @@ struct UIImageDeclarations : public LLInitParam::Block<UIImageDeclarations>
|
||||
|
||||
bool LLUIImageList::initFromFile()
|
||||
{
|
||||
// construct path to canonical textures.xml in default skin dir
|
||||
std::string base_file_path = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "default", "textures", "textures.xml");
|
||||
|
||||
LLXMLNodePtr root;
|
||||
|
||||
if (!LLXMLNode::parseFile(base_file_path, root, NULL))
|
||||
// Look for textures.xml in all the right places. Pass
|
||||
// constraint=LLDir::ALL_SKINS because we want to overlay textures.xml
|
||||
// from all the skins directories.
|
||||
std::vector<std::string> textures_paths =
|
||||
gDirUtilp->findSkinnedFilenames(LLDir::TEXTURES, "textures.xml", LLDir::ALL_SKINS);
|
||||
std::vector<std::string>::const_iterator pi(textures_paths.begin()), pend(textures_paths.end());
|
||||
if (pi == pend)
|
||||
{
|
||||
LL_WARNS() << "Unable to parse UI image list file " << base_file_path << LL_ENDL;
|
||||
LL_WARNS() << "No textures.xml found in skins directories" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// The first (most generic) file gets special validations
|
||||
LLXMLNodePtr root;
|
||||
if (!LLXMLNode::parseFile(*pi, root, NULL))
|
||||
{
|
||||
LL_WARNS() << "Unable to parse UI image list file " << *pi << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
if (!root->hasAttribute("version"))
|
||||
{
|
||||
LL_WARNS() << "No valid version number in UI image list file " << base_file_path << LL_ENDL;
|
||||
LL_WARNS() << "No valid version number in UI image list file " << *pi << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
UIImageDeclarations images;
|
||||
LLXUIParser parser;
|
||||
parser.readXUI(root, images, base_file_path);
|
||||
parser.readXUI(root, images, *pi);
|
||||
|
||||
// add components defined in current skin
|
||||
std::string skin_update_path = gDirUtilp->getSkinDir()
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures"
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures.xml";
|
||||
LLXMLNodePtr update_root;
|
||||
if (skin_update_path != base_file_path
|
||||
&& LLXMLNode::parseFile(skin_update_path, update_root, NULL))
|
||||
// add components defined in the rest of the skin paths
|
||||
while (++pi != pend)
|
||||
{
|
||||
parser.readXUI(update_root, images, skin_update_path);
|
||||
}
|
||||
|
||||
// add components defined in user override of current skin
|
||||
skin_update_path = gDirUtilp->getUserSkinDir()
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures"
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures.xml";
|
||||
if (skin_update_path != base_file_path
|
||||
&& LLXMLNode::parseFile(skin_update_path, update_root, NULL))
|
||||
{
|
||||
parser.readXUI(update_root, images, skin_update_path);
|
||||
LLXMLNodePtr update_root;
|
||||
if (LLXMLNode::parseFile(*pi, update_root, NULL))
|
||||
{
|
||||
parser.readXUI(update_root, images, *pi);
|
||||
}
|
||||
}
|
||||
|
||||
if (!images.validateBlock()) return false;
|
||||
@@ -1769,7 +1818,7 @@ bool LLUIImageList::initFromFile()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
preloadUIImage(image.name, file_name, image.use_mips, image.scale);
|
||||
preloadUIImage(image.name, file_name, image.use_mips, image.scale, image.clip, image.scale_type);
|
||||
}
|
||||
|
||||
if (cur_pass == PASS_DECODE_NOW && !gSavedSettings.getBOOL("NoPreload"))
|
||||
@@ -1778,115 +1827,6 @@ bool LLUIImageList::initFromFile()
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}*/
|
||||
bool LLUIImageList::initFromFile()
|
||||
{
|
||||
// construct path to canonical textures.xml in default skin dir
|
||||
std::string base_file_path = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "default", "textures", "textures.xml");
|
||||
|
||||
LLXMLNodePtr root;
|
||||
|
||||
if (!LLXMLNode::parseFile(base_file_path, root, NULL))
|
||||
{
|
||||
LL_WARNS() << "Unable to parse UI image list file " << base_file_path << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!root->hasAttribute("version"))
|
||||
{
|
||||
LL_WARNS() << "No valid version number in UI image list file " << base_file_path << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> paths;
|
||||
// path to current selected skin
|
||||
paths.push_back(gDirUtilp->getSkinDir()
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures"
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures.xml");
|
||||
// path to user overrides on current skin
|
||||
paths.push_back(gDirUtilp->getUserSkinDir()
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures"
|
||||
+ gDirUtilp->getDirDelimiter()
|
||||
+ "textures.xml");
|
||||
|
||||
// apply skinned xml files incrementally
|
||||
for(std::vector<std::string>::iterator path_it = paths.begin();
|
||||
path_it != paths.end();
|
||||
++path_it)
|
||||
{
|
||||
// don't reapply base file to itself
|
||||
if (!path_it->empty() && (*path_it) != base_file_path)
|
||||
{
|
||||
LLXMLNodePtr update_root;
|
||||
if (LLXMLNode::parseFile(*path_it, update_root, NULL))
|
||||
{
|
||||
LLXMLNode::updateNode(root, update_root);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
PASS_DECODE_NOW,
|
||||
PASS_DECODE_LATER,
|
||||
NUM_PASSES
|
||||
};
|
||||
|
||||
for (S32 pass = PASS_DECODE_NOW; pass < NUM_PASSES; pass++)
|
||||
{
|
||||
LLXMLNodePtr child_nodep = root->getFirstChild();
|
||||
while(child_nodep.notNull())
|
||||
{
|
||||
std::string image_name;
|
||||
child_nodep->getAttributeString("name", image_name);
|
||||
|
||||
std::string file_name = image_name;
|
||||
LLRect scale_rect;
|
||||
BOOL use_mip_maps = FALSE;
|
||||
|
||||
BOOL preload = FALSE;
|
||||
child_nodep->getAttributeBOOL("preload", preload);
|
||||
|
||||
// load high priority textures on first pass (to kick off decode)
|
||||
if (preload)
|
||||
{
|
||||
if (pass == PASS_DECODE_LATER)
|
||||
{
|
||||
child_nodep = child_nodep->getNextSibling();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pass == PASS_DECODE_NOW)
|
||||
{
|
||||
child_nodep = child_nodep->getNextSibling();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
child_nodep->getAttributeString("file_name", file_name);
|
||||
child_nodep->getAttributeBOOL("use_mips", use_mip_maps);
|
||||
|
||||
child_nodep->getAttributeS32("scale_left", scale_rect.mLeft);
|
||||
child_nodep->getAttributeS32("scale_right", scale_rect.mRight);
|
||||
child_nodep->getAttributeS32("scale_bottom", scale_rect.mBottom);
|
||||
child_nodep->getAttributeS32("scale_top", scale_rect.mTop);
|
||||
|
||||
preloadUIImage(image_name, file_name, use_mip_maps, scale_rect, LLRectBase<S32>::null);
|
||||
|
||||
child_nodep = child_nodep->getNextSibling();
|
||||
}
|
||||
|
||||
if (pass == PASS_DECODE_NOW && !gSavedSettings.getBOOL("NoPreload"))
|
||||
{
|
||||
gTextureList.decodeAllImages(10.f); // decode preloaded images
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -217,20 +217,22 @@ public:
|
||||
|
||||
bool initFromFile();
|
||||
|
||||
LLPointer<LLUIImage> preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect);
|
||||
LLPointer<LLUIImage> preloadUIImage(const std::string& name, const std::string& filename, BOOL use_mips, const LLRect& scale_rect, const LLRect& clip_rect, LLUIImage::EScaleStyle stype);
|
||||
|
||||
static void onUIImageLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );
|
||||
private:
|
||||
LLPointer<LLUIImage> loadUIImageByName(const std::string& name, const std::string& filename,
|
||||
BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null,
|
||||
const LLRect& clip_rect = LLRect::null,
|
||||
LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI);
|
||||
LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI,
|
||||
LLUIImage::EScaleStyle = LLUIImage::SCALE_INNER);
|
||||
LLPointer<LLUIImage> loadUIImageByID(const LLUUID& id,
|
||||
BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null,
|
||||
const LLRect& clip_rect = LLRect::null,
|
||||
LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI);
|
||||
LLViewerTexture::EBoostLevel boost_priority = LLGLTexture::BOOST_UI,
|
||||
LLUIImage::EScaleStyle = LLUIImage::SCALE_INNER);
|
||||
|
||||
LLPointer<LLUIImage> loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, const LLRect& clip_rect = LLRect::null);
|
||||
LLPointer<LLUIImage> loadUIImage(LLViewerFetchedTexture* imagep, const std::string& name, BOOL use_mips = FALSE, const LLRect& scale_rect = LLRect::null, const LLRect& clip_rect = LLRect::null, LLUIImage::EScaleStyle = LLUIImage::SCALE_INNER);
|
||||
|
||||
|
||||
struct LLUIImageLoadData
|
||||
|
||||
@@ -1777,8 +1777,7 @@ LLViewerWindow::LLViewerWindow(
|
||||
LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"),
|
||||
mDisplayScale.mV[VX],
|
||||
mDisplayScale.mV[VY],
|
||||
gDirUtilp->getAppRODataDir(),
|
||||
LLUICtrlFactory::getXUIPaths());
|
||||
gDirUtilp->getAppRODataDir());
|
||||
}
|
||||
// Create container for all sub-views
|
||||
LLView::Params rvp;
|
||||
@@ -5425,8 +5424,7 @@ void LLViewerWindow::initFonts(F32 zoom_factor)
|
||||
LLFontGL::initClass( gSavedSettings.getF32("FontScreenDPI"),
|
||||
mDisplayScale.mV[VX] * zoom_factor,
|
||||
mDisplayScale.mV[VY] * zoom_factor,
|
||||
gDirUtilp->getAppRODataDir(),
|
||||
LLUICtrlFactory::getXUIPaths());
|
||||
gDirUtilp->getAppRODataDir());
|
||||
LLFontGL::loadDefaultFonts();
|
||||
}
|
||||
void LLViewerWindow::toggleFullscreen(BOOL show_progress)
|
||||
|
||||
@@ -149,10 +149,10 @@ void LLWorldMapView::initClass()
|
||||
sHomeImage = LLUI::getUIImage("map_home.tga");
|
||||
sTelehubImage = LLUI::getUIImage("map_telehub.tga");
|
||||
sInfohubImage = LLUI::getUIImage("map_infohub.tga");
|
||||
sEventImage = LLUI::getUIImage("map_event.tga");
|
||||
sEventMatureImage = LLUI::getUIImage("map_event_mature.tga");
|
||||
sEventImage = LLUI::getUIImage("Parcel_PG_Light");
|
||||
sEventMatureImage = LLUI::getUIImage("Parcel_M_Light");
|
||||
// To Do: update the image resource for adult events.
|
||||
sEventAdultImage = LLUI::getUIImage("map_event_adult.tga");
|
||||
sEventAdultImage = LLUI::getUIImage("Parcel_R_Light");
|
||||
|
||||
sTrackCircleImage = LLUI::getUIImage("map_track_16.tga");
|
||||
sTrackArrowImage = LLUI::getUIImage("direction_arrow.tga");
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 343 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 268 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 812 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |