diff --git a/panda/src/pgraph/modelPool.I b/panda/src/pgraph/modelPool.I index 9037576808..da95626d3e 100644 --- a/panda/src/pgraph/modelPool.I +++ b/panda/src/pgraph/modelPool.I @@ -157,6 +157,16 @@ list_contents(ostream &out) { get_ptr()->ns_list_contents(out); } +//////////////////////////////////////////////////////////////////// +// Function: ModelPool::list_contents +// Access: Public, Static +// Description: Lists the contents of the model pool to cout. +//////////////////////////////////////////////////////////////////// +INLINE void ModelPool:: +list_contents() { + get_ptr()->ns_list_contents(cout); +} + //////////////////////////////////////////////////////////////////// // Function: ModelPool::Constructor // Access: Private diff --git a/panda/src/pgraph/modelPool.cxx b/panda/src/pgraph/modelPool.cxx index fd40e952a2..da7ffb84dc 100644 --- a/panda/src/pgraph/modelPool.cxx +++ b/panda/src/pgraph/modelPool.cxx @@ -218,12 +218,16 @@ void ModelPool:: ns_list_contents(ostream &out) const { MutexHolder holder(_lock); - out << _models.size() << " models:\n"; + out << "model pool contents:\n"; + Models::const_iterator ti; for (ti = _models.begin(); ti != _models.end(); ++ti) { - out << " " << (*ti).first - << " (count = " << (*ti).second->get_model_ref_count() << ")\n"; + out << (*ti).first << "\n" + << " (count = " << (*ti).second->get_model_ref_count() + << ")\n"; } + + out << "total number of models: " << _models.size() << "\n"; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pgraph/modelPool.h b/panda/src/pgraph/modelPool.h index 2655ca5aff..a36790079a 100644 --- a/panda/src/pgraph/modelPool.h +++ b/panda/src/pgraph/modelPool.h @@ -67,6 +67,7 @@ PUBLISHED: INLINE static int garbage_collect(); INLINE static void list_contents(ostream &out); + INLINE static void list_contents(); static void write(ostream &out); private: