From 6aac3e4a164457bfb08ff03d29313b84aedc607e Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Mon, 26 Feb 2024 06:34:53 -0600 Subject: Disable all 3D nodes, physics, and resources when compiling without 3D --- main/performance.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'main/performance.cpp') diff --git a/main/performance.cpp b/main/performance.cpp index aff26c20a3..e8d519bb46 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -37,9 +37,12 @@ #include "servers/audio_server.h" #include "servers/navigation_server_3d.h" #include "servers/physics_server_2d.h" -#include "servers/physics_server_3d.h" #include "servers/rendering_server.h" +#ifndef _3D_DISABLED +#include "servers/physics_server_3d.h" +#endif // _3D_DISABLED + Performance *Performance::singleton = nullptr; void Performance::_bind_methods() { @@ -71,9 +74,11 @@ void Performance::_bind_methods() { BIND_ENUM_CONSTANT(PHYSICS_2D_ACTIVE_OBJECTS); BIND_ENUM_CONSTANT(PHYSICS_2D_COLLISION_PAIRS); BIND_ENUM_CONSTANT(PHYSICS_2D_ISLAND_COUNT); +#ifndef _3D_DISABLED BIND_ENUM_CONSTANT(PHYSICS_3D_ACTIVE_OBJECTS); BIND_ENUM_CONSTANT(PHYSICS_3D_COLLISION_PAIRS); BIND_ENUM_CONSTANT(PHYSICS_3D_ISLAND_COUNT); +#endif // _3D_DISABLED BIND_ENUM_CONSTANT(AUDIO_OUTPUT_LATENCY); BIND_ENUM_CONSTANT(NAVIGATION_ACTIVE_MAPS); BIND_ENUM_CONSTANT(NAVIGATION_REGION_COUNT); @@ -119,9 +124,11 @@ String Performance::get_monitor_name(Monitor p_monitor) const { "physics_2d/active_objects", "physics_2d/collision_pairs", "physics_2d/islands", +#ifndef _3D_DISABLED "physics_3d/active_objects", "physics_3d/collision_pairs", "physics_3d/islands", +#endif // _3D_DISABLED "audio/driver/output_latency", "navigation/active_maps", "navigation/regions", @@ -248,9 +255,11 @@ Performance::MonitorType Performance::get_monitor_type(Monitor p_monitor) const MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, +#ifndef _3D_DISABLED MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, +#endif // _3D_DISABLED MONITOR_TYPE_TIME, MONITOR_TYPE_QUANTITY, MONITOR_TYPE_QUANTITY, -- cgit v1.2.3