-
-
Notifications
You must be signed in to change notification settings - Fork 22.7k
FTI
- Change SceneTree
global setting to static
#107886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FTI
- Change SceneTree
global setting to static
#107886
Conversation
Also fixup FTI configuration warnings so that they only output when the project is using FTI.
@@ -216,7 +216,7 @@ void Light2D::_notification(int p_what) { | |||
} break; | |||
|
|||
case NOTIFICATION_RESET_PHYSICS_INTERPOLATION: { | |||
if (is_visible_in_tree() && is_physics_interpolated()) { | |||
if (is_visible_in_tree() && is_physics_interpolated_and_enabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few misc cases like this in the PR.
is_physics_interpolated_and_enabled()
is now cheaper as a result of doing the static change (as there's no pointer lookup etc), so it makes sense to check the full version in a few more places.
@lawnjelly this is the demo project I was using to create the documentation I mentioned about yesterday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, makes sense that we only provide warnings for potential misconfiguration for FTI only if its enabled.
Approvals also welcome for #107889 which is the same, so I can merge in 3.x. |
Thanks! |
Also fixup FTI configuration warnings so that they only output when the project is using FTI.
@BastiaanOlij noticed that some FTI configuration warnings were firing when FTI was off in the project.
This happened because checking whether FTI was on in the editor was previously unsupported (as it was hard coded to OFF).
I had also been long term intending to swap using a local variable for global on / off in
SceneTree
to a static, the reason being that it would no longer be necessary to checkis_inside_tree()
and access the variable via a pointer, for what is likely to be a bottleneck check (and the global setting hardly ever changes, so a static makes sense here).So I take the opportunity to swap both the global setting to a static, and add an extra one for checking the on / off setting within the editor (while not actually enabled the FTI functionality).
This enables us to check the project global setting before issuing configuration warnings, without having to use e.g.
GET_GLOBAL_CACHED()
, which isn't a particularly good way of doing this here due to the string duplication.Notes