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:
parent
8edf97e342
commit
f8f350a32a
48 changed files with 110 additions and 77 deletions
|
|
@ -379,7 +379,7 @@ static bool _test_blender_path(const String &p_path, String *r_err = nullptr) {
|
|||
}
|
||||
|
||||
bool EditorFileSystemImportFormatSupportQueryBlend::is_active() const {
|
||||
bool blend_enabled = GLOBAL_GET("filesystem/import/blender/enabled");
|
||||
bool blend_enabled = GLOBAL_GET_CACHED(bool, "filesystem/import/blender/enabled");
|
||||
|
||||
if (blend_enabled && !_test_blender_path(EDITOR_GET("filesystem/import/blender/blender_path").operator String())) {
|
||||
// Intending to import Blender, but blend not configured.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue