/*************************************************************************/ /* register_core_types.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_core_types.h" #include "core/bind/core_bind.h" #include "core/class_db.h" #include "core/compressed_translation.h" #include "core/core_string_names.h" #include "core/crypto/crypto.h" #include "core/crypto/hashing_context.h" #include "core/engine.h" #include "core/func_ref.h" #include "core/input_map.h" #include "core/io/config_file.h" #include "core/io/dtls_server.h" #include "core/io/http_client.h" #include "core/io/image_loader.h" #include "core/io/marshalls.h" #include "core/io/multiplayer_api.h" #include "core/io/networked_multiplayer_peer.h" #include "core/io/packet_peer.h" #include "core/io/packet_peer_dtls.h" #include "core/io/packet_peer_udp.h" #include "core/io/pck_packer.h" #include "core/io/resource_format_binary.h" #include "core/io/resource_importer.h" #include "core/io/stream_peer_ssl.h" #include "core/io/tcp_server.h" #include "core/io/translation_loader_po.h" #include "core/io/udp_server.h" #include "core/io/xml_parser.h" #include "core/math/a_star.h" #include "core/math/expression.h" #include "core/math/geometry.h" #include "core/math/random_number_generator.h" #include "core/math/triangle_mesh.h" #include "core/os/input.h" #include "core/os/main_loop.h" #include "core/packed_data_container.h" #include "core/path_remap.h" #include "core/project_settings.h" #include "core/translation.h" #include "core/undo_redo.h" static Ref resource_saver_binary; static Ref resource_loader_binary; static Ref resource_format_importer; static Ref resource_format_image; static Ref resource_format_po; static Ref resource_format_saver_crypto; static Ref resource_format_loader_crypto; static _ResourceLoader *_resource_loader = NULL; static _ResourceSaver *_resource_saver = NULL; static _OS *_os = NULL; static _Engine *_engine = NULL; static _ClassDB *_classdb = NULL; static _Marshalls *_marshalls = NULL; static _JSON *_json = NULL; static IP *ip = NULL; static _Geometry *_geometry = NULL; extern Mutex _global_mutex; extern void register_global_constants(); extern void unregister_global_constants(); extern void register_variant_methods(); extern void unregister_variant_methods(); void register_core_types() { //consistency check ERR_FAIL_COND(sizeof(Callable) > 16); ObjectDB::setup(); ResourceCache::setup(); StringName::setup(); ResourceLoader::initialize(); register_global_constants(); register_variant_methods(); CoreStringNames::create(); resource_format_po.instance(); ResourceLoader::add_resource_format_loader(resource_format_po); resource_saver_binary.instance(); ResourceSaver::add_resource_format_saver(resource_saver_binary); resource_loader_binary.instance(); ResourceLoader::add_resource_format_loader(resource_loader_binary); resource_format_importer.instance(); ResourceLoader::add_resource_format_loader(resource_format_importer); resource_format_image.instance(); ResourceLoader::add_resource_format_loader(resource_format_image); ClassDB::register_class(); ClassDB::register_virtual_class