From e009925ca3e8fc6eabefba7eebd1905f53370092 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 24 Apr 2003 19:51:27 +0000 Subject: [PATCH] output texture info --- stepmania/src/RageTextureManager.cpp | 18 ++++++++++++++++++ stepmania/src/RageTextureManager.h | 2 ++ stepmania/src/ScreenManager.cpp | 1 + 3 files changed, 21 insertions(+) diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 0a18293d2d..02691b466a 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -223,3 +223,21 @@ bool RageTextureManager::SetPrefs( int iTextureColorDepth, bool bDelayedDelete, ASSERT( m_iTextureColorDepth==16 || m_iTextureColorDepth==32 ); return need_reload; } + +void RageTextureManager::DiagnosticOutput() const +{ + unsigned cnt = distance(m_mapPathToTexture.begin(), m_mapPathToTexture.end()); + LOG->Trace("%u textures loaded:", cnt); + for( std::map::const_iterator i = m_mapPathToTexture.begin(); + i != m_mapPathToTexture.end(); ++i ) + { + const RageTextureID &ID = i->first; + const RageTexture *tex = i->second; + + /* This could output much more, but I only need resolution now and I don't + * want it to be more than one line. */ + LOG->Trace(" %3ix%3i (%2i) %s", + tex->GetTextureHeight(), tex->GetTextureWidth(), + tex->m_iRefCount, Basename(ID.filename).c_str() ); + } +} diff --git a/stepmania/src/RageTextureManager.h b/stepmania/src/RageTextureManager.h index 28a924246e..1dfbd0ecdb 100644 --- a/stepmania/src/RageTextureManager.h +++ b/stepmania/src/RageTextureManager.h @@ -43,6 +43,8 @@ public: void InvalidateTextures(); + void RageTextureManager::DiagnosticOutput() const; + protected: void DeleteTexture( RageTexture *t ); enum GCType { cached_textures, delayed_delete }; diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 2e2eedbd53..8bd3b8f6d5 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -299,6 +299,7 @@ void ScreenManager::EmptyDeleteQueue() /* Now that we've actually deleted a screen, it makes sense to clear out * cached textures. */ TEXTUREMAN->DeleteCachedTextures(); + TEXTUREMAN->DiagnosticOutput(); } /* XXX: Big hack: