Display more information for list_contents.

This commit is contained in:
aignacio_sf 2006-12-08 22:24:43 +00:00
parent af8a72f828
commit 82ee360915

View File

@ -787,26 +787,32 @@ void TexturePool::
ns_list_contents(ostream &out) const {
MutexHolder holder(_lock);
int total_size;
int total_ram_size;
Textures::const_iterator ti;
out << "texture pool contents:\n";
int total_size;
total_size = 0;
Textures::const_iterator ti;
total_ram_size = 0;
for (ti = _textures.begin(); ti != _textures.end(); ++ti) {
Texture *tex = (*ti).second;
out << (*ti).first << "\n";
out << " (count = " << tex->get_ref_count()
<< ", ram = " << tex->get_ram_image_size()
<< ", size = " << tex->get_ram_page_size()
<< ", w = " << tex->get_x_size()
<< ", h = " << tex->get_y_size()
<< ")\n";
nassertv(tex->_texture_pool_key == (*ti).first);
total_size += tex->get_ram_image_size();
total_ram_size += tex->get_ram_image_size();
total_size += tex->get_ram_page_size();
}
out << "total number of textures: " << _textures.size() << "\n";
out << "texture pool ram : " << total_ram_size << "\n";
out << "texture pool size: " << total_size << "\n";
out << "texture pool size - texture pool ram: " << total_size - total_ram_size << "\n";
}
////////////////////////////////////////////////////////////////////