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

@ -400,8 +400,6 @@ String Engine::get_shader_cache_path() const {
return shader_cache_path;
}
Engine *Engine::singleton = nullptr;
Engine *Engine::get_singleton() {
return singleton;
}

View file

@ -90,7 +90,7 @@ private:
bool _print_header = true;
static Engine *singleton;
static inline Engine *singleton = nullptr;
String write_movie_path;
String shader_cache_path;

View file

@ -48,10 +48,6 @@
#include "modules/modules_enabled.gen.h" // For mono.
#endif // TOOLS_ENABLED
const String ProjectSettings::PROJECT_DATA_DIR_NAME_SUFFIX = "godot";
ProjectSettings *ProjectSettings::singleton = nullptr;
ProjectSettings *ProjectSettings::get_singleton() {
return singleton;
}

View file

@ -44,7 +44,7 @@ class ProjectSettings : public Object {
public:
typedef HashMap<String, Variant> CustomMap;
static const String PROJECT_DATA_DIR_NAME_SUFFIX;
static inline const String PROJECT_DATA_DIR_NAME_SUFFIX = "godot";
// Properties that are not for built in values begin from this value, so builtin ones are displayed first.
constexpr static const int32_t NO_BUILTIN_ORDER_BASE = 1 << 16;
@ -116,7 +116,7 @@ protected:
void _queue_changed();
void _emit_changed();
static ProjectSettings *singleton;
static inline ProjectSettings *singleton = nullptr;
Error _load_settings_text(const String &p_path);
Error _load_settings_binary(const String &p_path);