mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
Add GLOBAL_GET cached macros.
GLOBAL_GET is an expensive operation which should not be used each frame / tick. This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed. Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
@@ -193,6 +193,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
|
||||
for (int i = 0; i < custom_feature_array.size(); i++) {
|
||||
custom_features.insert(custom_feature_array[i]);
|
||||
}
|
||||
_version++;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -226,6 +227,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
|
||||
}
|
||||
}
|
||||
|
||||
_version++;
|
||||
return true;
|
||||
}
|
||||
bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
|
||||
Reference in New Issue
Block a user