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
|
|
@ -110,7 +110,7 @@ void Shape2D::_bind_methods() {
|
|||
}
|
||||
|
||||
bool Shape2D::is_collision_outline_enabled() {
|
||||
return GLOBAL_GET("debug/shapes/collision/draw_2d_outlines");
|
||||
return GLOBAL_GET_CACHED(bool, "debug/shapes/collision/draw_2d_outlines");
|
||||
}
|
||||
|
||||
Shape2D::Shape2D(const RID &p_rid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue