diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-08-29 12:56:53 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-08-29 12:57:37 +0200 |
commit | eb56d1d1eb6ba3fbf3cc45f603d893d8963d74f5 (patch) | |
tree | 056183aed685273bc1690bcfbb82b0145183d5e9 /core/io | |
parent | 583c0c4897ca7ba669ab78d397fc894b718613ce (diff) |
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).
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource.cpp | 40 | ||||
-rw-r--r-- | core/io/resource.h | 1 |
2 files changed, 0 insertions, 41 deletions
diff --git a/core/io/resource.cpp b/core/io/resource.cpp index fec5ca5c7b..d117f86f39 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -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 -} diff --git a/core/io/resource.h b/core/io/resource.h index a2cde87990..a76a3920be 100644 --- a/core/io/resource.h +++ b/core/io/resource.h @@ -167,7 +167,6 @@ public: static void reload_externals(); static bool has(const String &p_path); static Ref<Resource> get_ref(const String &p_path); - static void dump(const char *p_file = nullptr, bool p_short = false); static void get_cached_resources(List<Ref<Resource>> *p_resources); static int get_cached_resource_count(); }; |