summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-07-11 19:30:33 -0300
committerreduz <reduzio@gmail.com>2021-07-13 09:25:14 -0300
commit5ad4f26659b435add8c4d36009be6a2222a0a624 (patch)
treedc19033d4ca18272ef5e8393ec95ff6667a903e1 /core/object
parentfc00a8390193220cea702d9ab684fb6c53d97a6b (diff)
Implement the ability to disable classes
* This PR adds the ability to disable classes when building. * For now it's only possible to do this via command like: `scons disable_classes=RayCast2D,Area3D` * Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
Diffstat (limited to 'core/object')
-rw-r--r--core/object/class_db.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/object/class_db.h b/core/object/class_db.h
index af528bfde7..e0cba1b8b5 100644
--- a/core/object/class_db.h
+++ b/core/object/class_db.h
@@ -434,4 +434,15 @@ public:
#endif
+#define GDREGISTER_CLASS(m_class) \
+ if (!GD_IS_DEFINED(ClassDB_Disable_##m_class)) { \
+ ClassDB::register_class<m_class>(); \
+ }
+#define GDREGISTER_VIRTUAL_CLASS(m_class) \
+ if (!GD_IS_DEFINED(ClassDB_Disable_##m_class)) { \
+ ClassDB::register_virtual_class<m_class>(); \
+ }
+
+#include "core/disabled_classes.gen.h"
+
#endif // CLASS_DB_H