Drop obsolete resource usage debug methods from OS class

These methods exist since the dawn of (open source) Godot and have hardly
been updated over time, so they barely work and I'm fairly sure nobody is
using them. (See #46505 for details.)

While some of the functionality they aimed to provide might be useful for
optimization work and introspection, this should likely be redesigned from
scratch with a cleaner and more modern interface (e.g. exposed via the
Performance singleton, or ResourceLoader, and a better API overall).
This commit is contained in:
Rémi Verschelde
2022-08-29 12:56:53 +02:00
parent 583c0c4897
commit eb56d1d1eb
7 changed files with 0 additions and 243 deletions

View File

@ -543,43 +543,3 @@ int ResourceCache::get_cached_resource_count() {
return rc;
}
void ResourceCache::dump(const char *p_file, bool p_short) {
#ifdef DEBUG_ENABLED
lock.lock();
HashMap<String, int> type_count;
Ref<FileAccess> f;
if (p_file) {
f = FileAccess::open(String::utf8(p_file), FileAccess::WRITE);
ERR_FAIL_COND_MSG(f.is_null(), "Cannot create file at path '" + String::utf8(p_file) + "'.");
}
for (KeyValue<String, Resource *> &E : resources) {
Resource *r = E.value;
if (!type_count.has(r->get_class())) {
type_count[r->get_class()] = 0;
}
type_count[r->get_class()]++;
if (!p_short) {
if (f.is_valid()) {
f->store_line(r->get_class() + ": " + r->get_path());
}
}
}
for (const KeyValue<String, int> &E : type_count) {
if (f.is_valid()) {
f->store_line(E.key + " count: " + itos(E.value));
}
}
lock.unlock();
#else
WARN_PRINT("ResourceCache::dump only with in debug builds.");
#endif
}