summaryrefslogtreecommitdiffstats
path: root/core/os/os.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-08-29 12:56:53 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-08-29 12:57:37 +0200
commiteb56d1d1eb6ba3fbf3cc45f603d893d8963d74f5 (patch)
tree056183aed685273bc1690bcfbb82b0145183d5e9 /core/os/os.cpp
parent583c0c4897ca7ba669ab78d397fc894b718613ce (diff)
downloadredot-engine-eb56d1d1eb6ba3fbf3cc45f603d893d8963d74f5.tar.gz
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/os/os.cpp')
-rw-r--r--core/os/os.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 45cd7109e2..5536155d05 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -186,46 +186,6 @@ void OS::set_stderr_enabled(bool p_enabled) {
_stderr_enabled = p_enabled;
}
-static Ref<FileAccess> _OSPRF;
-
-static void _OS_printres(Object *p_obj) {
- Resource *res = Object::cast_to<Resource>(p_obj);
- if (!res) {
- return;
- }
-
- String str = vformat("%s - %s - %s", res->to_string(), res->get_name(), res->get_path());
- if (_OSPRF.is_valid()) {
- _OSPRF->store_line(str);
- } else {
- print_line(str);
- }
-}
-
-void OS::print_all_resources(String p_to_file) {
- ERR_FAIL_COND(!p_to_file.is_empty() && _OSPRF.is_valid());
- if (!p_to_file.is_empty()) {
- Error err;
- _OSPRF = FileAccess::open(p_to_file, FileAccess::WRITE, &err);
- if (err != OK) {
- _OSPRF.unref();
- ERR_FAIL_MSG("Can't print all resources to file: " + String(p_to_file) + ".");
- }
- }
-
- ObjectDB::debug_objects(_OS_printres);
-
- _OSPRF.unref();
-}
-
-void OS::print_resources_in_use(bool p_short) {
- ResourceCache::dump(nullptr, p_short);
-}
-
-void OS::dump_resources_to_file(const char *p_file) {
- ResourceCache::dump(p_file);
-}
-
int OS::get_exit_code() const {
return _exit_code;
}