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:
lawnjelly
2025-04-29 14:48:52 +01:00
parent 8edf97e342
commit f8f350a32a
48 changed files with 110 additions and 77 deletions

View File

@ -636,8 +636,8 @@ bool AnimationMixer::_update_caches() {
List<StringName> sname_list;
get_animation_list(&sname_list);
bool check_path = GLOBAL_GET("animation/warnings/check_invalid_track_paths");
bool check_angle_interpolation = GLOBAL_GET("animation/warnings/check_angle_interpolation_type_conflicting");
bool check_path = GLOBAL_GET_CACHED(bool, "animation/warnings/check_invalid_track_paths");
bool check_angle_interpolation = GLOBAL_GET_CACHED(bool, "animation/warnings/check_angle_interpolation_type_conflicting");
Node *parent = get_node_or_null(root_node);
if (!parent) {