summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/llviewerwindow.cpp54
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml10
3 files changed, 73 insertions, 4 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 7b3f50e4e2..c7302ea607 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1851,10 +1851,21 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>DebugShowTextureInfo</key>
+ <map>
+ <key>Comment</key>
+ <string>Show inertested texture info</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>DebugShowTime</key>
<map>
<key>Comment</key>
- <string>Show depth buffer contents</string>
+ <string>Show time info</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index fda6f316e6..ed0789bc50 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -296,13 +296,15 @@ private:
line_list_t mLineList;
LLColor4 mTextColor;
-public:
- LLDebugText(LLViewerWindow* window) : mWindow(window) {}
-
void addText(S32 x, S32 y, const std::string &text)
{
mLineList.push_back(Line(text, x, y));
}
+
+ void clearText() { mLineList.clear(); }
+
+public:
+ LLDebugText(LLViewerWindow* window) : mWindow(window) {}
void update()
{
@@ -323,6 +325,8 @@ public:
U32 ypos = 64;
const U32 y_inc = 20;
+ clearText();
+
if (gSavedSettings.getBOOL("DebugShowTime"))
{
const U32 y_inc2 = 15;
@@ -601,6 +605,50 @@ public:
ypos += y_inc;
}
}
+
+ if (gSavedSettings.getBOOL("DebugShowTextureInfo"))
+ {
+ LLViewerObject* objectp = NULL ;
+ //objectp = = gAgentCamera.getFocusObject();
+
+ LLSelectNode* nodep = LLSelectMgr::instance().getHoverNode();
+ if (nodep)
+ {
+ objectp = nodep->getObject();
+ }
+ if (objectp && !objectp->isDead())
+ {
+ S32 num_faces = objectp->mDrawable->getNumFaces() ;
+
+ for(S32 i = 0 ; i < num_faces; i++)
+ {
+ LLFace* facep = objectp->mDrawable->getFace(i) ;
+ if(facep)
+ {
+ //addText(xpos, ypos, llformat("ts_min: %.3f ts_max: %.3f tt_min: %.3f tt_max: %.3f", facep->mTexExtents[0].mV[0], facep->mTexExtents[1].mV[0],
+ // facep->mTexExtents[0].mV[1], facep->mTexExtents[1].mV[1]));
+ //ypos += y_inc;
+
+ addText(xpos, ypos, llformat("v_size: %.3f: p_size: %.3f", facep->getVirtualSize(), facep->getPixelArea()));
+ ypos += y_inc;
+
+ //const LLTextureEntry *tep = facep->getTextureEntry();
+ //if(tep)
+ //{
+ // addText(xpos, ypos, llformat("scale_s: %.3f: scale_t: %.3f", tep->mScaleS, tep->mScaleT)) ;
+ // ypos += y_inc;
+ //}
+
+ LLViewerTexture* tex = facep->getTexture() ;
+ if(tex)
+ {
+ addText(xpos, ypos, llformat("ID: %s v_size: %.3f", tex->getID().asString().c_str(), tex->getMaxVirtualSize()));
+ ypos += y_inc;
+ }
+ }
+ }
+ }
+ }
}
void draw()
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index b36cf13f1b..e2a3067796 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1917,6 +1917,16 @@
function="ToggleControl"
parameter="DebugShowRenderInfo" />
</menu_item_check>
+ <menu_item_check
+ label="Show Texture Info"
+ name="Show Texture Info">
+ <menu_item_check.on_check
+ function="CheckControl"
+ parameter="DebugShowTextureInfo" />
+ <menu_item_check.on_click
+ function="ToggleControl"
+ parameter="DebugShowTextureInfo" />
+ </menu_item_check>
<menu_item_check
label="Show Matrices"
name="Show Matrices">