From 0ae00a07d6db161fd0b6b2b91b08ef39757189c5 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Tue, 26 Apr 2022 22:52:53 -0500 Subject: Rename variable names for some singletons --- main/main.cpp | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'main/main.cpp') diff --git a/main/main.cpp b/main/main.cpp index f20ec94fa5..755924929c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -120,10 +120,10 @@ static RenderingServer *rendering_server = nullptr; static CameraServer *camera_server = nullptr; static XRServer *xr_server = nullptr; static TextServerManager *tsman = nullptr; -static PhysicsServer3D *physics_server = nullptr; -static PhysicsServer2D *physics_2d_server = nullptr; -static NavigationServer3D *navigation_server = nullptr; -static NavigationServer2D *navigation_2d_server = nullptr; +static PhysicsServer3D *physics_server_3d = nullptr; +static PhysicsServer2D *physics_server_2d = nullptr; +static NavigationServer3D *navigation_server_3d = nullptr; +static NavigationServer2D *navigation_server_2d = nullptr; // We error out if setup2() doesn't turn this true static bool _start_success = false; @@ -204,32 +204,32 @@ static String get_full_version_string() { // to have less code in main.cpp. void initialize_physics() { /// 3D Physics Server - physics_server = PhysicsServer3DManager::new_server( + physics_server_3d = PhysicsServer3DManager::new_server( ProjectSettings::get_singleton()->get(PhysicsServer3DManager::setting_property_name)); - if (!physics_server) { + if (!physics_server_3d) { // Physics server not found, Use the default physics - physics_server = PhysicsServer3DManager::new_default_server(); + physics_server_3d = PhysicsServer3DManager::new_default_server(); } - ERR_FAIL_COND(!physics_server); - physics_server->init(); + ERR_FAIL_COND(!physics_server_3d); + physics_server_3d->init(); /// 2D Physics server - physics_2d_server = PhysicsServer2DManager::new_server( + physics_server_2d = PhysicsServer2DManager::new_server( ProjectSettings::get_singleton()->get(PhysicsServer2DManager::setting_property_name)); - if (!physics_2d_server) { + if (!physics_server_2d) { // Physics server not found, Use the default physics - physics_2d_server = PhysicsServer2DManager::new_default_server(); + physics_server_2d = PhysicsServer2DManager::new_default_server(); } - ERR_FAIL_COND(!physics_2d_server); - physics_2d_server->init(); + ERR_FAIL_COND(!physics_server_2d); + physics_server_2d->init(); } void finalize_physics() { - physics_server->finish(); - memdelete(physics_server); + physics_server_3d->finish(); + memdelete(physics_server_3d); - physics_2d_server->finish(); - memdelete(physics_2d_server); + physics_server_2d->finish(); + memdelete(physics_server_2d); } void finalize_display() { @@ -240,18 +240,18 @@ void finalize_display() { } void initialize_navigation_server() { - ERR_FAIL_COND(navigation_server != nullptr); + ERR_FAIL_COND(navigation_server_3d != nullptr); - navigation_server = NavigationServer3DManager::new_default_server(); - navigation_2d_server = memnew(NavigationServer2D); + navigation_server_3d = NavigationServer3DManager::new_default_server(); + navigation_server_2d = memnew(NavigationServer2D); } void finalize_navigation_server() { - memdelete(navigation_server); - navigation_server = nullptr; + memdelete(navigation_server_3d); + navigation_server_3d = nullptr; - memdelete(navigation_2d_server); - navigation_2d_server = nullptr; + memdelete(navigation_server_2d); + navigation_server_2d = nullptr; } //#define DEBUG_INIT -- cgit v1.2.3