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

Prepare NavigationServer for process() and physics_process() split

Prepares the NavigationServer API for a split of its functionality between frame process() and stepped physics_process().
This commit is contained in:
smix8
2025-03-31 22:32:59 +02:00
parent c7ea8614d7
commit 16fd7b6ae1
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();