summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
authorAndrew Meadows <andrew@lindenlab.com>2010-12-22 09:36:12 -0800
committerAndrew Meadows <andrew@lindenlab.com>2010-12-22 09:36:12 -0800
commit7365ee2d9d79813b6f515d333b63210d583038b5 (patch)
treebd237c8141a0b5643038640f4bc24d1fb6d5fd65 /indra/newview/llviewertexturelist.cpp
parent049b00a6f10d50609055810b0800f49476b351d2 (diff)
parentab100825bd0064dc64b9ef8bea1c70bc04090716 (diff)
merge
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r--indra/newview/llviewertexturelist.cpp74
1 files changed, 39 insertions, 35 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 275dfaa996..10126219f8 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1531,42 +1531,45 @@ bool LLUIImageList::initFromFile()
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);
- }
- }
- }
-
UIImageDeclarations images;
LLXUIParser parser;
parser.readXUI(root, images, base_file_path);
+ // 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))
+ {
+ 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);
+ }
+
if (!images.validateBlock()) return false;
+ std::map<std::string, UIImageDeclaration> merged_declarations;
+ for (LLInitParam::ParamIterator<UIImageDeclaration>::const_iterator image_it = images.textures.begin();
+ image_it != images.textures.end();
+ ++image_it)
+ {
+ merged_declarations[image_it->name].overwriteFrom(*image_it);
+ }
+
enum e_decode_pass
{
PASS_DECODE_NOW,
@@ -1576,19 +1579,20 @@ bool LLUIImageList::initFromFile()
for (S32 cur_pass = PASS_DECODE_NOW; cur_pass < NUM_PASSES; cur_pass++)
{
- for (LLInitParam::ParamIterator<UIImageDeclaration>::const_iterator image_it = images.textures.begin();
- image_it != images.textures.end();
+ for (std::map<std::string, UIImageDeclaration>::const_iterator image_it = merged_declarations.begin();
+ image_it != merged_declarations.end();
++image_it)
{
- std::string file_name = image_it->file_name.isProvided() ? image_it->file_name() : image_it->name();
+ const UIImageDeclaration& image = image_it->second;
+ std::string file_name = image.file_name.isProvided() ? image.file_name() : image.name();
// load high priority textures on first pass (to kick off decode)
- enum e_decode_pass decode_pass = image_it->preload ? PASS_DECODE_NOW : PASS_DECODE_LATER;
+ enum e_decode_pass decode_pass = image.preload ? PASS_DECODE_NOW : PASS_DECODE_LATER;
if (decode_pass != cur_pass)
{
continue;
}
- preloadUIImage(image_it->name, file_name, image_it->use_mips, image_it->scale);
+ preloadUIImage(image.name, file_name, image.use_mips, image.scale);
}
if (cur_pass == PASS_DECODE_NOW && !gSavedSettings.getBOOL("NoPreload"))