diff options
author | Richard Linden <none@none> | 2010-11-15 15:52:54 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2010-11-15 15:52:54 -0800 |
commit | 50d21a75a7c6a41a5a3355a8c4406a33454c70dd (patch) | |
tree | e2fe3e855d710700cd956b505a3f0548038c9dac /indra/newview/llviewertexturelist.cpp | |
parent | e8e1d7e629b9a4a65cde766ed81334140a749428 (diff) | |
parent | 4bdac3f152862b257b9babe9b5a43329c9f544f9 (diff) |
merge
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 74 |
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")) |