summaryrefslogtreecommitdiffstats
path: root/main/performance.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2024-02-26 06:34:53 -0600
committerAaron Franke <arnfranke@yahoo.com>2024-03-11 01:00:55 -0700
commit6aac3e4a164457bfb08ff03d29313b84aedc607e (patch)
tree9c555a7a4cc1b355302c2485b9b65fba729fead3 /main/performance.cpp
parent810f127022ec2cbfb288e436151d1a777c7b5da7 (diff)
downloadredot-engine-6aac3e4a164457bfb08ff03d29313b84aedc607e.tar.gz
Disable all 3D nodes, physics, and resources when compiling without 3D
Diffstat (limited to 'main/performance.cpp')
-rw-r--r--main/performance.cpp11
1 files changed, 10 insertions, 1 deletions
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,