mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
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:
parent
fc00a83901
commit
5ad4f26659
@ -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("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("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("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)", "")
|
||||
@ -642,6 +643,7 @@ if selected_platform in platform_list:
|
||||
|
||||
if env["tools"]:
|
||||
env.Append(CPPDEFINES=["TOOLS_ENABLED"])
|
||||
methods.write_disabled_classes(env["disable_classes"].split(","))
|
||||
if env["disable_3d"]:
|
||||
if env["tools"]:
|
||||
print(
|
||||
|
@ -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
|
||||
|
@ -131,50 +131,50 @@ void register_core_types() {
|
||||
resource_format_image.instantiate();
|
||||
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>();
|
||||
ClassDB::register_class<WeakRef>();
|
||||
ClassDB::register_class<Resource>();
|
||||
ClassDB::register_class<Image>();
|
||||
GDREGISTER_CLASS(RefCounted);
|
||||
GDREGISTER_CLASS(WeakRef);
|
||||
GDREGISTER_CLASS(Resource);
|
||||
GDREGISTER_CLASS(Image);
|
||||
|
||||
ClassDB::register_virtual_class<InputEvent>();
|
||||
ClassDB::register_virtual_class<InputEventWithModifiers>();
|
||||
ClassDB::register_virtual_class<InputEventFromWindow>();
|
||||
ClassDB::register_class<InputEventKey>();
|
||||
ClassDB::register_virtual_class<InputEventMouse>();
|
||||
ClassDB::register_class<InputEventMouseButton>();
|
||||
ClassDB::register_class<InputEventMouseMotion>();
|
||||
ClassDB::register_class<InputEventJoypadButton>();
|
||||
ClassDB::register_class<InputEventJoypadMotion>();
|
||||
ClassDB::register_class<InputEventScreenDrag>();
|
||||
ClassDB::register_class<InputEventScreenTouch>();
|
||||
ClassDB::register_class<InputEventAction>();
|
||||
ClassDB::register_virtual_class<InputEventGesture>();
|
||||
ClassDB::register_class<InputEventMagnifyGesture>();
|
||||
ClassDB::register_class<InputEventPanGesture>();
|
||||
ClassDB::register_class<InputEventMIDI>();
|
||||
GDREGISTER_VIRTUAL_CLASS(InputEvent);
|
||||
GDREGISTER_VIRTUAL_CLASS(InputEventWithModifiers);
|
||||
GDREGISTER_VIRTUAL_CLASS(InputEventFromWindow);
|
||||
GDREGISTER_CLASS(InputEventKey);
|
||||
GDREGISTER_VIRTUAL_CLASS(InputEventMouse);
|
||||
GDREGISTER_CLASS(InputEventMouseButton);
|
||||
GDREGISTER_CLASS(InputEventMouseMotion);
|
||||
GDREGISTER_CLASS(InputEventJoypadButton);
|
||||
GDREGISTER_CLASS(InputEventJoypadMotion);
|
||||
GDREGISTER_CLASS(InputEventScreenDrag);
|
||||
GDREGISTER_CLASS(InputEventScreenTouch);
|
||||
GDREGISTER_CLASS(InputEventAction);
|
||||
GDREGISTER_VIRTUAL_CLASS(InputEventGesture);
|
||||
GDREGISTER_CLASS(InputEventMagnifyGesture);
|
||||
GDREGISTER_CLASS(InputEventPanGesture);
|
||||
GDREGISTER_CLASS(InputEventMIDI);
|
||||
|
||||
// Network
|
||||
ClassDB::register_virtual_class<IP>();
|
||||
GDREGISTER_VIRTUAL_CLASS(IP);
|
||||
|
||||
ClassDB::register_virtual_class<StreamPeer>();
|
||||
ClassDB::register_class<StreamPeerBuffer>();
|
||||
ClassDB::register_class<StreamPeerTCP>();
|
||||
ClassDB::register_class<TCPServer>();
|
||||
GDREGISTER_VIRTUAL_CLASS(StreamPeer);
|
||||
GDREGISTER_CLASS(StreamPeerBuffer);
|
||||
GDREGISTER_CLASS(StreamPeerTCP);
|
||||
GDREGISTER_CLASS(TCPServer);
|
||||
|
||||
ClassDB::register_virtual_class<PacketPeer>();
|
||||
ClassDB::register_class<PacketPeerStream>();
|
||||
ClassDB::register_class<PacketPeerUDP>();
|
||||
ClassDB::register_class<UDPServer>();
|
||||
GDREGISTER_VIRTUAL_CLASS(PacketPeer);
|
||||
GDREGISTER_CLASS(PacketPeerStream);
|
||||
GDREGISTER_CLASS(PacketPeerUDP);
|
||||
GDREGISTER_CLASS(UDPServer);
|
||||
|
||||
ClassDB::register_custom_instance_class<HTTPClient>();
|
||||
|
||||
// Crypto
|
||||
ClassDB::register_class<HashingContext>();
|
||||
ClassDB::register_class<AESContext>();
|
||||
GDREGISTER_CLASS(HashingContext);
|
||||
GDREGISTER_CLASS(AESContext);
|
||||
ClassDB::register_custom_instance_class<X509Certificate>();
|
||||
ClassDB::register_custom_instance_class<CryptoKey>();
|
||||
ClassDB::register_custom_instance_class<HMACContext>();
|
||||
@ -188,42 +188,42 @@ void register_core_types() {
|
||||
resource_format_loader_crypto.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_format_loader_crypto);
|
||||
|
||||
ClassDB::register_virtual_class<MultiplayerPeer>();
|
||||
ClassDB::register_class<MultiplayerAPI>();
|
||||
ClassDB::register_class<MainLoop>();
|
||||
ClassDB::register_class<Translation>();
|
||||
ClassDB::register_class<OptimizedTranslation>();
|
||||
ClassDB::register_class<UndoRedo>();
|
||||
ClassDB::register_class<TriangleMesh>();
|
||||
GDREGISTER_VIRTUAL_CLASS(MultiplayerPeer);
|
||||
GDREGISTER_CLASS(MultiplayerAPI);
|
||||
GDREGISTER_CLASS(MainLoop);
|
||||
GDREGISTER_CLASS(Translation);
|
||||
GDREGISTER_CLASS(OptimizedTranslation);
|
||||
GDREGISTER_CLASS(UndoRedo);
|
||||
GDREGISTER_CLASS(TriangleMesh);
|
||||
|
||||
ClassDB::register_class<ResourceFormatLoader>();
|
||||
ClassDB::register_class<ResourceFormatSaver>();
|
||||
GDREGISTER_CLASS(ResourceFormatLoader);
|
||||
GDREGISTER_CLASS(ResourceFormatSaver);
|
||||
|
||||
ClassDB::register_class<_File>();
|
||||
ClassDB::register_class<_Directory>();
|
||||
ClassDB::register_class<_Thread>();
|
||||
ClassDB::register_class<_Mutex>();
|
||||
ClassDB::register_class<_Semaphore>();
|
||||
GDREGISTER_CLASS(_File);
|
||||
GDREGISTER_CLASS(_Directory);
|
||||
GDREGISTER_CLASS(_Thread);
|
||||
GDREGISTER_CLASS(_Mutex);
|
||||
GDREGISTER_CLASS(_Semaphore);
|
||||
|
||||
ClassDB::register_class<XMLParser>();
|
||||
ClassDB::register_class<JSON>();
|
||||
GDREGISTER_CLASS(XMLParser);
|
||||
GDREGISTER_CLASS(JSON);
|
||||
|
||||
ClassDB::register_class<ConfigFile>();
|
||||
GDREGISTER_CLASS(ConfigFile);
|
||||
|
||||
ClassDB::register_class<PCKPacker>();
|
||||
GDREGISTER_CLASS(PCKPacker);
|
||||
|
||||
ClassDB::register_class<PackedDataContainer>();
|
||||
ClassDB::register_virtual_class<PackedDataContainerRef>();
|
||||
ClassDB::register_class<AStar>();
|
||||
ClassDB::register_class<AStar2D>();
|
||||
ClassDB::register_class<EncodedObjectAsID>();
|
||||
ClassDB::register_class<RandomNumberGenerator>();
|
||||
GDREGISTER_CLASS(PackedDataContainer);
|
||||
GDREGISTER_VIRTUAL_CLASS(PackedDataContainerRef);
|
||||
GDREGISTER_CLASS(AStar);
|
||||
GDREGISTER_CLASS(AStar2D);
|
||||
GDREGISTER_CLASS(EncodedObjectAsID);
|
||||
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);
|
||||
|
||||
@ -253,22 +253,22 @@ void register_core_settings() {
|
||||
}
|
||||
|
||||
void register_core_singletons() {
|
||||
ClassDB::register_class<ProjectSettings>();
|
||||
ClassDB::register_virtual_class<IP>();
|
||||
ClassDB::register_class<_Geometry2D>();
|
||||
ClassDB::register_class<_Geometry3D>();
|
||||
ClassDB::register_class<_ResourceLoader>();
|
||||
ClassDB::register_class<_ResourceSaver>();
|
||||
ClassDB::register_class<_OS>();
|
||||
ClassDB::register_class<_Engine>();
|
||||
ClassDB::register_class<_ClassDB>();
|
||||
ClassDB::register_class<_Marshalls>();
|
||||
ClassDB::register_class<TranslationServer>();
|
||||
ClassDB::register_virtual_class<Input>();
|
||||
ClassDB::register_class<InputMap>();
|
||||
ClassDB::register_class<Expression>();
|
||||
ClassDB::register_class<_EngineDebugger>();
|
||||
ClassDB::register_class<Time>();
|
||||
GDREGISTER_CLASS(ProjectSettings);
|
||||
GDREGISTER_VIRTUAL_CLASS(IP);
|
||||
GDREGISTER_CLASS(_Geometry2D);
|
||||
GDREGISTER_CLASS(_Geometry3D);
|
||||
GDREGISTER_CLASS(_ResourceLoader);
|
||||
GDREGISTER_CLASS(_ResourceSaver);
|
||||
GDREGISTER_CLASS(_OS);
|
||||
GDREGISTER_CLASS(_Engine);
|
||||
GDREGISTER_CLASS(_ClassDB);
|
||||
GDREGISTER_CLASS(_Marshalls);
|
||||
GDREGISTER_CLASS(TranslationServer);
|
||||
GDREGISTER_VIRTUAL_CLASS(Input);
|
||||
GDREGISTER_CLASS(InputMap);
|
||||
GDREGISTER_CLASS(Expression);
|
||||
GDREGISTER_CLASS(_EngineDebugger);
|
||||
GDREGISTER_CLASS(Time);
|
||||
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("ProjectSettings", ProjectSettings::get_singleton()));
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("IP", IP::get_singleton(), "IP"));
|
||||
|
@ -281,4 +281,11 @@ struct BuildIndexSequence<0, Is...> : IndexSequence<Is...> {};
|
||||
#define DEBUG_METHODS_ENABLED
|
||||
#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
|
||||
|
@ -3736,46 +3736,46 @@ void EditorNode::register_editor_types() {
|
||||
ResourceLoader::set_timestamp_on_load(true);
|
||||
ResourceSaver::set_timestamp_on_save(true);
|
||||
|
||||
ClassDB::register_class<EditorPaths>();
|
||||
ClassDB::register_class<EditorPlugin>();
|
||||
ClassDB::register_class<EditorTranslationParserPlugin>();
|
||||
ClassDB::register_class<EditorImportPlugin>();
|
||||
ClassDB::register_class<EditorScript>();
|
||||
ClassDB::register_class<EditorSelection>();
|
||||
ClassDB::register_class<EditorFileDialog>();
|
||||
ClassDB::register_virtual_class<EditorSettings>();
|
||||
ClassDB::register_class<EditorNode3DGizmo>();
|
||||
ClassDB::register_class<EditorNode3DGizmoPlugin>();
|
||||
ClassDB::register_virtual_class<EditorResourcePreview>();
|
||||
ClassDB::register_class<EditorResourcePreviewGenerator>();
|
||||
ClassDB::register_virtual_class<EditorFileSystem>();
|
||||
ClassDB::register_class<EditorFileSystemDirectory>();
|
||||
ClassDB::register_class<EditorVCSInterface>();
|
||||
ClassDB::register_virtual_class<ScriptEditor>();
|
||||
ClassDB::register_virtual_class<ScriptEditorBase>();
|
||||
ClassDB::register_class<EditorSyntaxHighlighter>();
|
||||
ClassDB::register_virtual_class<EditorInterface>();
|
||||
ClassDB::register_class<EditorExportPlugin>();
|
||||
ClassDB::register_class<EditorResourceConversionPlugin>();
|
||||
ClassDB::register_class<EditorSceneImporter>();
|
||||
ClassDB::register_class<EditorInspector>();
|
||||
ClassDB::register_class<EditorInspectorPlugin>();
|
||||
ClassDB::register_class<EditorProperty>();
|
||||
ClassDB::register_class<AnimationTrackEditPlugin>();
|
||||
ClassDB::register_class<ScriptCreateDialog>();
|
||||
ClassDB::register_class<EditorFeatureProfile>();
|
||||
ClassDB::register_class<EditorSpinSlider>();
|
||||
ClassDB::register_class<EditorResourcePicker>();
|
||||
ClassDB::register_class<EditorScriptPicker>();
|
||||
ClassDB::register_class<EditorSceneImporterMesh>();
|
||||
ClassDB::register_class<EditorSceneImporterMeshNode3D>();
|
||||
GDREGISTER_CLASS(EditorPaths);
|
||||
GDREGISTER_CLASS(EditorPlugin);
|
||||
GDREGISTER_CLASS(EditorTranslationParserPlugin);
|
||||
GDREGISTER_CLASS(EditorImportPlugin);
|
||||
GDREGISTER_CLASS(EditorScript);
|
||||
GDREGISTER_CLASS(EditorSelection);
|
||||
GDREGISTER_CLASS(EditorFileDialog);
|
||||
GDREGISTER_VIRTUAL_CLASS(EditorSettings);
|
||||
GDREGISTER_CLASS(EditorNode3DGizmo);
|
||||
GDREGISTER_CLASS(EditorNode3DGizmoPlugin);
|
||||
GDREGISTER_VIRTUAL_CLASS(EditorResourcePreview);
|
||||
GDREGISTER_CLASS(EditorResourcePreviewGenerator);
|
||||
GDREGISTER_VIRTUAL_CLASS(EditorFileSystem);
|
||||
GDREGISTER_CLASS(EditorFileSystemDirectory);
|
||||
GDREGISTER_CLASS(EditorVCSInterface);
|
||||
GDREGISTER_VIRTUAL_CLASS(ScriptEditor);
|
||||
GDREGISTER_VIRTUAL_CLASS(ScriptEditorBase);
|
||||
GDREGISTER_CLASS(EditorSyntaxHighlighter);
|
||||
GDREGISTER_VIRTUAL_CLASS(EditorInterface);
|
||||
GDREGISTER_CLASS(EditorExportPlugin);
|
||||
GDREGISTER_CLASS(EditorResourceConversionPlugin);
|
||||
GDREGISTER_CLASS(EditorSceneImporter);
|
||||
GDREGISTER_CLASS(EditorInspector);
|
||||
GDREGISTER_CLASS(EditorInspectorPlugin);
|
||||
GDREGISTER_CLASS(EditorProperty);
|
||||
GDREGISTER_CLASS(AnimationTrackEditPlugin);
|
||||
GDREGISTER_CLASS(ScriptCreateDialog);
|
||||
GDREGISTER_CLASS(EditorFeatureProfile);
|
||||
GDREGISTER_CLASS(EditorSpinSlider);
|
||||
GDREGISTER_CLASS(EditorResourcePicker);
|
||||
GDREGISTER_CLASS(EditorScriptPicker);
|
||||
GDREGISTER_CLASS(EditorSceneImporterMesh);
|
||||
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?
|
||||
ClassDB::register_class<EditorScenePostImport>();
|
||||
GDREGISTER_CLASS(EditorScenePostImport);
|
||||
//ClassDB::register_type<EditorImportExport>();
|
||||
ClassDB::register_class<EditorDebuggerPlugin>();
|
||||
GDREGISTER_CLASS(EditorDebuggerPlugin);
|
||||
|
||||
NativeExtensionManager::get_singleton()->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_EDITOR);
|
||||
}
|
||||
|
@ -884,7 +884,7 @@ void EditorSettings::create() {
|
||||
return;
|
||||
}
|
||||
|
||||
ClassDB::register_class<EditorSettings>(); // Otherwise it can't be unserialized.
|
||||
GDREGISTER_CLASS(EditorSettings); // Otherwise it can't be unserialized.
|
||||
|
||||
String config_file_path;
|
||||
Ref<ConfigFile> extra_config = memnew(ConfigFile);
|
||||
|
@ -549,7 +549,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
|
||||
translation_server = memnew(TranslationServer);
|
||||
performance = memnew(Performance);
|
||||
ClassDB::register_class<Performance>();
|
||||
GDREGISTER_CLASS(Performance);
|
||||
engine->add_singleton(Engine::Singleton("Performance", performance));
|
||||
|
||||
// Only flush stdout in debug builds by default, as spamming `print()` will
|
||||
|
12
methods.py
12
methods.py
@ -231,6 +231,18 @@ def is_module(path):
|
||||
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):
|
||||
includes_cpp = ""
|
||||
preregister_cpp = ""
|
||||
|
@ -272,7 +272,7 @@ void register_basis_universal_types() {
|
||||
Image::basis_universal_packer = basis_universal_packer;
|
||||
#endif
|
||||
Image::basis_universal_unpacker = basis_universal_unpacker;
|
||||
//ClassDB::register_class<TextureBasisU>();
|
||||
//GDREGISTER_CLASS(TextureBasisU);
|
||||
}
|
||||
|
||||
void unregister_basis_universal_types() {
|
||||
|
@ -36,15 +36,15 @@
|
||||
void register_csg_types() {
|
||||
#ifndef _3D_DISABLED
|
||||
|
||||
ClassDB::register_virtual_class<CSGShape3D>();
|
||||
ClassDB::register_virtual_class<CSGPrimitive3D>();
|
||||
ClassDB::register_class<CSGMesh3D>();
|
||||
ClassDB::register_class<CSGSphere3D>();
|
||||
ClassDB::register_class<CSGBox3D>();
|
||||
ClassDB::register_class<CSGCylinder3D>();
|
||||
ClassDB::register_class<CSGTorus3D>();
|
||||
ClassDB::register_class<CSGPolygon3D>();
|
||||
ClassDB::register_class<CSGCombiner3D>();
|
||||
GDREGISTER_VIRTUAL_CLASS(CSGShape3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(CSGPrimitive3D);
|
||||
GDREGISTER_CLASS(CSGMesh3D);
|
||||
GDREGISTER_CLASS(CSGSphere3D);
|
||||
GDREGISTER_CLASS(CSGBox3D);
|
||||
GDREGISTER_CLASS(CSGCylinder3D);
|
||||
GDREGISTER_CLASS(CSGTorus3D);
|
||||
GDREGISTER_CLASS(CSGPolygon3D);
|
||||
GDREGISTER_CLASS(CSGCombiner3D);
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
EditorPlugins::add_by_type<EditorPluginCSG>();
|
||||
|
@ -41,7 +41,7 @@ void register_enet_types() {
|
||||
enet_ok = true;
|
||||
}
|
||||
|
||||
ClassDB::register_class<ENetMultiplayerPeer>();
|
||||
GDREGISTER_CLASS(ENetMultiplayerPeer);
|
||||
}
|
||||
|
||||
void unregister_enet_types() {
|
||||
|
@ -46,7 +46,7 @@ void register_fbx_types() {
|
||||
ClassDB::APIType prev_api = ClassDB::get_current_api();
|
||||
ClassDB::set_current_api(ClassDB::API_EDITOR);
|
||||
|
||||
ClassDB::register_class<EditorSceneImporterFBX>();
|
||||
GDREGISTER_CLASS(EditorSceneImporterFBX);
|
||||
|
||||
ClassDB::set_current_api(prev_api);
|
||||
|
||||
|
@ -45,7 +45,7 @@ Ref<ResourceFormatSaverNativeScript> resource_saver_gdns;
|
||||
void register_nativescript_types() {
|
||||
native_script_language = memnew(NativeScriptLanguage);
|
||||
|
||||
ClassDB::register_class<NativeScript>();
|
||||
GDREGISTER_CLASS(NativeScript);
|
||||
|
||||
native_script_language->set_language_index(ScriptServer::get_language_count());
|
||||
ScriptServer::register_language(native_script_language);
|
||||
|
@ -34,9 +34,9 @@
|
||||
#include "stream_peer_gdnative.h"
|
||||
|
||||
void register_net_types() {
|
||||
ClassDB::register_class<MultiplayerPeerGDNative>();
|
||||
ClassDB::register_class<PacketPeerGDNative>();
|
||||
ClassDB::register_class<StreamPeerGDNative>();
|
||||
GDREGISTER_CLASS(MultiplayerPeerGDNative);
|
||||
GDREGISTER_CLASS(PacketPeerGDNative);
|
||||
GDREGISTER_CLASS(StreamPeerGDNative);
|
||||
}
|
||||
|
||||
void unregister_net_types() {
|
||||
|
@ -107,7 +107,7 @@ void GDAPI godot_pluginscript_register_language(const godot_pluginscript_languag
|
||||
}
|
||||
|
||||
void register_pluginscript_types() {
|
||||
ClassDB::register_class<PluginScript>();
|
||||
GDREGISTER_CLASS(PluginScript);
|
||||
}
|
||||
|
||||
void unregister_pluginscript_types() {
|
||||
|
@ -259,8 +259,8 @@ void register_gdnative_types() {
|
||||
EditorNode::add_init_callback(editor_init_callback);
|
||||
#endif
|
||||
|
||||
ClassDB::register_class<GDNativeLibrary>();
|
||||
ClassDB::register_class<GDNative>();
|
||||
GDREGISTER_CLASS(GDNativeLibrary);
|
||||
GDREGISTER_CLASS(GDNative);
|
||||
|
||||
resource_loader_gdnlib.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_gdnlib);
|
||||
|
@ -39,7 +39,7 @@ void register_videodecoder_types() {
|
||||
resource_loader_vsgdnative.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_vsgdnative, true);
|
||||
|
||||
ClassDB::register_class<VideoStreamGDNative>();
|
||||
GDREGISTER_CLASS(VideoStreamGDNative);
|
||||
}
|
||||
|
||||
void unregister_videodecoder_types() {
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "xr_interface_gdnative.h"
|
||||
|
||||
void register_xr_types() {
|
||||
ClassDB::register_class<XRInterfaceGDNative>();
|
||||
GDREGISTER_CLASS(XRInterfaceGDNative);
|
||||
ClassDB::add_compatibility_class("ARVRInterfaceGDNative", "XRInterfaceGDNative");
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ void GDScriptLanguageServer::stop() {
|
||||
}
|
||||
|
||||
void register_lsp_types() {
|
||||
ClassDB::register_class<GDScriptLanguageProtocol>();
|
||||
ClassDB::register_class<GDScriptTextDocument>();
|
||||
ClassDB::register_class<GDScriptWorkspace>();
|
||||
GDREGISTER_CLASS(GDScriptLanguageProtocol);
|
||||
GDREGISTER_CLASS(GDScriptTextDocument);
|
||||
GDREGISTER_CLASS(GDScriptWorkspace);
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ static void _editor_init() {
|
||||
#endif // TOOLS_ENABLED
|
||||
|
||||
void register_gdscript_types() {
|
||||
ClassDB::register_class<GDScript>();
|
||||
GDREGISTER_CLASS(GDScript);
|
||||
|
||||
script_language_gd = memnew(GDScriptLanguage);
|
||||
ScriptServer::register_language(script_language_gd);
|
||||
|
@ -62,25 +62,25 @@ void register_gltf_types() {
|
||||
#ifdef TOOLS_ENABLED
|
||||
ClassDB::APIType prev_api = ClassDB::get_current_api();
|
||||
ClassDB::set_current_api(ClassDB::API_EDITOR);
|
||||
ClassDB::register_class<EditorSceneImporterGLTF>();
|
||||
ClassDB::register_class<GLTFMesh>();
|
||||
GDREGISTER_CLASS(EditorSceneImporterGLTF);
|
||||
GDREGISTER_CLASS(GLTFMesh);
|
||||
EditorPlugins::add_by_type<SceneExporterGLTFPlugin>();
|
||||
ClassDB::set_current_api(prev_api);
|
||||
EditorNode::add_init_callback(_editor_init);
|
||||
#endif
|
||||
ClassDB::register_class<GLTFSpecGloss>();
|
||||
ClassDB::register_class<GLTFNode>();
|
||||
ClassDB::register_class<GLTFAnimation>();
|
||||
ClassDB::register_class<GLTFBufferView>();
|
||||
ClassDB::register_class<GLTFAccessor>();
|
||||
ClassDB::register_class<GLTFTexture>();
|
||||
ClassDB::register_class<GLTFSkeleton>();
|
||||
ClassDB::register_class<GLTFSkin>();
|
||||
ClassDB::register_class<GLTFCamera>();
|
||||
ClassDB::register_class<GLTFLight>();
|
||||
ClassDB::register_class<GLTFState>();
|
||||
ClassDB::register_class<GLTFDocument>();
|
||||
ClassDB::register_class<PackedSceneGLTF>();
|
||||
GDREGISTER_CLASS(GLTFSpecGloss);
|
||||
GDREGISTER_CLASS(GLTFNode);
|
||||
GDREGISTER_CLASS(GLTFAnimation);
|
||||
GDREGISTER_CLASS(GLTFBufferView);
|
||||
GDREGISTER_CLASS(GLTFAccessor);
|
||||
GDREGISTER_CLASS(GLTFTexture);
|
||||
GDREGISTER_CLASS(GLTFSkeleton);
|
||||
GDREGISTER_CLASS(GLTFSkin);
|
||||
GDREGISTER_CLASS(GLTFCamera);
|
||||
GDREGISTER_CLASS(GLTFLight);
|
||||
GDREGISTER_CLASS(GLTFState);
|
||||
GDREGISTER_CLASS(GLTFDocument);
|
||||
GDREGISTER_CLASS(PackedSceneGLTF);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
void register_gridmap_types() {
|
||||
#ifndef _3D_DISABLED
|
||||
ClassDB::register_class<GridMap>();
|
||||
GDREGISTER_CLASS(GridMap);
|
||||
#ifdef TOOLS_ENABLED
|
||||
EditorPlugins::add_by_type<GridMapEditorPlugin>();
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "jsonrpc.h"
|
||||
|
||||
void register_jsonrpc_types() {
|
||||
ClassDB::register_class<JSONRPC>();
|
||||
GDREGISTER_CLASS(JSONRPC);
|
||||
}
|
||||
|
||||
void unregister_jsonrpc_types() {
|
||||
|
@ -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_performance/max_rays_per_probe_pass", 64);
|
||||
#ifndef _3D_DISABLED
|
||||
ClassDB::register_class<LightmapperRD>();
|
||||
GDREGISTER_CLASS(LightmapperRD);
|
||||
Lightmapper::create_gpu = create_lightmapper_rd;
|
||||
#endif
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ void register_minimp3_types() {
|
||||
ResourceFormatImporter::get_singleton()->add_importer(mp3_import);
|
||||
}
|
||||
#endif
|
||||
ClassDB::register_class<AudioStreamMP3>();
|
||||
GDREGISTER_CLASS(AudioStreamMP3);
|
||||
}
|
||||
|
||||
void unregister_minimp3_types() {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "mobile_vr_interface.h"
|
||||
|
||||
void register_mobile_vr_types() {
|
||||
ClassDB::register_class<MobileVRInterface>();
|
||||
GDREGISTER_CLASS(MobileVRInterface);
|
||||
|
||||
if (XRServer::get_singleton()) {
|
||||
Ref<MobileVRInterface> mobile_vr;
|
||||
|
@ -41,11 +41,11 @@ Ref<ResourceFormatSaverCSharpScript> resource_saver_cs;
|
||||
_GodotSharp *_godotsharp = nullptr;
|
||||
|
||||
void register_mono_types() {
|
||||
ClassDB::register_class<CSharpScript>();
|
||||
GDREGISTER_CLASS(CSharpScript);
|
||||
|
||||
_godotsharp = memnew(_GodotSharp);
|
||||
|
||||
ClassDB::register_class<_GodotSharp>();
|
||||
GDREGISTER_CLASS(_GodotSharp);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("GodotSharp", _GodotSharp::get_singleton()));
|
||||
|
||||
script_language_cs = memnew(CSharpLanguage);
|
||||
|
@ -56,7 +56,7 @@ void register_navigation_types() {
|
||||
|
||||
#ifndef _3D_DISABLED
|
||||
_nav_mesh_generator = memnew(NavigationMeshGenerator);
|
||||
ClassDB::register_class<NavigationMeshGenerator>();
|
||||
GDREGISTER_CLASS(NavigationMeshGenerator);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationMeshGenerator", NavigationMeshGenerator::get_singleton()));
|
||||
#endif
|
||||
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include "open_simplex_noise.h"
|
||||
|
||||
void register_opensimplex_types() {
|
||||
ClassDB::register_class<OpenSimplexNoise>();
|
||||
ClassDB::register_class<NoiseTexture>();
|
||||
GDREGISTER_CLASS(OpenSimplexNoise);
|
||||
GDREGISTER_CLASS(NoiseTexture);
|
||||
}
|
||||
|
||||
void unregister_opensimplex_types() {
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include "regex.h"
|
||||
|
||||
void register_regex_types() {
|
||||
ClassDB::register_class<RegExMatch>();
|
||||
ClassDB::register_class<RegEx>();
|
||||
GDREGISTER_CLASS(RegExMatch);
|
||||
GDREGISTER_CLASS(RegEx);
|
||||
}
|
||||
|
||||
void unregister_regex_types() {
|
||||
|
@ -45,7 +45,7 @@ void register_stb_vorbis_types() {
|
||||
ResourceFormatImporter::get_singleton()->add_importer(ogg_import);
|
||||
}
|
||||
#endif
|
||||
ClassDB::register_class<AudioStreamOGGVorbis>();
|
||||
GDREGISTER_CLASS(AudioStreamOGGVorbis);
|
||||
}
|
||||
|
||||
void unregister_stb_vorbis_types() {
|
||||
|
@ -38,7 +38,7 @@ void register_theora_types() {
|
||||
resource_loader_theora.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_theora, true);
|
||||
|
||||
ClassDB::register_class<VideoStreamTheora>();
|
||||
GDREGISTER_CLASS(VideoStreamTheora);
|
||||
}
|
||||
|
||||
void unregister_theora_types() {
|
||||
|
@ -36,8 +36,8 @@
|
||||
#include "upnp_device.h"
|
||||
|
||||
void register_upnp_types() {
|
||||
ClassDB::register_class<UPNP>();
|
||||
ClassDB::register_class<UPNPDevice>();
|
||||
GDREGISTER_CLASS(UPNP);
|
||||
GDREGISTER_CLASS(UPNPDevice);
|
||||
}
|
||||
|
||||
void unregister_upnp_types() {
|
||||
|
@ -51,59 +51,59 @@ void register_visual_script_types() {
|
||||
//script_language_gd->init();
|
||||
ScriptServer::register_language(visual_script_language);
|
||||
|
||||
ClassDB::register_class<VisualScript>();
|
||||
ClassDB::register_virtual_class<VisualScriptNode>();
|
||||
ClassDB::register_class<VisualScriptFunctionState>();
|
||||
ClassDB::register_class<VisualScriptFunction>();
|
||||
ClassDB::register_virtual_class<VisualScriptLists>();
|
||||
ClassDB::register_class<VisualScriptComposeArray>();
|
||||
ClassDB::register_class<VisualScriptOperator>();
|
||||
ClassDB::register_class<VisualScriptVariableSet>();
|
||||
ClassDB::register_class<VisualScriptVariableGet>();
|
||||
ClassDB::register_class<VisualScriptConstant>();
|
||||
ClassDB::register_class<VisualScriptIndexGet>();
|
||||
ClassDB::register_class<VisualScriptIndexSet>();
|
||||
ClassDB::register_class<VisualScriptGlobalConstant>();
|
||||
ClassDB::register_class<VisualScriptClassConstant>();
|
||||
ClassDB::register_class<VisualScriptMathConstant>();
|
||||
ClassDB::register_class<VisualScriptBasicTypeConstant>();
|
||||
ClassDB::register_class<VisualScriptEngineSingleton>();
|
||||
ClassDB::register_class<VisualScriptSceneNode>();
|
||||
ClassDB::register_class<VisualScriptSceneTree>();
|
||||
ClassDB::register_class<VisualScriptResourcePath>();
|
||||
ClassDB::register_class<VisualScriptSelf>();
|
||||
ClassDB::register_class<VisualScriptCustomNode>();
|
||||
ClassDB::register_class<VisualScriptSubCall>();
|
||||
ClassDB::register_class<VisualScriptComment>();
|
||||
ClassDB::register_class<VisualScriptConstructor>();
|
||||
ClassDB::register_class<VisualScriptLocalVar>();
|
||||
ClassDB::register_class<VisualScriptLocalVarSet>();
|
||||
ClassDB::register_class<VisualScriptInputAction>();
|
||||
ClassDB::register_class<VisualScriptDeconstruct>();
|
||||
ClassDB::register_class<VisualScriptPreload>();
|
||||
ClassDB::register_class<VisualScriptTypeCast>();
|
||||
GDREGISTER_CLASS(VisualScript);
|
||||
GDREGISTER_VIRTUAL_CLASS(VisualScriptNode);
|
||||
GDREGISTER_CLASS(VisualScriptFunctionState);
|
||||
GDREGISTER_CLASS(VisualScriptFunction);
|
||||
GDREGISTER_VIRTUAL_CLASS(VisualScriptLists);
|
||||
GDREGISTER_CLASS(VisualScriptComposeArray);
|
||||
GDREGISTER_CLASS(VisualScriptOperator);
|
||||
GDREGISTER_CLASS(VisualScriptVariableSet);
|
||||
GDREGISTER_CLASS(VisualScriptVariableGet);
|
||||
GDREGISTER_CLASS(VisualScriptConstant);
|
||||
GDREGISTER_CLASS(VisualScriptIndexGet);
|
||||
GDREGISTER_CLASS(VisualScriptIndexSet);
|
||||
GDREGISTER_CLASS(VisualScriptGlobalConstant);
|
||||
GDREGISTER_CLASS(VisualScriptClassConstant);
|
||||
GDREGISTER_CLASS(VisualScriptMathConstant);
|
||||
GDREGISTER_CLASS(VisualScriptBasicTypeConstant);
|
||||
GDREGISTER_CLASS(VisualScriptEngineSingleton);
|
||||
GDREGISTER_CLASS(VisualScriptSceneNode);
|
||||
GDREGISTER_CLASS(VisualScriptSceneTree);
|
||||
GDREGISTER_CLASS(VisualScriptResourcePath);
|
||||
GDREGISTER_CLASS(VisualScriptSelf);
|
||||
GDREGISTER_CLASS(VisualScriptCustomNode);
|
||||
GDREGISTER_CLASS(VisualScriptSubCall);
|
||||
GDREGISTER_CLASS(VisualScriptComment);
|
||||
GDREGISTER_CLASS(VisualScriptConstructor);
|
||||
GDREGISTER_CLASS(VisualScriptLocalVar);
|
||||
GDREGISTER_CLASS(VisualScriptLocalVarSet);
|
||||
GDREGISTER_CLASS(VisualScriptInputAction);
|
||||
GDREGISTER_CLASS(VisualScriptDeconstruct);
|
||||
GDREGISTER_CLASS(VisualScriptPreload);
|
||||
GDREGISTER_CLASS(VisualScriptTypeCast);
|
||||
|
||||
ClassDB::register_class<VisualScriptFunctionCall>();
|
||||
ClassDB::register_class<VisualScriptPropertySet>();
|
||||
ClassDB::register_class<VisualScriptPropertyGet>();
|
||||
GDREGISTER_CLASS(VisualScriptFunctionCall);
|
||||
GDREGISTER_CLASS(VisualScriptPropertySet);
|
||||
GDREGISTER_CLASS(VisualScriptPropertyGet);
|
||||
//ClassDB::register_type<VisualScriptScriptCall>();
|
||||
ClassDB::register_class<VisualScriptEmitSignal>();
|
||||
GDREGISTER_CLASS(VisualScriptEmitSignal);
|
||||
|
||||
ClassDB::register_class<VisualScriptReturn>();
|
||||
ClassDB::register_class<VisualScriptCondition>();
|
||||
ClassDB::register_class<VisualScriptWhile>();
|
||||
ClassDB::register_class<VisualScriptIterator>();
|
||||
ClassDB::register_class<VisualScriptSequence>();
|
||||
//ClassDB::register_class<VisualScriptInputFilter>();
|
||||
ClassDB::register_class<VisualScriptSwitch>();
|
||||
ClassDB::register_class<VisualScriptSelect>();
|
||||
GDREGISTER_CLASS(VisualScriptReturn);
|
||||
GDREGISTER_CLASS(VisualScriptCondition);
|
||||
GDREGISTER_CLASS(VisualScriptWhile);
|
||||
GDREGISTER_CLASS(VisualScriptIterator);
|
||||
GDREGISTER_CLASS(VisualScriptSequence);
|
||||
//GDREGISTER_CLASS(VisualScriptInputFilter);
|
||||
GDREGISTER_CLASS(VisualScriptSwitch);
|
||||
GDREGISTER_CLASS(VisualScriptSelect);
|
||||
|
||||
ClassDB::register_class<VisualScriptYield>();
|
||||
ClassDB::register_class<VisualScriptYieldSignal>();
|
||||
GDREGISTER_CLASS(VisualScriptYield);
|
||||
GDREGISTER_CLASS(VisualScriptYieldSignal);
|
||||
|
||||
ClassDB::register_class<VisualScriptBuiltinFunc>();
|
||||
GDREGISTER_CLASS(VisualScriptBuiltinFunc);
|
||||
|
||||
ClassDB::register_class<VisualScriptExpression>();
|
||||
GDREGISTER_CLASS(VisualScriptExpression);
|
||||
|
||||
register_visual_script_nodes();
|
||||
register_visual_script_func_nodes();
|
||||
@ -114,7 +114,7 @@ void register_visual_script_types() {
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
ClassDB::set_current_api(ClassDB::API_EDITOR);
|
||||
ClassDB::register_class<_VisualScriptEditor>();
|
||||
GDREGISTER_CLASS(_VisualScriptEditor);
|
||||
ClassDB::set_current_api(ClassDB::API_CORE);
|
||||
vs_editor_singleton = memnew(_VisualScriptEditor);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("VisualScriptEditor", _VisualScriptEditor::get_singleton()));
|
||||
|
@ -38,7 +38,7 @@ void register_webm_types() {
|
||||
resource_loader_webm.instantiate();
|
||||
ResourceLoader::add_resource_format_loader(resource_loader_webm, true);
|
||||
|
||||
ClassDB::register_class<VideoStreamWebm>();
|
||||
GDREGISTER_CLASS(VideoStreamWebm);
|
||||
}
|
||||
|
||||
void unregister_webm_types() {
|
||||
|
@ -58,11 +58,11 @@ void register_webrtc_types() {
|
||||
|
||||
ClassDB::register_custom_instance_class<WebRTCPeerConnection>();
|
||||
#ifdef WEBRTC_GDNATIVE_ENABLED
|
||||
ClassDB::register_class<WebRTCPeerConnectionGDNative>();
|
||||
ClassDB::register_class<WebRTCDataChannelGDNative>();
|
||||
GDREGISTER_CLASS(WebRTCPeerConnectionGDNative);
|
||||
GDREGISTER_CLASS(WebRTCDataChannelGDNative);
|
||||
#endif
|
||||
ClassDB::register_virtual_class<WebRTCDataChannel>();
|
||||
ClassDB::register_class<WebRTCMultiplayerPeer>();
|
||||
GDREGISTER_VIRTUAL_CLASS(WebRTCDataChannel);
|
||||
GDREGISTER_CLASS(WebRTCMultiplayerPeer);
|
||||
}
|
||||
|
||||
void unregister_webrtc_types() {}
|
||||
|
@ -63,7 +63,7 @@ void register_websocket_types() {
|
||||
WSLServer::make_default();
|
||||
#endif
|
||||
|
||||
ClassDB::register_virtual_class<WebSocketMultiplayerPeer>();
|
||||
GDREGISTER_VIRTUAL_CLASS(WebSocketMultiplayerPeer);
|
||||
ClassDB::register_custom_instance_class<WebSocketServer>();
|
||||
ClassDB::register_custom_instance_class<WebSocketClient>();
|
||||
ClassDB::register_custom_instance_class<WebSocketPeer>();
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "webxr_interface_js.h"
|
||||
|
||||
void register_webxr_types() {
|
||||
ClassDB::register_virtual_class<WebXRInterface>();
|
||||
GDREGISTER_VIRTUAL_CLASS(WebXRInterface);
|
||||
|
||||
#ifdef JAVASCRIPT_ENABLED
|
||||
Ref<WebXRInterfaceJS> webxr;
|
||||
|
@ -44,11 +44,11 @@ void register_android_api() {
|
||||
// `JNISingleton` registration occurs in
|
||||
// `platform/android/java_godot_lib_jni.cpp#Java_org_godotengine_godot_GodotLib_setup`
|
||||
java_class_wrapper = memnew(JavaClassWrapper); // Dummy
|
||||
ClassDB::register_class<JNISingleton>();
|
||||
GDREGISTER_CLASS(JNISingleton);
|
||||
#endif
|
||||
|
||||
ClassDB::register_class<JavaClass>();
|
||||
ClassDB::register_class<JavaClassWrapper>();
|
||||
GDREGISTER_CLASS(JavaClass);
|
||||
GDREGISTER_CLASS(JavaClassWrapper);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("JavaClassWrapper", JavaClassWrapper::get_singleton()));
|
||||
}
|
||||
|
||||
|
@ -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()));
|
||||
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) {
|
||||
|
@ -37,8 +37,8 @@ static JavaScript *javascript_eval;
|
||||
|
||||
void register_javascript_api() {
|
||||
JavaScriptToolsEditorPlugin::initialize();
|
||||
ClassDB::register_virtual_class<JavaScriptObject>();
|
||||
ClassDB::register_virtual_class<JavaScript>();
|
||||
GDREGISTER_VIRTUAL_CLASS(JavaScriptObject);
|
||||
GDREGISTER_VIRTUAL_CLASS(JavaScript);
|
||||
javascript_eval = memnew(JavaScript);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("JavaScript", javascript_eval));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -120,106 +120,106 @@ void preregister_server_types() {
|
||||
void register_server_types() {
|
||||
OS::get_singleton()->set_has_server_feature_callback(has_server_feature_callback);
|
||||
|
||||
ClassDB::register_virtual_class<DisplayServer>();
|
||||
ClassDB::register_virtual_class<RenderingServer>();
|
||||
ClassDB::register_class<AudioServer>();
|
||||
GDREGISTER_VIRTUAL_CLASS(DisplayServer);
|
||||
GDREGISTER_VIRTUAL_CLASS(RenderingServer);
|
||||
GDREGISTER_CLASS(AudioServer);
|
||||
|
||||
ClassDB::register_class<TextServerManager>();
|
||||
ClassDB::register_virtual_class<TextServer>();
|
||||
GDREGISTER_CLASS(TextServerManager);
|
||||
GDREGISTER_VIRTUAL_CLASS(TextServer);
|
||||
TextServer::initialize_hex_code_box_fonts();
|
||||
|
||||
ClassDB::register_virtual_class<PhysicsServer2D>();
|
||||
ClassDB::register_virtual_class<PhysicsServer3D>();
|
||||
ClassDB::register_virtual_class<NavigationServer2D>();
|
||||
ClassDB::register_virtual_class<NavigationServer3D>();
|
||||
ClassDB::register_class<XRServer>();
|
||||
ClassDB::register_class<CameraServer>();
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsServer2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsServer3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(NavigationServer2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(NavigationServer3D);
|
||||
GDREGISTER_CLASS(XRServer);
|
||||
GDREGISTER_CLASS(CameraServer);
|
||||
|
||||
ClassDB::register_virtual_class<RenderingDevice>();
|
||||
GDREGISTER_VIRTUAL_CLASS(RenderingDevice);
|
||||
|
||||
ClassDB::register_virtual_class<XRInterface>();
|
||||
ClassDB::register_class<XRPositionalTracker>();
|
||||
GDREGISTER_VIRTUAL_CLASS(XRInterface);
|
||||
GDREGISTER_CLASS(XRPositionalTracker);
|
||||
|
||||
ClassDB::register_virtual_class<AudioStream>();
|
||||
ClassDB::register_virtual_class<AudioStreamPlayback>();
|
||||
ClassDB::register_virtual_class<AudioStreamPlaybackResampled>();
|
||||
ClassDB::register_class<AudioStreamMicrophone>();
|
||||
ClassDB::register_class<AudioStreamRandomPitch>();
|
||||
ClassDB::register_virtual_class<AudioEffect>();
|
||||
ClassDB::register_virtual_class<AudioEffectInstance>();
|
||||
ClassDB::register_class<AudioEffectEQ>();
|
||||
ClassDB::register_class<AudioEffectFilter>();
|
||||
ClassDB::register_class<AudioBusLayout>();
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioStream);
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioStreamPlayback);
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioStreamPlaybackResampled);
|
||||
GDREGISTER_CLASS(AudioStreamMicrophone);
|
||||
GDREGISTER_CLASS(AudioStreamRandomPitch);
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioEffect);
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioEffectInstance);
|
||||
GDREGISTER_CLASS(AudioEffectEQ);
|
||||
GDREGISTER_CLASS(AudioEffectFilter);
|
||||
GDREGISTER_CLASS(AudioBusLayout);
|
||||
|
||||
ClassDB::register_class<AudioStreamGenerator>();
|
||||
ClassDB::register_virtual_class<AudioStreamGeneratorPlayback>();
|
||||
GDREGISTER_CLASS(AudioStreamGenerator);
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioStreamGeneratorPlayback);
|
||||
|
||||
{
|
||||
//audio effects
|
||||
ClassDB::register_class<AudioEffectAmplify>();
|
||||
GDREGISTER_CLASS(AudioEffectAmplify);
|
||||
|
||||
ClassDB::register_class<AudioEffectReverb>();
|
||||
GDREGISTER_CLASS(AudioEffectReverb);
|
||||
|
||||
ClassDB::register_class<AudioEffectLowPassFilter>();
|
||||
ClassDB::register_class<AudioEffectHighPassFilter>();
|
||||
ClassDB::register_class<AudioEffectBandPassFilter>();
|
||||
ClassDB::register_class<AudioEffectNotchFilter>();
|
||||
ClassDB::register_class<AudioEffectBandLimitFilter>();
|
||||
ClassDB::register_class<AudioEffectLowShelfFilter>();
|
||||
ClassDB::register_class<AudioEffectHighShelfFilter>();
|
||||
GDREGISTER_CLASS(AudioEffectLowPassFilter);
|
||||
GDREGISTER_CLASS(AudioEffectHighPassFilter);
|
||||
GDREGISTER_CLASS(AudioEffectBandPassFilter);
|
||||
GDREGISTER_CLASS(AudioEffectNotchFilter);
|
||||
GDREGISTER_CLASS(AudioEffectBandLimitFilter);
|
||||
GDREGISTER_CLASS(AudioEffectLowShelfFilter);
|
||||
GDREGISTER_CLASS(AudioEffectHighShelfFilter);
|
||||
|
||||
ClassDB::register_class<AudioEffectEQ6>();
|
||||
ClassDB::register_class<AudioEffectEQ10>();
|
||||
ClassDB::register_class<AudioEffectEQ21>();
|
||||
GDREGISTER_CLASS(AudioEffectEQ6);
|
||||
GDREGISTER_CLASS(AudioEffectEQ10);
|
||||
GDREGISTER_CLASS(AudioEffectEQ21);
|
||||
|
||||
ClassDB::register_class<AudioEffectDistortion>();
|
||||
GDREGISTER_CLASS(AudioEffectDistortion);
|
||||
|
||||
ClassDB::register_class<AudioEffectStereoEnhance>();
|
||||
GDREGISTER_CLASS(AudioEffectStereoEnhance);
|
||||
|
||||
ClassDB::register_class<AudioEffectPanner>();
|
||||
ClassDB::register_class<AudioEffectChorus>();
|
||||
ClassDB::register_class<AudioEffectDelay>();
|
||||
ClassDB::register_class<AudioEffectCompressor>();
|
||||
ClassDB::register_class<AudioEffectLimiter>();
|
||||
ClassDB::register_class<AudioEffectPitchShift>();
|
||||
ClassDB::register_class<AudioEffectPhaser>();
|
||||
GDREGISTER_CLASS(AudioEffectPanner);
|
||||
GDREGISTER_CLASS(AudioEffectChorus);
|
||||
GDREGISTER_CLASS(AudioEffectDelay);
|
||||
GDREGISTER_CLASS(AudioEffectCompressor);
|
||||
GDREGISTER_CLASS(AudioEffectLimiter);
|
||||
GDREGISTER_CLASS(AudioEffectPitchShift);
|
||||
GDREGISTER_CLASS(AudioEffectPhaser);
|
||||
|
||||
ClassDB::register_class<AudioEffectRecord>();
|
||||
ClassDB::register_class<AudioEffectSpectrumAnalyzer>();
|
||||
ClassDB::register_virtual_class<AudioEffectSpectrumAnalyzerInstance>();
|
||||
GDREGISTER_CLASS(AudioEffectRecord);
|
||||
GDREGISTER_CLASS(AudioEffectSpectrumAnalyzer);
|
||||
GDREGISTER_VIRTUAL_CLASS(AudioEffectSpectrumAnalyzerInstance);
|
||||
|
||||
ClassDB::register_class<AudioEffectCapture>();
|
||||
GDREGISTER_CLASS(AudioEffectCapture);
|
||||
}
|
||||
|
||||
ClassDB::register_virtual_class<RenderingDevice>();
|
||||
ClassDB::register_class<RDTextureFormat>();
|
||||
ClassDB::register_class<RDTextureView>();
|
||||
ClassDB::register_class<RDAttachmentFormat>();
|
||||
ClassDB::register_class<RDFramebufferPass>();
|
||||
ClassDB::register_class<RDSamplerState>();
|
||||
ClassDB::register_class<RDVertexAttribute>();
|
||||
ClassDB::register_class<RDUniform>();
|
||||
ClassDB::register_class<RDPipelineRasterizationState>();
|
||||
ClassDB::register_class<RDPipelineMultisampleState>();
|
||||
ClassDB::register_class<RDPipelineDepthStencilState>();
|
||||
ClassDB::register_class<RDPipelineColorBlendStateAttachment>();
|
||||
ClassDB::register_class<RDPipelineColorBlendState>();
|
||||
ClassDB::register_class<RDShaderSource>();
|
||||
ClassDB::register_class<RDShaderBytecode>();
|
||||
ClassDB::register_class<RDShaderFile>();
|
||||
ClassDB::register_class<RDPipelineSpecializationConstant>();
|
||||
GDREGISTER_VIRTUAL_CLASS(RenderingDevice);
|
||||
GDREGISTER_CLASS(RDTextureFormat);
|
||||
GDREGISTER_CLASS(RDTextureView);
|
||||
GDREGISTER_CLASS(RDAttachmentFormat);
|
||||
GDREGISTER_CLASS(RDFramebufferPass);
|
||||
GDREGISTER_CLASS(RDSamplerState);
|
||||
GDREGISTER_CLASS(RDVertexAttribute);
|
||||
GDREGISTER_CLASS(RDUniform);
|
||||
GDREGISTER_CLASS(RDPipelineRasterizationState);
|
||||
GDREGISTER_CLASS(RDPipelineMultisampleState);
|
||||
GDREGISTER_CLASS(RDPipelineDepthStencilState);
|
||||
GDREGISTER_CLASS(RDPipelineColorBlendStateAttachment);
|
||||
GDREGISTER_CLASS(RDPipelineColorBlendState);
|
||||
GDREGISTER_CLASS(RDShaderSource);
|
||||
GDREGISTER_CLASS(RDShaderBytecode);
|
||||
GDREGISTER_CLASS(RDShaderFile);
|
||||
GDREGISTER_CLASS(RDPipelineSpecializationConstant);
|
||||
|
||||
ClassDB::register_class<CameraFeed>();
|
||||
GDREGISTER_CLASS(CameraFeed);
|
||||
|
||||
ClassDB::register_virtual_class<PhysicsDirectBodyState2D>();
|
||||
ClassDB::register_virtual_class<PhysicsDirectSpaceState2D>();
|
||||
ClassDB::register_class<PhysicsTestMotionResult2D>();
|
||||
ClassDB::register_class<PhysicsShapeQueryParameters2D>();
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState2D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState2D);
|
||||
GDREGISTER_CLASS(PhysicsTestMotionResult2D);
|
||||
GDREGISTER_CLASS(PhysicsShapeQueryParameters2D);
|
||||
|
||||
ClassDB::register_class<PhysicsShapeQueryParameters3D>();
|
||||
ClassDB::register_virtual_class<PhysicsDirectBodyState3D>();
|
||||
ClassDB::register_virtual_class<PhysicsDirectSpaceState3D>();
|
||||
ClassDB::register_class<PhysicsTestMotionResult3D>();
|
||||
GDREGISTER_CLASS(PhysicsShapeQueryParameters3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState3D);
|
||||
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState3D);
|
||||
GDREGISTER_CLASS(PhysicsTestMotionResult3D);
|
||||
|
||||
// Physics 2D
|
||||
GLOBAL_DEF(PhysicsServer2DManager::setting_property_name, "DEFAULT");
|
||||
|
@ -206,7 +206,7 @@ TEST_CASE("[Object] Script instance property getter") {
|
||||
}
|
||||
|
||||
TEST_CASE("[Object] Built-in property setter") {
|
||||
ClassDB::register_class<_TestDerivedObject>();
|
||||
GDREGISTER_CLASS(_TestDerivedObject);
|
||||
_TestDerivedObject derived_object;
|
||||
|
||||
bool valid = false;
|
||||
@ -218,7 +218,7 @@ TEST_CASE("[Object] Built-in property setter") {
|
||||
}
|
||||
|
||||
TEST_CASE("[Object] Built-in property getter") {
|
||||
ClassDB::register_class<_TestDerivedObject>();
|
||||
GDREGISTER_CLASS(_TestDerivedObject);
|
||||
_TestDerivedObject derived_object;
|
||||
derived_object.set_property(100);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user