Add debugging info for small textures not loaded. Part 1 of fix for SH-659.

meow-7.2.2
Tonya Souther 2011-01-30 16:56:07 -06:00
parent 8e86b772d5
commit 72fd8359ba
3 changed files with 73 additions and 4 deletions

View File

@ -2205,10 +2205,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>

View File

@ -299,14 +299,16 @@ 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()
{
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ;
@ -326,6 +328,8 @@ public:
U32 ypos = 64;
const U32 y_inc = 20;
clearText();
if (gSavedSettings.getBOOL("DebugShowTime"))
{
const U32 y_inc2 = 15;
@ -599,6 +603,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()

View File

@ -2192,6 +2192,16 @@
function="ToggleControl"
parameter="DebugShowTime" />
</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 Render Info"
name="Show Render Info">