Inline static variables (part 1)

This commit is contained in:
kobewi
2025-04-28 20:27:50 +02:00
parent 67c96c89cc
commit 5af4bef46f
52 changed files with 85 additions and 247 deletions

View File

@@ -46,8 +46,6 @@ namespace CoreBind {
////// ResourceLoader //////
ResourceLoader *ResourceLoader::singleton = nullptr;
Error ResourceLoader::load_threaded_request(const String &p_path, const String &p_type_hint, bool p_use_sub_threads, CacheMode p_cache_mode) {
return ::ResourceLoader::load_threaded_request(p_path, p_type_hint, p_use_sub_threads, ResourceFormatLoader::CacheMode(p_cache_mode));
}
@@ -195,8 +193,6 @@ ResourceUID::ID ResourceSaver::get_resource_id_for_path(const String &p_path, bo
return ::ResourceSaver::get_resource_id_for_path(p_path, p_generate);
}
ResourceSaver *ResourceSaver::singleton = nullptr;
void ResourceSaver::_bind_methods() {
ClassDB::bind_method(D_METHOD("save", "resource", "path", "flags"), &ResourceSaver::save, DEFVAL(""), DEFVAL((uint32_t)FLAG_NONE));
ClassDB::bind_method(D_METHOD("set_uid", "resource", "uid"), &ResourceSaver::set_uid);
@@ -722,8 +718,6 @@ void OS::remove_logger(const Ref<Logger> &p_logger) {
logger_bind->loggers.erase(p_logger);
}
OS *OS::singleton = nullptr;
void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_entropy", "size"), &OS::get_entropy);
ClassDB::bind_method(D_METHOD("get_system_ca_certificates"), &OS::get_system_ca_certificates);
@@ -877,8 +871,6 @@ OS::~OS() {
////// Geometry2D //////
Geometry2D *Geometry2D::singleton = nullptr;
Geometry2D *Geometry2D::get_singleton() {
return singleton;
}
@@ -1138,8 +1130,6 @@ void Geometry2D::_bind_methods() {
////// Geometry3D //////
Geometry3D *Geometry3D::singleton = nullptr;
Geometry3D *Geometry3D::get_singleton() {
return singleton;
}
@@ -1282,8 +1272,6 @@ void Geometry3D::_bind_methods() {
////// Marshalls //////
Marshalls *Marshalls::singleton = nullptr;
Marshalls *Marshalls::get_singleton() {
return singleton;
}
@@ -2128,8 +2116,6 @@ void Engine::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "physics_jitter_fix"), "set_physics_jitter_fix", "get_physics_jitter_fix");
}
Engine *Engine::singleton = nullptr;
////// EngineDebugger //////
bool EngineDebugger::is_active() {
@@ -2275,8 +2261,6 @@ EngineDebugger::~EngineDebugger() {
captures.clear();
}
EngineDebugger *EngineDebugger::singleton = nullptr;
void EngineDebugger::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_active"), &EngineDebugger::is_active);