use GetTextureDiagnostics

This commit is contained in:
Glenn Maynard
2003-06-22 01:53:36 +00:00
parent c8e02ec0ae
commit 4c73bd7b99
+14 -4
View File
@@ -45,6 +45,7 @@
#include "RageUtil.h" #include "RageUtil.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageException.h" #include "RageException.h"
#include "RageDisplay.h"
RageTextureManager* TEXTUREMAN = NULL; RageTextureManager* TEXTUREMAN = NULL;
@@ -338,16 +339,25 @@ void RageTextureManager::DiagnosticOutput() const
{ {
unsigned cnt = distance(m_mapPathToTexture.begin(), m_mapPathToTexture.end()); unsigned cnt = distance(m_mapPathToTexture.begin(), m_mapPathToTexture.end());
LOG->Trace("%u textures loaded:", cnt); LOG->Trace("%u textures loaded:", cnt);
int total = 0;
for( std::map<RageTextureID, RageTexture*>::const_iterator i = m_mapPathToTexture.begin(); for( std::map<RageTextureID, RageTexture*>::const_iterator i = m_mapPathToTexture.begin();
i != m_mapPathToTexture.end(); ++i ) i != m_mapPathToTexture.end(); ++i )
{ {
const RageTextureID &ID = i->first; const RageTextureID &ID = i->first;
const RageTexture *tex = i->second; const RageTexture *tex = i->second;
/* This could output much more, but I only need resolution now and I don't CString diags = DISPLAY->GetTextureDiagnostics( tex->GetTexHandle() );
* want it to be more than one line. */ CString str = ssprintf("%3ix%3i (%2i)",
LOG->Trace(" %3ix%3i (%2i) %s",
tex->GetTextureHeight(), tex->GetTextureWidth(), tex->GetTextureHeight(), tex->GetTextureWidth(),
tex->m_iRefCount, Basename(ID.filename).c_str() ); tex->m_iRefCount);
if( diags != "" )
str += " " + diags;
LOG->Trace(" %-40s %s",
str.c_str(), Basename(ID.filename).c_str() );
total += tex->GetTextureHeight() * tex->GetTextureWidth();
} }
LOG->Trace("total %3i texels", total);
} }