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.
This commit is contained in:
reduz 2021-07-11 19:30:33 -03:00
parent fc00a83901
commit 5ad4f26659
44 changed files with 789 additions and 757 deletions

View File

@ -142,6 +142,7 @@ opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all
opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False)) opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False)) opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False))
opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False)) opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False))
opts.Add("disable_classes", "Disable given classes (comma separated)", "")
opts.Add(BoolVariable("modules_enabled_by_default", "If no, disable all modules except ones explicitly enabled", True)) opts.Add(BoolVariable("modules_enabled_by_default", "If no, disable all modules except ones explicitly enabled", True))
opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", False)) opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", False))
opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "") opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "")
@ -642,6 +643,7 @@ if selected_platform in platform_list:
if env["tools"]: if env["tools"]:
env.Append(CPPDEFINES=["TOOLS_ENABLED"]) env.Append(CPPDEFINES=["TOOLS_ENABLED"])
methods.write_disabled_classes(env["disable_classes"].split(","))
if env["disable_3d"]: if env["disable_3d"]:
if env["tools"]: if env["tools"]:
print( print(

View File

@ -434,4 +434,15 @@ public:
#endif #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 #endif // CLASS_DB_H

View File

@ -131,50 +131,50 @@ void register_core_types() {
resource_format_image.instantiate(); resource_format_image.instantiate();
ResourceLoader::add_resource_format_loader(resource_format_image); ResourceLoader::add_resource_format_loader(resource_format_image);
ClassDB::register_class<Object>(); GDREGISTER_CLASS(Object);
ClassDB::register_virtual_class<Script>(); GDREGISTER_VIRTUAL_CLASS(Script);
ClassDB::register_class<RefCounted>(); GDREGISTER_CLASS(RefCounted);
ClassDB::register_class<WeakRef>(); GDREGISTER_CLASS(WeakRef);
ClassDB::register_class<Resource>(); GDREGISTER_CLASS(Resource);
ClassDB::register_class<Image>(); GDREGISTER_CLASS(Image);
ClassDB::register_virtual_class<InputEvent>(); GDREGISTER_VIRTUAL_CLASS(InputEvent);
ClassDB::register_virtual_class<InputEventWithModifiers>(); GDREGISTER_VIRTUAL_CLASS(InputEventWithModifiers);
ClassDB::register_virtual_class<InputEventFromWindow>(); GDREGISTER_VIRTUAL_CLASS(InputEventFromWindow);
ClassDB::register_class<InputEventKey>(); GDREGISTER_CLASS(InputEventKey);
ClassDB::register_virtual_class<InputEventMouse>(); GDREGISTER_VIRTUAL_CLASS(InputEventMouse);
ClassDB::register_class<InputEventMouseButton>(); GDREGISTER_CLASS(InputEventMouseButton);
ClassDB::register_class<InputEventMouseMotion>(); GDREGISTER_CLASS(InputEventMouseMotion);
ClassDB::register_class<InputEventJoypadButton>(); GDREGISTER_CLASS(InputEventJoypadButton);
ClassDB::register_class<InputEventJoypadMotion>(); GDREGISTER_CLASS(InputEventJoypadMotion);
ClassDB::register_class<InputEventScreenDrag>(); GDREGISTER_CLASS(InputEventScreenDrag);
ClassDB::register_class<InputEventScreenTouch>(); GDREGISTER_CLASS(InputEventScreenTouch);
ClassDB::register_class<InputEventAction>(); GDREGISTER_CLASS(InputEventAction);
ClassDB::register_virtual_class<InputEventGesture>(); GDREGISTER_VIRTUAL_CLASS(InputEventGesture);
ClassDB::register_class<InputEventMagnifyGesture>(); GDREGISTER_CLASS(InputEventMagnifyGesture);
ClassDB::register_class<InputEventPanGesture>(); GDREGISTER_CLASS(InputEventPanGesture);
ClassDB::register_class<InputEventMIDI>(); GDREGISTER_CLASS(InputEventMIDI);
// Network // Network
ClassDB::register_virtual_class<IP>(); GDREGISTER_VIRTUAL_CLASS(IP);
ClassDB::register_virtual_class<StreamPeer>(); GDREGISTER_VIRTUAL_CLASS(StreamPeer);
ClassDB::register_class<StreamPeerBuffer>(); GDREGISTER_CLASS(StreamPeerBuffer);
ClassDB::register_class<StreamPeerTCP>(); GDREGISTER_CLASS(StreamPeerTCP);
ClassDB::register_class<TCPServer>(); GDREGISTER_CLASS(TCPServer);
ClassDB::register_virtual_class<PacketPeer>(); GDREGISTER_VIRTUAL_CLASS(PacketPeer);
ClassDB::register_class<PacketPeerStream>(); GDREGISTER_CLASS(PacketPeerStream);
ClassDB::register_class<PacketPeerUDP>(); GDREGISTER_CLASS(PacketPeerUDP);
ClassDB::register_class<UDPServer>(); GDREGISTER_CLASS(UDPServer);
ClassDB::register_custom_instance_class<HTTPClient>(); ClassDB::register_custom_instance_class<HTTPClient>();
// Crypto // Crypto
ClassDB::register_class<HashingContext>(); GDREGISTER_CLASS(HashingContext);
ClassDB::register_class<AESContext>(); GDREGISTER_CLASS(AESContext);
ClassDB::register_custom_instance_class<X509Certificate>(); ClassDB::register_custom_instance_class<X509Certificate>();
ClassDB::register_custom_instance_class<CryptoKey>(); ClassDB::register_custom_instance_class<CryptoKey>();
ClassDB::register_custom_instance_class<HMACContext>(); ClassDB::register_custom_instance_class<HMACContext>();
@ -188,42 +188,42 @@ void register_core_types() {
resource_format_loader_crypto.instantiate(); resource_format_loader_crypto.instantiate();
ResourceLoader::add_resource_format_loader(resource_format_loader_crypto); ResourceLoader::add_resource_format_loader(resource_format_loader_crypto);
ClassDB::register_virtual_class<MultiplayerPeer>(); GDREGISTER_VIRTUAL_CLASS(MultiplayerPeer);
ClassDB::register_class<MultiplayerAPI>(); GDREGISTER_CLASS(MultiplayerAPI);
ClassDB::register_class<MainLoop>(); GDREGISTER_CLASS(MainLoop);
ClassDB::register_class<Translation>(); GDREGISTER_CLASS(Translation);
ClassDB::register_class<OptimizedTranslation>(); GDREGISTER_CLASS(OptimizedTranslation);
ClassDB::register_class<UndoRedo>(); GDREGISTER_CLASS(UndoRedo);
ClassDB::register_class<TriangleMesh>(); GDREGISTER_CLASS(TriangleMesh);
ClassDB::register_class<ResourceFormatLoader>(); GDREGISTER_CLASS(ResourceFormatLoader);
ClassDB::register_class<ResourceFormatSaver>(); GDREGISTER_CLASS(ResourceFormatSaver);
ClassDB::register_class<_File>(); GDREGISTER_CLASS(_File);
ClassDB::register_class<_Directory>(); GDREGISTER_CLASS(_Directory);
ClassDB::register_class<_Thread>(); GDREGISTER_CLASS(_Thread);
ClassDB::register_class<_Mutex>(); GDREGISTER_CLASS(_Mutex);
ClassDB::register_class<_Semaphore>(); GDREGISTER_CLASS(_Semaphore);
ClassDB::register_class<XMLParser>(); GDREGISTER_CLASS(XMLParser);
ClassDB::register_class<JSON>(); GDREGISTER_CLASS(JSON);
ClassDB::register_class<ConfigFile>(); GDREGISTER_CLASS(ConfigFile);
ClassDB::register_class<PCKPacker>(); GDREGISTER_CLASS(PCKPacker);
ClassDB::register_class<PackedDataContainer>(); GDREGISTER_CLASS(PackedDataContainer);
ClassDB::register_virtual_class<PackedDataContainerRef>(); GDREGISTER_VIRTUAL_CLASS(PackedDataContainerRef);
ClassDB::register_class<AStar>(); GDREGISTER_CLASS(AStar);
ClassDB::register_class<AStar2D>(); GDREGISTER_CLASS(AStar2D);
ClassDB::register_class<EncodedObjectAsID>(); GDREGISTER_CLASS(EncodedObjectAsID);
ClassDB::register_class<RandomNumberGenerator>(); GDREGISTER_CLASS(RandomNumberGenerator);
ClassDB::register_virtual_class<ResourceImporter>(); GDREGISTER_VIRTUAL_CLASS(ResourceImporter);
ClassDB::register_class<NativeExtension>(); GDREGISTER_CLASS(NativeExtension);
ClassDB::register_virtual_class<NativeExtensionManager>(); GDREGISTER_VIRTUAL_CLASS(NativeExtensionManager);
native_extension_manager = memnew(NativeExtensionManager); native_extension_manager = memnew(NativeExtensionManager);
@ -253,22 +253,22 @@ void register_core_settings() {
} }
void register_core_singletons() { void register_core_singletons() {
ClassDB::register_class<ProjectSettings>(); GDREGISTER_CLASS(ProjectSettings);
ClassDB::register_virtual_class<IP>(); GDREGISTER_VIRTUAL_CLASS(IP);
ClassDB::register_class<_Geometry2D>(); GDREGISTER_CLASS(_Geometry2D);
ClassDB::register_class<_Geometry3D>(); GDREGISTER_CLASS(_Geometry3D);
ClassDB::register_class<_ResourceLoader>(); GDREGISTER_CLASS(_ResourceLoader);
ClassDB::register_class<_ResourceSaver>(); GDREGISTER_CLASS(_ResourceSaver);
ClassDB::register_class<_OS>(); GDREGISTER_CLASS(_OS);
ClassDB::register_class<_Engine>(); GDREGISTER_CLASS(_Engine);
ClassDB::register_class<_ClassDB>(); GDREGISTER_CLASS(_ClassDB);
ClassDB::register_class<_Marshalls>(); GDREGISTER_CLASS(_Marshalls);
ClassDB::register_class<TranslationServer>(); GDREGISTER_CLASS(TranslationServer);
ClassDB::register_virtual_class<Input>(); GDREGISTER_VIRTUAL_CLASS(Input);
ClassDB::register_class<InputMap>(); GDREGISTER_CLASS(InputMap);
ClassDB::register_class<Expression>(); GDREGISTER_CLASS(Expression);
ClassDB::register_class<_EngineDebugger>(); GDREGISTER_CLASS(_EngineDebugger);
ClassDB::register_class<Time>(); GDREGISTER_CLASS(Time);
Engine::get_singleton()->add_singleton(Engine::Singleton("ProjectSettings", ProjectSettings::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("ProjectSettings", ProjectSettings::get_singleton()));
Engine::get_singleton()->add_singleton(Engine::Singleton("IP", IP::get_singleton(), "IP")); Engine::get_singleton()->add_singleton(Engine::Singleton("IP", IP::get_singleton(), "IP"));

View File

@ -281,4 +281,11 @@ struct BuildIndexSequence<0, Is...> : IndexSequence<Is...> {};
#define DEBUG_METHODS_ENABLED #define DEBUG_METHODS_ENABLED
#endif #endif
// Macro GD_IS_DEFINED() allows to check if a macro is defined. It needs to be defined to anything (say 1) to work.
#define __GDARG_PLACEHOLDER_1 0,
#define __gd_take_second_arg(__ignored, val, ...) val
#define ____gd_is_defined(arg1_or_junk) __gd_take_second_arg(arg1_or_junk 1, 0)
#define ___gd_is_defined(val) ____gd_is_defined(__GDARG_PLACEHOLDER_##val)
#define GD_IS_DEFINED(x) ___gd_is_defined(x)
#endif // TYPEDEFS_H #endif // TYPEDEFS_H

View File

@ -3736,46 +3736,46 @@ void EditorNode::register_editor_types() {
ResourceLoader::set_timestamp_on_load(true); ResourceLoader::set_timestamp_on_load(true);
ResourceSaver::set_timestamp_on_save(true); ResourceSaver::set_timestamp_on_save(true);
ClassDB::register_class<EditorPaths>(); GDREGISTER_CLASS(EditorPaths);
ClassDB::register_class<EditorPlugin>(); GDREGISTER_CLASS(EditorPlugin);
ClassDB::register_class<EditorTranslationParserPlugin>(); GDREGISTER_CLASS(EditorTranslationParserPlugin);
ClassDB::register_class<EditorImportPlugin>(); GDREGISTER_CLASS(EditorImportPlugin);
ClassDB::register_class<EditorScript>(); GDREGISTER_CLASS(EditorScript);
ClassDB::register_class<EditorSelection>(); GDREGISTER_CLASS(EditorSelection);
ClassDB::register_class<EditorFileDialog>(); GDREGISTER_CLASS(EditorFileDialog);
ClassDB::register_virtual_class<EditorSettings>(); GDREGISTER_VIRTUAL_CLASS(EditorSettings);
ClassDB::register_class<EditorNode3DGizmo>(); GDREGISTER_CLASS(EditorNode3DGizmo);
ClassDB::register_class<EditorNode3DGizmoPlugin>(); GDREGISTER_CLASS(EditorNode3DGizmoPlugin);
ClassDB::register_virtual_class<EditorResourcePreview>(); GDREGISTER_VIRTUAL_CLASS(EditorResourcePreview);
ClassDB::register_class<EditorResourcePreviewGenerator>(); GDREGISTER_CLASS(EditorResourcePreviewGenerator);
ClassDB::register_virtual_class<EditorFileSystem>(); GDREGISTER_VIRTUAL_CLASS(EditorFileSystem);
ClassDB::register_class<EditorFileSystemDirectory>(); GDREGISTER_CLASS(EditorFileSystemDirectory);
ClassDB::register_class<EditorVCSInterface>(); GDREGISTER_CLASS(EditorVCSInterface);
ClassDB::register_virtual_class<ScriptEditor>(); GDREGISTER_VIRTUAL_CLASS(ScriptEditor);
ClassDB::register_virtual_class<ScriptEditorBase>(); GDREGISTER_VIRTUAL_CLASS(ScriptEditorBase);
ClassDB::register_class<EditorSyntaxHighlighter>(); GDREGISTER_CLASS(EditorSyntaxHighlighter);
ClassDB::register_virtual_class<EditorInterface>(); GDREGISTER_VIRTUAL_CLASS(EditorInterface);
ClassDB::register_class<EditorExportPlugin>(); GDREGISTER_CLASS(EditorExportPlugin);
ClassDB::register_class<EditorResourceConversionPlugin>(); GDREGISTER_CLASS(EditorResourceConversionPlugin);
ClassDB::register_class<EditorSceneImporter>(); GDREGISTER_CLASS(EditorSceneImporter);
ClassDB::register_class<EditorInspector>(); GDREGISTER_CLASS(EditorInspector);
ClassDB::register_class<EditorInspectorPlugin>(); GDREGISTER_CLASS(EditorInspectorPlugin);
ClassDB::register_class<EditorProperty>(); GDREGISTER_CLASS(EditorProperty);
ClassDB::register_class<AnimationTrackEditPlugin>(); GDREGISTER_CLASS(AnimationTrackEditPlugin);
ClassDB::register_class<ScriptCreateDialog>(); GDREGISTER_CLASS(ScriptCreateDialog);
ClassDB::register_class<EditorFeatureProfile>(); GDREGISTER_CLASS(EditorFeatureProfile);
ClassDB::register_class<EditorSpinSlider>(); GDREGISTER_CLASS(EditorSpinSlider);
ClassDB::register_class<EditorResourcePicker>(); GDREGISTER_CLASS(EditorResourcePicker);
ClassDB::register_class<EditorScriptPicker>(); GDREGISTER_CLASS(EditorScriptPicker);
ClassDB::register_class<EditorSceneImporterMesh>(); GDREGISTER_CLASS(EditorSceneImporterMesh);
ClassDB::register_class<EditorSceneImporterMeshNode3D>(); GDREGISTER_CLASS(EditorSceneImporterMeshNode3D);
ClassDB::register_virtual_class<FileSystemDock>(); GDREGISTER_VIRTUAL_CLASS(FileSystemDock);
// FIXME: Is this stuff obsolete, or should it be ported to new APIs? // FIXME: Is this stuff obsolete, or should it be ported to new APIs?
ClassDB::register_class<EditorScenePostImport>(); GDREGISTER_CLASS(EditorScenePostImport);
//ClassDB::register_type<EditorImportExport>(); //ClassDB::register_type<EditorImportExport>();
ClassDB::register_class<EditorDebuggerPlugin>(); GDREGISTER_CLASS(EditorDebuggerPlugin);
NativeExtensionManager::get_singleton()->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_EDITOR); NativeExtensionManager::get_singleton()->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_EDITOR);
} }

View File

@ -884,7 +884,7 @@ void EditorSettings::create() {
return; return;
} }
ClassDB::register_class<EditorSettings>(); // Otherwise it can't be unserialized. GDREGISTER_CLASS(EditorSettings); // Otherwise it can't be unserialized.
String config_file_path; String config_file_path;
Ref<ConfigFile> extra_config = memnew(ConfigFile); Ref<ConfigFile> extra_config = memnew(ConfigFile);

View File

@ -549,7 +549,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
translation_server = memnew(TranslationServer); translation_server = memnew(TranslationServer);
performance = memnew(Performance); performance = memnew(Performance);
ClassDB::register_class<Performance>(); GDREGISTER_CLASS(Performance);
engine->add_singleton(Engine::Singleton("Performance", performance)); engine->add_singleton(Engine::Singleton("Performance", performance));
// Only flush stdout in debug builds by default, as spamming `print()` will // Only flush stdout in debug builds by default, as spamming `print()` will

View File

@ -231,6 +231,18 @@ def is_module(path):
return True return True
def write_disabled_classes(class_list):
f = open("core/disabled_classes.gen.h", "w")
f.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
f.write("#ifndef DISABLED_CLASSES_GEN_H\n")
f.write("#define DISABLED_CLASSES_GEN_H\n\n")
for c in class_list:
cs = c.strip()
if cs != "":
f.write("#define ClassDB_Disable_" + cs + " 1\n")
f.write("\n#endif\n")
def write_modules(modules): def write_modules(modules):
includes_cpp = "" includes_cpp = ""
preregister_cpp = "" preregister_cpp = ""

View File

@ -272,7 +272,7 @@ void register_basis_universal_types() {
Image::basis_universal_packer = basis_universal_packer; Image::basis_universal_packer = basis_universal_packer;
#endif #endif
Image::basis_universal_unpacker = basis_universal_unpacker; Image::basis_universal_unpacker = basis_universal_unpacker;
//ClassDB::register_class<TextureBasisU>(); //GDREGISTER_CLASS(TextureBasisU);
} }
void unregister_basis_universal_types() { void unregister_basis_universal_types() {

View File

@ -36,15 +36,15 @@
void register_csg_types() { void register_csg_types() {
#ifndef _3D_DISABLED #ifndef _3D_DISABLED
ClassDB::register_virtual_class<CSGShape3D>(); GDREGISTER_VIRTUAL_CLASS(CSGShape3D);
ClassDB::register_virtual_class<CSGPrimitive3D>(); GDREGISTER_VIRTUAL_CLASS(CSGPrimitive3D);
ClassDB::register_class<CSGMesh3D>(); GDREGISTER_CLASS(CSGMesh3D);
ClassDB::register_class<CSGSphere3D>(); GDREGISTER_CLASS(CSGSphere3D);
ClassDB::register_class<CSGBox3D>(); GDREGISTER_CLASS(CSGBox3D);
ClassDB::register_class<CSGCylinder3D>(); GDREGISTER_CLASS(CSGCylinder3D);
ClassDB::register_class<CSGTorus3D>(); GDREGISTER_CLASS(CSGTorus3D);
ClassDB::register_class<CSGPolygon3D>(); GDREGISTER_CLASS(CSGPolygon3D);
ClassDB::register_class<CSGCombiner3D>(); GDREGISTER_CLASS(CSGCombiner3D);
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
EditorPlugins::add_by_type<EditorPluginCSG>(); EditorPlugins::add_by_type<EditorPluginCSG>();

View File

@ -41,7 +41,7 @@ void register_enet_types() {
enet_ok = true; enet_ok = true;
} }
ClassDB::register_class<ENetMultiplayerPeer>(); GDREGISTER_CLASS(ENetMultiplayerPeer);
} }
void unregister_enet_types() { void unregister_enet_types() {

View File

@ -46,7 +46,7 @@ void register_fbx_types() {
ClassDB::APIType prev_api = ClassDB::get_current_api(); ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR); ClassDB::set_current_api(ClassDB::API_EDITOR);
ClassDB::register_class<EditorSceneImporterFBX>(); GDREGISTER_CLASS(EditorSceneImporterFBX);
ClassDB::set_current_api(prev_api); ClassDB::set_current_api(prev_api);

View File

@ -45,7 +45,7 @@ Ref<ResourceFormatSaverNativeScript> resource_saver_gdns;
void register_nativescript_types() { void register_nativescript_types() {
native_script_language = memnew(NativeScriptLanguage); native_script_language = memnew(NativeScriptLanguage);
ClassDB::register_class<NativeScript>(); GDREGISTER_CLASS(NativeScript);
native_script_language->set_language_index(ScriptServer::get_language_count()); native_script_language->set_language_index(ScriptServer::get_language_count());
ScriptServer::register_language(native_script_language); ScriptServer::register_language(native_script_language);

View File

@ -34,9 +34,9 @@
#include "stream_peer_gdnative.h" #include "stream_peer_gdnative.h"
void register_net_types() { void register_net_types() {
ClassDB::register_class<MultiplayerPeerGDNative>(); GDREGISTER_CLASS(MultiplayerPeerGDNative);
ClassDB::register_class<PacketPeerGDNative>(); GDREGISTER_CLASS(PacketPeerGDNative);
ClassDB::register_class<StreamPeerGDNative>(); GDREGISTER_CLASS(StreamPeerGDNative);
} }
void unregister_net_types() { void unregister_net_types() {

View File

@ -107,7 +107,7 @@ void GDAPI godot_pluginscript_register_language(const godot_pluginscript_languag
} }
void register_pluginscript_types() { void register_pluginscript_types() {
ClassDB::register_class<PluginScript>(); GDREGISTER_CLASS(PluginScript);
} }
void unregister_pluginscript_types() { void unregister_pluginscript_types() {

View File

@ -259,8 +259,8 @@ void register_gdnative_types() {
EditorNode::add_init_callback(editor_init_callback); EditorNode::add_init_callback(editor_init_callback);
#endif #endif
ClassDB::register_class<GDNativeLibrary>(); GDREGISTER_CLASS(GDNativeLibrary);
ClassDB::register_class<GDNative>(); GDREGISTER_CLASS(GDNative);
resource_loader_gdnlib.instantiate(); resource_loader_gdnlib.instantiate();
ResourceLoader::add_resource_format_loader(resource_loader_gdnlib); ResourceLoader::add_resource_format_loader(resource_loader_gdnlib);

View File

@ -39,7 +39,7 @@ void register_videodecoder_types() {
resource_loader_vsgdnative.instantiate(); resource_loader_vsgdnative.instantiate();
ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true); ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true);
ClassDB::register_class<VideoStreamGDNative>(); GDREGISTER_CLASS(VideoStreamGDNative);
} }
void unregister_videodecoder_types() { void unregister_videodecoder_types() {

View File

@ -32,7 +32,7 @@
#include "xr_interface_gdnative.h" #include "xr_interface_gdnative.h"
void register_xr_types() { void register_xr_types() {
ClassDB::register_class<XRInterfaceGDNative>(); GDREGISTER_CLASS(XRInterfaceGDNative);
ClassDB::add_compatibility_class("ARVRInterfaceGDNative", "XRInterfaceGDNative"); ClassDB::add_compatibility_class("ARVRInterfaceGDNative", "XRInterfaceGDNative");
} }

View File

@ -101,7 +101,7 @@ void GDScriptLanguageServer::stop() {
} }
void register_lsp_types() { void register_lsp_types() {
ClassDB::register_class<GDScriptLanguageProtocol>(); GDREGISTER_CLASS(GDScriptLanguageProtocol);
ClassDB::register_class<GDScriptTextDocument>(); GDREGISTER_CLASS(GDScriptTextDocument);
ClassDB::register_class<GDScriptWorkspace>(); GDREGISTER_CLASS(GDScriptWorkspace);
} }

View File

@ -112,7 +112,7 @@ static void _editor_init() {
#endif // TOOLS_ENABLED #endif // TOOLS_ENABLED
void register_gdscript_types() { void register_gdscript_types() {
ClassDB::register_class<GDScript>(); GDREGISTER_CLASS(GDScript);
script_language_gd = memnew(GDScriptLanguage); script_language_gd = memnew(GDScriptLanguage);
ScriptServer::register_language(script_language_gd); ScriptServer::register_language(script_language_gd);

View File

@ -62,25 +62,25 @@ void register_gltf_types() {
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
ClassDB::APIType prev_api = ClassDB::get_current_api(); ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR); ClassDB::set_current_api(ClassDB::API_EDITOR);
ClassDB::register_class<EditorSceneImporterGLTF>(); GDREGISTER_CLASS(EditorSceneImporterGLTF);
ClassDB::register_class<GLTFMesh>(); GDREGISTER_CLASS(GLTFMesh);
EditorPlugins::add_by_type<SceneExporterGLTFPlugin>(); EditorPlugins::add_by_type<SceneExporterGLTFPlugin>();
ClassDB::set_current_api(prev_api); ClassDB::set_current_api(prev_api);
EditorNode::add_init_callback(_editor_init); EditorNode::add_init_callback(_editor_init);
#endif #endif
ClassDB::register_class<GLTFSpecGloss>(); GDREGISTER_CLASS(GLTFSpecGloss);
ClassDB::register_class<GLTFNode>(); GDREGISTER_CLASS(GLTFNode);
ClassDB::register_class<GLTFAnimation>(); GDREGISTER_CLASS(GLTFAnimation);
ClassDB::register_class<GLTFBufferView>(); GDREGISTER_CLASS(GLTFBufferView);
ClassDB::register_class<GLTFAccessor>(); GDREGISTER_CLASS(GLTFAccessor);
ClassDB::register_class<GLTFTexture>(); GDREGISTER_CLASS(GLTFTexture);
ClassDB::register_class<GLTFSkeleton>(); GDREGISTER_CLASS(GLTFSkeleton);
ClassDB::register_class<GLTFSkin>(); GDREGISTER_CLASS(GLTFSkin);
ClassDB::register_class<GLTFCamera>(); GDREGISTER_CLASS(GLTFCamera);
ClassDB::register_class<GLTFLight>(); GDREGISTER_CLASS(GLTFLight);
ClassDB::register_class<GLTFState>(); GDREGISTER_CLASS(GLTFState);
ClassDB::register_class<GLTFDocument>(); GDREGISTER_CLASS(GLTFDocument);
ClassDB::register_class<PackedSceneGLTF>(); GDREGISTER_CLASS(PackedSceneGLTF);
#endif #endif
} }

View File

@ -37,7 +37,7 @@
void register_gridmap_types() { void register_gridmap_types() {
#ifndef _3D_DISABLED #ifndef _3D_DISABLED
ClassDB::register_class<GridMap>(); GDREGISTER_CLASS(GridMap);
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
EditorPlugins::add_by_type<GridMapEditorPlugin>(); EditorPlugins::add_by_type<GridMapEditorPlugin>();
#endif #endif

View File

@ -33,7 +33,7 @@
#include "jsonrpc.h" #include "jsonrpc.h"
void register_jsonrpc_types() { void register_jsonrpc_types() {
ClassDB::register_class<JSONRPC>(); GDREGISTER_CLASS(JSONRPC);
} }
void unregister_jsonrpc_types() { void unregister_jsonrpc_types() {

View File

@ -54,7 +54,7 @@ void register_lightmapper_rd_types() {
GLOBAL_DEF("rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count", 2048); GLOBAL_DEF("rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count", 2048);
GLOBAL_DEF("rendering/lightmapping/bake_performance/max_rays_per_probe_pass", 64); GLOBAL_DEF("rendering/lightmapping/bake_performance/max_rays_per_probe_pass", 64);
#ifndef _3D_DISABLED #ifndef _3D_DISABLED
ClassDB::register_class<LightmapperRD>(); GDREGISTER_CLASS(LightmapperRD);
Lightmapper::create_gpu = create_lightmapper_rd; Lightmapper::create_gpu = create_lightmapper_rd;
#endif #endif
} }

View File

@ -45,7 +45,7 @@ void register_minimp3_types() {
ResourceFormatImporter::get_singleton()->add_importer(mp3_import); ResourceFormatImporter::get_singleton()->add_importer(mp3_import);
} }
#endif #endif
ClassDB::register_class<AudioStreamMP3>(); GDREGISTER_CLASS(AudioStreamMP3);
} }
void unregister_minimp3_types() { void unregister_minimp3_types() {

View File

@ -33,7 +33,7 @@
#include "mobile_vr_interface.h" #include "mobile_vr_interface.h"
void register_mobile_vr_types() { void register_mobile_vr_types() {
ClassDB::register_class<MobileVRInterface>(); GDREGISTER_CLASS(MobileVRInterface);
if (XRServer::get_singleton()) { if (XRServer::get_singleton()) {
Ref<MobileVRInterface> mobile_vr; Ref<MobileVRInterface> mobile_vr;

View File

@ -41,11 +41,11 @@ Ref<ResourceFormatSaverCSharpScript> resource_saver_cs;
_GodotSharp *_godotsharp = nullptr; _GodotSharp *_godotsharp = nullptr;
void register_mono_types() { void register_mono_types() {
ClassDB::register_class<CSharpScript>(); GDREGISTER_CLASS(CSharpScript);
_godotsharp = memnew(_GodotSharp); _godotsharp = memnew(_GodotSharp);
ClassDB::register_class<_GodotSharp>(); GDREGISTER_CLASS(_GodotSharp);
Engine::get_singleton()->add_singleton(Engine::Singleton("GodotSharp", _GodotSharp::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("GodotSharp", _GodotSharp::get_singleton()));
script_language_cs = memnew(CSharpLanguage); script_language_cs = memnew(CSharpLanguage);

View File

@ -56,7 +56,7 @@ void register_navigation_types() {
#ifndef _3D_DISABLED #ifndef _3D_DISABLED
_nav_mesh_generator = memnew(NavigationMeshGenerator); _nav_mesh_generator = memnew(NavigationMeshGenerator);
ClassDB::register_class<NavigationMeshGenerator>(); GDREGISTER_CLASS(NavigationMeshGenerator);
Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationMeshGenerator", NavigationMeshGenerator::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationMeshGenerator", NavigationMeshGenerator::get_singleton()));
#endif #endif

View File

@ -33,8 +33,8 @@
#include "open_simplex_noise.h" #include "open_simplex_noise.h"
void register_opensimplex_types() { void register_opensimplex_types() {
ClassDB::register_class<OpenSimplexNoise>(); GDREGISTER_CLASS(OpenSimplexNoise);
ClassDB::register_class<NoiseTexture>(); GDREGISTER_CLASS(NoiseTexture);
} }
void unregister_opensimplex_types() { void unregister_opensimplex_types() {

View File

@ -33,8 +33,8 @@
#include "regex.h" #include "regex.h"
void register_regex_types() { void register_regex_types() {
ClassDB::register_class<RegExMatch>(); GDREGISTER_CLASS(RegExMatch);
ClassDB::register_class<RegEx>(); GDREGISTER_CLASS(RegEx);
} }
void unregister_regex_types() { void unregister_regex_types() {

View File

@ -45,7 +45,7 @@ void register_stb_vorbis_types() {
ResourceFormatImporter::get_singleton()->add_importer(ogg_import); ResourceFormatImporter::get_singleton()->add_importer(ogg_import);
} }
#endif #endif
ClassDB::register_class<AudioStreamOGGVorbis>(); GDREGISTER_CLASS(AudioStreamOGGVorbis);
} }
void unregister_stb_vorbis_types() { void unregister_stb_vorbis_types() {

View File

@ -38,7 +38,7 @@ void register_theora_types() {
resource_loader_theora.instantiate(); resource_loader_theora.instantiate();
ResourceLoader::add_resource_format_loader(resource_loader_theora, true); ResourceLoader::add_resource_format_loader(resource_loader_theora, true);
ClassDB::register_class<VideoStreamTheora>(); GDREGISTER_CLASS(VideoStreamTheora);
} }
void unregister_theora_types() { void unregister_theora_types() {

View File

@ -36,8 +36,8 @@
#include "upnp_device.h" #include "upnp_device.h"
void register_upnp_types() { void register_upnp_types() {
ClassDB::register_class<UPNP>(); GDREGISTER_CLASS(UPNP);
ClassDB::register_class<UPNPDevice>(); GDREGISTER_CLASS(UPNPDevice);
} }
void unregister_upnp_types() { void unregister_upnp_types() {

View File

@ -51,59 +51,59 @@ void register_visual_script_types() {
//script_language_gd->init(); //script_language_gd->init();
ScriptServer::register_language(visual_script_language); ScriptServer::register_language(visual_script_language);
ClassDB::register_class<VisualScript>(); GDREGISTER_CLASS(VisualScript);
ClassDB::register_virtual_class<VisualScriptNode>(); GDREGISTER_VIRTUAL_CLASS(VisualScriptNode);
ClassDB::register_class<VisualScriptFunctionState>(); GDREGISTER_CLASS(VisualScriptFunctionState);
ClassDB::register_class<VisualScriptFunction>(); GDREGISTER_CLASS(VisualScriptFunction);
ClassDB::register_virtual_class<VisualScriptLists>(); GDREGISTER_VIRTUAL_CLASS(VisualScriptLists);
ClassDB::register_class<VisualScriptComposeArray>(); GDREGISTER_CLASS(VisualScriptComposeArray);
ClassDB::register_class<VisualScriptOperator>(); GDREGISTER_CLASS(VisualScriptOperator);
ClassDB::register_class<VisualScriptVariableSet>(); GDREGISTER_CLASS(VisualScriptVariableSet);
ClassDB::register_class<VisualScriptVariableGet>(); GDREGISTER_CLASS(VisualScriptVariableGet);
ClassDB::register_class<VisualScriptConstant>(); GDREGISTER_CLASS(VisualScriptConstant);
ClassDB::register_class<VisualScriptIndexGet>(); GDREGISTER_CLASS(VisualScriptIndexGet);
ClassDB::register_class<VisualScriptIndexSet>(); GDREGISTER_CLASS(VisualScriptIndexSet);
ClassDB::register_class<VisualScriptGlobalConstant>(); GDREGISTER_CLASS(VisualScriptGlobalConstant);
ClassDB::register_class<VisualScriptClassConstant>(); GDREGISTER_CLASS(VisualScriptClassConstant);
ClassDB::register_class<VisualScriptMathConstant>(); GDREGISTER_CLASS(VisualScriptMathConstant);
ClassDB::register_class<VisualScriptBasicTypeConstant>(); GDREGISTER_CLASS(VisualScriptBasicTypeConstant);
ClassDB::register_class<VisualScriptEngineSingleton>(); GDREGISTER_CLASS(VisualScriptEngineSingleton);
ClassDB::register_class<VisualScriptSceneNode>(); GDREGISTER_CLASS(VisualScriptSceneNode);
ClassDB::register_class<VisualScriptSceneTree>(); GDREGISTER_CLASS(VisualScriptSceneTree);
ClassDB::register_class<VisualScriptResourcePath>(); GDREGISTER_CLASS(VisualScriptResourcePath);
ClassDB::register_class<VisualScriptSelf>(); GDREGISTER_CLASS(VisualScriptSelf);
ClassDB::register_class<VisualScriptCustomNode>(); GDREGISTER_CLASS(VisualScriptCustomNode);
ClassDB::register_class<VisualScriptSubCall>(); GDREGISTER_CLASS(VisualScriptSubCall);
ClassDB::register_class<VisualScriptComment>(); GDREGISTER_CLASS(VisualScriptComment);
ClassDB::register_class<VisualScriptConstructor>(); GDREGISTER_CLASS(VisualScriptConstructor);
ClassDB::register_class<VisualScriptLocalVar>(); GDREGISTER_CLASS(VisualScriptLocalVar);
ClassDB::register_class<VisualScriptLocalVarSet>(); GDREGISTER_CLASS(VisualScriptLocalVarSet);
ClassDB::register_class<VisualScriptInputAction>(); GDREGISTER_CLASS(VisualScriptInputAction);
ClassDB::register_class<VisualScriptDeconstruct>(); GDREGISTER_CLASS(VisualScriptDeconstruct);
ClassDB::register_class<VisualScriptPreload>(); GDREGISTER_CLASS(VisualScriptPreload);
ClassDB::register_class<VisualScriptTypeCast>(); GDREGISTER_CLASS(VisualScriptTypeCast);
ClassDB::register_class<VisualScriptFunctionCall>(); GDREGISTER_CLASS(VisualScriptFunctionCall);
ClassDB::register_class<VisualScriptPropertySet>(); GDREGISTER_CLASS(VisualScriptPropertySet);
ClassDB::register_class<VisualScriptPropertyGet>(); GDREGISTER_CLASS(VisualScriptPropertyGet);
//ClassDB::register_type<VisualScriptScriptCall>(); //ClassDB::register_type<VisualScriptScriptCall>();
ClassDB::register_class<VisualScriptEmitSignal>(); GDREGISTER_CLASS(VisualScriptEmitSignal);
ClassDB::register_class<VisualScriptReturn>(); GDREGISTER_CLASS(VisualScriptReturn);
ClassDB::register_class<VisualScriptCondition>(); GDREGISTER_CLASS(VisualScriptCondition);
ClassDB::register_class<VisualScriptWhile>(); GDREGISTER_CLASS(VisualScriptWhile);
ClassDB::register_class<VisualScriptIterator>(); GDREGISTER_CLASS(VisualScriptIterator);
ClassDB::register_class<VisualScriptSequence>(); GDREGISTER_CLASS(VisualScriptSequence);
//ClassDB::register_class<VisualScriptInputFilter>(); //GDREGISTER_CLASS(VisualScriptInputFilter);
ClassDB::register_class<VisualScriptSwitch>(); GDREGISTER_CLASS(VisualScriptSwitch);
ClassDB::register_class<VisualScriptSelect>(); GDREGISTER_CLASS(VisualScriptSelect);
ClassDB::register_class<VisualScriptYield>(); GDREGISTER_CLASS(VisualScriptYield);
ClassDB::register_class<VisualScriptYieldSignal>(); GDREGISTER_CLASS(VisualScriptYieldSignal);
ClassDB::register_class<VisualScriptBuiltinFunc>(); GDREGISTER_CLASS(VisualScriptBuiltinFunc);
ClassDB::register_class<VisualScriptExpression>(); GDREGISTER_CLASS(VisualScriptExpression);
register_visual_script_nodes(); register_visual_script_nodes();
register_visual_script_func_nodes(); register_visual_script_func_nodes();
@ -114,7 +114,7 @@ void register_visual_script_types() {
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
ClassDB::set_current_api(ClassDB::API_EDITOR); ClassDB::set_current_api(ClassDB::API_EDITOR);
ClassDB::register_class<_VisualScriptEditor>(); GDREGISTER_CLASS(_VisualScriptEditor);
ClassDB::set_current_api(ClassDB::API_CORE); ClassDB::set_current_api(ClassDB::API_CORE);
vs_editor_singleton = memnew(_VisualScriptEditor); vs_editor_singleton = memnew(_VisualScriptEditor);
Engine::get_singleton()->add_singleton(Engine::Singleton("VisualScriptEditor", _VisualScriptEditor::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("VisualScriptEditor", _VisualScriptEditor::get_singleton()));

View File

@ -38,7 +38,7 @@ void register_webm_types() {
resource_loader_webm.instantiate(); resource_loader_webm.instantiate();
ResourceLoader::add_resource_format_loader(resource_loader_webm, true); ResourceLoader::add_resource_format_loader(resource_loader_webm, true);
ClassDB::register_class<VideoStreamWebm>(); GDREGISTER_CLASS(VideoStreamWebm);
} }
void unregister_webm_types() { void unregister_webm_types() {

View File

@ -58,11 +58,11 @@ void register_webrtc_types() {
ClassDB::register_custom_instance_class<WebRTCPeerConnection>(); ClassDB::register_custom_instance_class<WebRTCPeerConnection>();
#ifdef WEBRTC_GDNATIVE_ENABLED #ifdef WEBRTC_GDNATIVE_ENABLED
ClassDB::register_class<WebRTCPeerConnectionGDNative>(); GDREGISTER_CLASS(WebRTCPeerConnectionGDNative);
ClassDB::register_class<WebRTCDataChannelGDNative>(); GDREGISTER_CLASS(WebRTCDataChannelGDNative);
#endif #endif
ClassDB::register_virtual_class<WebRTCDataChannel>(); GDREGISTER_VIRTUAL_CLASS(WebRTCDataChannel);
ClassDB::register_class<WebRTCMultiplayerPeer>(); GDREGISTER_CLASS(WebRTCMultiplayerPeer);
} }
void unregister_webrtc_types() {} void unregister_webrtc_types() {}

View File

@ -63,7 +63,7 @@ void register_websocket_types() {
WSLServer::make_default(); WSLServer::make_default();
#endif #endif
ClassDB::register_virtual_class<WebSocketMultiplayerPeer>(); GDREGISTER_VIRTUAL_CLASS(WebSocketMultiplayerPeer);
ClassDB::register_custom_instance_class<WebSocketServer>(); ClassDB::register_custom_instance_class<WebSocketServer>();
ClassDB::register_custom_instance_class<WebSocketClient>(); ClassDB::register_custom_instance_class<WebSocketClient>();
ClassDB::register_custom_instance_class<WebSocketPeer>(); ClassDB::register_custom_instance_class<WebSocketPeer>();

View File

@ -34,7 +34,7 @@
#include "webxr_interface_js.h" #include "webxr_interface_js.h"
void register_webxr_types() { void register_webxr_types() {
ClassDB::register_virtual_class<WebXRInterface>(); GDREGISTER_VIRTUAL_CLASS(WebXRInterface);
#ifdef JAVASCRIPT_ENABLED #ifdef JAVASCRIPT_ENABLED
Ref<WebXRInterfaceJS> webxr; Ref<WebXRInterfaceJS> webxr;

View File

@ -44,11 +44,11 @@ void register_android_api() {
// `JNISingleton` registration occurs in // `JNISingleton` registration occurs in
// `platform/android/java_godot_lib_jni.cpp#Java_org_godotengine_godot_GodotLib_setup` // `platform/android/java_godot_lib_jni.cpp#Java_org_godotengine_godot_GodotLib_setup`
java_class_wrapper = memnew(JavaClassWrapper); // Dummy java_class_wrapper = memnew(JavaClassWrapper); // Dummy
ClassDB::register_class<JNISingleton>(); GDREGISTER_CLASS(JNISingleton);
#endif #endif
ClassDB::register_class<JavaClass>(); GDREGISTER_CLASS(JavaClass);
ClassDB::register_class<JavaClassWrapper>(); GDREGISTER_CLASS(JavaClassWrapper);
Engine::get_singleton()->add_singleton(Engine::Singleton("JavaClassWrapper", JavaClassWrapper::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("JavaClassWrapper", JavaClassWrapper::get_singleton()));
} }

View File

@ -157,7 +157,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jc
} }
java_class_wrapper = memnew(JavaClassWrapper(godot_java->get_activity())); java_class_wrapper = memnew(JavaClassWrapper(godot_java->get_activity()));
ClassDB::register_class<JNISingleton>(); GDREGISTER_CLASS(JNISingleton);
} }
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jclass clazz, jobject p_surface, jint p_width, jint p_height) { JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jclass clazz, jobject p_surface, jint p_width, jint p_height) {

View File

@ -37,8 +37,8 @@ static JavaScript *javascript_eval;
void register_javascript_api() { void register_javascript_api() {
JavaScriptToolsEditorPlugin::initialize(); JavaScriptToolsEditorPlugin::initialize();
ClassDB::register_virtual_class<JavaScriptObject>(); GDREGISTER_VIRTUAL_CLASS(JavaScriptObject);
ClassDB::register_virtual_class<JavaScript>(); GDREGISTER_VIRTUAL_CLASS(JavaScript);
javascript_eval = memnew(JavaScript); javascript_eval = memnew(JavaScript);
Engine::get_singleton()->add_singleton(Engine::Singleton("JavaScript", javascript_eval)); Engine::get_singleton()->add_singleton(Engine::Singleton("JavaScript", javascript_eval));
} }

File diff suppressed because it is too large Load Diff

View File

@ -120,106 +120,106 @@ void preregister_server_types() {
void register_server_types() { void register_server_types() {
OS::get_singleton()->set_has_server_feature_callback(has_server_feature_callback); OS::get_singleton()->set_has_server_feature_callback(has_server_feature_callback);
ClassDB::register_virtual_class<DisplayServer>(); GDREGISTER_VIRTUAL_CLASS(DisplayServer);
ClassDB::register_virtual_class<RenderingServer>(); GDREGISTER_VIRTUAL_CLASS(RenderingServer);
ClassDB::register_class<AudioServer>(); GDREGISTER_CLASS(AudioServer);
ClassDB::register_class<TextServerManager>(); GDREGISTER_CLASS(TextServerManager);
ClassDB::register_virtual_class<TextServer>(); GDREGISTER_VIRTUAL_CLASS(TextServer);
TextServer::initialize_hex_code_box_fonts(); TextServer::initialize_hex_code_box_fonts();
ClassDB::register_virtual_class<PhysicsServer2D>(); GDREGISTER_VIRTUAL_CLASS(PhysicsServer2D);
ClassDB::register_virtual_class<PhysicsServer3D>(); GDREGISTER_VIRTUAL_CLASS(PhysicsServer3D);
ClassDB::register_virtual_class<NavigationServer2D>(); GDREGISTER_VIRTUAL_CLASS(NavigationServer2D);
ClassDB::register_virtual_class<NavigationServer3D>(); GDREGISTER_VIRTUAL_CLASS(NavigationServer3D);
ClassDB::register_class<XRServer>(); GDREGISTER_CLASS(XRServer);
ClassDB::register_class<CameraServer>(); GDREGISTER_CLASS(CameraServer);
ClassDB::register_virtual_class<RenderingDevice>(); GDREGISTER_VIRTUAL_CLASS(RenderingDevice);
ClassDB::register_virtual_class<XRInterface>(); GDREGISTER_VIRTUAL_CLASS(XRInterface);
ClassDB::register_class<XRPositionalTracker>(); GDREGISTER_CLASS(XRPositionalTracker);
ClassDB::register_virtual_class<AudioStream>(); GDREGISTER_VIRTUAL_CLASS(AudioStream);
ClassDB::register_virtual_class<AudioStreamPlayback>(); GDREGISTER_VIRTUAL_CLASS(AudioStreamPlayback);
ClassDB::register_virtual_class<AudioStreamPlaybackResampled>(); GDREGISTER_VIRTUAL_CLASS(AudioStreamPlaybackResampled);
ClassDB::register_class<AudioStreamMicrophone>(); GDREGISTER_CLASS(AudioStreamMicrophone);
ClassDB::register_class<AudioStreamRandomPitch>(); GDREGISTER_CLASS(AudioStreamRandomPitch);
ClassDB::register_virtual_class<AudioEffect>(); GDREGISTER_VIRTUAL_CLASS(AudioEffect);
ClassDB::register_virtual_class<AudioEffectInstance>(); GDREGISTER_VIRTUAL_CLASS(AudioEffectInstance);
ClassDB::register_class<AudioEffectEQ>(); GDREGISTER_CLASS(AudioEffectEQ);
ClassDB::register_class<AudioEffectFilter>(); GDREGISTER_CLASS(AudioEffectFilter);
ClassDB::register_class<AudioBusLayout>(); GDREGISTER_CLASS(AudioBusLayout);
ClassDB::register_class<AudioStreamGenerator>(); GDREGISTER_CLASS(AudioStreamGenerator);
ClassDB::register_virtual_class<AudioStreamGeneratorPlayback>(); GDREGISTER_VIRTUAL_CLASS(AudioStreamGeneratorPlayback);
{ {
//audio effects //audio effects
ClassDB::register_class<AudioEffectAmplify>(); GDREGISTER_CLASS(AudioEffectAmplify);
ClassDB::register_class<AudioEffectReverb>(); GDREGISTER_CLASS(AudioEffectReverb);
ClassDB::register_class<AudioEffectLowPassFilter>(); GDREGISTER_CLASS(AudioEffectLowPassFilter);
ClassDB::register_class<AudioEffectHighPassFilter>(); GDREGISTER_CLASS(AudioEffectHighPassFilter);
ClassDB::register_class<AudioEffectBandPassFilter>(); GDREGISTER_CLASS(AudioEffectBandPassFilter);
ClassDB::register_class<AudioEffectNotchFilter>(); GDREGISTER_CLASS(AudioEffectNotchFilter);
ClassDB::register_class<AudioEffectBandLimitFilter>(); GDREGISTER_CLASS(AudioEffectBandLimitFilter);
ClassDB::register_class<AudioEffectLowShelfFilter>(); GDREGISTER_CLASS(AudioEffectLowShelfFilter);
ClassDB::register_class<AudioEffectHighShelfFilter>(); GDREGISTER_CLASS(AudioEffectHighShelfFilter);
ClassDB::register_class<AudioEffectEQ6>(); GDREGISTER_CLASS(AudioEffectEQ6);
ClassDB::register_class<AudioEffectEQ10>(); GDREGISTER_CLASS(AudioEffectEQ10);
ClassDB::register_class<AudioEffectEQ21>(); GDREGISTER_CLASS(AudioEffectEQ21);
ClassDB::register_class<AudioEffectDistortion>(); GDREGISTER_CLASS(AudioEffectDistortion);
ClassDB::register_class<AudioEffectStereoEnhance>(); GDREGISTER_CLASS(AudioEffectStereoEnhance);
ClassDB::register_class<AudioEffectPanner>(); GDREGISTER_CLASS(AudioEffectPanner);
ClassDB::register_class<AudioEffectChorus>(); GDREGISTER_CLASS(AudioEffectChorus);
ClassDB::register_class<AudioEffectDelay>(); GDREGISTER_CLASS(AudioEffectDelay);
ClassDB::register_class<AudioEffectCompressor>(); GDREGISTER_CLASS(AudioEffectCompressor);
ClassDB::register_class<AudioEffectLimiter>(); GDREGISTER_CLASS(AudioEffectLimiter);
ClassDB::register_class<AudioEffectPitchShift>(); GDREGISTER_CLASS(AudioEffectPitchShift);
ClassDB::register_class<AudioEffectPhaser>(); GDREGISTER_CLASS(AudioEffectPhaser);
ClassDB::register_class<AudioEffectRecord>(); GDREGISTER_CLASS(AudioEffectRecord);
ClassDB::register_class<AudioEffectSpectrumAnalyzer>(); GDREGISTER_CLASS(AudioEffectSpectrumAnalyzer);
ClassDB::register_virtual_class<AudioEffectSpectrumAnalyzerInstance>(); GDREGISTER_VIRTUAL_CLASS(AudioEffectSpectrumAnalyzerInstance);
ClassDB::register_class<AudioEffectCapture>(); GDREGISTER_CLASS(AudioEffectCapture);
} }
ClassDB::register_virtual_class<RenderingDevice>(); GDREGISTER_VIRTUAL_CLASS(RenderingDevice);
ClassDB::register_class<RDTextureFormat>(); GDREGISTER_CLASS(RDTextureFormat);
ClassDB::register_class<RDTextureView>(); GDREGISTER_CLASS(RDTextureView);
ClassDB::register_class<RDAttachmentFormat>(); GDREGISTER_CLASS(RDAttachmentFormat);
ClassDB::register_class<RDFramebufferPass>(); GDREGISTER_CLASS(RDFramebufferPass);
ClassDB::register_class<RDSamplerState>(); GDREGISTER_CLASS(RDSamplerState);
ClassDB::register_class<RDVertexAttribute>(); GDREGISTER_CLASS(RDVertexAttribute);
ClassDB::register_class<RDUniform>(); GDREGISTER_CLASS(RDUniform);
ClassDB::register_class<RDPipelineRasterizationState>(); GDREGISTER_CLASS(RDPipelineRasterizationState);
ClassDB::register_class<RDPipelineMultisampleState>(); GDREGISTER_CLASS(RDPipelineMultisampleState);
ClassDB::register_class<RDPipelineDepthStencilState>(); GDREGISTER_CLASS(RDPipelineDepthStencilState);
ClassDB::register_class<RDPipelineColorBlendStateAttachment>(); GDREGISTER_CLASS(RDPipelineColorBlendStateAttachment);
ClassDB::register_class<RDPipelineColorBlendState>(); GDREGISTER_CLASS(RDPipelineColorBlendState);
ClassDB::register_class<RDShaderSource>(); GDREGISTER_CLASS(RDShaderSource);
ClassDB::register_class<RDShaderBytecode>(); GDREGISTER_CLASS(RDShaderBytecode);
ClassDB::register_class<RDShaderFile>(); GDREGISTER_CLASS(RDShaderFile);
ClassDB::register_class<RDPipelineSpecializationConstant>(); GDREGISTER_CLASS(RDPipelineSpecializationConstant);
ClassDB::register_class<CameraFeed>(); GDREGISTER_CLASS(CameraFeed);
ClassDB::register_virtual_class<PhysicsDirectBodyState2D>(); GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState2D);
ClassDB::register_virtual_class<PhysicsDirectSpaceState2D>(); GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState2D);
ClassDB::register_class<PhysicsTestMotionResult2D>(); GDREGISTER_CLASS(PhysicsTestMotionResult2D);
ClassDB::register_class<PhysicsShapeQueryParameters2D>(); GDREGISTER_CLASS(PhysicsShapeQueryParameters2D);
ClassDB::register_class<PhysicsShapeQueryParameters3D>(); GDREGISTER_CLASS(PhysicsShapeQueryParameters3D);
ClassDB::register_virtual_class<PhysicsDirectBodyState3D>(); GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState3D);
ClassDB::register_virtual_class<PhysicsDirectSpaceState3D>(); GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState3D);
ClassDB::register_class<PhysicsTestMotionResult3D>(); GDREGISTER_CLASS(PhysicsTestMotionResult3D);
// Physics 2D // Physics 2D
GLOBAL_DEF(PhysicsServer2DManager::setting_property_name, "DEFAULT"); GLOBAL_DEF(PhysicsServer2DManager::setting_property_name, "DEFAULT");

View File

@ -206,7 +206,7 @@ TEST_CASE("[Object] Script instance property getter") {
} }
TEST_CASE("[Object] Built-in property setter") { TEST_CASE("[Object] Built-in property setter") {
ClassDB::register_class<_TestDerivedObject>(); GDREGISTER_CLASS(_TestDerivedObject);
_TestDerivedObject derived_object; _TestDerivedObject derived_object;
bool valid = false; bool valid = false;
@ -218,7 +218,7 @@ TEST_CASE("[Object] Built-in property setter") {
} }
TEST_CASE("[Object] Built-in property getter") { TEST_CASE("[Object] Built-in property getter") {
ClassDB::register_class<_TestDerivedObject>(); GDREGISTER_CLASS(_TestDerivedObject);
_TestDerivedObject derived_object; _TestDerivedObject derived_object;
derived_object.set_property(100); derived_object.set_property(100);