summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichard <none@none>2009-11-13 18:27:59 -0800
committerrichard <none@none>2009-11-13 18:27:59 -0800
commitf4fdaa8ee9d8016ca23957e78fe246206579723f (patch)
treeea18319a2ef1ce05485d44f28d90631c0ba92a5f
parenta1cb7debf8cfc5de7f7949203ddd23d4cc96a598 (diff)
parentffadb3d29fe4e7be69dbb26650737c061c3cb206 (diff)
merge
-rw-r--r--indra/newview/llviewertexturelist.cpp6
-rw-r--r--indra/newview/skins/default/textures/textures.xml30
2 files changed, 33 insertions, 3 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 703a13976c..dbcf563010 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1467,14 +1467,14 @@ struct UIImageDeclaration : public LLInitParam::Block<UIImageDeclaration>
Mandatory<std::string> name;
Optional<std::string> file_name;
Optional<bool> preload;
- Optional<LLRect> scale_rect;
+ Optional<LLRect> scale;
Optional<bool> use_mips;
UIImageDeclaration()
: name("name"),
file_name("file_name"),
preload("preload", false),
- scale_rect("scale"),
+ scale("scale"),
use_mips("use_mips", false)
{}
};
@@ -1564,7 +1564,7 @@ bool LLUIImageList::initFromFile()
{
continue;
}
- preloadUIImage(image_it->name, file_name, image_it->use_mips, image_it->scale_rect);
+ preloadUIImage(image_it->name, file_name, image_it->use_mips, image_it->scale);
}
if (cur_pass == PASS_DECODE_NOW && !gSavedSettings.getBOOL("NoPreload"))
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index d5293bdbb5..1c2f6a235e 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -1,3 +1,33 @@
+<!--
+This file contains metadata about how to load, display, and scale textures for rendering in the UI.
+Images do *NOT* have to appear in this file in order to use them as textures in the UI...simply refer
+to them by filename (relative to textures directory).
+NOTE: if you want to reuse an image file with different metadata, simply create a new texture entry
+with the same filename but different name
+
+<texture
+ name="MyTexture" (mandatory)
+ - this is the name you reference the texture by in XUI. For example, <button image_unselected="MyTexture"/>
+ file_name="images/my_texture.png" (optional)
+ - this is the path to the actual file asset, relative to the current skins "textures" directory.
+ If not supplied, the filename will be taken from the texture name itself, "MyTexture" in this case.
+ NOTE: you need to provide an extension on the filename (".png", ".tga", ".jpg") for us to decode the image properly
+ preload="true" (optional, false by default)
+ - If true, we will attempt to load the image before displaying any UI.
+ If false, we will load in the background after initializing the UI.
+ use_mips="true" (currently unused)
+ scale.left="1"
+ scale.bottom="1"
+ scale.top="15"
+ scale.right="31"
+ - Specifies the segmentation for 9-slice image scaling. Specifically, the pixel offsets from the LOWER LEFT corner
+ that define the region of the image that is stretched to make the whole image fit in the required space.
+ In this example, if the source image is 32x16 pixels, we have defined a center region that starts one pixel up
+ and to the right from the bottom left corner and extends to 31 pixels right and 15 pixels up from the bottom left
+ corner. The end result is that the image will keep a 1 pixel border all around while stretching to fit the required
+ region.
+-->
+
<textures version="101">
<!-- Please add new files alphabetically to prevent merge conflicts. JC -->
<texture name="Accordion_ArrowClosed_Off" file_name="containers/Accordion_ArrowClosed_Off.png" preload="false" />