1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #104862 from smix8/navserver_process

Prepare NavigationServer for `process()` and `physics_process()` split
This commit is contained in:
Thaddeus Crews
2025-04-02 07:37:32 -05:00
15 changed files with 131 additions and 103 deletions

View File

@@ -4648,10 +4648,10 @@ bool Main::iteration() {
uint64_t navigation_begin = OS::get_singleton()->get_ticks_usec();
#ifndef NAVIGATION_2D_DISABLED
NavigationServer2D::get_singleton()->process(physics_step * time_scale);
NavigationServer2D::get_singleton()->physics_process(physics_step * time_scale);
#endif // NAVIGATION_2D_DISABLED
#ifndef NAVIGATION_3D_DISABLED
NavigationServer3D::get_singleton()->process(physics_step * time_scale);
NavigationServer3D::get_singleton()->physics_process(physics_step * time_scale);
#endif // NAVIGATION_3D_DISABLED
navigation_process_ticks = MAX(navigation_process_ticks, OS::get_singleton()->get_ticks_usec() - navigation_begin); // keep the largest one for reference
@@ -4691,6 +4691,13 @@ bool Main::iteration() {
}
message_queue->flush();
#ifndef NAVIGATION_2D_DISABLED
NavigationServer2D::get_singleton()->process(process_step * time_scale);
#endif // NAVIGATION_2D_DISABLED
#ifndef NAVIGATION_3D_DISABLED
NavigationServer3D::get_singleton()->process(process_step * time_scale);
#endif // NAVIGATION_3D_DISABLED
RenderingServer::get_singleton()->sync(); //sync if still drawing from previous frames.
const bool has_pending_resources_for_processing = RD::get_singleton() && RD::get_singleton()->has_pending_resources_for_processing();