1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #65031 from akien-mga/os-drop-obsolete-resource-debugging

This commit is contained in:
Rémi Verschelde
2022-08-29 15:04:17 +02:00
committed by GitHub
7 changed files with 0 additions and 243 deletions

View File

@@ -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;
}