summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-11 14:02:57 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-11 14:02:57 +0100
commitf040a351c2f27c6b86c40c71a28babf99dd0b9bd (patch)
treeb3e74218248f87b1dee7fcc51baad32c333a510d /main
parenteffb2708342e67666d5cfee544f62b000df0b77b (diff)
parent6aac3e4a164457bfb08ff03d29313b84aedc607e (diff)
downloadredot-engine-f040a351c2f27c6b86c40c71a28babf99dd0b9bd.tar.gz
Merge pull request #89381 from aaronfranke/disable-3d
Disable all 3D nodes, physics, and resources when compiling without 3D
Diffstat (limited to 'main')
-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,