diff options
701 files changed, 5528 insertions, 2716 deletions
diff --git a/.travis.yml b/.travis.yml index 409c870e79..974ef93d3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,12 +20,12 @@ matrix: #- env: GODOT_TARGET=windows TOOLS=yes # os: linux # compiler: gcc + - env: GODOT_TARGET=android TOOLS=no + os: linux + compiler: gcc - env: GODOT_TARGET=osx TOOLS=yes os: osx compiler: clang - #- env: GODOT_TARGET=android TOOLS=no - # os: osx - # compiler: clang #- env: GODOT_TARGET=iphone TOOLS=no # os: osx # compiler: clang @@ -61,15 +61,29 @@ addons: # For style checks. - clang-format-3.9 +install: + - if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$GODOT_TARGET" = "android" ]; then + misc/travis/android-tools-linux.sh; + fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then + misc/travis/scons-local-osx.sh; + misc/travis/ccache-osx.sh; + fi + - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then + misc/travis/android-tools-osx.sh; + fi + before_script: + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then + export CCACHE="/usr/bin/ccache"; + fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then - brew update; brew install scons ccache; + export CCACHE="/usr/local/bin/ccache"; export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then - brew update; brew install -v android-sdk; - brew install -v android-ndk | grep -v "inflating:" | grep -v "creating:"; - export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk; + - if [ "$GODOT_TARGET" = "android" ]; then + export ANDROID_HOME=$TRAVIS_BUILD_DIR/godot-dev/build-tools/android-sdk; + export ANDROID_NDK_ROOT=$TRAVIS_BUILD_DIR/godot-dev/build-tools/android-ndk; fi script: @@ -78,3 +92,10 @@ script: else scons -j2 CC=$CC CXX=$CXX platform=$GODOT_TARGET TOOLS=$TOOLS verbose=yes progress=no; fi + +after_success: + - if [ "$STATIC_CHECKS" != "yes" ] && [ $(command -v ccache) ]; then + which ccache; + ccache --version | grep "ccache version"; + ccache -s; + fi; diff --git a/SConstruct b/SConstruct index 9d536e0d16..10982211ac 100644 --- a/SConstruct +++ b/SConstruct @@ -1,4 +1,3 @@ - #!/usr/bin/env python EnsureSConsVersion(0, 98, 1) @@ -271,9 +270,12 @@ if selected_platform in platform_list: if len(pieces) > 0: basename = pieces[0] basename = basename.replace('\\\\', '/') - env.vs_srcs = env.vs_srcs + [basename + ".cpp"] - env.vs_incs = env.vs_incs + [basename + ".h"] - # print basename + if os.path.isfile(basename + ".h"): + env.vs_incs = env.vs_incs + [basename + ".h"] + if os.path.isfile(basename + ".c"): + env.vs_srcs = env.vs_srcs + [basename + ".c"] + elif os.path.isfile(basename + ".cpp"): + env.vs_srcs = env.vs_srcs + [basename + ".cpp"] env.AddToVSProject = AddToVSProject env.extra_suffix = "" @@ -367,7 +369,7 @@ if selected_platform in platform_list: sys.modules.pop('detect') env.module_list = [] - env.doc_class_path={} + env.doc_class_path = {} for x in module_list: if not env['module_' + x + '_enabled']: @@ -383,11 +385,10 @@ if selected_platform in platform_list: doc_classes = config.get_doc_classes() doc_path = config.get_doc_path() for c in doc_classes: - env.doc_class_path[c]="modules/"+x+"/"+doc_path + env.doc_class_path[c] = "modules/" + x + "/" + doc_path except: pass - sys.path.remove(tmppath) sys.modules.pop('config') diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index c369f4bffe..e1adb250e7 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2592,6 +2592,16 @@ bool _Engine::is_in_physics_frame() const { return Engine::get_singleton()->is_in_physics_frame(); } +bool _Engine::has_singleton(const String &p_name) const { + + return Engine::get_singleton()->has_singleton(p_name); +} + +Object *_Engine::get_singleton_object(const String &p_name) const { + + return Engine::get_singleton()->get_singleton_object(p_name); +} + void _Engine::set_editor_hint(bool p_enabled) { Engine::get_singleton()->set_editor_hint(p_enabled); @@ -2621,6 +2631,9 @@ void _Engine::_bind_methods() { ClassDB::bind_method(D_METHOD("is_in_physics_frame"), &_Engine::is_in_physics_frame); + ClassDB::bind_method(D_METHOD("has_singleton", "name"), &_Engine::has_singleton); + ClassDB::bind_method(D_METHOD("get_singleton", "name"), &_Engine::get_singleton_object); + ClassDB::bind_method(D_METHOD("set_editor_hint", "enabled"), &_Engine::set_editor_hint); ClassDB::bind_method(D_METHOD("is_editor_hint"), &_Engine::is_editor_hint); } diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index bbbb40d926..9be8895443 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -670,6 +670,9 @@ public: bool is_in_physics_frame() const; + bool has_singleton(const String &p_name) const; + Object *get_singleton_object(const String &p_name) const; + void set_editor_hint(bool p_enabled); bool is_editor_hint() const; diff --git a/core/engine.cpp b/core/engine.cpp index c609ae9520..31abcd62ef 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -100,6 +100,31 @@ Dictionary Engine::get_version_info() const { return dict; } +void Engine::add_singleton(const Singleton &p_singleton) { + + singletons.push_back(p_singleton); + singleton_ptrs[p_singleton.name] = p_singleton.ptr; +} + +Object *Engine::get_singleton_object(const String &p_name) const { + + const Map<StringName, Object *>::Element *E = singleton_ptrs.find(p_name); + ERR_EXPLAIN("Failed to retrieve non-existent singleton '" + p_name + "'"); + ERR_FAIL_COND_V(!E, NULL); + return E->get(); +}; + +bool Engine::has_singleton(const String &p_name) const { + + return singleton_ptrs.has(p_name); +}; + +void Engine::get_singletons(List<Singleton> *p_singletons) { + + for (List<Singleton>::Element *E = singletons.front(); E; E = E->next()) + p_singletons->push_back(E->get()); +} + Engine *Engine::singleton = NULL; Engine *Engine::get_singleton() { diff --git a/core/engine.h b/core/engine.h index 3b4979582f..4a573c1539 100644 --- a/core/engine.h +++ b/core/engine.h @@ -37,6 +37,17 @@ class Engine { +public: + struct Singleton { + StringName name; + Object *ptr; + Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) + : name(p_name), + ptr(p_ptr) { + } + }; + +private: friend class Main; uint64_t frames_drawn; @@ -54,6 +65,9 @@ class Engine { uint64_t _idle_frames; bool _in_physics; + List<Singleton> singletons; + Map<StringName, Object *> singleton_ptrs; + bool editor_hint; static Engine *singleton; @@ -83,6 +97,11 @@ public: void set_frame_delay(uint32_t p_msec); uint32_t get_frame_delay() const; + void add_singleton(const Singleton &p_singleton); + void get_singletons(List<Singleton> *p_singletons); + bool has_singleton(const String &p_name) const; + Object *get_singleton_object(const String &p_name) const; + _FORCE_INLINE_ bool get_use_pixel_snap() const { return _pixel_snap; } #ifdef TOOLS_ENABLED diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 46d52384e5..5097898314 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -30,6 +30,7 @@ #include "http_client.h" #include "io/stream_peer_ssl.h" +#ifndef JAVASCRIPT_ENABLED Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, bool p_verify_host) { close(); @@ -405,38 +406,6 @@ Error HTTPClient::poll() { return OK; } -Dictionary HTTPClient::_get_response_headers_as_dictionary() { - - List<String> rh; - get_response_headers(&rh); - Dictionary ret; - for (const List<String>::Element *E = rh.front(); E; E = E->next()) { - String s = E->get(); - int sp = s.find(":"); - if (sp == -1) - continue; - String key = s.substr(0, sp).strip_edges(); - String value = s.substr(sp + 1, s.length()).strip_edges(); - ret[key] = value; - } - - return ret; -} - -PoolStringArray HTTPClient::_get_response_headers() { - - List<String> rh; - get_response_headers(&rh); - PoolStringArray ret; - ret.resize(rh.size()); - int idx = 0; - for (const List<String>::Element *E = rh.front(); E; E = E->next()) { - ret.set(idx++, E->get()); - } - - return ret; -} - int HTTPClient::get_response_body_length() const { return body_size; @@ -612,6 +581,74 @@ Error HTTPClient::_get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received } } +void HTTPClient::set_read_chunk_size(int p_size) { + ERR_FAIL_COND(p_size < 256 || p_size > (1 << 24)); + read_chunk_size = p_size; +} + +HTTPClient::HTTPClient() { + + tcp_connection = StreamPeerTCP::create_ref(); + resolving = IP::RESOLVER_INVALID_ID; + status = STATUS_DISCONNECTED; + conn_port = 80; + body_size = 0; + chunked = false; + body_left = 0; + chunk_left = 0; + response_num = 0; + ssl = false; + blocking = false; + read_chunk_size = 4096; +} + +HTTPClient::~HTTPClient() { +} + +#endif // #ifndef JAVASCRIPT_ENABLED + +String HTTPClient::query_string_from_dict(const Dictionary &p_dict) { + String query = ""; + Array keys = p_dict.keys(); + for (int i = 0; i < keys.size(); ++i) { + query += "&" + String(keys[i]).http_escape() + "=" + String(p_dict[keys[i]]).http_escape(); + } + query.erase(0, 1); + return query; +} + +Dictionary HTTPClient::_get_response_headers_as_dictionary() { + + List<String> rh; + get_response_headers(&rh); + Dictionary ret; + for (const List<String>::Element *E = rh.front(); E; E = E->next()) { + String s = E->get(); + int sp = s.find(":"); + if (sp == -1) + continue; + String key = s.substr(0, sp).strip_edges(); + String value = s.substr(sp + 1, s.length()).strip_edges(); + ret[key] = value; + } + + return ret; +} + +PoolStringArray HTTPClient::_get_response_headers() { + + List<String> rh; + get_response_headers(&rh); + PoolStringArray ret; + ret.resize(rh.size()); + int idx = 0; + for (const List<String>::Element *E = rh.front(); E; E = E->next()) { + ret.set(idx++, E->get()); + } + + return ret; +} + void HTTPClient::_bind_methods() { ClassDB::bind_method(D_METHOD("connect_to_host", "host", "port", "use_ssl", "verify_host"), &HTTPClient::connect_to_host, DEFVAL(false), DEFVAL(true)); @@ -717,37 +754,3 @@ void HTTPClient::_bind_methods() { BIND_ENUM_CONSTANT(RESPONSE_INSUFFICIENT_STORAGE); BIND_ENUM_CONSTANT(RESPONSE_NOT_EXTENDED); } - -void HTTPClient::set_read_chunk_size(int p_size) { - ERR_FAIL_COND(p_size < 256 || p_size > (1 << 24)); - read_chunk_size = p_size; -} - -String HTTPClient::query_string_from_dict(const Dictionary &p_dict) { - String query = ""; - Array keys = p_dict.keys(); - for (int i = 0; i < keys.size(); ++i) { - query += "&" + String(keys[i]).http_escape() + "=" + String(p_dict[keys[i]]).http_escape(); - } - query.erase(0, 1); - return query; -} - -HTTPClient::HTTPClient() { - - tcp_connection = StreamPeerTCP::create_ref(); - resolving = IP::RESOLVER_INVALID_ID; - status = STATUS_DISCONNECTED; - conn_port = 80; - body_size = 0; - chunked = false; - body_left = 0; - chunk_left = 0; - response_num = 0; - ssl = false; - blocking = false; - read_chunk_size = 4096; -} - -HTTPClient::~HTTPClient() { -} diff --git a/core/io/http_client.h b/core/io/http_client.h index f8a3349e6e..db5dd115bd 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -131,6 +131,7 @@ public: }; private: +#ifndef JAVASCRIPT_ENABLED Status status; IP::ResolverID resolving; int conn_port; @@ -152,13 +153,18 @@ private: int response_num; Vector<String> response_headers; + int read_chunk_size; + + Error _get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received); + +#else +#include "platform/javascript/http_client.h.inc" +#endif - static void _bind_methods(); PoolStringArray _get_response_headers(); Dictionary _get_response_headers_as_dictionary(); - int read_chunk_size; - Error _get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received); + static void _bind_methods(); public: //Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index d5135fe414..bc0b3717ed 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -39,6 +39,7 @@ #include <math.h> #define Math_PI 3.14159265358979323846 +#define Math_TAU 6.28318530717958647692 #define Math_SQRT12 0.7071067811865475244008443621048490 #define Math_LN2 0.693147180559945309417 #define Math_INF INFINITY diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 2e4fc26784..65a6f2b83c 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -776,32 +776,6 @@ Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) { return ret; } -void ProjectSettings::add_singleton(const Singleton &p_singleton) { - - singletons.push_back(p_singleton); - singleton_ptrs[p_singleton.name] = p_singleton.ptr; -} - -Object *ProjectSettings::get_singleton_object(const String &p_name) const { - - const Map<StringName, Object *>::Element *E = singleton_ptrs.find(p_name); - if (!E) - return NULL; - else - return E->get(); -}; - -bool ProjectSettings::has_singleton(const String &p_name) const { - - return get_singleton_object(p_name) != NULL; -}; - -void ProjectSettings::get_singletons(List<Singleton> *p_singletons) { - - for (List<Singleton>::Element *E = singletons.front(); E; E = E->next()) - p_singletons->push_back(E->get()); -} - Vector<String> ProjectSettings::get_optimizer_presets() const { List<PropertyInfo> pi; @@ -893,8 +867,6 @@ void ProjectSettings::_bind_methods() { ClassDB::bind_method(D_METHOD("localize_path", "path"), &ProjectSettings::localize_path); ClassDB::bind_method(D_METHOD("globalize_path", "path"), &ProjectSettings::globalize_path); ClassDB::bind_method(D_METHOD("save"), &ProjectSettings::save); - ClassDB::bind_method(D_METHOD("has_singleton", "name"), &ProjectSettings::has_singleton); - ClassDB::bind_method(D_METHOD("get_singleton", "name"), &ProjectSettings::get_singleton_object); ClassDB::bind_method(D_METHOD("load_resource_pack", "pack"), &ProjectSettings::_load_resource_pack); ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &ProjectSettings::property_can_revert); ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &ProjectSettings::property_get_revert); diff --git a/core/project_settings.h b/core/project_settings.h index f75cad815f..1c4078cebb 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -45,14 +45,6 @@ class ProjectSettings : public Object { public: typedef Map<String, Variant> CustomMap; - struct Singleton { - StringName name; - Object *ptr; - Singleton(const StringName &p_name = StringName(), Object *p_ptr = NULL) - : name(p_name), - ptr(p_ptr) { - } - }; enum { //properties that are not for built in values begin from this value, so builtin ones are displayed first NO_BUILTIN_ORDER_BASE = 1 << 16 @@ -106,9 +98,6 @@ protected: Error _save_settings_text(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String()); Error _save_settings_binary(const String &p_file, const Map<String, List<String> > &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String()); - List<Singleton> singletons; - Map<StringName, Object *> singleton_ptrs; - Error _save_custom_bnd(const String &p_file); bool _load_resource_pack(const String &p_pack); @@ -145,17 +134,11 @@ public: Error save(); void set_custom_property_info(const String &p_prop, const PropertyInfo &p_info); - void add_singleton(const Singleton &p_singleton); - void get_singletons(List<Singleton> *p_singletons); - - bool has_singleton(const String &p_name) const; - Vector<String> get_optimizer_presets() const; List<String> get_input_presets() const { return input_presets; } void set_disable_feature_overrides(bool p_disable); - Object *get_singleton_object(const String &p_name) const; void register_global_defaults(); diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index c6d7cd44e8..baaf738b42 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -34,6 +34,7 @@ #include "compressed_translation.h" #include "core/io/xml_parser.h" #include "core_string_names.h" +#include "engine.h" #include "func_ref.h" #include "geometry.h" #include "input_map.h" @@ -203,19 +204,19 @@ void register_core_singletons() { ClassDB::register_class<InputMap>(); ClassDB::register_class<_JSON>(); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ProjectSettings", ProjectSettings::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("IP", IP::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Geometry", _Geometry::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ResourceLoader", _ResourceLoader::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ResourceSaver", _ResourceSaver::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("OS", _OS::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Engine", _Engine::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ClassDB", _classdb)); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Marshalls", _Marshalls::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("TranslationServer", TranslationServer::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Input", Input::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InputMap", InputMap::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JSON", _JSON::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("ProjectSettings", ProjectSettings::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("IP", IP::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("Geometry", _Geometry::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("ResourceLoader", _ResourceLoader::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("ResourceSaver", _ResourceSaver::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("OS", _OS::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("Engine", _Engine::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("ClassDB", _classdb)); + Engine::get_singleton()->add_singleton(Engine::Singleton("Marshalls", _Marshalls::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("TranslationServer", TranslationServer::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("Input", Input::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("InputMap", InputMap::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("JSON", _JSON::get_singleton())); } void unregister_core_types() { diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 2feb068ecb..f77fb116c7 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "script_debugger_remote.h" +#include "engine.h" #include "io/ip.h" #include "io/marshalls.h" #include "os/input.h" @@ -939,7 +940,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() tcp_client(StreamPeerTCP::create_ref()), packet_peer_stream(Ref<PacketPeerStream>(memnew(PacketPeerStream))), last_perf_time(0), - performance(ProjectSettings::get_singleton()->get_singleton_object("Performance")), + performance(Engine::get_singleton()->get_singleton_object("Performance")), requested_quit(false), mutex(Mutex::create()), max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index 9c1d9a1aa2..3f2d0c71e7 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@GDScript" category="Core" version="3.0.alpha.custom_build"> +<class name="@GDScript" category="Core" version="3.0-alpha"> <brief_description> Built-in GDScript functions. </brief_description> @@ -196,7 +196,7 @@ <argument index="1" name="type" type="int"> </argument> <description> - Converts from a type to another in the best way possible. The [code]type[/code] parameter uses the enum TYPE_* in [@Global Scope]. + Converts from a type to another in the best way possible. The [code]type[/code] parameter uses the enum TYPE_* in [@GlobalScope]. [codeblock] a = Vector2(1, 0) # prints 1 @@ -984,7 +984,7 @@ <argument index="0" name="what" type="Variant"> </argument> <description> - Returns the internal type of the given Variant object, using the TYPE_* enum in [@Global Scope]. + Returns the internal type of the given Variant object, using the TYPE_* enum in [@GlobalScope]. [codeblock] p = parse_json('["a", "b", "c"]') if typeof(p) == TYPE_ARRAY: @@ -1117,7 +1117,10 @@ </methods> <constants> <constant name="PI" value="3.141593" enum=""> - Constant that represents how many times the diameter of a circumference fits around its perimeter. + Constant that represents how many times the diameter of a circle fits around its perimeter. + </constant> + <constant name="TAU" value="6.283185" enum=""> + The circle constant, the circumference of the unit circle. </constant> <constant name="INF" value="inf" enum=""> A positive infinity. (For negative infinity, use -INF). diff --git a/doc/classes/@Global Scope.xml b/doc/classes/@GlobalScope.xml index 20f323bb4f..258b06f320 100644 --- a/doc/classes/@Global Scope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@Global Scope" category="Core" version="3.0.alpha.custom_build"> +<class name="@GlobalScope" category="Core" version="3.0-alpha"> <brief_description> Global scope constants and variables. </brief_description> @@ -1038,7 +1038,11 @@ <constant name="JOY_AXIS_7" value="7"> Joypad Right Trigger Analog Axis </constant> - <constant name="JOY_AXIS_MAX" value="8"> + <constant name="JOY_AXIS_8" value="8"> + </constant> + <constant name="JOY_AXIS_9" value="9"> + </constant> + <constant name="JOY_AXIS_MAX" value="10"> </constant> <constant name="JOY_ANALOG_LX" value="0"> Joypad Left Stick Horizontal Axis diff --git a/doc/classes/@NativeScript.xml b/doc/classes/@NativeScript.xml index 03e6416b19..a9dfc4538a 100644 --- a/doc/classes/@NativeScript.xml +++ b/doc/classes/@NativeScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@NativeScript" category="Core" version="3.0.alpha.custom_build"> +<class name="@NativeScript" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/@VisualScript.xml b/doc/classes/@VisualScript.xml index fe40bc45e9..0e6205c040 100644 --- a/doc/classes/@VisualScript.xml +++ b/doc/classes/@VisualScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@VisualScript" category="Core" version="3.0.alpha.custom_build"> +<class name="@VisualScript" category="Core" version="3.0-alpha"> <brief_description> Built-in visual script functions. </brief_description> diff --git a/doc/classes/ARVRAnchor.xml b/doc/classes/ARVRAnchor.xml index ecd882cdb0..8bb12609b0 100644 --- a/doc/classes/ARVRAnchor.xml +++ b/doc/classes/ARVRAnchor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRAnchor" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRAnchor" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Anchor point in AR Space </brief_description> diff --git a/doc/classes/ARVRCamera.xml b/doc/classes/ARVRCamera.xml index e6817d3417..0d9886618d 100644 --- a/doc/classes/ARVRCamera.xml +++ b/doc/classes/ARVRCamera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRCamera" inherits="Camera" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRCamera" inherits="Camera" category="Core" version="3.0-alpha"> <brief_description> A camera node with a few overrules for AR/VR applied such as location tracking. </brief_description> diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml index af1deda2f0..8af483132b 100644 --- a/doc/classes/ARVRController.xml +++ b/doc/classes/ARVRController.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRController" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRController" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> A spatial node representing a spatially tracked controller. </brief_description> @@ -57,6 +57,12 @@ Returns the ID of the joystick object bound to this. Every controller tracked by the ARVR Server that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry. </description> </method> + <method name="get_rumble" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="is_button_pressed" qualifiers="const"> <return type="int"> </return> @@ -75,11 +81,21 @@ Changes the id that identifies the controller bound to this node. The first controller that the ARVR Server detects will have id 1, the second id 2, the third id 3, etc. When a controller is turned off that slot is freed ensuring that controllers will keep the same id while it is turned on even when controllers with lower ids are turned off. </description> </method> + <method name="set_rumble"> + <return type="void"> + </return> + <argument index="0" name="rumble" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="controller_id" type="int" setter="set_controller_id" getter="get_controller_id"> The controller's id. The first controller that the [ARVRServer] detects will have id 1, the second id 2, the third id 3, etc. When a controller is turned off, it's slot is freed. This ensures controllers will keep the same id even when controllers with lower ids are turned off. </member> + <member name="rumble" type="float" setter="set_rumble" getter="get_rumble"> + </member> </members> <signals> <signal name="button_pressed"> diff --git a/doc/classes/ARVRInterface.xml b/doc/classes/ARVRInterface.xml index 9aed6c96ef..e9f8857ec8 100644 --- a/doc/classes/ARVRInterface.xml +++ b/doc/classes/ARVRInterface.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRInterface" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRInterface" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Base class for ARVR interface implementation. </brief_description> @@ -33,7 +33,7 @@ Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). </description> </method> - <method name="get_recommended_render_targetsize"> + <method name="get_render_targetsize"> <return type="Vector2"> </return> <description> @@ -139,7 +139,7 @@ This interface support AR (video background and real world tracking). </constant> <constant name="ARVR_EXTERNAL" value="8"> - This interface outputs to an external device, if the main viewport is used the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of get_recommended_render_targetsize. Using a seperate viewport node frees up the main viewport for other purposes. + This interface outputs to an external device, if the main viewport is used the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of get_render_targetsize. Using a seperate viewport node frees up the main viewport for other purposes. </constant> <constant name="EYE_MONO" value="0"> Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported. diff --git a/doc/classes/ARVROrigin.xml b/doc/classes/ARVROrigin.xml index 226a69dea4..8ad3793c80 100644 --- a/doc/classes/ARVROrigin.xml +++ b/doc/classes/ARVROrigin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVROrigin" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVROrigin" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Our origin point in AR/VR. </brief_description> diff --git a/doc/classes/ARVRPositionalTracker.xml b/doc/classes/ARVRPositionalTracker.xml index 686ac1db77..2a2c6aa843 100644 --- a/doc/classes/ARVRPositionalTracker.xml +++ b/doc/classes/ARVRPositionalTracker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRPositionalTracker" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRPositionalTracker" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> A tracked object </brief_description> @@ -48,6 +48,12 @@ Returns the position of the controller adjusted by world scale. </description> </method> + <method name="get_rumble" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_tracks_orientation" qualifiers="const"> <return type="bool"> </return> @@ -78,7 +84,19 @@ Type of tracker. </description> </method> + <method name="set_rumble"> + <return type="void"> + </return> + <argument index="0" name="rumble" type="float"> + </argument> + <description> + </description> + </method> </methods> + <members> + <member name="rumble" type="float" setter="set_rumble" getter="get_rumble"> + </member> + </members> <constants> <constant name="TRACKER_HAND_UNKNOWN" value="0"> The hand this tracker is held in is unknown or not applicable. diff --git a/doc/classes/ARVRServer.xml b/doc/classes/ARVRServer.xml index bb7ac2c052..bee95ea072 100644 --- a/doc/classes/ARVRServer.xml +++ b/doc/classes/ARVRServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRServer" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRServer" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> This is our AR/VR Server. </brief_description> @@ -11,15 +11,6 @@ <demos> </demos> <methods> - <method name="add_interface"> - <return type="void"> - </return> - <argument index="0" name="interface" type="ARVRInterface"> - </argument> - <description> - Mostly exposed for GDNative based interfaces, this is called to register an available interface with the AR/VR server. - </description> - </method> <method name="center_on_hmd"> <return type="void"> </return> @@ -61,6 +52,13 @@ Get the number of interfaces currently registered with the AR/VR server. If you're game supports multiple AR/VR platforms you can look throught the available interface and either present the user with a selection or simply try an initialize each interface and use the first one that returns true. </description> </method> + <method name="get_interfaces" qualifiers="const"> + <return type="Array"> + </return> + <description> + Returns a list of available interfaces with both id and name of the interface. + </description> + </method> <method name="get_reference_frame" qualifiers="const"> <return type="Transform"> </return> @@ -91,15 +89,6 @@ Returns our world scale (see ARVROrigin for more information). </description> </method> - <method name="remove_interface"> - <return type="void"> - </return> - <argument index="0" name="interface" type="ARVRInterface"> - </argument> - <description> - Removes a registered interface, again exposed mostly for GDNative based interfaces. - </description> - </method> <method name="set_primary_interface"> <return type="void"> </return> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index 10ca3035fb..ceb3c907a6 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AStar" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="AStar" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> AStar class representation that uses vectors as edges. </brief_description> @@ -168,6 +168,28 @@ If you change the 2nd point's weight to 3, then the result will be [code][1, 4, 3][/code] instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. </description> </method> + <method name="get_point_connections"> + <return type="PoolIntArray"> + </return> + <argument index="0" name="arg0" type="int"> + </argument> + <description> + Returns an array with the ids of the points that form the connect with the given point. + [codeblock] + var as = AStar.new() + + as.add_point(1, Vector3(0,0,0)) + as.add_point(2, Vector3(0,1,0)) + as.add_point(3, Vector3(1,1,0)) + as.add_point(4, Vector3(2,0,0)) + + as.connect_points(1, 2, true) + as.connect_points(1, 3, true) + + var neighbors = as.get_point_connections(1) # returns [2, 3] + [/codeblock] + </description> + </method> <method name="get_point_path"> <return type="PoolVector3Array"> </return> @@ -243,28 +265,6 @@ Sets the [code]weight_scale[/code] for the point with the given id. </description> </method> - <method name="get_point_connections"> - <return type="PoolIntArray"> - </return> - <argument index="0" name="id" type="int"> - </argument> - <description> - Returns an array with the ids of the points that form the connect with the given point. - [codeblock] - var as = AStar.new() - - as.add_point(1, Vector3(0,0,0)) - as.add_point(2, Vector3(0,1,0)) - as.add_point(3, Vector3(1,1,0)) - as.add_point(4, Vector3(2,0,0)) - - as.connect_points(1, 2, true) - as.connect_points(1, 3, true) - - var neighbors = as.get_point_connections(1) # returns [2, 3] - [/codeblock] - </description> - </method> </methods> <constants> </constants> diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index f87a40b8aa..2292d54756 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AcceptDialog" inherits="WindowDialog" category="Core" version="3.0.alpha.custom_build"> +<class name="AcceptDialog" inherits="WindowDialog" category="Core" version="3.0-alpha"> <brief_description> Base dialog for user notification. </brief_description> diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml index dce7bf283a..984eb47f12 100644 --- a/doc/classes/AnimatedSprite.xml +++ b/doc/classes/AnimatedSprite.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimatedSprite" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="AnimatedSprite" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Sprite node that can use multiple textures for animation. </brief_description> diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml index b0bb7bb6ab..0d8e2fc433 100644 --- a/doc/classes/AnimatedSprite3D.xml +++ b/doc/classes/AnimatedSprite3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimatedSprite3D" inherits="SpriteBase3D" category="Core" version="3.0.alpha.custom_build"> +<class name="AnimatedSprite3D" inherits="SpriteBase3D" category="Core" version="3.0-alpha"> <brief_description> 2D sprite node in 3D world, that can use multiple 2D textures for animation. </brief_description> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index d853345268..677976f1d3 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Animation" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Animation" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Contains data used to animate everything in the engine. </brief_description> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 82eb291f27..f0a1f7f634 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationPlayer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="AnimationPlayer" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Container and player of [Animation] resources. </brief_description> diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml index b92e59b902..413606dbaa 100644 --- a/doc/classes/AnimationTreePlayer.xml +++ b/doc/classes/AnimationTreePlayer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AnimationTreePlayer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="AnimationTreePlayer" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Animation Player that uses a node graph for the blending. </brief_description> diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml index febced0a8e..85afa24214 100644 --- a/doc/classes/Area.xml +++ b/doc/classes/Area.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Area" inherits="CollisionObject" category="Core" version="3.0.alpha.custom_build"> +<class name="Area" inherits="CollisionObject" category="Core" version="3.0-alpha"> <brief_description> General purpose area node for detection and 3D physics influence. </brief_description> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 6bc6e36dfc..5869e2238e 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Area2D" inherits="CollisionObject2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Area2D" inherits="CollisionObject2D" category="Core" version="3.0-alpha"> <brief_description> 2D area for detection and 2D physics influence. </brief_description> diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 7c1d72333b..203c60e644 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Array" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Array" category="Built-In Types" version="3.0-alpha"> <brief_description> Generic array datatype. </brief_description> @@ -82,6 +82,8 @@ </description> </method> <method name="back"> + <return type="var"> + </return> <description> Returns the last element of the array if the array is not empty (size>0). </description> @@ -142,6 +144,8 @@ </description> </method> <method name="front"> + <return type="var"> + </return> <description> Returns the first element of the array if the array is not empty (size>0). </description> @@ -183,11 +187,15 @@ </description> </method> <method name="pop_back"> + <return type="var"> + </return> <description> Remove the last element of the array. </description> </method> <method name="pop_front"> + <return type="var"> + </return> <description> Remove the first element of the array. </description> diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index c9996c1a0f..10456f805d 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ArrayMesh" inherits="Mesh" category="Core" version="3.0.alpha.custom_build"> +<class name="ArrayMesh" inherits="Mesh" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> @@ -199,6 +199,18 @@ Set a [Material] for a given surface. Surface will be rendered using this material. </description> </method> + <method name="surface_update_region"> + <return type="void"> + </return> + <argument index="0" name="surf_idx" type="int"> + </argument> + <argument index="1" name="offset" type="int"> + </argument> + <argument index="2" name="data" type="PoolByteArray"> + </argument> + <description> + </description> + </method> </methods> <constants> <constant name="NO_INDEX_ARRAY" value="-1" enum=""> diff --git a/doc/classes/AtlasTexture.xml b/doc/classes/AtlasTexture.xml index 179f78f16f..7cb934889e 100644 --- a/doc/classes/AtlasTexture.xml +++ b/doc/classes/AtlasTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AtlasTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="AtlasTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> Packs multiple small textures in a single, bigger one. Helps to optimize video memory costs and render calls. </brief_description> @@ -30,6 +30,12 @@ <description> </description> </method> + <method name="has_filter_clip" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="set_atlas"> <return type="void"> </return> @@ -38,6 +44,14 @@ <description> </description> </method> + <method name="set_filter_clip"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_margin"> <return type="void"> </return> @@ -59,6 +73,8 @@ <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas"> The texture that contains the atlas. Can be any [Texture] subtype. </member> + <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip"> + </member> <member name="margin" type="Rect2" setter="set_margin" getter="get_margin"> The margin around the region. The [Rect2]'s 'size' parameter ('w' and 'h' in the editor) resizes the texture so it fits within the margin. </member> diff --git a/doc/classes/AudioBusLayout.xml b/doc/classes/AudioBusLayout.xml index 045c6c2bf9..c539c7500b 100644 --- a/doc/classes/AudioBusLayout.xml +++ b/doc/classes/AudioBusLayout.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioBusLayout" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioBusLayout" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Stores information about the audiobusses. </brief_description> diff --git a/doc/classes/AudioEffect.xml b/doc/classes/AudioEffect.xml index 627d243f25..804cba82fe 100644 --- a/doc/classes/AudioEffect.xml +++ b/doc/classes/AudioEffect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffect" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffect" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Audio Effect For Audio. </brief_description> diff --git a/doc/classes/AudioEffectAmplify.xml b/doc/classes/AudioEffectAmplify.xml index 35d7991833..0149e03de4 100644 --- a/doc/classes/AudioEffectAmplify.xml +++ b/doc/classes/AudioEffectAmplify.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectAmplify" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectAmplify" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Amplify audio effect to an Audio bus. Increases or decreases the volume of the selected audio bus. diff --git a/doc/classes/AudioEffectBandLimitFilter.xml b/doc/classes/AudioEffectBandLimitFilter.xml index d4b251fc8e..f83cf8ba72 100644 --- a/doc/classes/AudioEffectBandLimitFilter.xml +++ b/doc/classes/AudioEffectBandLimitFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectBandLimitFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectBandLimitFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> Adds a band limit filter to the Audio Bus. </brief_description> diff --git a/doc/classes/AudioEffectBandPassFilter.xml b/doc/classes/AudioEffectBandPassFilter.xml index b5c6ae3c20..e922d3e821 100644 --- a/doc/classes/AudioEffectBandPassFilter.xml +++ b/doc/classes/AudioEffectBandPassFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectBandPassFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectBandPassFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> Adds a band pass filter to the Audio Bus. </brief_description> diff --git a/doc/classes/AudioEffectChorus.xml b/doc/classes/AudioEffectChorus.xml index b9f27678ec..40bac419d6 100644 --- a/doc/classes/AudioEffectChorus.xml +++ b/doc/classes/AudioEffectChorus.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectChorus" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectChorus" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a chorus audio effect. </brief_description> diff --git a/doc/classes/AudioEffectCompressor.xml b/doc/classes/AudioEffectCompressor.xml index 9d7e25dbf2..ae877f145a 100644 --- a/doc/classes/AudioEffectCompressor.xml +++ b/doc/classes/AudioEffectCompressor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectCompressor" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectCompressor" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Compressor audio effect to an Audio bus. Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume. diff --git a/doc/classes/AudioEffectDelay.xml b/doc/classes/AudioEffectDelay.xml index 9dc61883ab..a9251b6cf0 100644 --- a/doc/classes/AudioEffectDelay.xml +++ b/doc/classes/AudioEffectDelay.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectDelay" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectDelay" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Delay audio effect to an Audio bus. Plays input signal back after a period of time. Two tap delay and feedback options. diff --git a/doc/classes/AudioEffectDistortion.xml b/doc/classes/AudioEffectDistortion.xml index 8b970e675e..25df71d5f5 100644 --- a/doc/classes/AudioEffectDistortion.xml +++ b/doc/classes/AudioEffectDistortion.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectDistortion" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectDistortion" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Distortion audio effect to an Audio bus. Modify the sound to make it dirty. diff --git a/doc/classes/AudioEffectEQ.xml b/doc/classes/AudioEffectEQ.xml index 246f6b882e..f8b4d426f4 100644 --- a/doc/classes/AudioEffectEQ.xml +++ b/doc/classes/AudioEffectEQ.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectEQ" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectEQ" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Base class for audio equalizers. Gives you control over frequencies. Use it to create a custom equalizer if [AudioEffectEQ6], [AudioEffectEQ10] or [AudioEffectEQ21] don't fit your needs. diff --git a/doc/classes/AudioEffectEQ10.xml b/doc/classes/AudioEffectEQ10.xml index 7a29f4cc0b..95801ef40c 100644 --- a/doc/classes/AudioEffectEQ10.xml +++ b/doc/classes/AudioEffectEQ10.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectEQ10" inherits="AudioEffectEQ" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectEQ10" inherits="AudioEffectEQ" category="Core" version="3.0-alpha"> <brief_description> Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz. Each frequency can be modulated between -60/+24 dB. diff --git a/doc/classes/AudioEffectEQ21.xml b/doc/classes/AudioEffectEQ21.xml index 327f5a291a..b62e0458f7 100644 --- a/doc/classes/AudioEffectEQ21.xml +++ b/doc/classes/AudioEffectEQ21.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectEQ21" inherits="AudioEffectEQ" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectEQ21" inherits="AudioEffectEQ" category="Core" version="3.0-alpha"> <brief_description> Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 22 Hz to 22000 Hz. Each frequency can be modulated between -60/+24 dB. diff --git a/doc/classes/AudioEffectEQ6.xml b/doc/classes/AudioEffectEQ6.xml index bc05535041..f679ccede4 100644 --- a/doc/classes/AudioEffectEQ6.xml +++ b/doc/classes/AudioEffectEQ6.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectEQ6" inherits="AudioEffectEQ" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectEQ6" inherits="AudioEffectEQ" category="Core" version="3.0-alpha"> <brief_description> Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. Each frequency can be modulated between -60/+24 dB. diff --git a/doc/classes/AudioEffectFilter.xml b/doc/classes/AudioEffectFilter.xml index 82d572b81b..244c07a6da 100644 --- a/doc/classes/AudioEffectFilter.xml +++ b/doc/classes/AudioEffectFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectFilter" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectFilter" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a filter to the Audio Bus. </brief_description> diff --git a/doc/classes/AudioEffectHighPassFilter.xml b/doc/classes/AudioEffectHighPassFilter.xml index c5e24af510..4718d4d4a5 100644 --- a/doc/classes/AudioEffectHighPassFilter.xml +++ b/doc/classes/AudioEffectHighPassFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectHighPassFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectHighPassFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> Adds a high pass filter to the Audio Bus. </brief_description> diff --git a/doc/classes/AudioEffectHighShelfFilter.xml b/doc/classes/AudioEffectHighShelfFilter.xml index a2504d6808..62ff3d9366 100644 --- a/doc/classes/AudioEffectHighShelfFilter.xml +++ b/doc/classes/AudioEffectHighShelfFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectHighShelfFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/AudioEffectLimiter.xml b/doc/classes/AudioEffectLimiter.xml index 5209f290b1..ebed589829 100644 --- a/doc/classes/AudioEffectLimiter.xml +++ b/doc/classes/AudioEffectLimiter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectLimiter" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectLimiter" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a soft clip Limiter audio effect to an Audio bus. </brief_description> diff --git a/doc/classes/AudioEffectLowPassFilter.xml b/doc/classes/AudioEffectLowPassFilter.xml index f102dda03e..9f9ecc98b1 100644 --- a/doc/classes/AudioEffectLowPassFilter.xml +++ b/doc/classes/AudioEffectLowPassFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectLowPassFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectLowPassFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> Adds a low pass filter to the Audio Bus. </brief_description> diff --git a/doc/classes/AudioEffectLowShelfFilter.xml b/doc/classes/AudioEffectLowShelfFilter.xml index 8cf1a63c81..c74d1bc479 100644 --- a/doc/classes/AudioEffectLowShelfFilter.xml +++ b/doc/classes/AudioEffectLowShelfFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectLowShelfFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/AudioEffectNotchFilter.xml b/doc/classes/AudioEffectNotchFilter.xml index 8ec9a4bc7c..6407fc8431 100644 --- a/doc/classes/AudioEffectNotchFilter.xml +++ b/doc/classes/AudioEffectNotchFilter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectNotchFilter" inherits="AudioEffectFilter" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectNotchFilter" inherits="AudioEffectFilter" category="Core" version="3.0-alpha"> <brief_description> Adds a notch filter to the Audio Bus. </brief_description> diff --git a/doc/classes/AudioEffectPanner.xml b/doc/classes/AudioEffectPanner.xml index 56b39a36c6..46be7c1696 100644 --- a/doc/classes/AudioEffectPanner.xml +++ b/doc/classes/AudioEffectPanner.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectPanner" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectPanner" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Panner audio effect to an Audio bus. Pans sound left or right. </brief_description> diff --git a/doc/classes/AudioEffectPhaser.xml b/doc/classes/AudioEffectPhaser.xml index bd9067471b..f413366fc7 100644 --- a/doc/classes/AudioEffectPhaser.xml +++ b/doc/classes/AudioEffectPhaser.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectPhaser" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectPhaser" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Phaser audio effect to an Audio bus. Combines the original signal with a copy that is slightly out of phase with the original. diff --git a/doc/classes/AudioEffectPitchShift.xml b/doc/classes/AudioEffectPitchShift.xml index edcb54e09e..490aacbc8e 100644 --- a/doc/classes/AudioEffectPitchShift.xml +++ b/doc/classes/AudioEffectPitchShift.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectPitchShift" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectPitchShift" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Pitch shift audio effect to an Audio bus. Raises or lowers the pitch of original sound. diff --git a/doc/classes/AudioEffectReverb.xml b/doc/classes/AudioEffectReverb.xml index f399f9f07a..e0567a48c7 100644 --- a/doc/classes/AudioEffectReverb.xml +++ b/doc/classes/AudioEffectReverb.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectReverb" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectReverb" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> Adds a Reverb audio effect to an Audio bus. Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces. diff --git a/doc/classes/AudioEffectStereoEnhance.xml b/doc/classes/AudioEffectStereoEnhance.xml index 345d019d85..eb17056813 100644 --- a/doc/classes/AudioEffectStereoEnhance.xml +++ b/doc/classes/AudioEffectStereoEnhance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioEffectStereoEnhance" inherits="AudioEffect" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioEffectStereoEnhance" inherits="AudioEffect" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index f8320c23af..ee334e26a2 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioServer" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioServer" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Server interface for low level audio access. </brief_description> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index b4a98b2d8c..67323c59c5 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStream" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStream" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Base class for audio streams. </brief_description> diff --git a/doc/classes/AudioStreamPlayback.xml b/doc/classes/AudioStreamPlayback.xml index f45beec42c..61393fbe29 100644 --- a/doc/classes/AudioStreamPlayback.xml +++ b/doc/classes/AudioStreamPlayback.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamPlayback" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamPlayback" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Meta class for playing back audio. </brief_description> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 1a9ad85565..55edbfb438 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamPlayer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamPlayer" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Plays back audio. </brief_description> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index c6fd8ff54f..98ebeacc5f 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamPlayer2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamPlayer2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Plays audio in 2D. </brief_description> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index 84f6792ef0..9c016a0173 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamPlayer3D" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamPlayer3D" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Plays 3D sound in 3D space </brief_description> diff --git a/doc/classes/AudioStreamRandomPitch.xml b/doc/classes/AudioStreamRandomPitch.xml index 1573a78d1f..56c7ee1998 100644 --- a/doc/classes/AudioStreamRandomPitch.xml +++ b/doc/classes/AudioStreamRandomPitch.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamRandomPitch" inherits="AudioStream" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamRandomPitch" inherits="AudioStream" category="Core" version="3.0-alpha"> <brief_description> Plays audio with random pitch tweaking. </brief_description> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index 7f7414e4d3..3a0a171480 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamSample" inherits="AudioStream" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamSample" inherits="AudioStream" category="Core" version="3.0-alpha"> <brief_description> Plays audio. </brief_description> diff --git a/doc/classes/BackBufferCopy.xml b/doc/classes/BackBufferCopy.xml index 6c44430949..2b5a9aac20 100644 --- a/doc/classes/BackBufferCopy.xml +++ b/doc/classes/BackBufferCopy.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BackBufferCopy" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="BackBufferCopy" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Copies a region of the screen (or the whole screen) to a buffer so it can be accessed with the texscreen() shader instruction. </brief_description> diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index 1b6583a834..26939143b6 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BaseButton" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="BaseButton" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Base class for different kinds of buttons. </brief_description> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index 7731647648..c8a28621ea 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Basis" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Basis" category="Built-In Types" version="3.0-alpha"> <brief_description> 3x3 matrix datatype. </brief_description> diff --git a/doc/classes/BitMap.xml b/doc/classes/BitMap.xml index 63e6a5f682..4de059d908 100644 --- a/doc/classes/BitMap.xml +++ b/doc/classes/BitMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BitMap" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="BitMap" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Boolean matrix. </brief_description> diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 43ce40562f..c013a474b2 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BitmapFont" inherits="Font" category="Core" version="3.0.alpha.custom_build"> +<class name="BitmapFont" inherits="Font" category="Core" version="3.0-alpha"> <brief_description> Renders text using [code]*.fnt[/code] fonts. </brief_description> diff --git a/doc/classes/BoneAttachment.xml b/doc/classes/BoneAttachment.xml index 9297c0e1b1..8f33d7a73c 100644 --- a/doc/classes/BoneAttachment.xml +++ b/doc/classes/BoneAttachment.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BoneAttachment" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="BoneAttachment" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> A node that will attach to a bone. </brief_description> diff --git a/doc/classes/BoxContainer.xml b/doc/classes/BoxContainer.xml index 0c70d919f3..a7465a959a 100644 --- a/doc/classes/BoxContainer.xml +++ b/doc/classes/BoxContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BoxContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="BoxContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> Base class for box containers. </brief_description> diff --git a/doc/classes/BoxShape.xml b/doc/classes/BoxShape.xml index 4e8eb0ba6f..0f46442550 100644 --- a/doc/classes/BoxShape.xml +++ b/doc/classes/BoxShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="BoxShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="BoxShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> Box shape resource. </brief_description> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index bb02e4266b..2964cc9efc 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Button" inherits="BaseButton" category="Core" version="3.0.alpha.custom_build"> +<class name="Button" inherits="BaseButton" category="Core" version="3.0-alpha"> <brief_description> Standard themed Button. </brief_description> diff --git a/doc/classes/ButtonGroup.xml b/doc/classes/ButtonGroup.xml index c2c999f9d8..ccc457f9e6 100644 --- a/doc/classes/ButtonGroup.xml +++ b/doc/classes/ButtonGroup.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ButtonGroup" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="ButtonGroup" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Group of Buttons. </brief_description> diff --git a/doc/classes/Camera.xml b/doc/classes/Camera.xml index aeebcf9c87..c840da9266 100644 --- a/doc/classes/Camera.xml +++ b/doc/classes/Camera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Camera" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Camera" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Camera node, displays from a point of view. </brief_description> diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 352e270e77..8704624b2d 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Camera2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Camera2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Camera node for 2D scenes. </brief_description> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 3682cc6d8f..dd192e2166 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CanvasItem" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="CanvasItem" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Base class of anything 2D. </brief_description> diff --git a/doc/classes/CanvasItemMaterial.xml b/doc/classes/CanvasItemMaterial.xml index 2a6553bb6a..b9d2653a2f 100644 --- a/doc/classes/CanvasItemMaterial.xml +++ b/doc/classes/CanvasItemMaterial.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CanvasItemMaterial" inherits="Material" category="Core" version="3.0.alpha.custom_build"> +<class name="CanvasItemMaterial" inherits="Material" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index f89c4ea754..139624bb1d 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CanvasLayer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="CanvasLayer" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Canvas drawing layer. </brief_description> diff --git a/doc/classes/CanvasModulate.xml b/doc/classes/CanvasModulate.xml index b4b20e29f9..3872d80236 100644 --- a/doc/classes/CanvasModulate.xml +++ b/doc/classes/CanvasModulate.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CanvasModulate" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="CanvasModulate" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Tint the entire canvas. </brief_description> diff --git a/doc/classes/CapsuleMesh.xml b/doc/classes/CapsuleMesh.xml index 13cdfa057d..497e795253 100644 --- a/doc/classes/CapsuleMesh.xml +++ b/doc/classes/CapsuleMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CapsuleMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="CapsuleMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Class representing a capsule-shaped [PrimitiveMesh]. </brief_description> diff --git a/doc/classes/CapsuleShape.xml b/doc/classes/CapsuleShape.xml index db075a504c..f2d3528e4f 100644 --- a/doc/classes/CapsuleShape.xml +++ b/doc/classes/CapsuleShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CapsuleShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="CapsuleShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> Capsule shape for collisions. </brief_description> diff --git a/doc/classes/CapsuleShape2D.xml b/doc/classes/CapsuleShape2D.xml index 4fb5579436..b700388303 100644 --- a/doc/classes/CapsuleShape2D.xml +++ b/doc/classes/CapsuleShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CapsuleShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="CapsuleShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Capsule shape for 2D collisions. </brief_description> diff --git a/doc/classes/CenterContainer.xml b/doc/classes/CenterContainer.xml index 2f81e7739f..9e88448e32 100644 --- a/doc/classes/CenterContainer.xml +++ b/doc/classes/CenterContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CenterContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="CenterContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> Keeps children controls centered. </brief_description> diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 50b431e00c..fb9a67323b 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CheckBox" inherits="Button" category="Core" version="3.0.alpha.custom_build"> +<class name="CheckBox" inherits="Button" category="Core" version="3.0-alpha"> <brief_description> Binary choice user interface widget </brief_description> diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index bb4e6fc0cb..996b4238a1 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CheckButton" inherits="Button" category="Core" version="3.0.alpha.custom_build"> +<class name="CheckButton" inherits="Button" category="Core" version="3.0-alpha"> <brief_description> Checkable button. </brief_description> diff --git a/doc/classes/CircleShape2D.xml b/doc/classes/CircleShape2D.xml index 1ed54f0705..e5158755fe 100644 --- a/doc/classes/CircleShape2D.xml +++ b/doc/classes/CircleShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CircleShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="CircleShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Circular shape for 2D collisions. </brief_description> diff --git a/doc/classes/ClassDB.xml b/doc/classes/ClassDB.xml index 35cf819959..2fed2f8676 100644 --- a/doc/classes/ClassDB.xml +++ b/doc/classes/ClassDB.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ClassDB" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="ClassDB" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Class information repository. </brief_description> diff --git a/doc/classes/CollisionObject.xml b/doc/classes/CollisionObject.xml index 71b0c5fa7c..be047ad699 100644 --- a/doc/classes/CollisionObject.xml +++ b/doc/classes/CollisionObject.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CollisionObject" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="CollisionObject" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Base node for collision objects. </brief_description> diff --git a/doc/classes/CollisionObject2D.xml b/doc/classes/CollisionObject2D.xml index ec0554d51f..d10368229c 100644 --- a/doc/classes/CollisionObject2D.xml +++ b/doc/classes/CollisionObject2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CollisionObject2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="CollisionObject2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Base node for 2D collision objects. </brief_description> diff --git a/doc/classes/CollisionPolygon.xml b/doc/classes/CollisionPolygon.xml index c2496424d6..13a993e9f4 100644 --- a/doc/classes/CollisionPolygon.xml +++ b/doc/classes/CollisionPolygon.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CollisionPolygon" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="CollisionPolygon" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Editor-only class for defining a collision polygon in 3D space. </brief_description> diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml index 7f30e8e83e..bc4d2a5b16 100644 --- a/doc/classes/CollisionPolygon2D.xml +++ b/doc/classes/CollisionPolygon2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CollisionPolygon2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="CollisionPolygon2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Defines a 2D collision polygon. </brief_description> diff --git a/doc/classes/CollisionShape.xml b/doc/classes/CollisionShape.xml index 6e98d2f979..3c9e252788 100644 --- a/doc/classes/CollisionShape.xml +++ b/doc/classes/CollisionShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CollisionShape" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="CollisionShape" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Node that represents collision shape data in 3D space. </brief_description> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index cefa0c1c81..caf3f8d8be 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CollisionShape2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="CollisionShape2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Node that represents collision shape data in 2D space. </brief_description> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 4547771b63..479eb719d4 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Color" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Color" category="Built-In Types" version="3.0-alpha"> <brief_description> Color in RGBA format with some support for ARGB format. </brief_description> diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml index 74c12cb9b2..b6aeb8d0e3 100644 --- a/doc/classes/ColorPicker.xml +++ b/doc/classes/ColorPicker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ColorPicker" inherits="BoxContainer" category="Core" version="3.0.alpha.custom_build"> +<class name="ColorPicker" inherits="BoxContainer" category="Core" version="3.0-alpha"> <brief_description> Color picker control. </brief_description> diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 7b54be36c9..24b37580d6 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ColorPickerButton" inherits="Button" category="Core" version="3.0.alpha.custom_build"> +<class name="ColorPickerButton" inherits="Button" category="Core" version="3.0-alpha"> <brief_description> Button that pops out a [ColorPicker] </brief_description> diff --git a/doc/classes/ColorRect.xml b/doc/classes/ColorRect.xml index 6e70a1e8b7..4dbc4f010c 100644 --- a/doc/classes/ColorRect.xml +++ b/doc/classes/ColorRect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ColorRect" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="ColorRect" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Colored rect for canvas. </brief_description> diff --git a/doc/classes/ConcavePolygonShape.xml b/doc/classes/ConcavePolygonShape.xml index 0b1cbf9c21..e586eb11c5 100644 --- a/doc/classes/ConcavePolygonShape.xml +++ b/doc/classes/ConcavePolygonShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConcavePolygonShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="ConcavePolygonShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> Concave polygon shape. </brief_description> diff --git a/doc/classes/ConcavePolygonShape2D.xml b/doc/classes/ConcavePolygonShape2D.xml index be884fd08d..5d2dbb4596 100644 --- a/doc/classes/ConcavePolygonShape2D.xml +++ b/doc/classes/ConcavePolygonShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConcavePolygonShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="ConcavePolygonShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Concave polygon 2D shape resource for physics. </brief_description> diff --git a/doc/classes/ConeTwistJoint.xml b/doc/classes/ConeTwistJoint.xml index baf28c5a74..2f72b451f3 100644 --- a/doc/classes/ConeTwistJoint.xml +++ b/doc/classes/ConeTwistJoint.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConeTwistJoint" inherits="Joint" category="Core" version="3.0.alpha.custom_build"> +<class name="ConeTwistJoint" inherits="Joint" category="Core" version="3.0-alpha"> <brief_description> A twist joint between two 3D bodies </brief_description> diff --git a/doc/classes/ConfigFile.xml b/doc/classes/ConfigFile.xml index 846a100f3c..ef668ca994 100644 --- a/doc/classes/ConfigFile.xml +++ b/doc/classes/ConfigFile.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConfigFile" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="ConfigFile" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Helper class to handle INI-style files. </brief_description> @@ -95,7 +95,7 @@ <argument index="0" name="path" type="String"> </argument> <description> - Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@Global Scope]. If the load was successful, the return value is [code]OK[/code]. + Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ConfigFile object which the method was called on. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [code]OK[/code]. </description> </method> <method name="save"> @@ -104,7 +104,7 @@ <argument index="0" name="path" type="String"> </argument> <description> - Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@Global Scope]. If the load was successful, the return value is [code]OK[/code]. + Saves the contents of the ConfigFile object to the file specified as a parameter. The output file uses an INI-style structure. Returns one of the [code]OK[/code], [code]FAILED[/code] or [code]ERR_*[/code] constants listed in [@GlobalScope]. If the load was successful, the return value is [code]OK[/code]. </description> </method> <method name="set_value"> diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index 84de287519..1bbb338c07 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConfirmationDialog" inherits="AcceptDialog" category="Core" version="3.0.alpha.custom_build"> +<class name="ConfirmationDialog" inherits="AcceptDialog" category="Core" version="3.0-alpha"> <brief_description> Dialog for confirmation of actions. </brief_description> diff --git a/doc/classes/Container.xml b/doc/classes/Container.xml index f8555def37..5490c84bae 100644 --- a/doc/classes/Container.xml +++ b/doc/classes/Container.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Container" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Container" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Base node for containers. </brief_description> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index b5765ac948..79870dd411 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Control" inherits="CanvasItem" category="Core" version="3.0.alpha.custom_build"> +<class name="Control" inherits="CanvasItem" category="Core" version="3.0-alpha"> <brief_description> All User Interface nodes inherit from Control. Features anchors and margins to adapt its position and size to its parent. </brief_description> diff --git a/doc/classes/ConvexPolygonShape.xml b/doc/classes/ConvexPolygonShape.xml index 822b99547e..0ea140148c 100644 --- a/doc/classes/ConvexPolygonShape.xml +++ b/doc/classes/ConvexPolygonShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConvexPolygonShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="ConvexPolygonShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> Convex polygon shape for 3D physics. </brief_description> diff --git a/doc/classes/ConvexPolygonShape2D.xml b/doc/classes/ConvexPolygonShape2D.xml index cf1fdccc26..40507c6a6b 100644 --- a/doc/classes/ConvexPolygonShape2D.xml +++ b/doc/classes/ConvexPolygonShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ConvexPolygonShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="ConvexPolygonShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Convex Polygon Shape for 2D physics. </brief_description> diff --git a/doc/classes/CubeMap.xml b/doc/classes/CubeMap.xml index b173bba3c6..9b0837306e 100644 --- a/doc/classes/CubeMap.xml +++ b/doc/classes/CubeMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CubeMap" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="CubeMap" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> A CubeMap is a 6 sided 3D texture. </brief_description> diff --git a/doc/classes/CubeMesh.xml b/doc/classes/CubeMesh.xml index 642f37c393..4a8ad104b7 100644 --- a/doc/classes/CubeMesh.xml +++ b/doc/classes/CubeMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CubeMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="CubeMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Generate an axis-aligned cuboid [PrimitiveMesh]. </brief_description> diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml index c89ab6fb9b..3741f51fad 100644 --- a/doc/classes/Curve.xml +++ b/doc/classes/Curve.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Curve" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Curve" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml index 99ec2b7d94..0d9dfad643 100644 --- a/doc/classes/Curve2D.xml +++ b/doc/classes/Curve2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Curve2D" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Curve2D" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Describes a Bezier curve in 2D space. </brief_description> diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml index 02299753cf..35f8db0177 100644 --- a/doc/classes/Curve3D.xml +++ b/doc/classes/Curve3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Curve3D" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Curve3D" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Describes a Bezier curve in 3D space. </brief_description> diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 8f8f60968a..61a6a2486f 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CurveTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="CurveTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/CylinderMesh.xml b/doc/classes/CylinderMesh.xml index 8399312dac..8398b52ee0 100644 --- a/doc/classes/CylinderMesh.xml +++ b/doc/classes/CylinderMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CylinderMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="CylinderMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Class representing a cylindrical [PrimitiveMesh]. </brief_description> diff --git a/doc/classes/DampedSpringJoint2D.xml b/doc/classes/DampedSpringJoint2D.xml index 36c5564513..da7147933d 100644 --- a/doc/classes/DampedSpringJoint2D.xml +++ b/doc/classes/DampedSpringJoint2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="DampedSpringJoint2D" inherits="Joint2D" category="Core" version="3.0.alpha.custom_build"> +<class name="DampedSpringJoint2D" inherits="Joint2D" category="Core" version="3.0-alpha"> <brief_description> Damped spring constraint for 2D physics. </brief_description> diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 4b37061af2..5664b2079b 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Dictionary" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Dictionary" category="Built-In Types" version="3.0-alpha"> <brief_description> Dictionary type. </brief_description> diff --git a/doc/classes/DirectionalLight.xml b/doc/classes/DirectionalLight.xml index 7de1791519..f0cc007339 100644 --- a/doc/classes/DirectionalLight.xml +++ b/doc/classes/DirectionalLight.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="DirectionalLight" inherits="Light" category="Core" version="3.0.alpha.custom_build"> +<class name="DirectionalLight" inherits="Light" category="Core" version="3.0-alpha"> <brief_description> Directional Light, such as the Sun or the Moon. </brief_description> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index c3c4c7a8ac..b11e0629cd 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Directory" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Directory" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Type used to handle the filesystem. </brief_description> @@ -34,7 +34,7 @@ </argument> <description> Change the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. [code]newdir[/code] or [code]../newdir[/code]), or an absolute path (e.g. [code]/tmp/newdir[/code] or [code]res://somedir/newdir[/code]). - The method returns one of the error code constants defined in [@Global Scope] (OK or ERR_*). + The method returns one of the error code constants defined in [@GlobalScope] (OK or ERR_*). </description> </method> <method name="copy"> @@ -46,7 +46,7 @@ </argument> <description> Copy the [i]from[/i] file to the [i]to[/i] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. - Returns one of the error code constants defined in [@Global Scope] (OK, FAILED or ERR_*). + Returns one of the error code constants defined in [@GlobalScope] (OK, FAILED or ERR_*). </description> </method> <method name="current_is_dir" qualifiers="const"> @@ -146,7 +146,7 @@ </argument> <description> Create a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see [method make_dir_recursive]). - The method returns one of the error code constants defined in [@Global Scope] (OK, FAILED or ERR_*). + The method returns one of the error code constants defined in [@GlobalScope] (OK, FAILED or ERR_*). </description> </method> <method name="make_dir_recursive"> @@ -156,7 +156,7 @@ </argument> <description> Create a target directory and all necessary intermediate directories in its path, by calling [method make_dir] recursively. The argument can be relative to the current directory, or an absolute path. - Return one of the error code constants defined in [@Global Scope] (OK, FAILED or ERR_*). + Return one of the error code constants defined in [@GlobalScope] (OK, FAILED or ERR_*). </description> </method> <method name="open"> @@ -166,7 +166,7 @@ </argument> <description> Open an existing directory of the filesystem. The [i]path[/i] argument can be within the project tree ([code]res://folder[/code]), the user directory ([code]user://folder[/code]) or an absolute path of the user filesystem (e.g. [code]/tmp/folder[/code] or [code]C:\tmp\folder[/code]). - The method returns one of the error code constants defined in [@Global Scope] (OK or ERR_*). + The method returns one of the error code constants defined in [@GlobalScope] (OK or ERR_*). </description> </method> <method name="remove"> @@ -176,7 +176,7 @@ </argument> <description> Delete the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. - Return one of the error code constants defined in [@Global Scope] (OK or FAILED). + Return one of the error code constants defined in [@GlobalScope] (OK or FAILED). </description> </method> <method name="rename"> @@ -188,7 +188,7 @@ </argument> <description> Rename (move) the [i]from[/i] file to the [i]to[/i] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. - Return one of the error code constants defined in [@Global Scope] (OK or FAILED). + Return one of the error code constants defined in [@GlobalScope] (OK or FAILED). </description> </method> </methods> diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index d7f08c85a1..9149e14a62 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="DynamicFont" inherits="Font" category="Core" version="3.0.alpha.custom_build"> +<class name="DynamicFont" inherits="Font" category="Core" version="3.0-alpha"> <brief_description> DynamicFont renders vector font files at runtime. </brief_description> diff --git a/doc/classes/DynamicFontData.xml b/doc/classes/DynamicFontData.xml index 9012b46e08..26529006cb 100644 --- a/doc/classes/DynamicFontData.xml +++ b/doc/classes/DynamicFontData.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="DynamicFontData" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="DynamicFontData" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Used with [DynamicFont] to describe the location of a font file. </brief_description> diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml index b0ed24b767..a3bab32476 100644 --- a/doc/classes/EditorExportPlugin.xml +++ b/doc/classes/EditorExportPlugin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorExportPlugin" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorExportPlugin" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 6ae893f189..f29d9fd4dd 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorFileDialog" inherits="ConfirmationDialog" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorFileDialog" inherits="ConfirmationDialog" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/EditorFileSystem.xml b/doc/classes/EditorFileSystem.xml index 6a2f811425..afec85184c 100644 --- a/doc/classes/EditorFileSystem.xml +++ b/doc/classes/EditorFileSystem.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorFileSystem" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorFileSystem" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Resource filesystem, as the editor sees it. </brief_description> diff --git a/doc/classes/EditorFileSystemDirectory.xml b/doc/classes/EditorFileSystemDirectory.xml index 7d284f864e..99bca09eb6 100644 --- a/doc/classes/EditorFileSystemDirectory.xml +++ b/doc/classes/EditorFileSystemDirectory.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorFileSystemDirectory" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorFileSystemDirectory" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> A diretory for the resource filesystem. </brief_description> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index c276a8f661..9836fb2527 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorImportPlugin" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorImportPlugin" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type. </brief_description> diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 3a3fd43b15..0059804c00 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorInterface" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorInterface" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Editor interface and main components. </brief_description> @@ -127,7 +127,7 @@ <return type="int" enum="Error"> </return> <description> - Saves the scene. Returns either OK or ERR_CANT_CREATE. See [@Global Scope] constants. + Saves the scene. Returns either OK or ERR_CANT_CREATE. See [@GlobalScope] constants. </description> </method> <method name="save_scene_as"> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index de79c3c85c..f9bdf1dcd5 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorPlugin" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorPlugin" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Used by the editor to extend its functionality. </brief_description> diff --git a/doc/classes/EditorResourceConversionPlugin.xml b/doc/classes/EditorResourceConversionPlugin.xml index e165ae376b..6fbb60ddf6 100644 --- a/doc/classes/EditorResourceConversionPlugin.xml +++ b/doc/classes/EditorResourceConversionPlugin.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorResourceConversionPlugin" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorResourceConversionPlugin" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/EditorResourcePreview.xml b/doc/classes/EditorResourcePreview.xml index 5174d9243b..44f60d4d2c 100644 --- a/doc/classes/EditorResourcePreview.xml +++ b/doc/classes/EditorResourcePreview.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorResourcePreview" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorResourcePreview" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Helper to generate previews of resources or files. </brief_description> diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml index 231198516e..3de0dbc708 100644 --- a/doc/classes/EditorResourcePreviewGenerator.xml +++ b/doc/classes/EditorResourcePreviewGenerator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorResourcePreviewGenerator" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorResourcePreviewGenerator" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Custom generator of previews. </brief_description> diff --git a/doc/classes/EditorScript.xml b/doc/classes/EditorScript.xml index 245dbc078d..1e46164fc6 100644 --- a/doc/classes/EditorScript.xml +++ b/doc/classes/EditorScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorScript" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorScript" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Base script that can be used to add extension functions to the editor. </brief_description> diff --git a/doc/classes/EditorSelection.xml b/doc/classes/EditorSelection.xml index a6dc60ee7b..999cb5e505 100644 --- a/doc/classes/EditorSelection.xml +++ b/doc/classes/EditorSelection.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorSelection" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorSelection" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Manages the SceneTree selection in the editor. </brief_description> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 17a4d2fe4b..a0e4fdb8e0 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorSettings" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorSettings" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Object that holds the project-independent editor settings. </brief_description> @@ -23,7 +23,7 @@ <argument index="0" name="info" type="Dictionary"> </argument> <description> - Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String]. + Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@GlobalScope]), and optionally hint:[int](see PROPERTY_HINT_* in [@GlobalScope]), hint_string:[String]. Example: [codeblock] editor_settings.set("category/property_name", 0) diff --git a/doc/classes/EditorSpatialGizmo.xml b/doc/classes/EditorSpatialGizmo.xml index 545eadeed2..e111eec3b9 100644 --- a/doc/classes/EditorSpatialGizmo.xml +++ b/doc/classes/EditorSpatialGizmo.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EditorSpatialGizmo" inherits="SpatialGizmo" category="Core" version="3.0.alpha.custom_build"> +<class name="EditorSpatialGizmo" inherits="SpatialGizmo" category="Core" version="3.0-alpha"> <brief_description> Custom gizmo for editing Spatial objects. </brief_description> diff --git a/doc/classes/EncodedObjectAsID.xml b/doc/classes/EncodedObjectAsID.xml index 412e60bf99..41839e3d01 100644 --- a/doc/classes/EncodedObjectAsID.xml +++ b/doc/classes/EncodedObjectAsID.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="EncodedObjectAsID" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="EncodedObjectAsID" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 083688b416..f43bbc2e9d 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Engine" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Engine" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Access to basic engine properties. </brief_description> @@ -39,6 +39,14 @@ Returns the main loop object (see [MainLoop] and [SceneTree]). </description> </method> + <method name="get_singleton" qualifiers="const"> + <return type="Object"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> <method name="get_target_fps" qualifiers="const"> <return type="float"> </return> @@ -67,6 +75,14 @@ "string" - major + minor + patch + status + revision in a single String </description> </method> + <method name="has_singleton" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> <method name="is_editor_hint" qualifiers="const"> <return type="bool"> </return> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 4d40d5af9a..285caa8d0a 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Environment" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Environment" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Resource for environment nodes (like [WorldEnvironment]) that define multiple rendering options. </brief_description> diff --git a/doc/classes/File.xml b/doc/classes/File.xml index 6272d4105c..8ec56e9c48 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="File" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="File" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Type to handle file reading and writing operations. </brief_description> @@ -120,7 +120,7 @@ <return type="int" enum="Error"> </return> <description> - Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [@Global Scope]. + Returns the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [@GlobalScope]. </description> </method> <method name="get_float" qualifiers="const"> diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index b3d131ca40..7dda486ac9 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="FileDialog" inherits="ConfirmationDialog" category="Core" version="3.0.alpha.custom_build"> +<class name="FileDialog" inherits="ConfirmationDialog" category="Core" version="3.0-alpha"> <brief_description> Dialog for selecting files or directories in the filesystem. </brief_description> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 2e2124cbd6..b83d66830f 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Font" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Font" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Internationalized font and text drawing support. </brief_description> diff --git a/doc/classes/FuncRef.xml b/doc/classes/FuncRef.xml index 987d750ced..65da5dd98f 100644 --- a/doc/classes/FuncRef.xml +++ b/doc/classes/FuncRef.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="FuncRef" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="FuncRef" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Reference to a function in an object. </brief_description> diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index 3f3d24aaaa..e445d94835 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GIProbe" inherits="VisualInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="GIProbe" inherits="VisualInstance" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GIProbeData.xml b/doc/classes/GIProbeData.xml index 6d47daf985..3777eba6af 100644 --- a/doc/classes/GIProbeData.xml +++ b/doc/classes/GIProbeData.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GIProbeData" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="GIProbeData" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Generic6DOFJoint.xml b/doc/classes/Generic6DOFJoint.xml index 89ec1fd836..202e461652 100644 --- a/doc/classes/Generic6DOFJoint.xml +++ b/doc/classes/Generic6DOFJoint.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Generic6DOFJoint" inherits="Joint" category="Core" version="3.0.alpha.custom_build"> +<class name="Generic6DOFJoint" inherits="Joint" category="Core" version="3.0-alpha"> <brief_description> The generic 6 degrees of freedom joint can implement a variety of joint-types by locking certain axes' rotation or translation. </brief_description> diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml index 1589a9a906..5da3ca0059 100644 --- a/doc/classes/Geometry.xml +++ b/doc/classes/Geometry.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Geometry" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Geometry" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> @@ -50,6 +50,26 @@ Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [code]radius[/code] and height [code]height[/code]. The parameter [code]sides[/code] defines how many planes will be generated for the round part of the cylinder. The parameter [code]axis[/code] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). </description> </method> + <method name="clip_polygon"> + <return type="PoolVector3Array"> + </return> + <argument index="0" name="points" type="PoolVector3Array"> + </argument> + <argument index="1" name="plane" type="Plane"> + </argument> + <description> + Clips the polygon defined by the points in [code]points[/code] against the [code]plane[/code] and returns the points of the clipped polygon. + </description> + </method> + <method name="convex_hull_2d"> + <return type="PoolVector2Array"> + </return> + <argument index="0" name="points" type="PoolVector2Array"> + </argument> + <description> + Given an array of [Vector2]s, returns the convex hull as a list of points in counter-clockwise order. The last point is the same as the first one. + </description> + </method> <method name="get_closest_point_to_segment"> <return type="Vector3"> </return> @@ -280,26 +300,6 @@ Triangulates the polygon specified by the points in [code]polygon[/code]. Returns a [PoolIntArray] where each triangle consists of three consecutive point indices into [code]polygon[/code] (i.e. the returned array will have [code]n * 3[/code] elements, with [code]n[/code] being the number of found triangles). If the triangulation did not succeed, an empty [PoolIntArray] is returned. </description> </method> - <method name="convex_hull_2d"> - <return type="PoolVector2Array"> - </return> - <argument index="0" name="points" type="PoolVector2Array"> - </argument> - <description> - Given an array of [Vector2]s, returns the convex hull as a list of points in counter-clockwise order. The last point is the same as the first one. - </description> - </method> - <method name="clip_polygon"> - <return type="PoolVector3Array"> - </return> - <argument index="0" name="points" type="PoolVector3Array"> - </argument> - <argument index="1" name="plane" type="Plane"> - </argument> - <description> - Clips the polygon defined by the points in [code]points[/code] against the [code]plane[/code] and returns the points of the clipped polygon. - </description> - </method> </methods> <constants> </constants> diff --git a/doc/classes/GeometryInstance.xml b/doc/classes/GeometryInstance.xml index 57aec8be41..f21dbecd04 100644 --- a/doc/classes/GeometryInstance.xml +++ b/doc/classes/GeometryInstance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GeometryInstance" inherits="VisualInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="GeometryInstance" inherits="VisualInstance" category="Core" version="3.0-alpha"> <brief_description> Base node for geometry based visual instances. </brief_description> diff --git a/doc/classes/Gradient.xml b/doc/classes/Gradient.xml index e086ae86b1..d557ec11c5 100644 --- a/doc/classes/Gradient.xml +++ b/doc/classes/Gradient.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Gradient" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Gradient" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Color interpolator node. </brief_description> diff --git a/doc/classes/GradientTexture.xml b/doc/classes/GradientTexture.xml index eab8ea77af..88a776cb6a 100644 --- a/doc/classes/GradientTexture.xml +++ b/doc/classes/GradientTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GradientTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="GradientTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> Gradient filled texture. </brief_description> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 01d578be5e..a07809ce95 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GraphEdit" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="GraphEdit" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them. </brief_description> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index e230390882..2ad0cc1182 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GraphNode" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="GraphNode" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> A GraphNode is a container with several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types. </brief_description> diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml index 30976eff99..01bbed6ea7 100644 --- a/doc/classes/GridContainer.xml +++ b/doc/classes/GridContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GridContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="GridContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> Grid container used to arrange elements in a grid like layout </brief_description> diff --git a/doc/classes/GrooveJoint2D.xml b/doc/classes/GrooveJoint2D.xml index 412a4504c3..182bf5e8f1 100644 --- a/doc/classes/GrooveJoint2D.xml +++ b/doc/classes/GrooveJoint2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GrooveJoint2D" inherits="Joint2D" category="Core" version="3.0.alpha.custom_build"> +<class name="GrooveJoint2D" inherits="Joint2D" category="Core" version="3.0-alpha"> <brief_description> Groove constraint for 2D physics. </brief_description> diff --git a/doc/classes/HBoxContainer.xml b/doc/classes/HBoxContainer.xml index 2ffc2a8c57..6ee9a2c1f4 100644 --- a/doc/classes/HBoxContainer.xml +++ b/doc/classes/HBoxContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HBoxContainer" inherits="BoxContainer" category="Core" version="3.0.alpha.custom_build"> +<class name="HBoxContainer" inherits="BoxContainer" category="Core" version="3.0-alpha"> <brief_description> Horizontal box container. </brief_description> diff --git a/doc/classes/HScrollBar.xml b/doc/classes/HScrollBar.xml index 188995527c..7fe26ec863 100644 --- a/doc/classes/HScrollBar.xml +++ b/doc/classes/HScrollBar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HScrollBar" inherits="ScrollBar" category="Core" version="3.0.alpha.custom_build"> +<class name="HScrollBar" inherits="ScrollBar" category="Core" version="3.0-alpha"> <brief_description> Horizontal scroll bar. </brief_description> diff --git a/doc/classes/HSeparator.xml b/doc/classes/HSeparator.xml index 351eee7ee6..487f83ec1d 100644 --- a/doc/classes/HSeparator.xml +++ b/doc/classes/HSeparator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HSeparator" inherits="Separator" category="Core" version="3.0.alpha.custom_build"> +<class name="HSeparator" inherits="Separator" category="Core" version="3.0-alpha"> <brief_description> Horizontal separator. </brief_description> diff --git a/doc/classes/HSlider.xml b/doc/classes/HSlider.xml index 25e62b90e3..b4a97425f3 100644 --- a/doc/classes/HSlider.xml +++ b/doc/classes/HSlider.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HSlider" inherits="Slider" category="Core" version="3.0.alpha.custom_build"> +<class name="HSlider" inherits="Slider" category="Core" version="3.0-alpha"> <brief_description> Horizontal slider. </brief_description> diff --git a/doc/classes/HSplitContainer.xml b/doc/classes/HSplitContainer.xml index d7dc79a783..a107d30be7 100644 --- a/doc/classes/HSplitContainer.xml +++ b/doc/classes/HSplitContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HSplitContainer" inherits="SplitContainer" category="Core" version="3.0.alpha.custom_build"> +<class name="HSplitContainer" inherits="SplitContainer" category="Core" version="3.0-alpha"> <brief_description> Horizontal split container. </brief_description> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index f148545848..569c76ae0c 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HTTPClient" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="HTTPClient" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Hyper-text transfer protocol client. </brief_description> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index b780d29d0e..a1a84d2211 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HTTPRequest" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="HTTPRequest" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> A Node with the ability to send HTTP requests. </brief_description> diff --git a/doc/classes/HingeJoint.xml b/doc/classes/HingeJoint.xml index d18e63f8a3..2d91549a66 100644 --- a/doc/classes/HingeJoint.xml +++ b/doc/classes/HingeJoint.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="HingeJoint" inherits="Joint" category="Core" version="3.0.alpha.custom_build"> +<class name="HingeJoint" inherits="Joint" category="Core" version="3.0-alpha"> <brief_description> A hinge between two 3D bodies. </brief_description> diff --git a/doc/classes/IP.xml b/doc/classes/IP.xml index fed7000df6..721cf07441 100644 --- a/doc/classes/IP.xml +++ b/doc/classes/IP.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="IP" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="IP" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> IP Protocol support functions. </brief_description> diff --git a/doc/classes/IP_Unix.xml b/doc/classes/IP_Unix.xml index d30ad795a8..bac7e374bb 100644 --- a/doc/classes/IP_Unix.xml +++ b/doc/classes/IP_Unix.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="IP_Unix" inherits="IP" category="Core" version="3.0.alpha.custom_build"> +<class name="IP_Unix" inherits="IP" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 905a844094..4f8da7af9e 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Image" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Image" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Image datatype. </brief_description> diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index b392252399..d179794c1f 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ImageTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="ImageTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> A [Texture] based on an [Image]. </brief_description> diff --git a/doc/classes/ImmediateGeometry.xml b/doc/classes/ImmediateGeometry.xml index cd7074aeaf..7ad09c3fe9 100644 --- a/doc/classes/ImmediateGeometry.xml +++ b/doc/classes/ImmediateGeometry.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ImmediateGeometry" inherits="GeometryInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="ImmediateGeometry" inherits="GeometryInstance" category="Core" version="3.0-alpha"> <brief_description> Draws simple geometry from code. </brief_description> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index d2d01dacb4..114c8d2c59 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Input" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Input" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> A Singleton that deals with inputs. </brief_description> @@ -75,7 +75,7 @@ <argument index="1" name="axis" type="int"> </argument> <description> - Returns the current value of the joypad axis at given index (see [code]JOY_*[/code] constants in [@Global Scope]) + Returns the current value of the joypad axis at given index (see [code]JOY_*[/code] constants in [@GlobalScope]) </description> </method> <method name="get_joy_axis_index_from_string"> @@ -209,7 +209,7 @@ <argument index="1" name="button" type="int"> </argument> <description> - Returns [code]true[/code] if you are pressing the joypad button. (see [code]JOY_*[/code] constants in [@Global Scope]) + Returns [code]true[/code] if you are pressing the joypad button. (see [code]JOY_*[/code] constants in [@GlobalScope]) </description> </method> <method name="is_joy_known"> @@ -218,7 +218,7 @@ <argument index="0" name="device" type="int"> </argument> <description> - Returns [code]true[/code] if the system knows the specified device. This means that it sets all button and axis indices exactly as defined in the [code]JOY_*[/code] constants (see [@Global Scope]). Unknown joypads are not expected to match these constants, but you can still retrieve events from them. + Returns [code]true[/code] if the system knows the specified device. This means that it sets all button and axis indices exactly as defined in the [code]JOY_*[/code] constants (see [@GlobalScope]). Unknown joypads are not expected to match these constants, but you can still retrieve events from them. </description> </method> <method name="is_key_pressed" qualifiers="const"> @@ -227,7 +227,7 @@ <argument index="0" name="scancode" type="int"> </argument> <description> - Returns [code]true[/code] if you are pressing the key. You can pass [code]KEY_*[/code], which are pre-defined constants listed in [@Global Scope]. + Returns [code]true[/code] if you are pressing the key. You can pass [code]KEY_*[/code], which are pre-defined constants listed in [@GlobalScope]. </description> </method> <method name="is_mouse_button_pressed" qualifiers="const"> @@ -236,7 +236,7 @@ <argument index="0" name="button" type="int"> </argument> <description> - Returns [code]true[/code] if you are pressing the mouse button. You can pass [code]BUTTON_*[/code], which are pre-defined constants listed in [@Global Scope]. + Returns [code]true[/code] if you are pressing the mouse button. You can pass [code]BUTTON_*[/code], which are pre-defined constants listed in [@GlobalScope]. </description> </method> <method name="joy_connection_changed"> diff --git a/doc/classes/InputDefault.xml b/doc/classes/InputDefault.xml index cb8ad6b823..9cbc993af1 100644 --- a/doc/classes/InputDefault.xml +++ b/doc/classes/InputDefault.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputDefault" inherits="Input" category="Core" version="3.0.alpha.custom_build"> +<class name="InputDefault" inherits="Input" category="Core" version="3.0-alpha"> <brief_description> Default implementation of the [Input] class. </brief_description> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index c6abf2fee5..1cebed7efc 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEvent" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEvent" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Generic input event </brief_description> diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml index d97f1d4a2e..13d3a14511 100644 --- a/doc/classes/InputEventAction.xml +++ b/doc/classes/InputEventAction.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventAction" inherits="InputEvent" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventAction" inherits="InputEvent" category="Core" version="3.0-alpha"> <brief_description> Input event type for actions. </brief_description> diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml index f13a1102b7..fecd65e6a2 100644 --- a/doc/classes/InputEventJoypadButton.xml +++ b/doc/classes/InputEventJoypadButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventJoypadButton" inherits="InputEvent" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventJoypadButton" inherits="InputEvent" category="Core" version="3.0-alpha"> <brief_description> Input event for gamepad buttons. </brief_description> diff --git a/doc/classes/InputEventJoypadMotion.xml b/doc/classes/InputEventJoypadMotion.xml index a7c585a55d..a89c91fbe6 100644 --- a/doc/classes/InputEventJoypadMotion.xml +++ b/doc/classes/InputEventJoypadMotion.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventJoypadMotion" inherits="InputEvent" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventJoypadMotion" inherits="InputEvent" category="Core" version="3.0-alpha"> <brief_description> Input event type for gamepad joysticks and other motions. For buttons see [code]InputEventJoypadMotion[/code]. </brief_description> diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml index 9565584a4f..440e1347f8 100644 --- a/doc/classes/InputEventKey.xml +++ b/doc/classes/InputEventKey.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventKey" inherits="InputEventWithModifiers" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventKey" inherits="InputEventWithModifiers" category="Core" version="3.0-alpha"> <brief_description> Input event type for keyboard events. </brief_description> diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml index 38eec74ffa..24a771cef3 100644 --- a/doc/classes/InputEventMouse.xml +++ b/doc/classes/InputEventMouse.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventMouse" inherits="InputEventWithModifiers" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventMouse" inherits="InputEventWithModifiers" category="Core" version="3.0-alpha"> <brief_description> Base input event type for mouse events. </brief_description> @@ -57,7 +57,7 @@ </methods> <members> <member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask"> - Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope]. + Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@GlobalScope]. </member> <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position"> Mouse position relative to the current [Viewport] when used in [method Control._gui_input], otherwise is at 0,0. diff --git a/doc/classes/InputEventMouseButton.xml b/doc/classes/InputEventMouseButton.xml index afc0c331c8..ff7c1da34e 100644 --- a/doc/classes/InputEventMouseButton.xml +++ b/doc/classes/InputEventMouseButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventMouseButton" inherits="InputEventMouse" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventMouseButton" inherits="InputEventMouse" category="Core" version="3.0-alpha"> <brief_description> Input event type for mouse button events. </brief_description> @@ -65,7 +65,7 @@ </methods> <members> <member name="button_index" type="int" setter="set_button_index" getter="get_button_index"> - Mouse button identifier, one of the BUTTON_* or BUTTON_WHEEL_* constants in [@Global Scope]. + Mouse button identifier, one of the BUTTON_* or BUTTON_WHEEL_* constants in [@GlobalScope]. </member> <member name="doubleclick" type="bool" setter="set_doubleclick" getter="is_doubleclick"> If [code]true[/code] the mouse button's state is a double-click. If [code]false[/code] the mouse button's state is released. diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index 5be82e1ffa..6c9165fea8 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventMouseMotion" inherits="InputEventMouse" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventMouseMotion" inherits="InputEventMouse" category="Core" version="3.0-alpha"> <brief_description> Input event type for mouse motion events. </brief_description> diff --git a/doc/classes/InputEventScreenDrag.xml b/doc/classes/InputEventScreenDrag.xml index 0c92ad5f70..a68f444a7c 100644 --- a/doc/classes/InputEventScreenDrag.xml +++ b/doc/classes/InputEventScreenDrag.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventScreenDrag" inherits="InputEvent" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventScreenDrag" inherits="InputEvent" category="Core" version="3.0-alpha"> <brief_description> Input event type for screen drag events. (only available on mobile devices) diff --git a/doc/classes/InputEventScreenTouch.xml b/doc/classes/InputEventScreenTouch.xml index 01ba9f1285..d0c7181e84 100644 --- a/doc/classes/InputEventScreenTouch.xml +++ b/doc/classes/InputEventScreenTouch.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventScreenTouch" inherits="InputEvent" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventScreenTouch" inherits="InputEvent" category="Core" version="3.0-alpha"> <brief_description> Input event type for screen touch events. (only available on mobile devices) diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml index 46107a4ab8..8e5ffed149 100644 --- a/doc/classes/InputEventWithModifiers.xml +++ b/doc/classes/InputEventWithModifiers.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputEventWithModifiers" inherits="InputEvent" category="Core" version="3.0.alpha.custom_build"> +<class name="InputEventWithModifiers" inherits="InputEvent" category="Core" version="3.0-alpha"> <brief_description> Base class for keys events with modifiers. </brief_description> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 99b77dab36..a04b9e78ae 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InputMap" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="InputMap" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Singleton that manages [InputEventAction]. </brief_description> diff --git a/doc/classes/InstancePlaceholder.xml b/doc/classes/InstancePlaceholder.xml index e962192f81..4105065cb6 100644 --- a/doc/classes/InstancePlaceholder.xml +++ b/doc/classes/InstancePlaceholder.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InstancePlaceholder" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="InstancePlaceholder" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Placeholder for the root [Node] of a [PackedScene]. </brief_description> diff --git a/doc/classes/InterpolatedCamera.xml b/doc/classes/InterpolatedCamera.xml index 5e5ce59a8b..bd532bec85 100644 --- a/doc/classes/InterpolatedCamera.xml +++ b/doc/classes/InterpolatedCamera.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="InterpolatedCamera" inherits="Camera" category="Core" version="3.0.alpha.custom_build"> +<class name="InterpolatedCamera" inherits="Camera" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 37c1db51f5..950b43417b 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ItemList" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="ItemList" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Control that provides a list of selectable items (and/or icons) in a single column, or optionally in multiple columns. </brief_description> diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml index 8bff140bb4..e945a580db 100644 --- a/doc/classes/JSON.xml +++ b/doc/classes/JSON.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="JSON" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="JSON" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Helper class for parsing JSON data. </brief_description> diff --git a/doc/classes/JSONParseResult.xml b/doc/classes/JSONParseResult.xml index 2d163c4a80..5bf9298f7a 100644 --- a/doc/classes/JSONParseResult.xml +++ b/doc/classes/JSONParseResult.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="JSONParseResult" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="JSONParseResult" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Data class wrapper for decoded JSON. </brief_description> @@ -70,13 +70,13 @@ </methods> <members> <member name="error" type="int" setter="set_error" getter="get_error" enum="Error"> - The error type if JSON source was not successfully parsed. See [@Global Scope]ERR_* constants. + The error type if JSON source was not successfully parsed. See [@GlobalScope]ERR_* constants. </member> <member name="error_line" type="int" setter="set_error_line" getter="get_error_line"> The line number where the error occurred if JSON source was not successfully parsed. </member> <member name="error_string" type="String" setter="set_error_string" getter="get_error_string"> - The error message if JSON source was not successfully parsed. See [@Global Scope]ERR_* constants. + The error message if JSON source was not successfully parsed. See [@GlobalScope]ERR_* constants. </member> <member name="result" type="Variant" setter="set_result" getter="get_result"> A [Variant] containing the parsed JSON. Use typeof() to check if it is what you expect. For example, if JSON source starts with braces [code]{}[/code] a [Dictionary] will be returned, if JSON source starts with array braces [code][][/code] an [Array] will be returned. diff --git a/doc/classes/Joint.xml b/doc/classes/Joint.xml index 901f84fe5e..30ece8df1f 100644 --- a/doc/classes/Joint.xml +++ b/doc/classes/Joint.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Joint" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Joint" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Base class for all 3D joints </brief_description> diff --git a/doc/classes/Joint2D.xml b/doc/classes/Joint2D.xml index b9caa7ef4b..df70a04f10 100644 --- a/doc/classes/Joint2D.xml +++ b/doc/classes/Joint2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Joint2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Joint2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Base node for all joint constraints in 2D physics. </brief_description> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index f80c00ed6d..b827db474d 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="KinematicBody" inherits="PhysicsBody" category="Core" version="3.0.alpha.custom_build"> +<class name="KinematicBody" inherits="PhysicsBody" category="Core" version="3.0-alpha"> <brief_description> Kinematic body 3D node. </brief_description> diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml index 798fc4153c..264e414ad4 100644 --- a/doc/classes/KinematicBody2D.xml +++ b/doc/classes/KinematicBody2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="KinematicBody2D" inherits="PhysicsBody2D" category="Core" version="3.0.alpha.custom_build"> +<class name="KinematicBody2D" inherits="PhysicsBody2D" category="Core" version="3.0-alpha"> <brief_description> Kinematic body 2D node. </brief_description> diff --git a/doc/classes/KinematicCollision.xml b/doc/classes/KinematicCollision.xml index b7269a646e..ce82004839 100644 --- a/doc/classes/KinematicCollision.xml +++ b/doc/classes/KinematicCollision.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="KinematicCollision" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="KinematicCollision" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Collision data for KinematicBody2D collisions. </brief_description> diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index 7a40a39292..e498dea7a5 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="KinematicCollision2D" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="KinematicCollision2D" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Collision data for KinematicBody2D collisions. </brief_description> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index 1d1ce63a58..93d7b20491 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Label" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Label" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Displays plain text in a line or wrapped inside a rectangle. For formatted text, use [RichTextLabel]. </brief_description> diff --git a/doc/classes/LargeTexture.xml b/doc/classes/LargeTexture.xml index f5416488f6..6ec3c80bca 100644 --- a/doc/classes/LargeTexture.xml +++ b/doc/classes/LargeTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="LargeTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="LargeTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> A Texture capable of storing many smaller Textures with offsets. </brief_description> diff --git a/doc/classes/Light.xml b/doc/classes/Light.xml index fd3ecc7365..1c625d59e1 100644 --- a/doc/classes/Light.xml +++ b/doc/classes/Light.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Light" inherits="VisualInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="Light" inherits="VisualInstance" category="Core" version="3.0-alpha"> <brief_description> Provides a base class for different kinds of light nodes. </brief_description> diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml index 05054e06fd..285d302ba7 100644 --- a/doc/classes/Light2D.xml +++ b/doc/classes/Light2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Light2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Light2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Casts light in a 2D environment. </brief_description> diff --git a/doc/classes/LightOccluder2D.xml b/doc/classes/LightOccluder2D.xml index babcf31c08..9a1b84158b 100644 --- a/doc/classes/LightOccluder2D.xml +++ b/doc/classes/LightOccluder2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="LightOccluder2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="LightOccluder2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Occludes light cast by a Light2D, casting shadows. </brief_description> diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml index 3cca256a5d..f49a806f0e 100644 --- a/doc/classes/Line2D.xml +++ b/doc/classes/Line2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Line2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Line2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> A 2D line. </brief_description> diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index bf81d90efe..432f583566 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="LineEdit" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="LineEdit" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Control that provides single line string editing. </brief_description> @@ -114,7 +114,7 @@ Return the text in the [code]LineEdit[/code]. </description> </method> - <method name="is_context_menu_enabled" qualifiers="const"> + <method name="is_context_menu_enabled"> <return type="bool"> </return> <description> @@ -180,7 +180,7 @@ <method name="set_context_menu_enabled"> <return type="void"> </return> - <argument index="0" name="enabled" type="bool"> + <argument index="0" name="enable" type="bool"> </argument> <description> Set the status of the context menu. When enabled, the context menu will appear when the [code]LineEdit[/code] is right clicked. @@ -268,6 +268,9 @@ <member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed"> Duration (in seconds) of a caret's blinking cycle. </member> + <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled"> + If [code]true[/code] the context menu will appear when right clicked. + </member> <member name="editable" type="bool" setter="set_editable" getter="is_editable"> If [code]false[/code] existing text cannot be modified and new text cannot be added. </member> @@ -292,9 +295,6 @@ <member name="text" type="String" setter="set_text" getter="get_text"> String value of the [LineEdit]. </member> - <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled"> - If [code]true[/code] the context menu will appear when right clicked. - </member> </members> <signals> <signal name="text_changed"> @@ -343,7 +343,9 @@ <constant name="MENU_UNDO" value="5"> Undoes the previous action. </constant> - <constant name="MENU_MAX" value="6"> + <constant name="MENU_REDO" value="6"> + </constant> + <constant name="MENU_MAX" value="7"> </constant> </constants> <theme_items> diff --git a/doc/classes/LineShape2D.xml b/doc/classes/LineShape2D.xml index 5596c48162..6ae6fad6f4 100644 --- a/doc/classes/LineShape2D.xml +++ b/doc/classes/LineShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="LineShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="LineShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Line shape for 2D collisions. </brief_description> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 5e7f467684..d13a0d7be6 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="LinkButton" inherits="BaseButton" category="Core" version="3.0.alpha.custom_build"> +<class name="LinkButton" inherits="BaseButton" category="Core" version="3.0-alpha"> <brief_description> Simple button used to represent a link to some resource </brief_description> diff --git a/doc/classes/Listener.xml b/doc/classes/Listener.xml index 176369cccb..742198acd0 100644 --- a/doc/classes/Listener.xml +++ b/doc/classes/Listener.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Listener" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Listener" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml index f8343467af..048b13a7ca 100644 --- a/doc/classes/MainLoop.xml +++ b/doc/classes/MainLoop.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MainLoop" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="MainLoop" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Main loop is the abstract main loop base class. </brief_description> diff --git a/doc/classes/MarginContainer.xml b/doc/classes/MarginContainer.xml index d4b9b01f63..1c748de229 100644 --- a/doc/classes/MarginContainer.xml +++ b/doc/classes/MarginContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MarginContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="MarginContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> Simple margin container. </brief_description> diff --git a/doc/classes/Marshalls.xml b/doc/classes/Marshalls.xml index b443d03108..0e561ab374 100644 --- a/doc/classes/Marshalls.xml +++ b/doc/classes/Marshalls.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Marshalls" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Marshalls" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Data transformation (marshalling) and encoding helpers. </brief_description> diff --git a/doc/classes/Material.xml b/doc/classes/Material.xml index 88b35ac6b5..87c2e51003 100644 --- a/doc/classes/Material.xml +++ b/doc/classes/Material.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Material" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Material" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Abstract base [Resource] for coloring and shading geometry. </brief_description> diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index f1ab74d00e..54be44d3d8 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MenuButton" inherits="Button" category="Core" version="3.0.alpha.custom_build"> +<class name="MenuButton" inherits="Button" category="Core" version="3.0-alpha"> <brief_description> Special button that brings up a [PopupMenu] when clicked. </brief_description> diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml index 658265d242..733f76728c 100644 --- a/doc/classes/Mesh.xml +++ b/doc/classes/Mesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Mesh" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Mesh" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> A [Resource] that contains vertex-array based geometry. </brief_description> diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml index 6088d30013..f433d7a753 100644 --- a/doc/classes/MeshDataTool.xml +++ b/doc/classes/MeshDataTool.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MeshDataTool" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="MeshDataTool" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/MeshInstance.xml b/doc/classes/MeshInstance.xml index 56b446cac1..5bd6bedf7e 100644 --- a/doc/classes/MeshInstance.xml +++ b/doc/classes/MeshInstance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MeshInstance" inherits="GeometryInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="MeshInstance" inherits="GeometryInstance" category="Core" version="3.0-alpha"> <brief_description> Node that instances meshes into a scenario. </brief_description> diff --git a/doc/classes/MeshLibrary.xml b/doc/classes/MeshLibrary.xml index 5636db23b5..54a8228d02 100644 --- a/doc/classes/MeshLibrary.xml +++ b/doc/classes/MeshLibrary.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MeshLibrary" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="MeshLibrary" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Library of meshes. </brief_description> diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index 6df9689ada..73384c27e4 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MultiMesh" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="MultiMesh" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Provides high performance mesh instancing. </brief_description> diff --git a/doc/classes/MultiMeshInstance.xml b/doc/classes/MultiMeshInstance.xml index 06454e3cdc..11e22c2581 100644 --- a/doc/classes/MultiMeshInstance.xml +++ b/doc/classes/MultiMeshInstance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MultiMeshInstance" inherits="GeometryInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="MultiMeshInstance" inherits="GeometryInstance" category="Core" version="3.0-alpha"> <brief_description> Node that instances a [MultiMesh]. </brief_description> diff --git a/doc/classes/Mutex.xml b/doc/classes/Mutex.xml index 3d0c8eb1df..d36dbb64c1 100644 --- a/doc/classes/Mutex.xml +++ b/doc/classes/Mutex.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Mutex" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Mutex" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> A synchronization Mutex. </brief_description> diff --git a/doc/classes/Navigation.xml b/doc/classes/Navigation.xml index 3e063f6a82..c83e81b197 100644 --- a/doc/classes/Navigation.xml +++ b/doc/classes/Navigation.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Navigation" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Navigation" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Navigation2D.xml b/doc/classes/Navigation2D.xml index ab10463a5d..ac2e0d88d8 100644 --- a/doc/classes/Navigation2D.xml +++ b/doc/classes/Navigation2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Navigation2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Navigation2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index 788fadfd77..dd49b0a593 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NavigationMesh" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="NavigationMesh" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/NavigationMeshInstance.xml b/doc/classes/NavigationMeshInstance.xml index 6d3a81a939..1e8998009e 100644 --- a/doc/classes/NavigationMeshInstance.xml +++ b/doc/classes/NavigationMeshInstance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NavigationMeshInstance" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="NavigationMeshInstance" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index 07eb4afb8d..fd7238114e 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NavigationPolygon" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="NavigationPolygon" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/NavigationPolygonInstance.xml b/doc/classes/NavigationPolygonInstance.xml index a6d70d5b4b..ac56b03002 100644 --- a/doc/classes/NavigationPolygonInstance.xml +++ b/doc/classes/NavigationPolygonInstance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NavigationPolygonInstance" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="NavigationPolygonInstance" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml index 3ac3895df2..4333c3d28a 100644 --- a/doc/classes/NetworkedMultiplayerPeer.xml +++ b/doc/classes/NetworkedMultiplayerPeer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NetworkedMultiplayerPeer" inherits="PacketPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="NetworkedMultiplayerPeer" inherits="PacketPeer" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Nil.xml b/doc/classes/Nil.xml index de12ad1261..1fccdc0148 100644 --- a/doc/classes/Nil.xml +++ b/doc/classes/Nil.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Nil" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Nil" category="Built-In Types" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index c74f3c5a68..2c8bce52a0 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NinePatchRect" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="NinePatchRect" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes. </brief_description> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 7ec4bbb8b5..a103d0eba0 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Node" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Node" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Base class for all the [i]scene[/i] elements. </brief_description> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 2fdc6bf440..195dd9265f 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Node2D" inherits="CanvasItem" category="Core" version="3.0.alpha.custom_build"> +<class name="Node2D" inherits="CanvasItem" category="Core" version="3.0-alpha"> <brief_description> A 2D game object, parent of all 2D related nodes. Has a position, rotation, scale and Z-index. </brief_description> diff --git a/doc/classes/NodePath.xml b/doc/classes/NodePath.xml index ba2145482f..c706864379 100644 --- a/doc/classes/NodePath.xml +++ b/doc/classes/NodePath.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NodePath" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="NodePath" category="Built-In Types" version="3.0-alpha"> <brief_description> Pre-parsed scene tree path. </brief_description> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 9fd4328402..db70b99de4 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="OS" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="OS" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Operating System functions. </brief_description> diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index 5ba5299a77..bea4c14a3c 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Object" category="Core" version="3.0-alpha"> <brief_description> Base class for all non built-in types. </brief_description> @@ -28,7 +28,7 @@ <return type="Array"> </return> <description> - Returns the object's property list as an [Array] of dictionaries. Dictionaries must contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]). + Returns the object's property list as an [Array] of dictionaries. Dictionaries must contain: name:String, type:int (see TYPE_* enum in [@GlobalScope]) and optionally: hint:int (see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@GlobalScope]). </description> </method> <method name="_init" qualifiers="virtual"> @@ -66,7 +66,7 @@ <argument index="1" name="arguments" type="Array" default="[ ]"> </argument> <description> - Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*). + Adds a user-defined [code]signal[/code]. Arguments are optional, but can be added as an [Array] of dictionaries, each containing "name" and "type" (from [@GlobalScope] TYPE_*). </description> </method> <method name="call" qualifiers="vararg"> @@ -212,7 +212,7 @@ <return type="Array"> </return> <description> - Returns the list of properties as an [Array] of dictionaries. Dictionaries contain: name:String, type:int (see TYPE_* enum in [@Global Scope]) and optionally: hint:int (see PROPERTY_HINT_* in [@Global Scope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@Global Scope]). + Returns the list of properties as an [Array] of dictionaries. Dictionaries contain: name:String, type:int (see TYPE_* enum in [@GlobalScope]) and optionally: hint:int (see PROPERTY_HINT_* in [@GlobalScope]), hint_string:String, usage:int (see PROPERTY_USAGE_* in [@GlobalScope]). </description> </method> <method name="get_script" qualifiers="const"> diff --git a/doc/classes/OccluderPolygon2D.xml b/doc/classes/OccluderPolygon2D.xml index 7bc1f74762..e86aa999ad 100644 --- a/doc/classes/OccluderPolygon2D.xml +++ b/doc/classes/OccluderPolygon2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="OccluderPolygon2D" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="OccluderPolygon2D" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Defines a 2D polygon for LightOccluder2D. </brief_description> diff --git a/doc/classes/OmniLight.xml b/doc/classes/OmniLight.xml index cb8e756a4c..7c8b1d4756 100644 --- a/doc/classes/OmniLight.xml +++ b/doc/classes/OmniLight.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="OmniLight" inherits="Light" category="Core" version="3.0.alpha.custom_build"> +<class name="OmniLight" inherits="Light" category="Core" version="3.0-alpha"> <brief_description> OmniDirectional Light, such as a light bulb or a candle. </brief_description> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 08ea23f05a..e08b5cac16 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="OptionButton" inherits="Button" category="Core" version="3.0.alpha.custom_build"> +<class name="OptionButton" inherits="Button" category="Core" version="3.0-alpha"> <brief_description> Button control that provides selectable options when pressed. </brief_description> diff --git a/doc/classes/PCKPacker.xml b/doc/classes/PCKPacker.xml index cf8efdf6be..4677c15b7b 100644 --- a/doc/classes/PCKPacker.xml +++ b/doc/classes/PCKPacker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PCKPacker" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="PCKPacker" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PHashTranslation.xml b/doc/classes/PHashTranslation.xml index b25ddcbf22..c74cc8793f 100644 --- a/doc/classes/PHashTranslation.xml +++ b/doc/classes/PHashTranslation.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PHashTranslation" inherits="Translation" category="Core" version="3.0.alpha.custom_build"> +<class name="PHashTranslation" inherits="Translation" category="Core" version="3.0-alpha"> <brief_description> Optimized translation. </brief_description> diff --git a/doc/classes/PackedDataContainer.xml b/doc/classes/PackedDataContainer.xml index 660a39f210..6e660b983a 100644 --- a/doc/classes/PackedDataContainer.xml +++ b/doc/classes/PackedDataContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PackedDataContainer" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="PackedDataContainer" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PackedDataContainerRef.xml b/doc/classes/PackedDataContainerRef.xml index 413cd4468b..9d44307afe 100644 --- a/doc/classes/PackedDataContainerRef.xml +++ b/doc/classes/PackedDataContainerRef.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PackedDataContainerRef" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="PackedDataContainerRef" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index b40207229c..a226a2bc28 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PackedScene" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="PackedScene" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PacketPeer.xml b/doc/classes/PacketPeer.xml index bc15e5fc0c..b99d5dc5e9 100644 --- a/doc/classes/PacketPeer.xml +++ b/doc/classes/PacketPeer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PacketPeer" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="PacketPeer" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Abstraction and base class for packet-based protocols. </brief_description> diff --git a/doc/classes/PacketPeerStream.xml b/doc/classes/PacketPeerStream.xml index 531046a4ba..38e2d9c1a1 100644 --- a/doc/classes/PacketPeerStream.xml +++ b/doc/classes/PacketPeerStream.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PacketPeerStream" inherits="PacketPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="PacketPeerStream" inherits="PacketPeer" category="Core" version="3.0-alpha"> <brief_description> Wrapper to use a PacketPeer over a StreamPeer. </brief_description> diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml index 1d2241b580..758ad35365 100644 --- a/doc/classes/PacketPeerUDP.xml +++ b/doc/classes/PacketPeerUDP.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PacketPeerUDP" inherits="PacketPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="PacketPeerUDP" inherits="PacketPeer" category="Core" version="3.0-alpha"> <brief_description> UDP packet peer. </brief_description> diff --git a/doc/classes/Panel.xml b/doc/classes/Panel.xml index 8a57659c0c..28a1e304aa 100644 --- a/doc/classes/Panel.xml +++ b/doc/classes/Panel.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Panel" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Panel" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Provides an opaque background for [Control] children. </brief_description> diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml index 29d5169b9e..415d71c8e7 100644 --- a/doc/classes/PanelContainer.xml +++ b/doc/classes/PanelContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PanelContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="PanelContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> Panel container type. </brief_description> diff --git a/doc/classes/PanoramaSky.xml b/doc/classes/PanoramaSky.xml index 81f358461e..7f24bb294b 100644 --- a/doc/classes/PanoramaSky.xml +++ b/doc/classes/PanoramaSky.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PanoramaSky" inherits="Sky" category="Core" version="3.0.alpha.custom_build"> +<class name="PanoramaSky" inherits="Sky" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/ParallaxBackground.xml b/doc/classes/ParallaxBackground.xml index 21b6150900..3186f6b972 100644 --- a/doc/classes/ParallaxBackground.xml +++ b/doc/classes/ParallaxBackground.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ParallaxBackground" inherits="CanvasLayer" category="Core" version="3.0.alpha.custom_build"> +<class name="ParallaxBackground" inherits="CanvasLayer" category="Core" version="3.0-alpha"> <brief_description> A node used to create a parallax scrolling background. </brief_description> diff --git a/doc/classes/ParallaxLayer.xml b/doc/classes/ParallaxLayer.xml index f1e6f9e046..784395b1ec 100644 --- a/doc/classes/ParallaxLayer.xml +++ b/doc/classes/ParallaxLayer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ParallaxLayer" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="ParallaxLayer" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> A parallax scrolling layer to be used with [ParallaxBackground]. </brief_description> diff --git a/doc/classes/Particles.xml b/doc/classes/Particles.xml index 1e89d2194c..4e070f67fd 100644 --- a/doc/classes/Particles.xml +++ b/doc/classes/Particles.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Particles" inherits="GeometryInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="Particles" inherits="GeometryInstance" category="Core" version="3.0-alpha"> <brief_description> 3D particle emitter. </brief_description> diff --git a/doc/classes/Particles2D.xml b/doc/classes/Particles2D.xml index cfc907b727..be69e03d56 100644 --- a/doc/classes/Particles2D.xml +++ b/doc/classes/Particles2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Particles2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Particles2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> 2D particle emitter. </brief_description> diff --git a/doc/classes/ParticlesMaterial.xml b/doc/classes/ParticlesMaterial.xml index bebdc44b69..2428d1880d 100644 --- a/doc/classes/ParticlesMaterial.xml +++ b/doc/classes/ParticlesMaterial.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ParticlesMaterial" inherits="Material" category="Core" version="3.0.alpha.custom_build"> +<class name="ParticlesMaterial" inherits="Material" category="Core" version="3.0-alpha"> <brief_description> Particle properties for [Particles] and [Particles2D] nodes. </brief_description> diff --git a/doc/classes/Path.xml b/doc/classes/Path.xml index 97543418b9..8138a92dcc 100644 --- a/doc/classes/Path.xml +++ b/doc/classes/Path.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Path" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Path" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Container for a [Curve3D]. </brief_description> diff --git a/doc/classes/Path2D.xml b/doc/classes/Path2D.xml index 722e0c1240..8172fc2c4b 100644 --- a/doc/classes/Path2D.xml +++ b/doc/classes/Path2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Path2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Path2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Contains a [Curve2D] path for [PathFollow2D] nodes to follow. </brief_description> diff --git a/doc/classes/PathFollow.xml b/doc/classes/PathFollow.xml index 86f55a2aaf..bdf2a082e0 100644 --- a/doc/classes/PathFollow.xml +++ b/doc/classes/PathFollow.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PathFollow" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="PathFollow" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Point sampler for a [Path]. </brief_description> diff --git a/doc/classes/PathFollow2D.xml b/doc/classes/PathFollow2D.xml index 850b81c046..01137d01d0 100644 --- a/doc/classes/PathFollow2D.xml +++ b/doc/classes/PathFollow2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PathFollow2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="PathFollow2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Point sampler for a [Path2D]. </brief_description> diff --git a/doc/classes/Performance.xml b/doc/classes/Performance.xml index 82ee3531f1..daf1bd62ed 100644 --- a/doc/classes/Performance.xml +++ b/doc/classes/Performance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Performance" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Performance" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Exposes performance related data. </brief_description> diff --git a/doc/classes/Physics2DDirectBodyState.xml b/doc/classes/Physics2DDirectBodyState.xml index cc68aaab1f..40666d8330 100644 --- a/doc/classes/Physics2DDirectBodyState.xml +++ b/doc/classes/Physics2DDirectBodyState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DDirectBodyState" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DDirectBodyState" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Direct access object to a physics body in the [Physics2DServer]. </brief_description> diff --git a/doc/classes/Physics2DDirectBodyStateSW.xml b/doc/classes/Physics2DDirectBodyStateSW.xml index c2444d4795..865fb6a347 100644 --- a/doc/classes/Physics2DDirectBodyStateSW.xml +++ b/doc/classes/Physics2DDirectBodyStateSW.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DDirectBodyStateSW" inherits="Physics2DDirectBodyState" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DDirectBodyStateSW" inherits="Physics2DDirectBodyState" category="Core" version="3.0-alpha"> <brief_description> Software implementation of [Physics2DDirectBodyState]. </brief_description> diff --git a/doc/classes/Physics2DDirectSpaceState.xml b/doc/classes/Physics2DDirectSpaceState.xml index b15d4dfd54..ca7dbab8b8 100644 --- a/doc/classes/Physics2DDirectSpaceState.xml +++ b/doc/classes/Physics2DDirectSpaceState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DDirectSpaceState" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DDirectSpaceState" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Direct access object to a space in the [Physics2DServer]. </brief_description> diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml index 6e3381c200..f3115144fa 100644 --- a/doc/classes/Physics2DServer.xml +++ b/doc/classes/Physics2DServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DServer" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DServer" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Physics 2D Server. </brief_description> @@ -338,10 +338,6 @@ <method name="body_create"> <return type="RID"> </return> - <argument index="0" name="mode" type="int" enum="Physics2DServer.BodyMode" default="2"> - </argument> - <argument index="1" name="init_sleeping" type="bool" default="false"> - </argument> <description> Creates a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time. </description> @@ -725,6 +721,30 @@ Returns whether a body can move from a given point in a given direction. Apart from the boolean return value, a [Physics2DTestMotionResult] can be passed to return additional information in. </description> </method> + <method name="capsule_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="circle_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="concave_polygon_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="convex_polygon_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> <method name="damped_spring_joint_create"> <return type="RID"> </return> @@ -832,6 +852,12 @@ Sets a joint parameter. Parameters are explained in the JOINT_PARAM* constants. </description> </method> + <method name="line_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> <method name="pin_joint_create"> <return type="RID"> </return> @@ -845,22 +871,31 @@ Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself. </description> </method> - <method name="set_active"> - <return type="void"> + <method name="ray_shape_create"> + <return type="RID"> </return> - <argument index="0" name="active" type="bool"> - </argument> <description> - Activates or deactivates the 2D physics engine. </description> </method> - <method name="shape_create"> + <method name="rectangle_shape_create"> <return type="RID"> </return> - <argument index="0" name="type" type="int" enum="Physics2DServer.ShapeType"> + <description> + </description> + </method> + <method name="segment_shape_create"> + <return type="RID"> + </return> + <description> + </description> + </method> + <method name="set_active"> + <return type="void"> + </return> + <argument index="0" name="active" type="bool"> </argument> <description> - Creates a shape of type SHAPE_*. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape]. + Activates or deactivates the 2D physics engine. </description> </method> <method name="shape_get_data" qualifiers="const"> diff --git a/doc/classes/Physics2DServerSW.xml b/doc/classes/Physics2DServerSW.xml index 67fd7a21d8..6764f1a4f6 100644 --- a/doc/classes/Physics2DServerSW.xml +++ b/doc/classes/Physics2DServerSW.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DServerSW" inherits="Physics2DServer" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DServerSW" inherits="Physics2DServer" category="Core" version="3.0-alpha"> <brief_description> Software implementation of [Physics2DServer]. </brief_description> diff --git a/doc/classes/Physics2DShapeQueryParameters.xml b/doc/classes/Physics2DShapeQueryParameters.xml index 04fe12cc07..829aec7a25 100644 --- a/doc/classes/Physics2DShapeQueryParameters.xml +++ b/doc/classes/Physics2DShapeQueryParameters.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DShapeQueryParameters" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DShapeQueryParameters" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Parameters to be sent to a 2D shape physics query. </brief_description> diff --git a/doc/classes/Physics2DShapeQueryResult.xml b/doc/classes/Physics2DShapeQueryResult.xml index 9786a6aa75..d5a29e79fa 100644 --- a/doc/classes/Physics2DShapeQueryResult.xml +++ b/doc/classes/Physics2DShapeQueryResult.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DShapeQueryResult" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DShapeQueryResult" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Physics2DTestMotionResult.xml b/doc/classes/Physics2DTestMotionResult.xml index a71d58faa7..6bc4849184 100644 --- a/doc/classes/Physics2DTestMotionResult.xml +++ b/doc/classes/Physics2DTestMotionResult.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Physics2DTestMotionResult" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Physics2DTestMotionResult" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PhysicsBody.xml b/doc/classes/PhysicsBody.xml index e75fbb8e2d..579a074731 100644 --- a/doc/classes/PhysicsBody.xml +++ b/doc/classes/PhysicsBody.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsBody" inherits="CollisionObject" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsBody" inherits="CollisionObject" category="Core" version="3.0-alpha"> <brief_description> Base class for all objects affected by physics in 3D space. </brief_description> diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index 748506baa9..bf341692bf 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsBody2D" inherits="CollisionObject2D" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsBody2D" inherits="CollisionObject2D" category="Core" version="3.0-alpha"> <brief_description> Base class for all objects affected by physics in 2D space. </brief_description> diff --git a/doc/classes/PhysicsDirectBodyState.xml b/doc/classes/PhysicsDirectBodyState.xml index 349b7e7c3f..33dafa29f6 100644 --- a/doc/classes/PhysicsDirectBodyState.xml +++ b/doc/classes/PhysicsDirectBodyState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsDirectBodyState" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsDirectBodyState" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PhysicsDirectBodyStateSW.xml b/doc/classes/PhysicsDirectBodyStateSW.xml deleted file mode 100644 index 6d283f307e..0000000000 --- a/doc/classes/PhysicsDirectBodyStateSW.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsDirectBodyStateSW" inherits="PhysicsDirectBodyState" category="Core" version="3.0.alpha.custom_build"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <demos> - </demos> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/PhysicsDirectSpaceState.xml b/doc/classes/PhysicsDirectSpaceState.xml index 01307b92c7..b5765b6421 100644 --- a/doc/classes/PhysicsDirectSpaceState.xml +++ b/doc/classes/PhysicsDirectSpaceState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsDirectSpaceState" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsDirectSpaceState" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml index b0f42b83a3..76dabd12ba 100644 --- a/doc/classes/PhysicsServer.xml +++ b/doc/classes/PhysicsServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsServer" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsServer" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Server interface for low level physics access. </brief_description> @@ -388,6 +388,14 @@ Returns the [PhysicsDirectBodyState] of the body. </description> </method> + <method name="body_get_kinematic_safe_margin" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="body" type="RID"> + </argument> + <description> + </description> + </method> <method name="body_get_max_contacts_reported" qualifiers="const"> <return type="int"> </return> @@ -598,6 +606,16 @@ Sets the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force integration]). </description> </method> + <method name="body_set_kinematic_safe_margin"> + <return type="void"> + </return> + <argument index="0" name="body" type="RID"> + </argument> + <argument index="1" name="margin" type="float"> + </argument> + <description> + </description> + </method> <method name="body_set_max_contacts_reported"> <return type="void"> </return> @@ -1422,7 +1440,9 @@ <constant name="BODY_MODE_RIGID" value="2"> Constant for rigid bodies. </constant> - <constant name="BODY_MODE_CHARACTER" value="3"> + <constant name="BODY_MODE_SOFT" value="3"> + </constant> + <constant name="BODY_MODE_CHARACTER" value="4"> Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. </constant> <constant name="BODY_PARAM_BOUNCE" value="0"> diff --git a/doc/classes/PhysicsServerSW.xml b/doc/classes/PhysicsServerSW.xml deleted file mode 100644 index 53e1c0057e..0000000000 --- a/doc/classes/PhysicsServerSW.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsServerSW" inherits="PhysicsServer" category="Core" version="3.0.alpha.custom_build"> - <brief_description> - Software implementation of [PhysicsServer]. - </brief_description> - <description> - This class exposes no new methods or properties and should not be used, as [PhysicsServer] automatically selects the best implementation available. - </description> - <tutorials> - </tutorials> - <demos> - </demos> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/PhysicsShapeQueryParameters.xml b/doc/classes/PhysicsShapeQueryParameters.xml index f2e8b1986a..b9023194d7 100644 --- a/doc/classes/PhysicsShapeQueryParameters.xml +++ b/doc/classes/PhysicsShapeQueryParameters.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsShapeQueryParameters" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsShapeQueryParameters" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PhysicsShapeQueryResult.xml b/doc/classes/PhysicsShapeQueryResult.xml index 4c4a283688..2e723e96df 100644 --- a/doc/classes/PhysicsShapeQueryResult.xml +++ b/doc/classes/PhysicsShapeQueryResult.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PhysicsShapeQueryResult" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="PhysicsShapeQueryResult" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Result of a shape query in Physics2DServer. </brief_description> diff --git a/doc/classes/PinJoint.xml b/doc/classes/PinJoint.xml index 1cc381b1b3..bcf69df816 100644 --- a/doc/classes/PinJoint.xml +++ b/doc/classes/PinJoint.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PinJoint" inherits="Joint" category="Core" version="3.0.alpha.custom_build"> +<class name="PinJoint" inherits="Joint" category="Core" version="3.0-alpha"> <brief_description> Pin Joint for 3D Shapes. </brief_description> diff --git a/doc/classes/PinJoint2D.xml b/doc/classes/PinJoint2D.xml index 009b0ec2f2..7f92567ae4 100644 --- a/doc/classes/PinJoint2D.xml +++ b/doc/classes/PinJoint2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PinJoint2D" inherits="Joint2D" category="Core" version="3.0.alpha.custom_build"> +<class name="PinJoint2D" inherits="Joint2D" category="Core" version="3.0-alpha"> <brief_description> Pin Joint for 2D Shapes. </brief_description> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 5c4eb984db..2fd02a56c6 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Plane" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Plane" category="Built-In Types" version="3.0-alpha"> <brief_description> Plane in hessian form. </brief_description> diff --git a/doc/classes/PlaneMesh.xml b/doc/classes/PlaneMesh.xml index 034bc391a6..93bc191e45 100644 --- a/doc/classes/PlaneMesh.xml +++ b/doc/classes/PlaneMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PlaneMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="PlaneMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Class representing a planar [PrimitiveMesh]. </brief_description> diff --git a/doc/classes/PlaneShape.xml b/doc/classes/PlaneShape.xml index 7e7bde4db3..d394f781e3 100644 --- a/doc/classes/PlaneShape.xml +++ b/doc/classes/PlaneShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PlaneShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="PlaneShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index 5aa7146ff7..ccf60e4d49 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Polygon2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Polygon2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> A 2D polygon. </brief_description> @@ -73,6 +73,12 @@ Return the rotation in radians of the texture polygon. </description> </method> + <method name="get_texture_rotation_degrees" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_texture_scale" qualifiers="const"> <return type="Vector2"> </return> @@ -173,6 +179,14 @@ Set the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in radians and clockwise rotation. </description> </method> + <method name="set_texture_rotation_degrees"> + <return type="void"> + </return> + <argument index="0" name="texture_rotation" type="float"> + </argument> + <description> + </description> + </method> <method name="set_texture_scale"> <return type="void"> </return> diff --git a/doc/classes/PolygonPathFinder.xml b/doc/classes/PolygonPathFinder.xml index a0d1284a85..213d7c0981 100644 --- a/doc/classes/PolygonPathFinder.xml +++ b/doc/classes/PolygonPathFinder.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PolygonPathFinder" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="PolygonPathFinder" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml index 9ef5390c5e..54efc24725 100644 --- a/doc/classes/PoolByteArray.xml +++ b/doc/classes/PoolByteArray.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolByteArray" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolByteArray" category="Built-In Types" version="3.0-alpha"> <brief_description> Raw byte array. </brief_description> diff --git a/doc/classes/PoolColorArray.xml b/doc/classes/PoolColorArray.xml index 70503a67b9..f7cf389577 100644 --- a/doc/classes/PoolColorArray.xml +++ b/doc/classes/PoolColorArray.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolColorArray" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolColorArray" category="Built-In Types" version="3.0-alpha"> <brief_description> Array of Colors </brief_description> diff --git a/doc/classes/PoolIntArray.xml b/doc/classes/PoolIntArray.xml index 5caa8add1e..53b2258c58 100644 --- a/doc/classes/PoolIntArray.xml +++ b/doc/classes/PoolIntArray.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolIntArray" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolIntArray" category="Built-In Types" version="3.0-alpha"> <brief_description> Integer Array. </brief_description> diff --git a/doc/classes/PoolRealArray.xml b/doc/classes/PoolRealArray.xml index ee2740e92a..cc22c256e7 100644 --- a/doc/classes/PoolRealArray.xml +++ b/doc/classes/PoolRealArray.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolRealArray" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolRealArray" category="Built-In Types" version="3.0-alpha"> <brief_description> Real Array. </brief_description> diff --git a/doc/classes/PoolStringArray.xml b/doc/classes/PoolStringArray.xml index ace4f732da..47928281cf 100644 --- a/doc/classes/PoolStringArray.xml +++ b/doc/classes/PoolStringArray.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolStringArray" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolStringArray" category="Built-In Types" version="3.0-alpha"> <brief_description> String Array. </brief_description> diff --git a/doc/classes/PoolVector2Array.xml b/doc/classes/PoolVector2Array.xml index fbfdb11825..2ece5a6486 100644 --- a/doc/classes/PoolVector2Array.xml +++ b/doc/classes/PoolVector2Array.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolVector2Array" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolVector2Array" category="Built-In Types" version="3.0-alpha"> <brief_description> An Array of Vector2. </brief_description> diff --git a/doc/classes/PoolVector3Array.xml b/doc/classes/PoolVector3Array.xml index e5e2924273..59f1c36a9e 100644 --- a/doc/classes/PoolVector3Array.xml +++ b/doc/classes/PoolVector3Array.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PoolVector3Array" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="PoolVector3Array" category="Built-In Types" version="3.0-alpha"> <brief_description> An Array of Vector3. </brief_description> diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml index 7e87c9fcc0..7a93c32ea8 100644 --- a/doc/classes/Popup.xml +++ b/doc/classes/Popup.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Popup" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Popup" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Base container control for popups and dialogs. </brief_description> diff --git a/doc/classes/PopupDialog.xml b/doc/classes/PopupDialog.xml index c51c5b6d21..82439e9d74 100644 --- a/doc/classes/PopupDialog.xml +++ b/doc/classes/PopupDialog.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PopupDialog" inherits="Popup" category="Core" version="3.0.alpha.custom_build"> +<class name="PopupDialog" inherits="Popup" category="Core" version="3.0-alpha"> <brief_description> Base class for Popup Dialogs. </brief_description> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 086eb8e34d..f3cd7df796 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PopupMenu" inherits="Popup" category="Core" version="3.0.alpha.custom_build"> +<class name="PopupMenu" inherits="Popup" category="Core" version="3.0-alpha"> <brief_description> PopupMenu displays a list of options. </brief_description> diff --git a/doc/classes/PopupPanel.xml b/doc/classes/PopupPanel.xml index f8060ab4f6..3878e345c9 100644 --- a/doc/classes/PopupPanel.xml +++ b/doc/classes/PopupPanel.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PopupPanel" inherits="Popup" category="Core" version="3.0.alpha.custom_build"> +<class name="PopupPanel" inherits="Popup" category="Core" version="3.0-alpha"> <brief_description> Class for displaying popups with a panel background. </brief_description> diff --git a/doc/classes/Position2D.xml b/doc/classes/Position2D.xml index ffb1c62d0f..6d282370d4 100644 --- a/doc/classes/Position2D.xml +++ b/doc/classes/Position2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Position2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Position2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Generic 2D Position hint for editing. </brief_description> diff --git a/doc/classes/Position3D.xml b/doc/classes/Position3D.xml index a544e59ddc..cd4c1293ca 100644 --- a/doc/classes/Position3D.xml +++ b/doc/classes/Position3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Position3D" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Position3D" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Generic 3D Position hint for editing </brief_description> diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml index 34141edbe7..5c8d467927 100644 --- a/doc/classes/PrimitiveMesh.xml +++ b/doc/classes/PrimitiveMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PrimitiveMesh" inherits="Mesh" category="Core" version="3.0.alpha.custom_build"> +<class name="PrimitiveMesh" inherits="Mesh" category="Core" version="3.0-alpha"> <brief_description> Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. </brief_description> diff --git a/doc/classes/PrismMesh.xml b/doc/classes/PrismMesh.xml index 21fa67bc82..fa53717111 100644 --- a/doc/classes/PrismMesh.xml +++ b/doc/classes/PrismMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PrismMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="PrismMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Class representing a prism-shaped [PrimitiveMesh]. </brief_description> diff --git a/doc/classes/ProceduralSky.xml b/doc/classes/ProceduralSky.xml index 032ce9def2..70e9388058 100644 --- a/doc/classes/ProceduralSky.xml +++ b/doc/classes/ProceduralSky.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ProceduralSky" inherits="Sky" category="Core" version="3.0.alpha.custom_build"> +<class name="ProceduralSky" inherits="Sky" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index f6be04cc19..d72b28efc5 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ProgressBar" inherits="Range" category="Core" version="3.0.alpha.custom_build"> +<class name="ProgressBar" inherits="Range" category="Core" version="3.0-alpha"> <brief_description> General purpose progress bar. </brief_description> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index bdf2cc0062..6f670ded64 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ProjectSettings" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="ProjectSettings" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Contains global variables accessible from everywhere. </brief_description> @@ -17,7 +17,7 @@ <argument index="0" name="hint" type="Dictionary"> </argument> <description> - Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String]. + Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@GlobalScope]), and optionally hint:[int](see PROPERTY_HINT_* in [@GlobalScope]), hint_string:[String]. Example: [codeblock] ProjectSettings.set("category/property_name", 0) @@ -59,14 +59,6 @@ <description> </description> </method> - <method name="get_singleton" qualifiers="const"> - <return type="Object"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> <method name="globalize_path" qualifiers="const"> <return type="String"> </return> @@ -85,14 +77,6 @@ Return true if a configuration value is present. </description> </method> - <method name="has_singleton" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> <method name="load_resource_pack"> <return type="bool"> </return> diff --git a/doc/classes/ProximityGroup.xml b/doc/classes/ProximityGroup.xml index 9b4b564900..b05d5b95dd 100644 --- a/doc/classes/ProximityGroup.xml +++ b/doc/classes/ProximityGroup.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ProximityGroup" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="ProximityGroup" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> General purpose proximity-detection node. </brief_description> diff --git a/doc/classes/QuadMesh.xml b/doc/classes/QuadMesh.xml index b7c66b04de..807141a284 100644 --- a/doc/classes/QuadMesh.xml +++ b/doc/classes/QuadMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="QuadMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="QuadMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Class representing a square mesh. </brief_description> @@ -11,7 +11,25 @@ <demos> </demos> <methods> + <method name="get_size" qualifiers="const"> + <return type="Vector2"> + </return> + <description> + </description> + </method> + <method name="set_size"> + <return type="void"> + </return> + <argument index="0" name="size" type="Vector2"> + </argument> + <description> + </description> + </method> </methods> + <members> + <member name="size" type="Vector2" setter="set_size" getter="get_size"> + </member> + </members> <constants> </constants> </class> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 056d7d10fa..1aa30075e4 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Quat" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Quat" category="Built-In Types" version="3.0-alpha"> <brief_description> Quaternion. </brief_description> diff --git a/doc/classes/RID.xml b/doc/classes/RID.xml index 89005b0d3b..831a4665c4 100644 --- a/doc/classes/RID.xml +++ b/doc/classes/RID.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RID" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="RID" category="Built-In Types" version="3.0-alpha"> <brief_description> Handle for a [Resource]'s unique ID. </brief_description> diff --git a/doc/classes/Range.xml b/doc/classes/Range.xml index cd75c2b658..d2ea59cbeb 100644 --- a/doc/classes/Range.xml +++ b/doc/classes/Range.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Range" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Range" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Abstract base class for range-based controls. </brief_description> diff --git a/doc/classes/RayCast.xml b/doc/classes/RayCast.xml index 3f999f7fe2..d5f57c43c8 100644 --- a/doc/classes/RayCast.xml +++ b/doc/classes/RayCast.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RayCast" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="RayCast" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Query the closest object intersecting a ray. </brief_description> diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index 45a83f7ded..f5828da796 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RayCast2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="RayCast2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Query the closest object intersecting a ray. </brief_description> diff --git a/doc/classes/RayShape.xml b/doc/classes/RayShape.xml index d5d367a335..d4826141e8 100644 --- a/doc/classes/RayShape.xml +++ b/doc/classes/RayShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RayShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="RayShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> Ray shape for 3D collisions. </brief_description> diff --git a/doc/classes/RayShape2D.xml b/doc/classes/RayShape2D.xml index 4f6313a1d2..c9779a4307 100644 --- a/doc/classes/RayShape2D.xml +++ b/doc/classes/RayShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RayShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="RayShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Ray shape for 2D collisions. </brief_description> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 5af8c82a7b..e0b8b6ec75 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Rect2" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Rect2" category="Built-In Types" version="3.0-alpha"> <brief_description> 2D Axis-aligned bounding box. </brief_description> diff --git a/doc/classes/Rect3.xml b/doc/classes/Rect3.xml index a56dac57c7..88be5fa419 100644 --- a/doc/classes/Rect3.xml +++ b/doc/classes/Rect3.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Rect3" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Rect3" category="Built-In Types" version="3.0-alpha"> <brief_description> Axis-Aligned Bounding Box. </brief_description> diff --git a/doc/classes/RectangleShape2D.xml b/doc/classes/RectangleShape2D.xml index 7a1aec2021..b61344d86f 100644 --- a/doc/classes/RectangleShape2D.xml +++ b/doc/classes/RectangleShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RectangleShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="RectangleShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Rectangle shape for 2D collisions. </brief_description> diff --git a/doc/classes/Reference.xml b/doc/classes/Reference.xml index 2531ea88ad..18bd51f675 100644 --- a/doc/classes/Reference.xml +++ b/doc/classes/Reference.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Reference" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="Reference" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Base class for anything that keeps a reference count. </brief_description> diff --git a/doc/classes/ReferenceRect.xml b/doc/classes/ReferenceRect.xml index e8de910cc8..75b513a147 100644 --- a/doc/classes/ReferenceRect.xml +++ b/doc/classes/ReferenceRect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ReferenceRect" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="ReferenceRect" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Reference frame for GUI. </brief_description> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index c3d95e5a62..1508323207 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ReflectionProbe" inherits="VisualInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="ReflectionProbe" inherits="VisualInstance" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/RegEx.xml b/doc/classes/RegEx.xml deleted file mode 100644 index 4577672c72..0000000000 --- a/doc/classes/RegEx.xml +++ /dev/null @@ -1,114 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="RegEx" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> - <brief_description> - Simple regular expression matcher. - </brief_description> - <description> - Class for finding text patterns in a string using regular expressions. It can not perform replacements. Regular expressions are a way to define patterns of text to be searched. Details on writing patterns are too long to explain here but the Internet is full of tutorials and detailed explanations. - Once created, the RegEx object needs to be compiled with the search pattern before it can be used. The search pattern must be escaped first for gdscript before it is escaped for the expression. For example: - [code]var exp = RegEx.new()[/code] - [code]exp.compile("\\d+")[/code] - would be read by RegEx as [code]\d+[/code] - Similarly: - [code]exp.compile("\"(?:\\\\.|[^\"])*\"")[/code] - would be read as [code]"(?:\\.|[^"])*"[/code] - Currently supported features: - * Capturing [code]()[/code] and non-capturing [code](?:)[/code] groups - * Named capturing groups [code](?P<name>)[/code] - * Any character [code].[/code] - * Shorthand character classes [code]\w \W \s \S \d \D[/code] - * User-defined character classes such as [code][A-Za-z][/code] - * Simple quantifiers [code]?[/code], [code]*[/code] and [code]+[/code] - * Range quantifiers [code]{x,y}[/code] - * Lazy (non-greedy) quantifiers [code]*?[/code] - * Beginning [code]^[/code] and end [code]$[/code] anchors - * Alternation [code]|[/code] - * Backreferences [code]\1[/code], [code]\g{1}[/code], and [code]\g<name>[/code] - * POSIX character classes [code][[:alnum:]][/code] - * Lookahead [code](?=)[/code], [code](?!)[/code] and lookbehind [code](?<=)[/code], [code](?<!)[/code] - * ASCII [code]\xFF[/code] and Unicode [code]\uFFFF[/code] code points (in a style similar to Python) - * Word boundaries [code]\b[/code], [code]\B[/code] - </description> - <tutorials> - </tutorials> - <demos> - </demos> - <methods> - <method name="clear"> - <return type="void"> - </return> - <description> - This method resets the state of the object, as it was freshly created. Namely, it unassigns the regular expression of this object. - </description> - </method> - <method name="compile"> - <return type="int" enum="Error"> - </return> - <argument index="0" name="pattern" type="String"> - </argument> - <description> - Compiles and assign the search pattern to use. - </description> - </method> - <method name="get_group_count" qualifiers="const"> - <return type="int"> - </return> - <description> - Returns the number of numeric capturing groups. - </description> - </method> - <method name="get_names" qualifiers="const"> - <return type="Array"> - </return> - <description> - Returns an array of names of named capturing groups. - </description> - </method> - <method name="get_pattern" qualifiers="const"> - <return type="String"> - </return> - <description> - Returns the search pattern used to compile the code. - </description> - </method> - <method name="is_valid" qualifiers="const"> - <return type="bool"> - </return> - <description> - Returns whether this object has a valid search pattern assigned. - </description> - </method> - <method name="search" qualifiers="const"> - <return type="RegExMatch"> - </return> - <argument index="0" name="subject" type="String"> - </argument> - <argument index="1" name="offset" type="int" default="0"> - </argument> - <argument index="2" name="end" type="int" default="-1"> - </argument> - <description> - Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching result if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be. - </description> - </method> - <method name="sub" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="subject" type="String"> - </argument> - <argument index="1" name="replacement" type="String"> - </argument> - <argument index="2" name="all" type="bool" default="false"> - </argument> - <argument index="3" name="offset" type="int" default="0"> - </argument> - <argument index="4" name="end" type="int" default="-1"> - </argument> - <description> - Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as [code]\1[/code] and [code]\g<name>[/code] expanded and resolved. By default only the first instance is replaced but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be. - </description> - </method> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/RegExMatch.xml b/doc/classes/RegExMatch.xml deleted file mode 100644 index abf2e383d5..0000000000 --- a/doc/classes/RegExMatch.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="RegExMatch" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> - <brief_description> - Contains the results of a regex search. - </brief_description> - <description> - Contains the results of a regex search. [method RegEx.search] returns an instance of [code]RegExMatch[/code] if it finds the search pattern in the [source] string. - </description> - <tutorials> - </tutorials> - <demos> - </demos> - <methods> - <method name="get_end" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="name" type="Variant" default="0"> - </argument> - <description> - Returns the end position of the match in the [source] string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). - </description> - </method> - <method name="get_group_count" qualifiers="const"> - <return type="int"> - </return> - <description> - Returns the number of numeric capturing groups. - </description> - </method> - <method name="get_names" qualifiers="const"> - <return type="Dictionary"> - </return> - <description> - Returns an array of names of named capturing groups. - </description> - </method> - <method name="get_start" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="name" type="Variant" default="0"> - </argument> - <description> - Returns the starting position of the match in the [source] string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). - </description> - </method> - <method name="get_string" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="name" type="Variant" default="0"> - </argument> - <description> - Returns the result of the match in the [source] string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). - </description> - </method> - <method name="get_strings" qualifiers="const"> - <return type="Array"> - </return> - <description> - Returns an [Array] of the matches in the [source] string. - </description> - </method> - <method name="get_subject" qualifiers="const"> - <return type="String"> - </return> - <description> - Returns the [source] string used with the search pattern to find this matching result. - </description> - </method> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/RemoteTransform.xml b/doc/classes/RemoteTransform.xml index 67679bc9df..76caea1a94 100644 --- a/doc/classes/RemoteTransform.xml +++ b/doc/classes/RemoteTransform.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RemoteTransform" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="RemoteTransform" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> RemoteTransform mirrors the [Transform] of another [Spatial] derived Node in the scene. </brief_description> diff --git a/doc/classes/RemoteTransform2D.xml b/doc/classes/RemoteTransform2D.xml index eac7427f9f..d6dcde5742 100644 --- a/doc/classes/RemoteTransform2D.xml +++ b/doc/classes/RemoteTransform2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RemoteTransform2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="RemoteTransform2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> RemoteTransform2D mirrors the [Transform2D] of another [CanvasItem] derived Node in the scene. </brief_description> diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 7767b26988..0044756003 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Resource" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Resource" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Base class for all resources. </brief_description> diff --git a/doc/classes/ResourceImporter.xml b/doc/classes/ResourceImporter.xml index 419c4a84fb..b627438c89 100644 --- a/doc/classes/ResourceImporter.xml +++ b/doc/classes/ResourceImporter.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceImporter" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="ResourceImporter" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/ResourceInteractiveLoader.xml b/doc/classes/ResourceInteractiveLoader.xml index d508b0a532..866347c0bb 100644 --- a/doc/classes/ResourceInteractiveLoader.xml +++ b/doc/classes/ResourceInteractiveLoader.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceInteractiveLoader" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="ResourceInteractiveLoader" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Interactive Resource Loader. </brief_description> diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index 9fb3c71a5b..5940031a76 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceLoader" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="ResourceLoader" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Resource Loader. </brief_description> diff --git a/doc/classes/ResourcePreloader.xml b/doc/classes/ResourcePreloader.xml index 35ebeb1760..f4c3334107 100644 --- a/doc/classes/ResourcePreloader.xml +++ b/doc/classes/ResourcePreloader.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourcePreloader" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="ResourcePreloader" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Resource Preloader Node. </brief_description> diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml index de296776ad..af9c592ded 100644 --- a/doc/classes/ResourceSaver.xml +++ b/doc/classes/ResourceSaver.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceSaver" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="ResourceSaver" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Resource Saving Interface. </brief_description> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index cc644f34cb..a907e0aa0a 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RichTextLabel" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="RichTextLabel" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Label that displays rich text. </brief_description> diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml index f9488d2f7f..d40f7b4429 100644 --- a/doc/classes/RigidBody.xml +++ b/doc/classes/RigidBody.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RigidBody" inherits="PhysicsBody" category="Core" version="3.0.alpha.custom_build"> +<class name="RigidBody" inherits="PhysicsBody" category="Core" version="3.0-alpha"> <brief_description> Physics Body whose position is determined through physics simulation in 3D space. </brief_description> diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml index e0ca6084e6..af8e59c83b 100644 --- a/doc/classes/RigidBody2D.xml +++ b/doc/classes/RigidBody2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="RigidBody2D" inherits="PhysicsBody2D" category="Core" version="3.0.alpha.custom_build"> +<class name="RigidBody2D" inherits="PhysicsBody2D" category="Core" version="3.0-alpha"> <brief_description> A body that is controlled by the 2D physics engine. </brief_description> diff --git a/doc/classes/SceneState.xml b/doc/classes/SceneState.xml index 967c3fbad6..61e08336db 100644 --- a/doc/classes/SceneState.xml +++ b/doc/classes/SceneState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SceneState" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="SceneState" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index f6a6ce36e3..7cfacc737d 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SceneTree" inherits="MainLoop" category="Core" version="3.0.alpha.custom_build"> +<class name="SceneTree" inherits="MainLoop" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml index 276c6857ae..6c540396e5 100644 --- a/doc/classes/SceneTreeTimer.xml +++ b/doc/classes/SceneTreeTimer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SceneTreeTimer" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="SceneTreeTimer" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index c13e009976..83e33c4764 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Script" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Script" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> A class stored as a resource. </brief_description> diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml index e93a0eda0c..7a95f1276e 100644 --- a/doc/classes/ScriptEditor.xml +++ b/doc/classes/ScriptEditor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ScriptEditor" inherits="PanelContainer" category="Core" version="3.0.alpha.custom_build"> +<class name="ScriptEditor" inherits="PanelContainer" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> @@ -9,6 +9,30 @@ <demos> </demos> <methods> + <method name="can_drop_data_fw" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="arg0" type="Vector2"> + </argument> + <argument index="1" name="arg1" type="Variant"> + </argument> + <argument index="2" name="arg2" type="Control"> + </argument> + <description> + </description> + </method> + <method name="drop_data_fw"> + <return type="void"> + </return> + <argument index="0" name="arg0" type="Vector2"> + </argument> + <argument index="1" name="arg1" type="Variant"> + </argument> + <argument index="2" name="arg2" type="Control"> + </argument> + <description> + </description> + </method> <method name="get_current_script"> <return type="Script"> </return> @@ -16,6 +40,16 @@ Returns a [Script] that is currently active in editor. </description> </method> + <method name="get_drag_data_fw"> + <return type="Variant"> + </return> + <argument index="0" name="arg0" type="Vector2"> + </argument> + <argument index="1" name="arg1" type="Control"> + </argument> + <description> + </description> + </method> <method name="get_open_scripts" qualifiers="const"> <return type="Array"> </return> diff --git a/doc/classes/ScrollBar.xml b/doc/classes/ScrollBar.xml index 7a10d3679e..312baf3bb6 100644 --- a/doc/classes/ScrollBar.xml +++ b/doc/classes/ScrollBar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ScrollBar" inherits="Range" category="Core" version="3.0.alpha.custom_build"> +<class name="ScrollBar" inherits="Range" category="Core" version="3.0-alpha"> <brief_description> Base class for scroll bars. </brief_description> diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 1ae06bde70..51bd950cd9 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ScrollContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="ScrollContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> A helper node for displaying scrollable elements (e.g. lists). </brief_description> diff --git a/doc/classes/SegmentShape2D.xml b/doc/classes/SegmentShape2D.xml index 3b7a747bcb..c59370018d 100644 --- a/doc/classes/SegmentShape2D.xml +++ b/doc/classes/SegmentShape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SegmentShape2D" inherits="Shape2D" category="Core" version="3.0.alpha.custom_build"> +<class name="SegmentShape2D" inherits="Shape2D" category="Core" version="3.0-alpha"> <brief_description> Segment shape for 2D collisions. </brief_description> diff --git a/doc/classes/Semaphore.xml b/doc/classes/Semaphore.xml index c9c8ac0298..0f70ec1bd2 100644 --- a/doc/classes/Semaphore.xml +++ b/doc/classes/Semaphore.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Semaphore" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Semaphore" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> A synchronization Semaphore. </brief_description> diff --git a/doc/classes/Separator.xml b/doc/classes/Separator.xml index 4bbabe58aa..8754eb566d 100644 --- a/doc/classes/Separator.xml +++ b/doc/classes/Separator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Separator" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Separator" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Base class for separators. </brief_description> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index 75644c31ab..53b67c9d38 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Shader" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Shader" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> To be changed, ignore. </brief_description> diff --git a/doc/classes/ShaderMaterial.xml b/doc/classes/ShaderMaterial.xml index 8bd9f1039e..81dec0cc14 100644 --- a/doc/classes/ShaderMaterial.xml +++ b/doc/classes/ShaderMaterial.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ShaderMaterial" inherits="Material" category="Core" version="3.0.alpha.custom_build"> +<class name="ShaderMaterial" inherits="Material" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Shape.xml b/doc/classes/Shape.xml index 4d822a1705..df39988a35 100644 --- a/doc/classes/Shape.xml +++ b/doc/classes/Shape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Shape" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Shape" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Base class for all 3D shape resources. </brief_description> diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index d5e2984ba0..fcc1ded4f7 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Shape2D" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Shape2D" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Base class for all 2D Shapes. </brief_description> diff --git a/doc/classes/ShortCut.xml b/doc/classes/ShortCut.xml index e8b3b962d3..b89c3a65bd 100644 --- a/doc/classes/ShortCut.xml +++ b/doc/classes/ShortCut.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ShortCut" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="ShortCut" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml index b5be340b77..b32f8bf7f0 100644 --- a/doc/classes/Skeleton.xml +++ b/doc/classes/Skeleton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Skeleton" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="Skeleton" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Skeleton for characters and animated objects. </brief_description> diff --git a/doc/classes/Sky.xml b/doc/classes/Sky.xml index 3045167346..a2259df42a 100644 --- a/doc/classes/Sky.xml +++ b/doc/classes/Sky.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Sky" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Sky" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Slider.xml b/doc/classes/Slider.xml index b9b2b98549..649752a8a2 100644 --- a/doc/classes/Slider.xml +++ b/doc/classes/Slider.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Slider" inherits="Range" category="Core" version="3.0.alpha.custom_build"> +<class name="Slider" inherits="Range" category="Core" version="3.0-alpha"> <brief_description> Base class for GUI Sliders. </brief_description> diff --git a/doc/classes/SliderJoint.xml b/doc/classes/SliderJoint.xml index adea8658d1..69cdf79c53 100644 --- a/doc/classes/SliderJoint.xml +++ b/doc/classes/SliderJoint.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SliderJoint" inherits="Joint" category="Core" version="3.0.alpha.custom_build"> +<class name="SliderJoint" inherits="Joint" category="Core" version="3.0-alpha"> <brief_description> Piston kind of slider between two bodies in 3D. </brief_description> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index 07f5ea5301..726654f91f 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Spatial" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="Spatial" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Most basic 3D game object, parent of all 3D related nodes. </brief_description> diff --git a/doc/classes/SpatialGizmo.xml b/doc/classes/SpatialGizmo.xml index 1612e80500..eaac74fe10 100644 --- a/doc/classes/SpatialGizmo.xml +++ b/doc/classes/SpatialGizmo.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpatialGizmo" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="SpatialGizmo" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index db47875050..9f8b563373 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpatialMaterial" inherits="Material" category="Core" version="3.0.alpha.custom_build"> +<class name="SpatialMaterial" inherits="Material" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> @@ -135,6 +135,12 @@ <description> </description> </method> + <method name="get_emission_operator" qualifiers="const"> + <return type="int" enum="SpatialMaterial.EmissionOperator"> + </return> + <description> + </description> + </method> <method name="get_feature" qualifiers="const"> <return type="bool"> </return> @@ -523,6 +529,14 @@ <description> </description> </method> + <method name="set_emission_operator"> + <return type="void"> + </return> + <argument index="0" name="operator" type="int" enum="SpatialMaterial.EmissionOperator"> + </argument> + <description> + </description> + </method> <method name="set_feature"> <return type="void"> </return> @@ -843,6 +857,8 @@ </member> <member name="emission_energy" type="float" setter="set_emission_energy" getter="get_emission_energy"> </member> + <member name="emission_operator" type="int" setter="set_emission_operator" getter="get_emission_operator" enum="SpatialMaterial.EmissionOperator"> + </member> <member name="emission_texture" type="Texture" setter="set_texture" getter="get_texture"> </member> <member name="flags_fixed_size" type="bool" setter="set_flag" getter="get_flag"> @@ -1113,5 +1129,9 @@ </constant> <constant name="TEXTURE_CHANNEL_GRAYSCALE" value="4"> </constant> + <constant name="EMISSION_OP_ADD" value="0"> + </constant> + <constant name="EMISSION_OP_MULTIPLY" value="1"> + </constant> </constants> </class> diff --git a/doc/classes/SpatialVelocityTracker.xml b/doc/classes/SpatialVelocityTracker.xml index 95871c8cdc..62d3f02c89 100644 --- a/doc/classes/SpatialVelocityTracker.xml +++ b/doc/classes/SpatialVelocityTracker.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpatialVelocityTracker" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="SpatialVelocityTracker" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/SphereMesh.xml b/doc/classes/SphereMesh.xml index 0ae48cb7d7..42af9cd6b8 100644 --- a/doc/classes/SphereMesh.xml +++ b/doc/classes/SphereMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SphereMesh" inherits="PrimitiveMesh" category="Core" version="3.0.alpha.custom_build"> +<class name="SphereMesh" inherits="PrimitiveMesh" category="Core" version="3.0-alpha"> <brief_description> Class representing a spherical [PrimitiveMesh]. </brief_description> diff --git a/doc/classes/SphereShape.xml b/doc/classes/SphereShape.xml index 7c6174f4e4..28f96b0028 100644 --- a/doc/classes/SphereShape.xml +++ b/doc/classes/SphereShape.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SphereShape" inherits="Shape" category="Core" version="3.0.alpha.custom_build"> +<class name="SphereShape" inherits="Shape" category="Core" version="3.0-alpha"> <brief_description> Sphere shape for 3D collisions. </brief_description> diff --git a/doc/classes/SpinBox.xml b/doc/classes/SpinBox.xml index 31ef1865e9..e0c0a88148 100644 --- a/doc/classes/SpinBox.xml +++ b/doc/classes/SpinBox.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpinBox" inherits="Range" category="Core" version="3.0.alpha.custom_build"> +<class name="SpinBox" inherits="Range" category="Core" version="3.0-alpha"> <brief_description> Numerical input text field. </brief_description> diff --git a/doc/classes/SplitContainer.xml b/doc/classes/SplitContainer.xml index 861a483f6d..50ed6a5f64 100644 --- a/doc/classes/SplitContainer.xml +++ b/doc/classes/SplitContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SplitContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="SplitContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> Container for splitting and adjusting. </brief_description> diff --git a/doc/classes/SpotLight.xml b/doc/classes/SpotLight.xml index 430e7c4a26..ce58791171 100644 --- a/doc/classes/SpotLight.xml +++ b/doc/classes/SpotLight.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpotLight" inherits="Light" category="Core" version="3.0.alpha.custom_build"> +<class name="SpotLight" inherits="Light" category="Core" version="3.0-alpha"> <brief_description> Spotlight [Light], such as a reflector spotlight or a lantern. </brief_description> diff --git a/doc/classes/Sprite.xml b/doc/classes/Sprite.xml index 0cdc8f7099..7996adab51 100644 --- a/doc/classes/Sprite.xml +++ b/doc/classes/Sprite.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Sprite" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="Sprite" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> General purpose Sprite node. </brief_description> diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index e51616a071..5354d8c819 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Sprite3D" inherits="SpriteBase3D" category="Core" version="3.0.alpha.custom_build"> +<class name="Sprite3D" inherits="SpriteBase3D" category="Core" version="3.0-alpha"> <brief_description> 2D Sprite node in 3D world. </brief_description> diff --git a/doc/classes/SpriteBase3D.xml b/doc/classes/SpriteBase3D.xml index f6c3367704..69537cd884 100644 --- a/doc/classes/SpriteBase3D.xml +++ b/doc/classes/SpriteBase3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpriteBase3D" inherits="GeometryInstance" category="Core" version="3.0.alpha.custom_build"> +<class name="SpriteBase3D" inherits="GeometryInstance" category="Core" version="3.0-alpha"> <brief_description> 2D Sprite node in 3D environment. </brief_description> diff --git a/doc/classes/SpriteFrames.xml b/doc/classes/SpriteFrames.xml index e46fdc80e0..336b155689 100644 --- a/doc/classes/SpriteFrames.xml +++ b/doc/classes/SpriteFrames.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SpriteFrames" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="SpriteFrames" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Sprite frame library for AnimatedSprite. </brief_description> diff --git a/doc/classes/StaticBody.xml b/doc/classes/StaticBody.xml index 6b5b007310..a008f0b99c 100644 --- a/doc/classes/StaticBody.xml +++ b/doc/classes/StaticBody.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StaticBody" inherits="PhysicsBody" category="Core" version="3.0.alpha.custom_build"> +<class name="StaticBody" inherits="PhysicsBody" category="Core" version="3.0-alpha"> <brief_description> Static body for 3D Physics. </brief_description> diff --git a/doc/classes/StaticBody2D.xml b/doc/classes/StaticBody2D.xml index cff41074b8..9f1f79ad59 100644 --- a/doc/classes/StaticBody2D.xml +++ b/doc/classes/StaticBody2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StaticBody2D" inherits="PhysicsBody2D" category="Core" version="3.0.alpha.custom_build"> +<class name="StaticBody2D" inherits="PhysicsBody2D" category="Core" version="3.0-alpha"> <brief_description> Static body for 2D Physics. </brief_description> diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index 077de3dc3c..4f92a524b1 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamPeer" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="StreamPeer" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Abstraction and base class for stream-based protocols. </brief_description> diff --git a/doc/classes/StreamPeerBuffer.xml b/doc/classes/StreamPeerBuffer.xml index 141d46564c..5c67598285 100644 --- a/doc/classes/StreamPeerBuffer.xml +++ b/doc/classes/StreamPeerBuffer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamPeerBuffer" inherits="StreamPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="StreamPeerBuffer" inherits="StreamPeer" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/StreamPeerSSL.xml b/doc/classes/StreamPeerSSL.xml index 5eb3f551f4..59d0e492e4 100644 --- a/doc/classes/StreamPeerSSL.xml +++ b/doc/classes/StreamPeerSSL.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamPeerSSL" inherits="StreamPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="StreamPeerSSL" inherits="StreamPeer" category="Core" version="3.0-alpha"> <brief_description> SSL Stream peer. </brief_description> diff --git a/doc/classes/StreamPeerTCP.xml b/doc/classes/StreamPeerTCP.xml index 9b7cd91ea5..3df68d0926 100644 --- a/doc/classes/StreamPeerTCP.xml +++ b/doc/classes/StreamPeerTCP.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamPeerTCP" inherits="StreamPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="StreamPeerTCP" inherits="StreamPeer" category="Core" version="3.0-alpha"> <brief_description> TCP Stream peer. </brief_description> diff --git a/doc/classes/StreamTexture.xml b/doc/classes/StreamTexture.xml index 6e6f2e8056..2a5ad36b25 100644 --- a/doc/classes/StreamTexture.xml +++ b/doc/classes/StreamTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StreamTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="StreamTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 546712f223..ecf9e54ee7 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="String" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="String" category="Built-In Types" version="3.0-alpha"> <brief_description> Built-in string class. </brief_description> @@ -273,6 +273,12 @@ Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal. </description> </method> + <method name="dedent"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="empty"> <return type="bool"> </return> diff --git a/doc/classes/StyleBox.xml b/doc/classes/StyleBox.xml index ab1ec1f997..c904522c7f 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StyleBox" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="StyleBox" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Base class for drawing stylized boxes for the UI. </brief_description> diff --git a/doc/classes/StyleBoxEmpty.xml b/doc/classes/StyleBoxEmpty.xml index f11959c41d..fd0e256e36 100644 --- a/doc/classes/StyleBoxEmpty.xml +++ b/doc/classes/StyleBoxEmpty.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StyleBoxEmpty" inherits="StyleBox" category="Core" version="3.0.alpha.custom_build"> +<class name="StyleBoxEmpty" inherits="StyleBox" category="Core" version="3.0-alpha"> <brief_description> Empty stylebox (does not display anything). </brief_description> diff --git a/doc/classes/StyleBoxFlat.xml b/doc/classes/StyleBoxFlat.xml index eb9f82af6c..ab1f733c5c 100644 --- a/doc/classes/StyleBoxFlat.xml +++ b/doc/classes/StyleBoxFlat.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.0.alpha.custom_build"> +<class name="StyleBoxFlat" inherits="StyleBox" category="Core" version="3.0-alpha"> <brief_description> Customizable Stylebox with a given set of parameters. (no texture required) </brief_description> diff --git a/doc/classes/StyleBoxLine.xml b/doc/classes/StyleBoxLine.xml new file mode 100644 index 0000000000..669d74416f --- /dev/null +++ b/doc/classes/StyleBoxLine.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="StyleBoxLine" inherits="StyleBox" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="get_color" qualifiers="const"> + <return type="Color"> + </return> + <description> + </description> + </method> + <method name="get_grow" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_thickness" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="is_vertical" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="set_color"> + <return type="void"> + </return> + <argument index="0" name="color" type="Color"> + </argument> + <description> + </description> + </method> + <method name="set_grow"> + <return type="void"> + </return> + <argument index="0" name="grow" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_thickness"> + <return type="void"> + </return> + <argument index="0" name="thickness" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_vertical"> + <return type="void"> + </return> + <argument index="0" name="vertical" type="bool"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="color" type="Color" setter="set_color" getter="get_color"> + </member> + <member name="thickness" type="int" setter="set_thickness" getter="get_thickness"> + </member> + <member name="vertical" type="bool" setter="set_vertical" getter="is_vertical"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/StyleBoxTexture.xml b/doc/classes/StyleBoxTexture.xml index 458fdad99e..2b64b5d6bf 100644 --- a/doc/classes/StyleBoxTexture.xml +++ b/doc/classes/StyleBoxTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="StyleBoxTexture" inherits="StyleBox" category="Core" version="3.0.alpha.custom_build"> +<class name="StyleBoxTexture" inherits="StyleBox" category="Core" version="3.0-alpha"> <brief_description> Texture Based 3x3 scale style. </brief_description> diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 987a725977..93090d9d2e 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SurfaceTool" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="SurfaceTool" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Helper tool to create geometry. </brief_description> diff --git a/doc/classes/TCP_Server.xml b/doc/classes/TCP_Server.xml index 97115619ad..20cdbe4231 100644 --- a/doc/classes/TCP_Server.xml +++ b/doc/classes/TCP_Server.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TCP_Server" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="TCP_Server" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> TCP Server. </brief_description> diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index a7dd86a459..4921690074 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TabContainer" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="TabContainer" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Tabbed Container. </brief_description> diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index d3893ab9a7..e007decf47 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Tabs" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Tabs" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Tabs Control. </brief_description> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index e7f94b5826..0e862a7903 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TextEdit" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="TextEdit" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Multiline text editing control. </brief_description> @@ -232,19 +232,18 @@ Insert a given text at the cursor position. </description> </method> - <method name="is_highlight_all_occurrences_enabled" qualifiers="const"> + <method name="is_context_menu_enabled"> <return type="bool"> </return> <description> - Returns true if highlight all occurrences is enabled. + Returns true if the context menu is enabled. </description> </method> - </method> - <method name="is_context_menu_enabled" qualifiers="const"> + <method name="is_highlight_all_occurrences_enabled" qualifiers="const"> <return type="bool"> </return> <description> - Returns true if the context menu is enabled. + Returns true if highlight all occurrences is enabled. </description> </method> <method name="is_highlight_current_line_enabled" qualifiers="const"> @@ -259,6 +258,13 @@ <description> </description> </method> + <method name="is_readonly" qualifiers="const"> + <return type="bool"> + </return> + <description> + Return true if the text editor is in read-only mode (see [method set_readonly]). + </description> + </method> <method name="is_selection_active" qualifiers="const"> <return type="bool"> </return> @@ -348,7 +354,7 @@ <method name="set_context_menu_enabled"> <return type="void"> </return> - <argument index="0" name="enabled" type="bool"> + <argument index="0" name="enable" type="bool"> </argument> <description> Set the status of the context menu. When enabled, the context menu will appear when the [code]TextEdit[/code] is right clicked. @@ -464,20 +470,26 @@ </member> <member name="caret_block_mode" type="bool" setter="cursor_set_block_mode" getter="cursor_is_block_mode"> </member> + <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled"> + </member> <member name="highlight_all_occurrences" type="bool" setter="set_highlight_all_occurrences" getter="is_highlight_all_occurrences_enabled"> </member> <member name="highlight_current_line" type="bool" setter="set_highlight_current_line" getter="is_highlight_current_line_enabled"> </member> <member name="override_selected_font_color" type="bool" setter="set_override_selected_font_color" getter="is_overriding_selected_font_color"> </member> - <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled"> + <member name="readonly" type="bool" setter="set_readonly" getter="is_readonly"> + If [code]true[/code] read-only mode is enabled. Existing text cannot be modified and new text cannot be added. </member> - <member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled"> + <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled"> </member> <member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled"> </member> <member name="syntax_highlighting" type="bool" setter="set_syntax_coloring" getter="is_syntax_coloring_enabled"> </member> + <member name="text" type="String" setter="set_text" getter="get_text"> + String value of the [TextEdit]. + </member> <member name="v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed"> </member> </members> diff --git a/doc/classes/Texture.xml b/doc/classes/Texture.xml index 93cba29d09..a856eb64ad 100644 --- a/doc/classes/Texture.xml +++ b/doc/classes/Texture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Texture" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Texture" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Texture for 2D and 3D. </brief_description> diff --git a/doc/classes/TextureButton.xml b/doc/classes/TextureButton.xml index 8e51548c10..a6d935376a 100644 --- a/doc/classes/TextureButton.xml +++ b/doc/classes/TextureButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TextureButton" inherits="BaseButton" category="Core" version="3.0.alpha.custom_build"> +<class name="TextureButton" inherits="BaseButton" category="Core" version="3.0-alpha"> <brief_description> Texture-based button. Supports Pressed, Hover, Disabled and Focused states. </brief_description> diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml index f8165753c6..550c38920a 100644 --- a/doc/classes/TextureProgress.xml +++ b/doc/classes/TextureProgress.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TextureProgress" inherits="Range" category="Core" version="3.0.alpha.custom_build"> +<class name="TextureProgress" inherits="Range" category="Core" version="3.0-alpha"> <brief_description> Texture-based progress bar. Useful for loading screens and life or stamina bars. </brief_description> diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml index af5626ae84..cef102e8ae 100644 --- a/doc/classes/TextureRect.xml +++ b/doc/classes/TextureRect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TextureRect" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="TextureRect" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Draws a sprite or a texture inside a User Interface. The texture can tile or not. </brief_description> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 4dd45ac821..0a95a52e4f 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Theme" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Theme" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Theme for controls. </brief_description> diff --git a/doc/classes/Thread.xml b/doc/classes/Thread.xml index e2326ffe98..24bc4bb985 100644 --- a/doc/classes/Thread.xml +++ b/doc/classes/Thread.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Thread" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="Thread" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> A unit of execution in a process. </brief_description> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index c44fa500cd..c48f58f123 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TileMap" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="TileMap" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Node for 2D tile-based maps. </brief_description> @@ -59,6 +59,12 @@ Return true if tiles are to be centered in y coordinate (by default this is false and they are drawn from upper left cell corner). </description> </method> + <method name="get_clip_uv" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="get_collision_bounce" qualifiers="const"> <return type="float"> </return> @@ -298,6 +304,14 @@ Set tiles to be centered in y coordinate. (by default this is false and they are drawn from upper left cell corner). </description> </method> + <method name="set_clip_uv"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_collision_bounce"> <return type="void"> </return> @@ -450,6 +464,8 @@ </method> </methods> <members> + <member name="cell_clip_uv" type="bool" setter="set_clip_uv" getter="get_clip_uv"> + </member> <member name="cell_custom_transform" type="Transform2D" setter="set_custom_transform" getter="get_custom_transform"> The custom [Transform2D] to be applied to the TileMap's cells. </member> diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index a858138144..a1063567f8 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TileSet" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="TileSet" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Tile library for tilemaps. </brief_description> diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml index 035dec7980..8d834537a7 100644 --- a/doc/classes/Timer.xml +++ b/doc/classes/Timer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Timer" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="Timer" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> A countdown timer. </brief_description> diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml index 7723dadb83..b541d00d2f 100644 --- a/doc/classes/ToolButton.xml +++ b/doc/classes/ToolButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ToolButton" inherits="Button" category="Core" version="3.0.alpha.custom_build"> +<class name="ToolButton" inherits="Button" category="Core" version="3.0-alpha"> <brief_description> Flat button helper class. </brief_description> diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml index 51cb7f86f2..283ead1b1b 100644 --- a/doc/classes/TouchScreenButton.xml +++ b/doc/classes/TouchScreenButton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TouchScreenButton" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="TouchScreenButton" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Button for touch screen devices. </brief_description> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index cd80d568e7..9e1672e6f5 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Transform" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Transform" category="Built-In Types" version="3.0-alpha"> <brief_description> 3D Transformation. 3x4 matrix. </brief_description> diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml index a9d71d7093..d17063b550 100644 --- a/doc/classes/Transform2D.xml +++ b/doc/classes/Transform2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Transform2D" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Transform2D" category="Built-In Types" version="3.0-alpha"> <brief_description> 2D Transformation. 3x2 matrix. </brief_description> diff --git a/doc/classes/Translation.xml b/doc/classes/Translation.xml index c0707d26b8..dc2609b3e1 100644 --- a/doc/classes/Translation.xml +++ b/doc/classes/Translation.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Translation" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="Translation" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Language Translation. </brief_description> diff --git a/doc/classes/TranslationServer.xml b/doc/classes/TranslationServer.xml index 1657541c19..8b50bf027b 100644 --- a/doc/classes/TranslationServer.xml +++ b/doc/classes/TranslationServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TranslationServer" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="TranslationServer" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Server that manages all translations. Translations can be set to it and removed from it. </brief_description> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index bf9245d23a..508a0ec194 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Tree" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="Tree" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Control to show a tree of items. </brief_description> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index f0eb23b636..b463ef7bbb 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TreeItem" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="TreeItem" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Control for a single item inside a [Tree]. </brief_description> diff --git a/doc/classes/TriangleMesh.xml b/doc/classes/TriangleMesh.xml index 21b85c1d05..21a37913c8 100644 --- a/doc/classes/TriangleMesh.xml +++ b/doc/classes/TriangleMesh.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="TriangleMesh" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="TriangleMesh" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index b11498083b..822eee5838 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Tween" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="Tween" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Node useful for animations with unknown start and end points. </brief_description> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index d450a8812e..718522aa57 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="UndoRedo" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="UndoRedo" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Helper to manage UndoRedo in the editor or custom tools. </brief_description> diff --git a/doc/classes/VBoxContainer.xml b/doc/classes/VBoxContainer.xml index de544ed031..b64b04437a 100644 --- a/doc/classes/VBoxContainer.xml +++ b/doc/classes/VBoxContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VBoxContainer" inherits="BoxContainer" category="Core" version="3.0.alpha.custom_build"> +<class name="VBoxContainer" inherits="BoxContainer" category="Core" version="3.0-alpha"> <brief_description> Vertical box container. </brief_description> diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index 4510ac1e2e..5e5ed6f211 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VScrollBar" inherits="ScrollBar" category="Core" version="3.0.alpha.custom_build"> +<class name="VScrollBar" inherits="ScrollBar" category="Core" version="3.0-alpha"> <brief_description> Vertical version of [ScrollBar], which goes from left (min) to right (max). </brief_description> diff --git a/doc/classes/VSeparator.xml b/doc/classes/VSeparator.xml index f98473a148..88c043f9ca 100644 --- a/doc/classes/VSeparator.xml +++ b/doc/classes/VSeparator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VSeparator" inherits="Separator" category="Core" version="3.0.alpha.custom_build"> +<class name="VSeparator" inherits="Separator" category="Core" version="3.0-alpha"> <brief_description> Vertical version of [Separator]. </brief_description> diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index fa4fa34d54..bc0a3a25b6 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VSlider" inherits="Slider" category="Core" version="3.0.alpha.custom_build"> +<class name="VSlider" inherits="Slider" category="Core" version="3.0-alpha"> <brief_description> Vertical slider. </brief_description> diff --git a/doc/classes/VSplitContainer.xml b/doc/classes/VSplitContainer.xml index aac10841c3..e5a8981aaf 100644 --- a/doc/classes/VSplitContainer.xml +++ b/doc/classes/VSplitContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VSplitContainer" inherits="SplitContainer" category="Core" version="3.0.alpha.custom_build"> +<class name="VSplitContainer" inherits="SplitContainer" category="Core" version="3.0-alpha"> <brief_description> Vertical split container. </brief_description> diff --git a/doc/classes/Variant.xml b/doc/classes/Variant.xml index 914ef10036..14df6f050f 100644 --- a/doc/classes/Variant.xml +++ b/doc/classes/Variant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Variant" category="Core" version="3.0.alpha.custom_build"> +<class name="Variant" category="Core" version="3.0-alpha"> <brief_description> The most important data type in Godot. </brief_description> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 510559327f..3afad1d6fa 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Vector2" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Vector2" category="Built-In Types" version="3.0-alpha"> <brief_description> Vector used for 2D Math. </brief_description> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index a05bc5db9a..cec5970f06 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Vector3" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="Vector3" category="Built-In Types" version="3.0-alpha"> <brief_description> Vector class, which performs basic 3D vector math operations. </brief_description> diff --git a/doc/classes/VehicleBody.xml b/doc/classes/VehicleBody.xml index 48202665fb..f9f3590385 100644 --- a/doc/classes/VehicleBody.xml +++ b/doc/classes/VehicleBody.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VehicleBody" inherits="PhysicsBody" category="Core" version="3.0.alpha.custom_build"> +<class name="VehicleBody" inherits="PhysicsBody" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VehicleWheel.xml b/doc/classes/VehicleWheel.xml index b2e54e25bc..f04c33cc5a 100644 --- a/doc/classes/VehicleWheel.xml +++ b/doc/classes/VehicleWheel.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VehicleWheel" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="VehicleWheel" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VideoPlayer.xml b/doc/classes/VideoPlayer.xml index 5387ec30b3..340b162727 100644 --- a/doc/classes/VideoPlayer.xml +++ b/doc/classes/VideoPlayer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VideoPlayer" inherits="Control" category="Core" version="3.0.alpha.custom_build"> +<class name="VideoPlayer" inherits="Control" category="Core" version="3.0-alpha"> <brief_description> Control to play video files. </brief_description> @@ -25,6 +25,12 @@ Get the amount of milliseconds to store in buffer while playing. </description> </method> + <method name="get_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_stream" qualifiers="const"> <return type="VideoStream"> </return> @@ -129,6 +135,14 @@ Set the amount of milliseconds to buffer during playback. </description> </method> + <method name="set_bus"> + <return type="void"> + </return> + <argument index="0" name="bus" type="String"> + </argument> + <description> + </description> + </method> <method name="set_expand"> <return type="void"> </return> @@ -196,6 +210,8 @@ </member> <member name="autoplay" type="bool" setter="set_autoplay" getter="has_autoplay"> </member> + <member name="bus" type="String" setter="set_bus" getter="get_bus"> + </member> <member name="expand" type="bool" setter="set_expand" getter="has_expand"> </member> <member name="paused" type="bool" setter="set_paused" getter="is_paused"> diff --git a/doc/classes/VideoStream.xml b/doc/classes/VideoStream.xml index c282cdfbd0..00607b0f0a 100644 --- a/doc/classes/VideoStream.xml +++ b/doc/classes/VideoStream.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VideoStream" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="VideoStream" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 28a7cb7c8e..9bd229ef26 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Viewport" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="Viewport" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Creates a sub-view into the screen. </brief_description> diff --git a/doc/classes/ViewportContainer.xml b/doc/classes/ViewportContainer.xml index d4d42ad4fb..5a4c3af1f6 100644 --- a/doc/classes/ViewportContainer.xml +++ b/doc/classes/ViewportContainer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ViewportContainer" inherits="Container" category="Core" version="3.0.alpha.custom_build"> +<class name="ViewportContainer" inherits="Container" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> @@ -9,6 +9,12 @@ <demos> </demos> <methods> + <method name="get_stretch_shrink" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="is_stretch_enabled" qualifiers="const"> <return type="bool"> </return> @@ -23,10 +29,20 @@ <description> </description> </method> + <method name="set_stretch_shrink"> + <return type="void"> + </return> + <argument index="0" name="amount" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="stretch" type="bool" setter="set_stretch" getter="is_stretch_enabled"> </member> + <member name="stretch_shrink" type="int" setter="set_stretch_shrink" getter="get_stretch_shrink"> + </member> </members> <constants> </constants> diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index f2515cbcc7..1eace840a8 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ViewportTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build"> +<class name="ViewportTexture" inherits="Texture" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisibilityEnabler.xml b/doc/classes/VisibilityEnabler.xml index 881ba91fad..95bcbd6816 100644 --- a/doc/classes/VisibilityEnabler.xml +++ b/doc/classes/VisibilityEnabler.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityEnabler" inherits="VisibilityNotifier" category="Core" version="3.0.alpha.custom_build"> +<class name="VisibilityEnabler" inherits="VisibilityNotifier" category="Core" version="3.0-alpha"> <brief_description> Enable certain nodes only when visible. </brief_description> diff --git a/doc/classes/VisibilityEnabler2D.xml b/doc/classes/VisibilityEnabler2D.xml index b881de4f91..f23d54a544 100644 --- a/doc/classes/VisibilityEnabler2D.xml +++ b/doc/classes/VisibilityEnabler2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityEnabler2D" inherits="VisibilityNotifier2D" category="Core" version="3.0.alpha.custom_build"> +<class name="VisibilityEnabler2D" inherits="VisibilityNotifier2D" category="Core" version="3.0-alpha"> <brief_description> Enable certain nodes only when visible. </brief_description> diff --git a/doc/classes/VisibilityNotifier.xml b/doc/classes/VisibilityNotifier.xml index 816523fc27..1dfa60a5ac 100644 --- a/doc/classes/VisibilityNotifier.xml +++ b/doc/classes/VisibilityNotifier.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityNotifier" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="VisibilityNotifier" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Detects when the node is visible on screen. </brief_description> diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml index 86227a0277..b8db14e583 100644 --- a/doc/classes/VisibilityNotifier2D.xml +++ b/doc/classes/VisibilityNotifier2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisibilityNotifier2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="VisibilityNotifier2D" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Detects when the node is visible on screen. </brief_description> diff --git a/doc/classes/VisualInstance.xml b/doc/classes/VisualInstance.xml index ed317882a8..be2d38bf9f 100644 --- a/doc/classes/VisualInstance.xml +++ b/doc/classes/VisualInstance.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualInstance" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualInstance" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml index 8e3cb8ee50..1030e4ecc0 100644 --- a/doc/classes/VisualServer.xml +++ b/doc/classes/VisualServer.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualServer" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualServer" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> Server for anything visible. </brief_description> @@ -1791,6 +1791,12 @@ </description> </method> </methods> + <signals> + <signal name="frame_drawn_in_thread"> + <description> + </description> + </signal> + </signals> <constants> <constant name="NO_INDEX_ARRAY" value="-1" enum=""> </constant> diff --git a/doc/classes/WeakRef.xml b/doc/classes/WeakRef.xml index 23629881d3..00e5bdfd2c 100644 --- a/doc/classes/WeakRef.xml +++ b/doc/classes/WeakRef.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="WeakRef" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="WeakRef" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Holds an [Object], but does not contribute to the reference count if the object is a reference. </brief_description> diff --git a/doc/classes/WindowDialog.xml b/doc/classes/WindowDialog.xml index e57983c367..a6ebd45a76 100644 --- a/doc/classes/WindowDialog.xml +++ b/doc/classes/WindowDialog.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="WindowDialog" inherits="Popup" category="Core" version="3.0.alpha.custom_build"> +<class name="WindowDialog" inherits="Popup" category="Core" version="3.0-alpha"> <brief_description> Base class for window dialogs. </brief_description> diff --git a/doc/classes/World.xml b/doc/classes/World.xml index f4f5f5b756..6d243f26a5 100644 --- a/doc/classes/World.xml +++ b/doc/classes/World.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="World" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="World" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Class that has everything pertaining to a world. </brief_description> diff --git a/doc/classes/World2D.xml b/doc/classes/World2D.xml index d57117fef0..bf3cc9f24b 100644 --- a/doc/classes/World2D.xml +++ b/doc/classes/World2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="World2D" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="World2D" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> Class that has everything pertaining to a 2D world. </brief_description> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index 561cd09f43..13922b4987 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="WorldEnvironment" inherits="Node" category="Core" version="3.0.alpha.custom_build"> +<class name="WorldEnvironment" inherits="Node" category="Core" version="3.0-alpha"> <brief_description> Sets environment properties for the entire scene </brief_description> diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml index bb9599e273..5e7ba3b4bf 100644 --- a/doc/classes/XMLParser.xml +++ b/doc/classes/XMLParser.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="XMLParser" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="XMLParser" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> Low-level class for creating parsers for XML files. </brief_description> diff --git a/doc/classes/YSort.xml b/doc/classes/YSort.xml index 3c0c8b3d06..de4c8be11a 100644 --- a/doc/classes/YSort.xml +++ b/doc/classes/YSort.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="YSort" inherits="Node2D" category="Core" version="3.0.alpha.custom_build"> +<class name="YSort" inherits="Node2D" category="Core" version="3.0-alpha"> <brief_description> Sort all child nodes based on their Y positions. </brief_description> diff --git a/doc/classes/bool.xml b/doc/classes/bool.xml index 1d662ba946..f596180bcf 100644 --- a/doc/classes/bool.xml +++ b/doc/classes/bool.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="bool" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="bool" category="Built-In Types" version="3.0-alpha"> <brief_description> Boolean built-in type </brief_description> diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 942aa4d55a..703ca55be8 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="float" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="float" category="Built-In Types" version="3.0-alpha"> <brief_description> Float built-in type </brief_description> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 7c2267ac9a..79a198b198 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="int" category="Built-In Types" version="3.0.alpha.custom_build"> +<class name="int" category="Built-In Types" version="3.0-alpha"> <brief_description> Integer built-in type. </brief_description> diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 72a3c3256b..220a3533b7 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -168,9 +168,11 @@ void RasterizerGLES3::initialize() { #ifdef __APPLE__ // FIXME glDebugMessageCallbackARB does not seem to work on Mac OS X and opengl 3, this may be an issue with our opengl canvas.. #else - glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB); - glDebugMessageCallbackARB(_gl_debug_print, NULL); - glEnable(_EXT_DEBUG_OUTPUT); + if (OS::get_singleton()->is_stdout_verbose()) { + glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB); + glDebugMessageCallbackARB(_gl_debug_print, NULL); + glEnable(_EXT_DEBUG_OUTPUT); + } #endif #endif diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 9a92e63c0c..0c57e4e9cf 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -4282,7 +4282,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const if (i > 0) { glEnable(GL_BLEND); } - _setup_directional_light(i, p_cam_transform.affine_inverse(), shadow_atlas != NULL); + _setup_directional_light(i, p_cam_transform.affine_inverse(), shadow_atlas != NULL && shadow_atlas->size > 0); _render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, env_radiance_tex, false, false, false, i > 0, shadow_atlas != NULL); } } @@ -4345,7 +4345,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const } else { for (int i = 0; i < state.directional_light_count; i++) { directional_light = directional_lights[i]; - _setup_directional_light(i, p_cam_transform.affine_inverse(), shadow_atlas != NULL); + _setup_directional_light(i, p_cam_transform.affine_inverse(), shadow_atlas != NULL && shadow_atlas->size > 0); _render_list(&render_list.elements[render_list.max_elements - render_list.alpha_element_count], render_list.alpha_element_count, p_cam_transform, p_cam_projection, env_radiance_tex, false, true, false, i > 0, shadow_atlas != NULL); } } diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 296d945cda..5071fbba01 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2866,7 +2866,7 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: glGenBuffers(1, &surface->vertex_id); glBindBuffer(GL_ARRAY_BUFFER, surface->vertex_id); - glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), GL_STATIC_DRAW); + glBufferData(GL_ARRAY_BUFFER, array_size, vr.ptr(), p_format & VS::ARRAY_FLAG_USE_DYNAMIC_UPDATE ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind if (p_format & VS::ARRAY_FORMAT_INDEX) { @@ -3104,6 +3104,22 @@ VS::BlendShapeMode RasterizerStorageGLES3::mesh_get_blend_shape_mode(RID p_mesh) return mesh->blend_shape_mode; } +void RasterizerStorageGLES3::mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) { + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + ERR_FAIL_INDEX(p_surface, mesh->surfaces.size()); + + int total_size = p_data.size(); + ERR_FAIL_COND(p_offset + total_size > mesh->surfaces[p_surface]->array_byte_size); + + PoolVector<uint8_t>::Read r = p_data.read(); + + glBindBuffer(GL_ARRAY_BUFFER, mesh->surfaces[p_surface]->array_id); + glBufferSubData(GL_ARRAY_BUFFER, p_offset, total_size, r.ptr()); + glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind +} + void RasterizerStorageGLES3::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) { Mesh *mesh = mesh_owner.getornull(p_mesh); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 6abc22b643..bd5aad29c9 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -692,6 +692,8 @@ public: virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode); virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const; + virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data); + virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material); virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const; diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index 731d6968ce..4bbb18ce42 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -381,8 +381,7 @@ void main() { if (clip_rect_uv) { - vec2 half_texpixel = color_texpixel_size * 0.5; - uv = clamp(uv,src_rect.xy+half_texpixel,src_rect.xy+abs(src_rect.zw)-color_texpixel_size); + uv = clamp(uv,src_rect.xy,src_rect.xy+abs(src_rect.zw)); } #endif diff --git a/editor/SCsub b/editor/SCsub index c531d2c7a6..ff351cbc5d 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -21,11 +21,11 @@ def make_certs_header(target, source, env): g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef _CERTS_RAW_H\n") g.write("#define _CERTS_RAW_H\n") - g.write("static const int _certs_compressed_size=" + str(len(buf)) + ";\n") - g.write("static const int _certs_uncompressed_size=" + str(decomp_size) + ";\n") - g.write("static const unsigned char _certs_compressed[]={\n") + g.write("static const int _certs_compressed_size = " + str(len(buf)) + ";\n") + g.write("static const int _certs_uncompressed_size = " + str(decomp_size) + ";\n") + g.write("static const unsigned char _certs_compressed[] = {\n") for i in range(len(buf)): - g.write(byte_to_str(buf[i]) + ",\n") + g.write("\t" + byte_to_str(buf[i]) + ",\n") g.write("};\n") g.write("#endif") @@ -43,7 +43,7 @@ def make_doc_header(target, source, env): continue f = open_utf8(src, "r") content = f.read() - buf+=content + buf += content buf = encode_utf8(docbegin + buf + docend) decomp_size = len(buf) @@ -53,11 +53,11 @@ def make_doc_header(target, source, env): g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") g.write("#ifndef _DOC_DATA_RAW_H\n") g.write("#define _DOC_DATA_RAW_H\n") - g.write("static const int _doc_data_compressed_size=" + str(len(buf)) + ";\n") - g.write("static const int _doc_data_uncompressed_size=" + str(decomp_size) + ";\n") - g.write("static const unsigned char _doc_data_compressed[]={\n") + g.write("static const int _doc_data_compressed_size = " + str(len(buf)) + ";\n") + g.write("static const int _doc_data_uncompressed_size = " + str(decomp_size) + ";\n") + g.write("static const unsigned char _doc_data_compressed[] = {\n") for i in range(len(buf)): - g.write(byte_to_str(buf[i]) + ",\n") + g.write("\t" + byte_to_str(buf[i]) + ",\n") g.write("};\n") g.write("#endif") @@ -82,10 +82,10 @@ def make_fonts_header(target, source, env): name = os.path.splitext(os.path.basename(source[i].srcnode().abspath))[0] - g.write("static const int _font_" + name + "_size=" + str(len(buf)) + ";\n") - g.write("static const unsigned char _font_" + name + "[]={\n") + g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n") + g.write("static const unsigned char _font_" + name + "[] = {\n") for i in range(len(buf)): - g.write(byte_to_str(buf[i]) + ",\n") + g.write("\t" + byte_to_str(buf[i]) + ",\n") g.write("};\n") @@ -116,11 +116,9 @@ def make_translations_header(target, source, env): buf = zlib.compress(buf) name = os.path.splitext(os.path.basename(sorted_paths[i]))[0] - #g.write("static const int _translation_"+name+"_compressed_size="+str(len(buf))+";\n") - #g.write("static const int _translation_"+name+"_uncompressed_size="+str(decomp_size)+";\n") - g.write("static const unsigned char _translation_" + name + "_compressed[]={\n") + g.write("static const unsigned char _translation_" + name + "_compressed[] = {\n") for i in range(len(buf)): - g.write(byte_to_str(buf[i]) + ",\n") + g.write("\t" + byte_to_str(buf[i]) + ",\n") g.write("};\n") @@ -132,10 +130,10 @@ def make_translations_header(target, source, env): g.write("\tint uncomp_size;\n") g.write("\tconst unsigned char* data;\n") g.write("};\n\n") - g.write("static EditorTranslationList _editor_translations[]={\n") + g.write("static EditorTranslationList _editor_translations[] = {\n") for x in xl_names: - g.write("\t{ \"" + x[0] + "\", " + str(x[1]) + ", " + str(x[2]) + ",_translation_" + x[0] + "_compressed},\n") - g.write("\t{NULL,0,0,NULL}\n") + g.write("\t{ \"" + x[0] + "\", " + str(x[1]) + ", " + str(x[2]) + ", _translation_" + x[0] + "_compressed},\n") + g.write("\t{NULL, 0, 0, NULL}\n") g.write("};\n") g.write("#endif") @@ -392,13 +390,13 @@ def make_license_header(target, source, env): def _make_doc_data_class_path(to_path): g = open_utf8(os.path.join(to_path,"doc_data_class_path.gen.h"), "w") - g.write("static const int _doc_data_class_path_count="+str(len(env.doc_class_path))+";\n") + g.write("static const int _doc_data_class_path_count = " + str(len(env.doc_class_path)) + ";\n") g.write("struct _DocDataClassPath { const char* name; const char* path; };\n") - g.write("static const _DocDataClassPath _doc_data_class_paths["+str(len(env.doc_class_path)+1)+"]={\n"); - for c in env.doc_class_path: - g.write("{\""+c+"\",\""+env.doc_class_path[c]+"\"},\n") - g.write("{NULL,NULL}\n") + g.write("static const _DocDataClassPath _doc_data_class_paths[" + str(len(env.doc_class_path) + 1) + "] = {\n"); + for c in sorted(env.doc_class_path): + g.write("\t{\"" + c + "\", \"" + env.doc_class_path[c] + "\"},\n") + g.write("\t{NULL, NULL}\n") g.write("};\n") @@ -423,6 +421,7 @@ if env['tools']: _make_doc_data_class_path(os.path.join(env.Dir('#').abspath, "editor/doc")) + docs = sorted(docs) env.Depends("#editor/doc_data_compressed.gen.h", docs) env.Command("#editor/doc_data_compressed.gen.h", docs, make_doc_header) # Certificates diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 057b2d827d..f7f823c945 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "doc_data.h" +#include "engine.h" #include "global_constants.h" #include "io/compression.h" #include "io/marshalls.h" @@ -529,7 +530,7 @@ void DocData::generate(bool p_basic_types) { { - String cname = "@Global Scope"; + String cname = "@GlobalScope"; class_list[cname] = ClassDoc(); ClassDoc &c = class_list[cname]; c.name = cname; @@ -543,14 +544,14 @@ void DocData::generate(bool p_basic_types) { c.constants.push_back(cd); } - List<ProjectSettings::Singleton> singletons; - ProjectSettings::get_singleton()->get_singletons(&singletons); + List<Engine::Singleton> singletons; + Engine::get_singleton()->get_singletons(&singletons); //servers (this is kind of hackish) - for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) { + for (List<Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) { PropertyDoc pd; - ProjectSettings::Singleton &s = E->get(); + Engine::Singleton &s = E->get(); pd.name = s.name; pd.type = s.ptr->get_class(); while (String(ClassDB::get_parent_class(pd.type)) != "Object") @@ -615,11 +616,6 @@ void DocData::generate(bool p_basic_types) { } } -static String _format_description(const String &string) { - - return string.dedent().strip_edges().replace("\n", "\n\n"); -} - static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> &methods) { String section = parser->get_node_name(); @@ -666,7 +662,7 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> & parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - method.description = _format_description(parser->get_node_data()); + method.description = parser->get_node_data(); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == element) @@ -781,20 +777,20 @@ Error DocData::_load(Ref<XMLParser> parser) { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - c.brief_description = _format_description(parser->get_node_data()); + c.brief_description = parser->get_node_data(); } else if (name == "description") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - c.description = _format_description(parser->get_node_data()); + c.description = parser->get_node_data(); } else if (name == "tutorials") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - c.tutorials = parser->get_node_data().strip_edges(); + c.tutorials = parser->get_node_data(); } else if (name == "demos") { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - c.demos = parser->get_node_data().strip_edges(); + c.demos = parser->get_node_data(); } else if (name == "methods") { Error err = _parse_methods(parser, c.methods); @@ -828,7 +824,7 @@ Error DocData::_load(Ref<XMLParser> parser) { prop.enumeration = parser->get_attribute_value("enum"); parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - prop.description = _format_description(parser->get_node_data()); + prop.description = parser->get_node_data(); c.properties.push_back(prop); } else { ERR_EXPLAIN("Invalid tag in doc file: " + name); @@ -857,7 +853,7 @@ Error DocData::_load(Ref<XMLParser> parser) { prop.type = parser->get_attribute_value("type"); parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - prop.description = parser->get_node_data().strip_edges(); + prop.description = parser->get_node_data(); c.theme_properties.push_back(prop); } else { ERR_EXPLAIN("Invalid tag in doc file: " + name); @@ -888,7 +884,7 @@ Error DocData::_load(Ref<XMLParser> parser) { } parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) - constant.description = parser->get_node_data().strip_edges(); + constant.description = parser->get_node_data(); c.constants.push_back(constant); } else { ERR_EXPLAIN("Invalid tag in doc file: " + name); @@ -915,6 +911,8 @@ Error DocData::_load(Ref<XMLParser> parser) { static void _write_string(FileAccess *f, int p_tablevel, const String &p_string) { + if (p_string == "") + return; String tab; for (int i = 0; i < p_tablevel; i++) tab += "\t"; @@ -953,24 +951,20 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri if (c.category == "") category = "Core"; header += " category=\"" + category + "\""; - header += " version=\"" + String(VERSION_MKSTRING) + "\""; + header += String(" version=\"") + _MKSTR(VERSION_MAJOR) + "." + _MKSTR(VERSION_MINOR) + "-" + _MKSTR(VERSION_STATUS) + "\""; header += ">"; _write_string(f, 0, header); _write_string(f, 1, "<brief_description>"); - if (c.brief_description != "") - _write_string(f, 2, c.brief_description.xml_escape()); + _write_string(f, 2, c.brief_description.strip_edges().xml_escape()); _write_string(f, 1, "</brief_description>"); _write_string(f, 1, "<description>"); - if (c.description != "") - _write_string(f, 2, c.description.xml_escape()); + _write_string(f, 2, c.description.strip_edges().xml_escape()); _write_string(f, 1, "</description>"); _write_string(f, 1, "<tutorials>"); - if (c.tutorials != "") - _write_string(f, 2, c.tutorials.xml_escape()); + _write_string(f, 2, c.tutorials.strip_edges().xml_escape()); _write_string(f, 1, "</tutorials>"); _write_string(f, 1, "<demos>"); - if (c.demos != "") - _write_string(f, 2, c.demos.xml_escape()); + _write_string(f, 2, c.demos.strip_edges().xml_escape()); _write_string(f, 1, "</demos>"); _write_string(f, 1, "<methods>"); @@ -1014,8 +1008,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri } _write_string(f, 3, "<description>"); - if (m.description != "") - _write_string(f, 4, m.description.xml_escape()); + _write_string(f, 4, m.description.strip_edges().xml_escape()); _write_string(f, 3, "</description>"); _write_string(f, 2, "</method>"); @@ -1036,8 +1029,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri } PropertyDoc &p = c.properties[i]; _write_string(f, 2, "<member name=\"" + p.name + "\" type=\"" + p.type + "\" setter=\"" + p.setter + "\" getter=\"" + p.getter + "\"" + enum_text + ">"); - if (p.description != "") - _write_string(f, 3, p.description.xml_escape()); + _write_string(f, 3, p.description.strip_edges().xml_escape()); _write_string(f, 2, "</member>"); } _write_string(f, 1, "</members>"); @@ -1060,8 +1052,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri } _write_string(f, 3, "<description>"); - if (m.description != "") - _write_string(f, 4, m.description.xml_escape()); + _write_string(f, 4, m.description.strip_edges().xml_escape()); _write_string(f, 3, "</description>"); _write_string(f, 2, "</signal>"); @@ -1080,8 +1071,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri } else { _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\">"); } - if (k.description != "") - _write_string(f, 3, k.description.xml_escape()); + _write_string(f, 3, k.description.strip_edges().xml_escape()); _write_string(f, 2, "</constant>"); } diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp index 2ba7e3c779..13dbb149d5 100644 --- a/editor/doc/doc_dump.cpp +++ b/editor/doc/doc_dump.cpp @@ -82,8 +82,8 @@ void DocDump::dump(const String &p_file) { FileAccess *f = FileAccess::open(p_file, FileAccess::WRITE); _write_string(f, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); + _write_string(f, 0, String("<doc version=\"") + _MKSTR(VERSION_MAJOR) + "." + _MKSTR(VERSION_MINOR) + "-" + _MKSTR(VERSION_STATUS) + "\" name=\"Engine Types\">"); - _write_string(f, 0, "<doc version=\"" + String(VERSION_MKSTRING) + "\" name=\"Engine Types\">"); while (class_list.size()) { String name = class_list.front()->get(); diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index efe32b99ab..a458a10cd2 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -982,7 +982,7 @@ void EditorExport::remove_export_preset(int p_idx) { void EditorExport::add_export_plugin(const Ref<EditorExportPlugin> &p_plugin) { - if (export_plugins.find(p_plugin) == 1) { + if (export_plugins.find(p_plugin) == -1) { export_plugins.push_back(p_plugin); } } diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index a6fc8dcddf..9db3bcba00 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -821,8 +821,6 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const scan_actions.push_back(ia); } } - - EditorResourcePreview::get_singleton()->check_for_invalidation(p_dir->get_file_path(i)); } for (int i = 0; i < p_dir->subdirs.size(); i++) { @@ -915,7 +913,8 @@ void EditorFileSystem::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - scan(); + call_deferred("scan"); //this should happen after every editor node entered the tree + } break; case NOTIFICATION_EXIT_TREE: { if (use_threads && thread) { @@ -1266,7 +1265,6 @@ void EditorFileSystem::update_file(const String &p_file) { fs->files[cpos]->deps = _get_dependencies(p_file); fs->files[cpos]->import_valid = ResourceLoader::is_import_valid(p_file); - EditorResourcePreview::get_singleton()->call_deferred("check_for_invalidation", p_file); call_deferred("emit_signal", "filesystem_changed"); //update later } @@ -1436,6 +1434,8 @@ void EditorFileSystem::_reimport_file(const String &p_file) { r->set_import_last_modified_time(0); } } + + EditorResourcePreview::get_singleton()->check_for_invalidation(p_file); } void EditorFileSystem::reimport_files(const Vector<String> &p_files) { diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 03cd2c9b6b..cc7f1cac43 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -555,7 +555,7 @@ void EditorHelp::_class_desc_select(const String &p_select) { if (select.find(".") != -1) { class_name = select.get_slice(".", 0); } else { - class_name = "@Global Scope"; + class_name = "@GlobalScope"; } emit_signal("go_to_help", "class_enum:" + class_name + ":" + select); return; @@ -1478,9 +1478,10 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { Color font_color_hl = p_rt->get_color("headline_color", "EditorHelp"); Color link_color = p_rt->get_color("accent_color", "Editor").linear_interpolate(font_color_hl, 0.8); - String bbcode = p_bbcode.replace("\t", " ").replace("\r", " ").strip_edges(); + String bbcode = p_bbcode.dedent().replace("\t", "").replace("\r", "").strip_edges(); List<String> tag_stack; + bool code_tag = false; int pos = 0; while (pos < bbcode.length()) { @@ -1491,7 +1492,10 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { brk_pos = bbcode.length(); if (brk_pos > pos) { - p_rt->add_text(bbcode.substr(pos, brk_pos - pos)); + String text = bbcode.substr(pos, brk_pos - pos); + if (!code_tag) + text = text.replace("\n", "\n\n"); + p_rt->add_text(text); } if (brk_pos == bbcode.length()) @@ -1500,7 +1504,11 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { int brk_end = bbcode.find("]", brk_pos + 1); if (brk_end == -1) { - p_rt->add_text(bbcode.substr(brk_pos, bbcode.length() - brk_pos)); + + String text = bbcode.substr(brk_pos, bbcode.length() - brk_pos); + if (!code_tag) + text = text.replace("\n", "\n\n"); + p_rt->add_text(text); break; } @@ -1509,20 +1517,23 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { if (tag.begins_with("/")) { bool tag_ok = tag_stack.size() && tag_stack.front()->get() == tag.substr(1, tag.length()); - if (tag_stack.size()) { - } if (!tag_ok) { p_rt->add_text("["); - pos++; + pos = brk_pos + 1; continue; } tag_stack.pop_front(); pos = brk_end + 1; + code_tag = false; if (tag != "/img") p_rt->pop(); + } else if (code_tag) { + + p_rt->add_text("["); + pos = brk_pos + 1; } else if (tag.begins_with("method ")) { @@ -1559,6 +1570,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { //use monospace font p_rt->push_font(doc_code_font); + code_tag = true; pos = brk_end + 1; tag_stack.push_front(tag); } else if (tag == "center") { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 0675cf2c75..6a4e879340 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -284,9 +284,10 @@ void EditorNode::_notification(int p_what) { if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/editor/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/editor/capitalize_properties", true))); - Ref<Theme> theme = create_editor_theme(theme_base->get_theme()); + Ref<Theme> theme = create_custom_theme(theme_base->get_theme()); theme_base->set_theme(theme); + gui_base->set_theme(theme); gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles")); @@ -871,7 +872,7 @@ void EditorNode::_find_node_types(Node *p_node, int &count_2d, int &count_3d) { _find_node_types(p_node->get_child(i), count_2d, count_3d); } -void EditorNode::_save_scene_with_preview(String p_file) { +void EditorNode::_save_scene_with_preview(String p_file, int p_idx) { EditorProgress save("save", TTR("Saving Scene"), 4); save.step(TTR("Analyzing"), 0); @@ -937,7 +938,7 @@ void EditorNode::_save_scene_with_preview(String p_file) { } save.step(TTR("Saving Scene"), 4); - _save_scene(p_file); + _save_scene(p_file, p_idx); EditorResourcePreview::get_singleton()->check_for_invalidation(p_file); } @@ -1095,10 +1096,7 @@ void EditorNode::_dialog_action(String p_file) { if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) { _save_default_environment(); - if (scene_idx != editor_data.get_edited_scene()) - _save_scene(p_file, scene_idx); - else - _save_scene_with_preview(p_file); + _save_scene_with_preview(p_file, scene_idx); if (scene_idx != -1) _discard_changes(); @@ -1825,7 +1823,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { if (scene && scene->get_filename() != "") { if (scene_idx != editor_data.get_edited_scene()) - _save_scene(scene->get_filename(), scene_idx); + _save_scene_with_preview(scene->get_filename(), scene_idx); else _save_scene_with_preview(scene->get_filename()); @@ -4691,9 +4689,9 @@ EditorNode::EditorNode() { theme_base->add_child(gui_base); gui_base->set_anchors_and_margins_preset(Control::PRESET_WIDE); - Ref<Theme> theme = create_editor_theme(); + Ref<Theme> theme = create_custom_theme(); theme_base->set_theme(theme); - gui_base->set_theme(create_custom_theme()); + gui_base->set_theme(theme); gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); resource_preview = memnew(EditorResourcePreview); @@ -5535,6 +5533,10 @@ EditorNode::EditorNode() { spatial_mat_convert.instance(); resource_conversion_plugins.push_back(spatial_mat_convert); + Ref<CanvasItemMaterialConversionPlugin> canvas_item_mat_convert; + canvas_item_mat_convert.instance(); + resource_conversion_plugins.push_back(canvas_item_mat_convert); + Ref<ParticlesMaterialConversionPlugin> particles_mat_convert; particles_mat_convert.instance(); resource_conversion_plugins.push_back(particles_mat_convert); diff --git a/editor/editor_node.h b/editor/editor_node.h index 7d0649cef3..81ff886228 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -503,7 +503,7 @@ private: void _mark_unsaved_scenes(); void _find_node_types(Node *p_node, int &count_2d, int &count_3d); - void _save_scene_with_preview(String p_file); + void _save_scene_with_preview(String p_file, int p_idx = -1); Map<String, Set<String> > dependency_errors; diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index f92962a4cb..5b4bdb59d3 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -86,7 +86,6 @@ void EditorResourcePreview::_thread_func(void *ud) { void EditorResourcePreview::_preview_ready(const String &p_str, const Ref<Texture> &p_texture, ObjectID id, const StringName &p_func, const Variant &p_ud) { - //print_line("preview is ready"); preview_mutex->lock(); String path = p_str; @@ -121,7 +120,6 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem &p_item, c type = p_item.resource->get_class(); else type = ResourceLoader::get_resource_type(p_item.path); - //print_line("resource type is: "+type); if (type == "") return Ref<Texture>(); //could not guess type @@ -144,7 +142,6 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem &p_item, c if (!p_item.resource.is_valid()) { // cache the preview in case it's a resource on disk if (generated.is_valid()) { - //print_line("was generated"); int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; //wow it generated a preview... save cache @@ -164,15 +161,11 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem &p_item, c void EditorResourcePreview::_thread() { - //print_line("begin thread"); while (!exit) { - //print_line("wait for semaphore"); preview_sem->wait(); preview_mutex->lock(); - //print_line("blue team go"); - if (queue.size()) { QueueItem item = queue.front()->get(); @@ -189,12 +182,11 @@ void EditorResourcePreview::_thread() { preview_mutex->unlock(); } else { + preview_mutex->unlock(); Ref<ImageTexture> texture; - //print_line("pop from queue "+item.path); - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size *= EDSCALE; @@ -304,7 +296,6 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p cache.erase(path_id); //erase if exists, since it will be regen - //print_line("send to thread "+p_path); QueueItem item; item.function = p_receiver_func; item.id = p_receiver->get_instance_id(); @@ -328,7 +319,6 @@ void EditorResourcePreview::queue_resource_preview(const String &p_path, Object return; } - //print_line("send to thread "+p_path); QueueItem item; item.function = p_receiver_func; item.id = p_receiver->get_instance_id(); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index ffa978e194..0f9f50095d 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -582,7 +582,22 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color_disabled", "CheckButton", font_color_disabled); theme->set_color("icon_color_hover", "CheckButton", font_color_hl); + theme->set_constant("hseparation", "CheckButton", 4 * EDSCALE); + theme->set_constant("check_vadjust", "CheckButton", 0 * EDSCALE); + // Checkbox + Ref<StyleBoxFlat> sb_checkbox = style_menu->duplicate(); + // HACK, in reality, the checkbox draws the text over the icon by default, so the margin compensates that. + const int cb_w = theme->get_icon("GuiChecked", "EditorIcons")->get_width() + default_margin_size; + sb_checkbox->set_default_margin(MARGIN_LEFT, cb_w * EDSCALE); + sb_checkbox->set_default_margin(MARGIN_RIGHT, default_margin_size * EDSCALE); + sb_checkbox->set_default_margin(MARGIN_TOP, default_margin_size * EDSCALE); + sb_checkbox->set_default_margin(MARGIN_BOTTOM, default_margin_size * EDSCALE); + + theme->set_stylebox("normal", "CheckBox", sb_checkbox); + theme->set_stylebox("pressed", "CheckBox", sb_checkbox); + theme->set_stylebox("disabled", "CheckBox", sb_checkbox); + theme->set_stylebox("hover", "CheckBox", sb_checkbox); theme->set_icon("checked", "CheckBox", theme->get_icon("GuiChecked", "EditorIcons")); theme->set_icon("unchecked", "CheckBox", theme->get_icon("GuiUnchecked", "EditorIcons")); theme->set_icon("radio_checked", "CheckBox", theme->get_icon("GuiRadioChecked", "EditorIcons")); @@ -594,6 +609,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color_disabled", "CheckBox", font_color_disabled); theme->set_color("icon_color_hover", "CheckBox", font_color_hl); + theme->set_constant("hseparation", "CheckBox", 4 * EDSCALE); + theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE); + // PopupMenu Ref<StyleBoxFlat> style_popup_menu = style_popup; theme->set_stylebox("panel", "PopupMenu", style_popup_menu); @@ -1049,12 +1067,14 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { return theme; } -Ref<Theme> create_custom_theme() { - Ref<Theme> theme = create_editor_theme(); +Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) { + Ref<Theme> theme; String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme"); if (custom_theme != "") { theme = ResourceLoader::load(custom_theme); + } else { + theme = create_editor_theme(p_theme); } String global_font = EditorSettings::get_singleton()->get("interface/editor/custom_font"); diff --git a/editor/editor_themes.h b/editor/editor_themes.h index a644c5936f..6f3b83e0b0 100644 --- a/editor/editor_themes.h +++ b/editor/editor_themes.h @@ -34,6 +34,6 @@ Ref<Theme> create_editor_theme(Ref<Theme> p_theme = NULL); -Ref<Theme> create_custom_theme(); +Ref<Theme> create_custom_theme(Ref<Theme> p_theme = NULL); #endif diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 9314839768..7abddb9f67 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -333,7 +333,7 @@ void FileSystemDock::navigate_to_path(const String &p_path) { } else if (dirAccess->dir_exists(p_path)) { path = p_path; } else { - ERR_EXPLAIN(TTR("Cannot navigate to '" + p_path + "' as it has not been found in the file system!")); + ERR_EXPLAIN(vformat(TTR("Cannot navigate to '%s' as it has not been found in the file system!"), p_path)); ERR_FAIL(); } diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 831eb74b66..397bb6ad68 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1,5 +1,6 @@ #include "editor_scene_importer_gltf.h" #include "io/json.h" +#include "math_defs.h" #include "os/file_access.h" #include "os/os.h" #include "scene/3d/camera.h" @@ -1378,8 +1379,8 @@ Error EditorSceneImporterGLTF::_parse_skins(GLTFState &state) { state.nodes[skin_node]->skeleton_children.push_back(i); } - state.skins.push_back(skin); } + state.skins.push_back(skin); } print_line("total skins: " + itos(state.skins.size())); @@ -1419,7 +1420,8 @@ Error EditorSceneImporterGLTF::_parse_cameras(GLTFState &state) { camera.perspective = true; if (d.has("perspective")) { Dictionary ppt = d["perspective"]; - camera.fov_size = ppt["yfov"]; + // GLTF spec is in radians, Godot's camera is in degrees. + camera.fov_size = (double)ppt["yfov"] * 180.0 / Math_PI; camera.zfar = ppt["zfar"]; camera.znear = ppt["znear"]; } else { diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp index e52f3bab72..84d55b4d14 100644 --- a/editor/import_dock.cpp +++ b/editor/import_dock.cpp @@ -87,23 +87,7 @@ void ImportDock::set_edit_path(const String &p_path) { return; } - List<ResourceImporter::ImportOption> options; - params->importer->get_import_options(&options); - - params->properties.clear(); - params->values.clear(); - - for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) { - - params->properties.push_back(E->get().option); - if (config->has_section_key("params", E->get().option.name)) { - params->values[E->get().option.name] = config->get_value("params", E->get().option.name); - } else { - params->values[E->get().option.name] = E->get().default_value; - } - } - - params->update(); + _update_options(config); List<Ref<ResourceImporter> > importers; ResourceFormatImporter::get_singleton()->get_importers_for_extension(p_path.get_extension(), &importers); @@ -125,6 +109,34 @@ void ImportDock::set_edit_path(const String &p_path) { } } + params->paths.clear(); + params->paths.push_back(p_path); + import->set_disabled(false); + import_as->set_disabled(false); + + imported->set_text(p_path.get_file()); +} + +void ImportDock::_update_options(const Ref<ConfigFile> &p_config) { + + List<ResourceImporter::ImportOption> options; + params->importer->get_import_options(&options); + + params->properties.clear(); + params->values.clear(); + + for (List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) { + + params->properties.push_back(E->get().option); + if (p_config.is_valid() && p_config->has_section_key("params", E->get().option.name)) { + params->values[E->get().option.name] = p_config->get_value("params", E->get().option.name); + } else { + params->values[E->get().option.name] = E->get().default_value; + } + } + + params->update(); + preset->get_popup()->clear(); if (params->importer->get_preset_count() == 0) { @@ -142,13 +154,6 @@ void ImportDock::set_edit_path(const String &p_path) { preset->get_popup()->add_separator(); preset->get_popup()->add_item(vformat(TTR("Clear Default for '%s'"), params->importer->get_visible_name()), ITEM_CLEAR_DEFAULT); } - - params->paths.clear(); - params->paths.push_back(p_path); - import->set_disabled(false); - import_as->set_disabled(false); - - imported->set_text(p_path.get_file()); } void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) { @@ -263,6 +268,24 @@ void ImportDock::set_edit_multiple_paths(const Vector<String> &p_paths) { imported->set_text(itos(p_paths.size()) + TTR(" Files")); } +void ImportDock::_importer_selected(int i_idx) { + String name = import_as->get_selected_metadata(); + Ref<ResourceImporter> importer = ResourceFormatImporter::get_singleton()->get_importer_by_name(name); + ERR_FAIL_COND(importer.is_null()); + + params->importer = importer; + + Ref<ConfigFile> config; + if (params->paths.size()) { + config.instance(); + Error err = config->load(params->paths[0] + ".import"); + if (err != OK) { + config.unref(); + } + } + _update_options(config); +} + void ImportDock::_preset_selected(int p_idx) { int item_id = preset->get_popup()->get_item_id(p_idx); @@ -336,6 +359,7 @@ void ImportDock::_reimport() { Error err = config->load(params->paths[i] + ".import"); ERR_CONTINUE(err != OK); + config->set_value("remap", "importer", params->importer->get_importer_name()); config->erase_section("params"); for (List<PropertyInfo>::Element *E = params->properties.front(); E; E = E->next()) { @@ -367,6 +391,7 @@ void ImportDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_reimport"), &ImportDock::_reimport); ClassDB::bind_method(D_METHOD("_preset_selected"), &ImportDock::_preset_selected); + ClassDB::bind_method(D_METHOD("_importer_selected"), &ImportDock::_importer_selected); } void ImportDock::initialize_import_options() const { @@ -384,6 +409,7 @@ ImportDock::ImportDock() { HBoxContainer *hb = memnew(HBoxContainer); add_margin_child(TTR("Import As:"), hb); import_as = memnew(OptionButton); + import_as->connect("item_selected", this, "_importer_selected"); hb->add_child(import_as); import_as->set_h_size_flags(SIZE_EXPAND_FILL); preset = memnew(MenuButton); diff --git a/editor/import_dock.h b/editor/import_dock.h index 029c458320..28c29e4b20 100644 --- a/editor/import_dock.h +++ b/editor/import_dock.h @@ -54,6 +54,8 @@ class ImportDock : public VBoxContainer { ImportDockParameters *params; void _preset_selected(int p_idx); + void _importer_selected(int i_idx); + void _update_options(const Ref<ConfigFile> &p_config = Ref<ConfigFile>()); void _reimport(); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index f2f913d2b3..736e176ab8 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -563,6 +563,14 @@ void AbstractPolygon2DEditor::forward_draw_over_canvas(Control *p_canvas) { const Vector2 next_point = xform.xform(p2); vpc->draw_line(point, next_point, col, 2); } + } + + for (int i = 0; i < n_points; i++) { + + const Vertex vertex(j, i); + + const Vector2 p = (vertex == edited_point) ? edited_point.pos : (points[i] + offset); + const Vector2 point = xform.xform(p); Ref<Texture> handle = vertex == active_point ? selected_handle : default_handle; vpc->draw_texture(handle, point - handle->get_size() * 0.5); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 16564ce45f..38467369db 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4373,11 +4373,11 @@ void CanvasItemEditorViewport::_on_mouse_exit() { void CanvasItemEditorViewport::_on_select_type(Object *selected) { CheckBox *check = Object::cast_to<CheckBox>(selected); String type = check->get_text(); - selector_label->set_text(vformat(TTR("Add %s"), type)); + selector->set_title(vformat(TTR("Add %s"), type)); label->set_text(vformat(TTR("Adding %s..."), type)); } -void CanvasItemEditorViewport::_on_change_type() { +void CanvasItemEditorViewport::_on_change_type_confirmed() { if (!button_group->get_pressed_button()) return; @@ -4387,6 +4387,11 @@ void CanvasItemEditorViewport::_on_change_type() { selector->hide(); } +void CanvasItemEditorViewport::_on_change_type_closed() { + + _remove_preview(); +} + void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) const { label->set_position(get_global_position() + Point2(14, 14) * EDSCALE); label_desc->set_position(label->get_position() + Point2(0, label->get_size().height)); @@ -4698,7 +4703,7 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p CheckBox *check = Object::cast_to<CheckBox>(btn_list[i]); check->set_pressed(check->get_text() == default_type); } - selector_label->set_text(vformat(TTR("Add %s"), default_type)); + selector->set_title(vformat(TTR("Add %s"), default_type)); selector->popup_centered_minsize(); } else { _perform_drop_data(); @@ -4721,7 +4726,8 @@ void CanvasItemEditorViewport::_notification(int p_what) { void CanvasItemEditorViewport::_bind_methods() { ClassDB::bind_method(D_METHOD("_on_select_type"), &CanvasItemEditorViewport::_on_select_type); - ClassDB::bind_method(D_METHOD("_on_change_type"), &CanvasItemEditorViewport::_on_change_type); + ClassDB::bind_method(D_METHOD("_on_change_type_confirmed"), &CanvasItemEditorViewport::_on_change_type_confirmed); + ClassDB::bind_method(D_METHOD("_on_change_type_closed"), &CanvasItemEditorViewport::_on_change_type_closed); ClassDB::bind_method(D_METHOD("_on_mouse_exit"), &CanvasItemEditorViewport::_on_mouse_exit); } @@ -4749,7 +4755,8 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte selector = memnew(AcceptDialog); editor->get_gui_base()->add_child(selector); selector->set_title(TTR("Change default type")); - selector->connect("confirmed", this, "_on_change_type"); + selector->connect("confirmed", this, "_on_change_type_confirmed"); + selector->connect("popup_hide", this, "_on_change_type_closed"); VBoxContainer *vbc = memnew(VBoxContainer); selector->add_child(vbc); @@ -4757,12 +4764,6 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte vbc->set_v_size_flags(SIZE_EXPAND_FILL); vbc->set_custom_minimum_size(Size2(200, 260) * EDSCALE); - selector_label = memnew(Label); - vbc->add_child(selector_label); - selector_label->set_align(Label::ALIGN_CENTER); - selector_label->set_valign(Label::VALIGN_BOTTOM); - selector_label->set_custom_minimum_size(Size2(0, 30) * EDSCALE); - btn_group = memnew(VBoxContainer); vbc->add_child(btn_group); btn_group->set_h_size_flags(0); diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 97e3b03569..457833e1a7 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -568,7 +568,8 @@ class CanvasItemEditorViewport : public Control { void _on_mouse_exit(); void _on_select_type(Object *selected); - void _on_change_type(); + void _on_change_type_confirmed(); + void _on_change_type_closed(); void _create_preview(const Vector<String> &files) const; void _remove_preview(); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index bd4891ccb7..1fc112896d 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -503,3 +503,41 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_ smat->set_render_priority(mat->get_render_priority()); return smat; } + +String CanvasItemMaterialConversionPlugin::converts_to() const { + + return "ShaderMaterial"; +} +bool CanvasItemMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const { + + Ref<CanvasItemMaterial> mat = p_resource; + return mat.is_valid(); +} +Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) { + + Ref<CanvasItemMaterial> mat = p_resource; + ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>()); + + Ref<ShaderMaterial> smat; + smat.instance(); + + Ref<Shader> shader; + shader.instance(); + + String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid()); + + shader->set_code(code); + + smat->set_shader(shader); + + List<PropertyInfo> params; + VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), ¶ms); + + for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) { + Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name); + smat->set_shader_param(E->get().name, value); + } + + smat->set_render_priority(mat->get_render_priority()); + return smat; +} diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 52c73cb7d8..2cc24be33a 100644 --- a/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -119,4 +119,12 @@ public: virtual Ref<Resource> convert(const Ref<Resource> &p_resource); }; +class CanvasItemMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(CanvasItemMaterialConversionPlugin, EditorResourceConversionPlugin) +public: + virtual String converts_to() const; + virtual bool handles(const Ref<Resource> &p_resource) const; + virtual Ref<Resource> convert(const Ref<Resource> &p_resource); +}; + #endif // MATERIAL_EDITOR_PLUGIN_H diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index a1183307fb..607ccaa4e7 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -865,20 +865,7 @@ void ScriptEditor::_menu_option(int p_option) { } break; case SEARCH_CLASSES: { - String current; - - if (tab_container->get_tab_count() > 0) { - EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(tab_container->get_current_tab())); - if (eh) { - current = eh->get_class(); - } - } - help_index->popup(); - - if (current != "") { - help_index->call_deferred("select_class", current); - } } break; case SEARCH_WEBSITE: { @@ -890,8 +877,13 @@ void ScriptEditor::_menu_option(int p_option) { _history_forward(); } break; case WINDOW_PREV: { + _history_back(); } break; + case WINDOW_SORT: { + _sort_list_on_update = true; + _update_script_names(); + } break; case DEBUG_SHOW: { if (debugger) { bool visible = debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_SHOW)); @@ -926,10 +918,6 @@ void ScriptEditor::_menu_option(int p_option) { if (current) { switch (p_option) { - case FILE_NEW: { - script_create_dialog->config("Node", ".gd"); - script_create_dialog->popup_centered(Size2(300, 300) * EDSCALE); - } break; case FILE_SAVE: { if (_test_script_times_on_disk()) @@ -1041,26 +1029,22 @@ void ScriptEditor::_menu_option(int p_option) { debugger->debug_continue(); } break; - case WINDOW_MOVE_LEFT: { + case WINDOW_MOVE_UP: { if (tab_container->get_current_tab() > 0) { - tab_container->call_deferred("set_current_tab", tab_container->get_current_tab() - 1); - script_list->call_deferred("select", tab_container->get_current_tab() - 1); tab_container->move_child(current, tab_container->get_current_tab() - 1); + tab_container->set_current_tab(tab_container->get_current_tab() - 1); _update_script_names(); } } break; - case WINDOW_MOVE_RIGHT: { + case WINDOW_MOVE_DOWN: { if (tab_container->get_current_tab() < tab_container->get_child_count() - 1) { - tab_container->call_deferred("set_current_tab", tab_container->get_current_tab() + 1); - script_list->call_deferred("select", tab_container->get_current_tab() + 1); tab_container->move_child(current, tab_container->get_current_tab() + 1); + tab_container->set_current_tab(tab_container->get_current_tab() + 1); _update_script_names(); } - } break; - default: { if (p_option >= WINDOW_SELECT_BASE) { @@ -1077,6 +1061,11 @@ void ScriptEditor::_menu_option(int p_option) { switch (p_option) { + case SEARCH_CLASSES: { + + help_index->popup(); + help_index->call_deferred("select_class", help->get_class()); + } break; case HELP_SEARCH_FIND: { help->popup_search(); } break; @@ -1092,6 +1081,22 @@ void ScriptEditor::_menu_option(int p_option) { case CLOSE_ALL: { _close_all_tabs(); } break; + case WINDOW_MOVE_UP: { + + if (tab_container->get_current_tab() > 0) { + tab_container->move_child(help, tab_container->get_current_tab() - 1); + tab_container->set_current_tab(tab_container->get_current_tab() - 1); + _update_script_names(); + } + } break; + case WINDOW_MOVE_DOWN: { + + if (tab_container->get_current_tab() < tab_container->get_child_count() - 1) { + tab_container->move_child(help, tab_container->get_current_tab() + 1); + tab_container->set_current_tab(tab_container->get_current_tab() + 1); + _update_script_names(); + } + } break; } } } @@ -1361,6 +1366,7 @@ struct _ScriptEditorItemData { String tooltip; bool used; int category; + Node *ref; bool operator<(const _ScriptEditorItemData &id) const { @@ -1526,6 +1532,7 @@ void ScriptEditor::_update_script_names() { sd.index = i; sd.used = used.has(se->get_edited_script()); sd.category = 0; + sd.ref = se; switch (sort_by) { case SORT_BY_NAME: { @@ -1565,16 +1572,38 @@ void ScriptEditor::_update_script_names() { _ScriptEditorItemData sd; sd.icon = icon; sd.name = name; - sd.sort_key = name; + sd.sort_key = name.to_lower(); sd.tooltip = tooltip; sd.index = i; sd.used = false; sd.category = split_script_help ? 1 : 0; + sd.ref = eh; + sedata.push_back(sd); } } - sedata.sort(); + if (_sort_list_on_update) { + sedata.sort(); + + // change actual order of tab_container so that the order can be rearranged by user + int cur_tab = tab_container->get_current_tab(); + int prev_tab = tab_container->get_previous_tab(); + int new_cur_tab = -1; + int new_prev_tab = -1; + for (int i = 0; i < sedata.size(); i++) { + tab_container->move_child(sedata[i].ref, i); + if (new_prev_tab == -1 && sedata[i].index == prev_tab) { + new_prev_tab = i; + } + if (new_cur_tab == -1 && sedata[i].index == cur_tab) { + new_cur_tab = i; + } + } + tab_container->call_deferred("set_current_tab", new_prev_tab); + tab_container->call_deferred("set_current_tab", new_cur_tab); + _sort_list_on_update = false; + } for (int i = 0; i < sedata.size(); i++) { @@ -1903,8 +1932,171 @@ void ScriptEditor::_script_split_dragged(float) { _save_layout(); } +Variant ScriptEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) { + + // return Variant(); // return this if drag disabled + + Node *cur_node = tab_container->get_child(tab_container->get_current_tab()); + + HBoxContainer *drag_preview = memnew(HBoxContainer); + String preview_name = ""; + Ref<Texture> preview_icon; + + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(cur_node); + if (se) { + preview_name = se->get_name(); + preview_icon = se->get_icon(); + } + EditorHelp *eh = Object::cast_to<EditorHelp>(cur_node); + if (eh) { + preview_name = eh->get_class(); + preview_icon = get_icon("Help", "EditorIcons"); + } + + if (!preview_icon.is_null()) { + TextureRect *tf = memnew(TextureRect); + tf->set_texture(preview_icon); + drag_preview->add_child(tf); + } + Label *label = memnew(Label(preview_name)); + drag_preview->add_child(label); + set_drag_preview(drag_preview); + + Dictionary drag_data; + drag_data["type"] = "script_list_element"; // using a custom type because node caused problems when dragging to scene tree + drag_data["script_list_element"] = cur_node; + + return drag_data; +} + +bool ScriptEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { + + Dictionary d = p_data; + if (!d.has("type")) + return false; + + if (String(d["type"]) == "script_list_element") { + + Node *node = d["script_list_element"]; + + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(node); + if (se) { + return true; + } + EditorHelp *eh = Object::cast_to<EditorHelp>(node); + if (eh) { + return true; + } + } + + if (String(d["type"]) == "nodes") { + + Array nodes = d["nodes"]; + if (nodes.size() == 0) + return false; + Node *node = get_node((nodes[0])); + + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(node); + if (se) { + return true; + } + EditorHelp *eh = Object::cast_to<EditorHelp>(node); + if (eh) { + return true; + } + } + + if (String(d["type"]) == "files") { + + Vector<String> files = d["files"]; + + if (files.size() == 0) + return false; //weird + + for (int i = 0; i < files.size(); i++) { + String file = files[i]; + if (file == "" || !FileAccess::exists(file)) + continue; + Ref<Script> scr = ResourceLoader::load(file); + if (scr.is_valid()) { + return true; + } + } + return true; + } + + return false; +} + +void ScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { + + if (!can_drop_data_fw(p_point, p_data, p_from)) + return; + + Dictionary d = p_data; + if (!d.has("type")) + return; + + if (String(d["type"]) == "script_list_element") { + + Node *node = d["script_list_element"]; + + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(node); + EditorHelp *eh = Object::cast_to<EditorHelp>(node); + if (se || eh) { + int new_index = script_list->get_item_at_position(p_point); + tab_container->move_child(node, new_index); + tab_container->set_current_tab(new_index); + _update_script_names(); + } + } + + if (String(d["type"]) == "nodes") { + + Array nodes = d["nodes"]; + if (nodes.size() == 0) + return; + Node *node = get_node(nodes[0]); + + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(node); + EditorHelp *eh = Object::cast_to<EditorHelp>(node); + if (se || eh) { + int new_index = script_list->get_item_at_position(p_point); + tab_container->move_child(node, new_index); + tab_container->set_current_tab(new_index); + _update_script_names(); + } + } + + if (String(d["type"]) == "files") { + + Vector<String> files = d["files"]; + + int new_index = script_list->get_item_at_position(p_point); + int num_tabs_before = tab_container->get_child_count(); + for (int i = 0; i < files.size(); i++) { + String file = files[i]; + if (file == "" || !FileAccess::exists(file)) + continue; + Ref<Script> scr = ResourceLoader::load(file); + if (scr.is_valid()) { + edit(scr); + if (tab_container->get_child_count() > num_tabs_before) { + tab_container->move_child(tab_container->get_child(tab_container->get_child_count() - 1), new_index); + num_tabs_before = tab_container->get_child_count(); + } else { + tab_container->move_child(tab_container->get_child(tab_container->get_current_tab()), new_index); + } + } + } + tab_container->set_current_tab(new_index); + _update_script_names(); + } +} + void ScriptEditor::_unhandled_input(const Ref<InputEvent> &p_event) { - if (p_event->is_pressed() || !is_visible_in_tree()) return; + if (!is_visible_in_tree() || !p_event->is_pressed() || p_event->is_echo()) + return; if (ED_IS_SHORTCUT("script_editor/next_script", p_event)) { int next_tab = script_list->get_current() + 1; next_tab %= script_list->get_item_count(); @@ -1917,6 +2109,62 @@ void ScriptEditor::_unhandled_input(const Ref<InputEvent> &p_event) { _go_to_tab(script_list->get_item_metadata(next_tab)); _update_script_names(); } + if (ED_IS_SHORTCUT("script_editor/window_move_up", p_event)) { + _menu_option(WINDOW_MOVE_UP); + } + if (ED_IS_SHORTCUT("script_editor/window_move_down", p_event)) { + _menu_option(WINDOW_MOVE_DOWN); + } +} + +void ScriptEditor::_script_list_gui_input(const Ref<InputEvent> &ev) { + + Ref<InputEventMouseButton> mb = ev; + if (mb.is_valid() && mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) { + + _make_script_list_context_menu(); + } +} + +void ScriptEditor::_make_script_list_context_menu() { + + context_menu->clear(); + + int selected = tab_container->get_current_tab(); + if (selected < 0 || selected >= tab_container->get_child_count()) + return; + + ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected)); + if (se) { + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/save"), FILE_SAVE); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/save_as"), FILE_SAVE_AS); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_file"), FILE_CLOSE); + context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/reload_script_soft"), FILE_TOOL_RELOAD_SOFT); + + Ref<Script> scr = se->get_edited_script(); + if (!scr.is_null() && scr->is_tool()) { + context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/run_file"), FILE_RUN); + } + } else { + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_file"), FILE_CLOSE); + } + + EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(selected)); + if (eh) { + // nothing + } + + context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_move_up"), WINDOW_MOVE_UP); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_move_down"), WINDOW_MOVE_DOWN); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_sort"), WINDOW_SORT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/toggle_scripts_panel"), TOGGLE_SCRIPTS_PANEL); + + context_menu->set_position(get_global_transform().xform(get_local_mouse_position())); + context_menu->set_size(Vector2(1, 1)); + context_menu->popup(); } void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) { @@ -2243,9 +2491,14 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_history_back", &ScriptEditor::_history_back); ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts); ClassDB::bind_method("_unhandled_input", &ScriptEditor::_unhandled_input); + ClassDB::bind_method("_script_list_gui_input", &ScriptEditor::_script_list_gui_input); ClassDB::bind_method("_script_changed", &ScriptEditor::_script_changed); ClassDB::bind_method("_update_recent_scripts", &ScriptEditor::_update_recent_scripts); + ClassDB::bind_method(D_METHOD("get_drag_data_fw"), &ScriptEditor::get_drag_data_fw); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &ScriptEditor::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &ScriptEditor::drop_data_fw); + ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script); ClassDB::bind_method(D_METHOD("get_open_scripts"), &ScriptEditor::_get_open_scripts); @@ -2287,6 +2540,15 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_split->set_split_offset(140); //list_split->set_split_offset(500); + _sort_list_on_update = true; + script_list->connect("gui_input", this, "_script_list_gui_input"); + script_list->set_allow_rmb_select(true); + script_list->set_drag_forwarding(this); + + context_menu = memnew(PopupMenu); + add_child(context_menu); + context_menu->connect("id_pressed", this, "_menu_option"); + members_overview = memnew(ItemList); list_split->add_child(members_overview); members_overview->set_custom_minimum_size(Size2(0, 100)); //need to give a bit of limit to avoid it from disappearing @@ -2303,8 +2565,11 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { tab_container->set_h_size_flags(SIZE_EXPAND_FILL); - ED_SHORTCUT("script_editor/next_script", TTR("Next script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_GREATER); - ED_SHORTCUT("script_editor/prev_script", TTR("Previous script"), KEY_MASK_CMD | KEY_LESS); + ED_SHORTCUT("script_editor/window_sort", TTR("Sort")); + ED_SHORTCUT("script_editor/window_move_up", TTR("Move Up"), KEY_MASK_SHIFT | KEY_MASK_ALT | KEY_UP); + ED_SHORTCUT("script_editor/window_move_down", TTR("Move Down"), KEY_MASK_SHIFT | KEY_MASK_ALT | KEY_DOWN); + ED_SHORTCUT("script_editor/next_script", TTR("Next script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_PERIOD); // these should be KEY_GREATER and KEY_LESS but those don't work + ED_SHORTCUT("script_editor/prev_script", TTR("Previous script"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_COLON); set_process_unhandled_input(true); file_menu = memnew(MenuButton); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 03fc4da7ce..b8317f9e86 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -150,10 +150,11 @@ class ScriptEditor : public PanelContainer { SEARCH_WEBSITE, HELP_SEARCH_FIND, HELP_SEARCH_FIND_NEXT, - WINDOW_MOVE_LEFT, - WINDOW_MOVE_RIGHT, + WINDOW_MOVE_UP, + WINDOW_MOVE_DOWN, WINDOW_NEXT, WINDOW_PREV, + WINDOW_SORT, WINDOW_SELECT_BASE = 100 }; @@ -173,6 +174,7 @@ class ScriptEditor : public PanelContainer { MenuButton *edit_menu; MenuButton *script_search_menu; MenuButton *debug_menu; + PopupMenu *context_menu; Timer *autosave_timer; uint64_t idle; @@ -292,6 +294,7 @@ class ScriptEditor : public PanelContainer { void _update_members_overview_visibility(); void _update_members_overview(); void _update_script_names(); + bool _sort_list_on_update; void _members_overview_selected(int p_idx); void _script_selected(int p_idx); @@ -306,8 +309,15 @@ class ScriptEditor : public PanelContainer { void _script_split_dragged(float); + Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); + bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; + void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); + void _unhandled_input(const Ref<InputEvent> &p_event); + void _script_list_gui_input(const Ref<InputEvent> &ev); + void _make_script_list_context_menu(); + void _help_search(String p_text); void _help_index(String p_text); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index adf65c11e1..6b945157e8 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -850,7 +850,8 @@ void ScriptTextEditor::_edit_option(int p_op) { if (line_id == 0 || next_id < 0) return; - swap_lines(tx, line_id, next_id); + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); } int from_line_up = from_line > 0 ? from_line - 1 : from_line; int to_line_up = to_line > 0 ? to_line - 1 : to_line; @@ -862,7 +863,8 @@ void ScriptTextEditor::_edit_option(int p_op) { if (line_id == 0 || next_id < 0) return; - swap_lines(tx, line_id, next_id); + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); } tx->end_complex_operation(); tx->update(); @@ -889,7 +891,8 @@ void ScriptTextEditor::_edit_option(int p_op) { if (line_id == tx->get_line_count() - 1 || next_id > tx->get_line_count()) return; - swap_lines(tx, line_id, next_id); + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); } int from_line_down = from_line < tx->get_line_count() ? from_line + 1 : from_line; int to_line_down = to_line < tx->get_line_count() ? to_line + 1 : to_line; @@ -901,7 +904,8 @@ void ScriptTextEditor::_edit_option(int p_op) { if (line_id == tx->get_line_count() - 1 || next_id > tx->get_line_count()) return; - swap_lines(tx, line_id, next_id); + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); } tx->end_complex_operation(); tx->update(); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index f7dcc4b52d..49e4642049 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -248,6 +248,8 @@ void ShaderTextEditor::_validate_script() { if (err != OK) { String error_text = "error(" + itos(sl.get_error_line()) + "): " + sl.get_error_text(); set_error(error_text); + for (int i = 0; i < get_text_edit()->get_line_count(); i++) + get_text_edit()->set_line_as_marked(i, false); get_text_edit()->set_line_as_marked(sl.get_error_line() - 1, true); } else { @@ -269,55 +271,284 @@ ShaderTextEditor::ShaderTextEditor() { void ShaderEditor::_menu_option(int p_option) { - ShaderTextEditor *current = shader_editor; - switch (p_option) { case EDIT_UNDO: { - - current->get_text_edit()->undo(); + shader_editor->get_text_edit()->undo(); } break; case EDIT_REDO: { - current->get_text_edit()->redo(); - + shader_editor->get_text_edit()->redo(); } break; case EDIT_CUT: { - - current->get_text_edit()->cut(); + shader_editor->get_text_edit()->cut(); } break; case EDIT_COPY: { - current->get_text_edit()->copy(); - + shader_editor->get_text_edit()->copy(); } break; case EDIT_PASTE: { - current->get_text_edit()->paste(); - + shader_editor->get_text_edit()->paste(); } break; case EDIT_SELECT_ALL: { + shader_editor->get_text_edit()->select_all(); + } break; + case EDIT_MOVE_LINE_UP: { + + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + tx->begin_complex_operation(); + if (tx->is_selection_active()) { + int from_line = tx->get_selection_from_line(); + int from_col = tx->get_selection_from_column(); + int to_line = tx->get_selection_to_line(); + int to_column = tx->get_selection_to_column(); + + for (int i = from_line; i <= to_line; i++) { + int line_id = i; + int next_id = i - 1; + + if (line_id == 0 || next_id < 0) + return; + + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); + } + int from_line_up = from_line > 0 ? from_line - 1 : from_line; + int to_line_up = to_line > 0 ? to_line - 1 : to_line; + tx->select(from_line_up, from_col, to_line_up, to_column); + } else { + int line_id = tx->cursor_get_line(); + int next_id = line_id - 1; + + if (line_id == 0 || next_id < 0) + return; + + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); + } + tx->end_complex_operation(); + tx->update(); + + } break; + case EDIT_MOVE_LINE_DOWN: { + + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + tx->begin_complex_operation(); + if (tx->is_selection_active()) { + int from_line = tx->get_selection_from_line(); + int from_col = tx->get_selection_from_column(); + int to_line = tx->get_selection_to_line(); + int to_column = tx->get_selection_to_column(); + + for (int i = to_line; i >= from_line; i--) { + int line_id = i; + int next_id = i + 1; + + if (line_id == tx->get_line_count() - 1 || next_id > tx->get_line_count()) + return; + + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); + } + int from_line_down = from_line < tx->get_line_count() ? from_line + 1 : from_line; + int to_line_down = to_line < tx->get_line_count() ? to_line + 1 : to_line; + tx->select(from_line_down, from_col, to_line_down, to_column); + } else { + int line_id = tx->cursor_get_line(); + int next_id = line_id + 1; + + if (line_id == tx->get_line_count() - 1 || next_id > tx->get_line_count()) + return; + + tx->swap_lines(line_id, next_id); + tx->cursor_set_line(next_id); + } + tx->end_complex_operation(); + tx->update(); + + } break; + case EDIT_INDENT_LEFT: { + + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + tx->begin_complex_operation(); + if (tx->is_selection_active()) { + tx->indent_selection_left(); + } else { + int begin = tx->cursor_get_line(); + String line_text = tx->get_line(begin); + // begins with tab + if (line_text.begins_with("\t")) { + line_text = line_text.substr(1, line_text.length()); + tx->set_line(begin, line_text); + } + // begins with 4 spaces + else if (line_text.begins_with(" ")) { + line_text = line_text.substr(4, line_text.length()); + tx->set_line(begin, line_text); + } + } + tx->end_complex_operation(); + tx->update(); + //tx->deselect(); + + } break; + case EDIT_INDENT_RIGHT: { + + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + tx->begin_complex_operation(); + if (tx->is_selection_active()) { + tx->indent_selection_right(); + } else { + int begin = tx->cursor_get_line(); + String line_text = tx->get_line(begin); + line_text = '\t' + line_text; + tx->set_line(begin, line_text); + } + tx->end_complex_operation(); + tx->update(); + //tx->deselect(); + + } break; + case EDIT_DELETE_LINE: { - current->get_text_edit()->select_all(); + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + tx->begin_complex_operation(); + int line = tx->cursor_get_line(); + tx->set_line(tx->cursor_get_line(), ""); + tx->backspace_at_cursor(); + tx->cursor_set_line(line); + tx->end_complex_operation(); } break; + case EDIT_CLONE_DOWN: { + + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + int from_line = tx->cursor_get_line(); + int to_line = tx->cursor_get_line(); + int column = tx->cursor_get_column(); + + if (tx->is_selection_active()) { + from_line = tx->get_selection_from_line(); + to_line = tx->get_selection_to_line(); + column = tx->cursor_get_column(); + } + int next_line = to_line + 1; + + tx->begin_complex_operation(); + for (int i = from_line; i <= to_line; i++) { + + if (i >= tx->get_line_count() - 1) { + tx->set_line(i, tx->get_line(i) + "\n"); + } + String line_clone = tx->get_line(i); + tx->insert_at(line_clone, next_line); + next_line++; + } + + tx->cursor_set_column(column); + if (tx->is_selection_active()) { + tx->select(to_line + 1, tx->get_selection_from_column(), next_line - 1, tx->get_selection_to_column()); + } + + tx->end_complex_operation(); + tx->update(); + + } break; + case EDIT_TOGGLE_COMMENT: { + + TextEdit *tx = shader_editor->get_text_edit(); + if (shader.is_null()) + return; + + tx->begin_complex_operation(); + if (tx->is_selection_active()) { + int begin = tx->get_selection_from_line(); + int end = tx->get_selection_to_line(); + + // End of selection ends on the first column of the last line, ignore it. + if (tx->get_selection_to_column() == 0) + end -= 1; + + // Check if all lines in the selected block are commented + bool is_commented = true; + for (int i = begin; i <= end; i++) { + if (!tx->get_line(i).begins_with("//")) { + is_commented = false; + break; + } + } + for (int i = begin; i <= end; i++) { + String line_text = tx->get_line(i); + + if (line_text.strip_edges().empty()) { + line_text = "//"; + } else { + if (is_commented) { + line_text = line_text.substr(2, line_text.length()); + } else { + line_text = "//" + line_text; + } + } + tx->set_line(i, line_text); + } + } else { + int begin = tx->cursor_get_line(); + String line_text = tx->get_line(begin); + + if (line_text.begins_with("//")) + line_text = line_text.substr(2, line_text.length()); + else + line_text = "//" + line_text; + tx->set_line(begin, line_text); + } + tx->end_complex_operation(); + tx->update(); + //tx->deselect(); + + } break; + case EDIT_COMPLETE: { + + shader_editor->get_text_edit()->query_code_comple(); + } break; case SEARCH_FIND: { - current->get_find_replace_bar()->popup_search(); + shader_editor->get_find_replace_bar()->popup_search(); } break; case SEARCH_FIND_NEXT: { - current->get_find_replace_bar()->search_next(); + shader_editor->get_find_replace_bar()->search_next(); } break; case SEARCH_FIND_PREV: { - current->get_find_replace_bar()->search_prev(); + shader_editor->get_find_replace_bar()->search_prev(); } break; case SEARCH_REPLACE: { - current->get_find_replace_bar()->popup_replace(); + shader_editor->get_find_replace_bar()->popup_replace(); } break; case SEARCH_GOTO_LINE: { - goto_line_dialog->popup_find_line(current->get_text_edit()); + goto_line_dialog->popup_find_line(shader_editor->get_text_edit()); } break; } + if (p_option != SEARCH_FIND && p_option != SEARCH_REPLACE && p_option != SEARCH_GOTO_LINE) { + shader_editor->get_text_edit()->call_deferred("grab_focus"); + } } void ShaderEditor::_notification(int p_what) { @@ -325,10 +556,6 @@ void ShaderEditor::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { } if (p_what == NOTIFICATION_DRAW) { - - RID ci = get_canvas_item(); - Ref<StyleBox> style = get_stylebox("panel", "Panel"); - style->draw(ci, Rect2(Point2(), get_size())); } } @@ -360,6 +587,7 @@ void ShaderEditor::_editor_settings_changed() { void ShaderEditor::_bind_methods() { ClassDB::bind_method("_editor_settings_changed", &ShaderEditor::_editor_settings_changed); + ClassDB::bind_method("_text_edit_gui_input", &ShaderEditor::_text_edit_gui_input); ClassDB::bind_method("_menu_option", &ShaderEditor::_menu_option); ClassDB::bind_method("_params_changed", &ShaderEditor::_params_changed); @@ -413,49 +641,122 @@ void ShaderEditor::apply_shaders() { } } -ShaderEditor::ShaderEditor() { +void ShaderEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { - HBoxContainer *hbc = memnew(HBoxContainer); + Ref<InputEventMouseButton> mb = ev; - add_child(hbc); + if (mb.is_valid()) { + + if (mb->get_button_index() == BUTTON_RIGHT && !mb->is_pressed()) { + + int col, row; + TextEdit *tx = shader_editor->get_text_edit(); + tx->_get_mouse_pos(mb->get_global_position() - tx->get_global_position(), row, col); + Vector2 mpos = mb->get_global_position() - tx->get_global_position(); + bool have_selection = (tx->get_selection_text().length() > 0); + _make_context_menu(have_selection); + } + } +} + +void ShaderEditor::_make_context_menu(bool p_selection) { + + context_menu->clear(); + if (p_selection) { + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); + } + + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + + context_menu->add_separator(); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT); + + context_menu->set_position(get_global_transform().xform(get_local_mouse_position())); + context_menu->set_size(Vector2(1, 1)); + context_menu->popup(); +} + +ShaderEditor::ShaderEditor(EditorNode *p_node) { + + shader_editor = memnew(ShaderTextEditor); + shader_editor->set_v_size_flags(SIZE_EXPAND_FILL); + shader_editor->add_constant_override("separation", 0); + shader_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); + + shader_editor->connect("script_changed", this, "apply_shaders"); + EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); + + shader_editor->get_text_edit()->set_callhint_settings( + EditorSettings::get_singleton()->get("text_editor/completion/put_callhint_tooltip_below_current_line"), + EditorSettings::get_singleton()->get("text_editor/completion/callhint_tooltip_offset")); + + shader_editor->get_text_edit()->set_select_identifiers_on_hover(true); + shader_editor->get_text_edit()->set_context_menu_enabled(false); + shader_editor->get_text_edit()->connect("gui_input", this, "_text_edit_gui_input"); + + shader_editor->update_editor_settings(); + + context_menu = memnew(PopupMenu); + add_child(context_menu); + context_menu->connect("id_pressed", this, "_menu_option"); + + VBoxContainer *main_container = memnew(VBoxContainer); + HBoxContainer *hbc = memnew(HBoxContainer); edit_menu = memnew(MenuButton); - hbc->add_child(edit_menu); - edit_menu->set_position(Point2(5, -1)); + //edit_menu->set_position(Point2(5, -1)); edit_menu->set_text(TTR("Edit")); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD | KEY_Z), EDIT_UNDO); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/redo", TTR("Redo"), KEY_MASK_CMD | KEY_Y), EDIT_REDO); + + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); + edit_menu->get_popup()->add_separator(); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); + edit_menu->get_popup()->add_separator(); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/cut", TTR("Cut"), KEY_MASK_CMD | KEY_X), EDIT_CUT); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/copy", TTR("Copy"), KEY_MASK_CMD | KEY_C), EDIT_COPY); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/paste", TTR("Paste"), KEY_MASK_CMD | KEY_V), EDIT_PASTE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_up"), EDIT_MOVE_LINE_UP); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_down"), EDIT_MOVE_LINE_DOWN); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/delete_line"), EDIT_DELETE_LINE); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/select_all", TTR("Select All"), KEY_MASK_CMD | KEY_A), EDIT_SELECT_ALL); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/complete_symbol"), EDIT_COMPLETE); + edit_menu->get_popup()->connect("id_pressed", this, "_menu_option"); search_menu = memnew(MenuButton); - hbc->add_child(search_menu); - search_menu->set_position(Point2(38, -1)); + //search_menu->set_position(Point2(38, -1)); search_menu->set_text(TTR("Search")); - search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD | KEY_F), SEARCH_FIND); - search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), SEARCH_FIND_NEXT); - search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_previous", TTR("Find Previous"), KEY_MASK_SHIFT | KEY_F3), SEARCH_FIND_PREV); - search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/replace", TTR("Replace.."), KEY_MASK_CMD | KEY_R), SEARCH_REPLACE); + + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE); search_menu->get_popup()->add_separator(); - //search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); - search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD | KEY_L), SEARCH_GOTO_LINE); + search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_line"), SEARCH_GOTO_LINE); search_menu->get_popup()->connect("id_pressed", this, "_menu_option"); + add_child(main_container); + main_container->add_child(hbc); + hbc->add_child(search_menu); + hbc->add_child(edit_menu); + hbc->add_style_override("panel", p_node->get_gui_base()->get_stylebox("ScriptEditorPanel", "EditorStyles")); + main_container->add_child(shader_editor); + goto_line_dialog = memnew(GotoLineDialog); add_child(goto_line_dialog); - shader_editor = memnew(ShaderTextEditor); - add_child(shader_editor); - shader_editor->set_v_size_flags(SIZE_EXPAND_FILL); - - shader_editor->connect("script_changed", this, "apply_shaders"); - EditorSettings::get_singleton()->connect("settings_changed", this, "_editor_settings_changed"); - _editor_settings_changed(); } @@ -504,7 +805,7 @@ void ShaderEditorPlugin::apply_changes() { ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) { editor = p_node; - shader_editor = memnew(ShaderEditor); + shader_editor = memnew(ShaderEditor(p_node)); shader_editor->set_custom_minimum_size(Size2(0, 300)); button = editor->add_bottom_panel_item(TTR("Shader"), shader_editor); diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index ab18784d9f..b191f5700f 100644 --- a/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -33,6 +33,7 @@ #include "editor/code_editor.h" #include "editor/editor_plugin.h" #include "scene/gui/menu_button.h" +#include "scene/gui/panel_container.h" #include "scene/gui/tab_container.h" #include "scene/gui/text_edit.h" #include "scene/main/timer.h" @@ -61,9 +62,9 @@ public: ShaderTextEditor(); }; -class ShaderEditor : public VBoxContainer { +class ShaderEditor : public PanelContainer { - GDCLASS(ShaderEditor, VBoxContainer); + GDCLASS(ShaderEditor, PanelContainer); enum { @@ -73,6 +74,14 @@ class ShaderEditor : public VBoxContainer { EDIT_COPY, EDIT_PASTE, EDIT_SELECT_ALL, + EDIT_MOVE_LINE_UP, + EDIT_MOVE_LINE_DOWN, + EDIT_INDENT_LEFT, + EDIT_INDENT_RIGHT, + EDIT_DELETE_LINE, + EDIT_CLONE_DOWN, + EDIT_TOGGLE_COMMENT, + EDIT_COMPLETE, SEARCH_FIND, SEARCH_FIND_NEXT, SEARCH_FIND_PREV, @@ -84,6 +93,7 @@ class ShaderEditor : public VBoxContainer { MenuButton *edit_menu; MenuButton *search_menu; MenuButton *settings_menu; + PopupMenu *context_menu; uint64_t idle; GotoLineDialog *goto_line_dialog; @@ -100,6 +110,8 @@ class ShaderEditor : public VBoxContainer { protected: void _notification(int p_what); static void _bind_methods(); + void _make_context_menu(bool p_selection); + void _text_edit_gui_input(const Ref<InputEvent> &ev); public: void apply_shaders(); @@ -110,7 +122,7 @@ public: virtual Size2 get_minimum_size() const { return Size2(0, 200); } void save_external_data(); - ShaderEditor(); + ShaderEditor(EditorNode *p_node); }; class ShaderEditorPlugin : public EditorPlugin { diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index e8714cece6..b87084e392 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -1255,7 +1255,6 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 motion_mask; Plane plane; - bool plane_mv; switch (_edit.plane) { case TRANSFORM_VIEW: @@ -1300,7 +1299,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { List<Node *> &selection = editor_selection->get_selected_node_list(); - bool local_coords = (spatial_editor->are_local_coords_enabled() && motion_mask != Vector3()); // Disable local transformation for TRANSFORM_VIEW + bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); // Disable local transformation for TRANSFORM_VIEW float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { @@ -1309,10 +1308,10 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 motion_snapped = motion; motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Scaling XYZ: ") + motion_snapped); + set_message(TTR("Scaling: ") + motion_snapped); } else { - set_message(TTR("Scaling XYZ: ") + motion); + set_message(TTR("Scaling: ") + motion); } for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1376,7 +1375,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 motion_mask; Plane plane; - bool plane_mv; + bool plane_mv = false; switch (_edit.plane) { case TRANSFORM_VIEW: @@ -1426,7 +1425,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { List<Node *> &selection = editor_selection->get_selected_node_list(); - bool local_coords = (spatial_editor->are_local_coords_enabled() && motion_mask != Vector3()); // Disable local transformation for TRANSFORM_VIEW + bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); // Disable local transformation for TRANSFORM_VIEW float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { @@ -1536,7 +1535,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { List<Node *> &selection = editor_selection->get_selected_node_list(); - bool local_coords = spatial_editor->are_local_coords_enabled(); + bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); // Disable local transformation for TRANSFORM_VIEW for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -2917,7 +2916,9 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P } } - instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); + if (scene != NULL) { + instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); + } editor_data->get_undo_redo().add_do_method(parent, "add_child", instanced_scene); editor_data->get_undo_redo().add_do_method(instanced_scene, "set_owner", editor->get_edited_scene()); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index eac5720b43..dda2851166 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -308,7 +308,7 @@ void ProjectExportDialog::_patch_button_pressed(Object *p_item, int p_column, in if (p_id == 0) { Vector<String> patches = current->get_patches(); ERR_FAIL_INDEX(patch_index, patches.size()); - patch_erase->set_text(vformat(TTR("Delete patch '" + patches[patch_index].get_file() + "' from list?"))); + patch_erase->set_text(vformat(TTR("Delete patch '%s' from list?"), patches[patch_index].get_file())); patch_erase->popup_centered_minsize(); } else { patch_dialog->popup_centered_ratio(); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 5bfdd73aad..cc9de3e44d 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -284,7 +284,6 @@ private: } ProjectSettings *current = memnew(ProjectSettings); - current->add_singleton(ProjectSettings::Singleton("Current")); if (current->setup(dir, "")) { set_message(TTR("Couldn't get project.godot in project path."), MESSAGE_ERROR); @@ -503,7 +502,6 @@ public: name_container->show(); ProjectSettings *current = memnew(ProjectSettings); - current->add_singleton(ProjectSettings::Singleton("Current")); if (current->setup(project_path->get_text(), "")) { set_message(TTR("Couldn't get project.godot in the project path."), MESSAGE_ERROR); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 340ea708b4..b07280a4cd 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -785,12 +785,12 @@ void ProjectSettingsEditor::_item_del() { String property = globals_editor->get_current_section().plus_file(path); if (!ProjectSettings::get_singleton()->has_setting(property)) { - EditorNode::get_singleton()->show_warning(TTR("No property '" + property + "' exists.")); + EditorNode::get_singleton()->show_warning(vformat(TTR("No property '%s' exists."), property)); return; } if (ProjectSettings::get_singleton()->get_order(property) < ProjectSettings::NO_BUILTIN_ORDER_BASE) { - EditorNode::get_singleton()->show_warning(TTR("Setting '" + property + "' is internal, and it can't be deleted.")); + EditorNode::get_singleton()->show_warning(vformat(TTR("Setting '%s' is internal, and it can't be deleted."), property)); return; } @@ -1782,6 +1782,7 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { tab_container->add_child(translations); //remap for properly select language in popup translation_locales_idxs_remap = Vector<int>(); + translation_locales_list_created = false; { diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 58f70ce11e..b5d5bc6045 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -860,6 +860,14 @@ Node *SceneTreeDock::_duplicate(Node *p_node, Map<Node *, Node *> &duplimap) { node->set(name, value); } + List<Connection> conns; + p_node->get_all_signal_connections(&conns); + for (List<Connection>::Element *E = conns.front(); E; E = E->next()) { + if (E->get().flags & CONNECT_PERSIST) { + node->connect(E->get().signal, E->get().target, E->get().method, E->get().binds, E->get().flags); + } + } + List<Node::GroupInfo> group_info; p_node->get_groups(&group_info); for (List<Node::GroupInfo>::Element *E = group_info.front(); E; E = E->next()) { @@ -1296,6 +1304,7 @@ void SceneTreeDock::_delete_confirm() { editor_data->get_undo_redo().add_do_method(editor, "set_edited_scene", (Object *)NULL); editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", edited_scene); editor_data->get_undo_redo().add_undo_method(edited_scene, "set_owner", edited_scene->get_owner()); + editor_data->get_undo_redo().add_undo_method(scene_tree, "update_tree"); editor_data->get_undo_redo().add_undo_reference(edited_scene); } else { @@ -1878,6 +1887,43 @@ void SceneTreeDock::open_script_dialog(Node *p_for_node) { _tool_selected(TOOL_ATTACH_SCRIPT); } +void SceneTreeDock::add_remote_tree_editor(Control *p_remote) { + ERR_FAIL_COND(remote_tree != NULL); + add_child(p_remote); + remote_tree = p_remote; + remote_tree->hide(); +} + +void SceneTreeDock::show_remote_tree() { + + button_hb->show(); + _remote_tree_selected(); +} + +void SceneTreeDock::hide_remote_tree() { + + button_hb->hide(); + _local_tree_selected(); +} + +void SceneTreeDock::_remote_tree_selected() { + + scene_tree->hide(); + if (remote_tree) + remote_tree->show(); + edit_remote->set_pressed(true); + edit_local->set_pressed(false); +} + +void SceneTreeDock::_local_tree_selected() { + + scene_tree->show(); + if (remote_tree) + remote_tree->hide(); + edit_remote->set_pressed(false); + edit_local->set_pressed(true); +} + void SceneTreeDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_tool_selected"), &SceneTreeDock::_tool_selected, DEFVAL(false)); @@ -1903,6 +1949,8 @@ void SceneTreeDock::_bind_methods() { ClassDB::bind_method(D_METHOD("_tree_rmb"), &SceneTreeDock::_tree_rmb); ClassDB::bind_method(D_METHOD("_filter_changed"), &SceneTreeDock::_filter_changed); ClassDB::bind_method(D_METHOD("_focus_node"), &SceneTreeDock::_focus_node); + ClassDB::bind_method(D_METHOD("_remote_tree_selected"), &SceneTreeDock::_remote_tree_selected); + ClassDB::bind_method(D_METHOD("_local_tree_selected"), &SceneTreeDock::_local_tree_selected); ClassDB::bind_method(D_METHOD("instance"), &SceneTreeDock::instance); } @@ -1973,7 +2021,28 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel button_clear_script = tb; tb->hide(); + button_hb = memnew(HBoxContainer); + vbc->add_child(button_hb); + + edit_remote = memnew(ToolButton); + button_hb->add_child(edit_remote); + edit_remote->set_h_size_flags(SIZE_EXPAND_FILL); + edit_remote->set_text(TTR("Remote")); + edit_remote->set_toggle_mode(true); + edit_remote->connect("pressed", this, "_remote_tree_selected"); + + edit_local = memnew(ToolButton); + button_hb->add_child(edit_local); + edit_local->set_h_size_flags(SIZE_EXPAND_FILL); + edit_local->set_text(TTR("Local")); + edit_local->set_toggle_mode(true); + edit_local->connect("pressed", this, "_local_tree_selected"); + + remote_tree = NULL; + button_hb->hide(); + scene_tree = memnew(SceneTreeEditor(false, true, true)); + vbc->add_child(scene_tree); scene_tree->set_v_size_flags(SIZE_EXPAND | SIZE_FILL); scene_tree->connect("rmb_pressed", this, "_tree_rmb"); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index f61c67bb13..97d3c4748a 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -95,7 +95,10 @@ class SceneTreeDock : public VBoxContainer { ToolButton *button_create_script; ToolButton *button_clear_script; + HBoxContainer *button_hb; + ToolButton *edit_local, *edit_remote; SceneTreeEditor *scene_tree; + Control *remote_tree; HBoxContainer *tool_hbc; void _tool_selected(int p_tool, bool p_confirm_override = false); @@ -174,6 +177,9 @@ class SceneTreeDock : public VBoxContainer { void _file_selected(String p_file); + void _remote_tree_selected(); + void _local_tree_selected(); + protected: void _notification(int p_what); static void _bind_methods(); @@ -194,6 +200,10 @@ public: SceneTreeEditor *get_tree_editor() { return scene_tree; } EditorData *get_editor_data() { return editor_data; } + void add_remote_tree_editor(Control *p_remote); + void show_remote_tree(); + void hide_remote_tree(); + void open_script_dialog(Node *p_for_node); SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSelection *p_editor_selection, EditorData &p_editor_data); }; diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index a6e0af05b2..c4b86c6b2b 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -354,7 +354,11 @@ void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) { void SceneTreeEditor::_node_script_changed(Node *p_node) { - _update_tree(); + if (tree_dirty) + return; + + MessageQueue::get_singleton()->push_call(this, "_update_tree"); + tree_dirty = true; /* changes the order :| TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL; diff --git a/main/main.cpp b/main/main.cpp index aa4dce93a6..cc6e66d352 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -294,7 +294,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>(); - globals->add_singleton(ProjectSettings::Singleton("Performance", performance)); + engine->add_singleton(Engine::Singleton("Performance", performance)); GLOBAL_DEF("debug/settings/crash_handler/message", String("Please include this when reporting the bug on https://github.com/godotengine/godot/issues")); diff --git a/methods.py b/methods.py index 2f3dac7e42..6e4fecd67e 100644 --- a/methods.py +++ b/methods.py @@ -1293,21 +1293,15 @@ def detect_modules(): // modules.cpp - THIS FILE IS GENERATED, DO NOT EDIT!!!!!!! #include "register_module_types.h" - """ + includes_cpp + """ void register_module_types() { - """ + register_cpp + """ - } void unregister_module_types() { - """ + unregister_cpp + """ - } - """ f = open("modules/register_module_types.gen.cpp", "w") diff --git a/misc/travis/android-tools-linux.sh b/misc/travis/android-tools-linux.sh new file mode 100755 index 0000000000..04fb2eee21 --- /dev/null +++ b/misc/travis/android-tools-linux.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +# SDK +# https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip +# SHA-256 444e22ce8ca0f67353bda4b85175ed3731cae3ffa695ca18119cbacef1c1bea0 +# latest version available here: https://developer.android.com/studio/index.html + +# NDK +# https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip +# SHA-1 0bf02d4e8b85fd770fd7b9b2cdec57f9441f27a2 +# latest version available here: https://developer.android.com/ndk/downloads/index.html + +BASH_RC=~/.bashrc +GODOT_BUILD_TOOLS_PATH=./godot-dev/build-tools +mkdir -p $GODOT_BUILD_TOOLS_PATH +cd $GODOT_BUILD_TOOLS_PATH + +ANDROID_BASE_URL=http://dl.google.com/android/repository + +ANDROID_SDK_RELEASE=3859397 +ANDROID_SDK_DIR=android-sdk +ANDROID_SDK_FILENAME=sdk-tools-linux-$ANDROID_SDK_RELEASE.zip +ANDROID_SDK_URL=$ANDROID_BASE_URL/$ANDROID_SDK_FILENAME +ANDROID_SDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_SDK_DIR +ANDROID_SDK_SHA256=444e22ce8ca0f67353bda4b85175ed3731cae3ffa695ca18119cbacef1c1bea0 + +ANDROID_NDK_RELEASE=r15c +ANDROID_NDK_DIR=android-ndk +ANDROID_NDK_FILENAME=android-ndk-$ANDROID_NDK_RELEASE-linux-x86_64.zip +ANDROID_NDK_URL=$ANDROID_BASE_URL/$ANDROID_NDK_FILENAME +ANDROID_NDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_NDK_DIR +ANDROID_NDK_SHA1=0bf02d4e8b85fd770fd7b9b2cdec57f9441f27a2 + +echo +echo "Download and install Android development tools ..." +echo + +if [ ! -e $ANDROID_SDK_FILENAME ]; then + echo "Downloading: Android SDK ..." + curl -L -O $ANDROID_SDK_URL +else + echo $ANDROID_SDK_SHA1 $ANDROID_SDK_FILENAME > $ANDROID_SDK_FILENAME.sha1 + if [ $(shasum -a 256 < $ANDROID_SDK_FILENAME | awk '{print $1;}') != $ANDROID_SDK_SHA1 ]; then + echo "Downloading: Android SDK ..." + curl -L -O $ANDROID_SDK_URL + fi +fi + +if [ ! -d $ANDROID_SDK_DIR ]; then + echo "Extracting: Android SDK ..." + unzip -qq $ANDROID_SDK_FILENAME -d $ANDROID_SDK_DIR + echo +fi + +if [ ! -e $ANDROID_NDK_FILENAME ]; then + echo "Downloading: Android NDK ..." + curl -L -O $ANDROID_NDK_URL +else + echo $ANDROID_NDK_MD5 $ANDROID_NDK_FILENAME > $ANDROID_NDK_FILENAME.md5 + if [ $(shasum -a 1 < $ANDROID_NDK_FILENAME | awk '{print $1;}') != $ANDROID_NDK_SHA1 ]; then + echo "Downloading: Android NDK ..." + curl -L -O $ANDROID_NDK_URL + fi +fi + +if [ ! -d $ANDROID_NDK_DIR ]; then + echo "Extracting: Android NDK ..." + unzip -qq $ANDROID_NDK_FILENAME + mv android-ndk-$ANDROID_NDK_RELEASE $ANDROID_NDK_DIR + echo +fi + +echo "Installing: Android Tools ..." +#$ANDROID_SDK_DIR/tools/bin/sdkmanager --all +yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager --licenses > /dev/null +$ANDROID_SDK_DIR/tools/bin/sdkmanager 'tools' > /dev/null +$ANDROID_SDK_DIR/tools/bin/sdkmanager 'platform-tools' > /dev/null +$ANDROID_SDK_DIR/tools/bin/sdkmanager 'build-tools;26.0.2' > /dev/null +echo + +EXPORT_VAL="export ANDROID_HOME=$ANDROID_SDK_PATH" +if ! grep -q "^$EXPORT_VAL" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +EXPORT_VAL="export ANDROID_NDK_ROOT=$ANDROID_NDK_PATH" +if ! grep -q "^$EXPORT_VAL" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools" +if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools.*" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools/bin" +if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools/bin.*" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +echo +echo "Done!" +echo diff --git a/misc/travis/android-tools-osx.sh b/misc/travis/android-tools-osx.sh new file mode 100755 index 0000000000..96125a3a3f --- /dev/null +++ b/misc/travis/android-tools-osx.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +# SDK +# https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip +# SHA-256 4a81754a760fce88cba74d69c364b05b31c53d57b26f9f82355c61d5fe4b9df9 +# latest version available here: https://developer.android.com/studio/index.html + +# NDK +# https://dl.google.com/android/repository/android-ndk-r15c-darwin-x86_64.zip +# SHA-1 ea4b5d76475db84745aa8828000d009625fc1f98 +# latest version available here: https://developer.android.com/ndk/downloads/index.html + +BASH_RC=~/.bashrc +GODOT_BUILD_TOOLS_PATH=./godot-dev/build-tools +mkdir -p $GODOT_BUILD_TOOLS_PATH +cd $GODOT_BUILD_TOOLS_PATH + +ANDROID_BASE_URL=http://dl.google.com/android/repository + +ANDROID_SDK_RELEASE=3859397 +ANDROID_SDK_DIR=android-sdk +ANDROID_SDK_FILENAME=sdk-tools-darwin-$ANDROID_SDK_RELEASE.zip +ANDROID_SDK_URL=$ANDROID_BASE_URL/$ANDROID_SDK_FILENAME +ANDROID_SDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_SDK_DIR +ANDROID_SDK_SHA256=4a81754a760fce88cba74d69c364b05b31c53d57b26f9f82355c61d5fe4b9df9 + +ANDROID_NDK_RELEASE=r15c +ANDROID_NDK_DIR=android-ndk +ANDROID_NDK_FILENAME=android-ndk-$ANDROID_NDK_RELEASE-darwin-x86_64.zip +ANDROID_NDK_URL=$ANDROID_BASE_URL/$ANDROID_NDK_FILENAME +ANDROID_NDK_PATH=$GODOT_BUILD_TOOLS_PATH/$ANDROID_NDK_DIR +ANDROID_NDK_SHA1=ea4b5d76475db84745aa8828000d009625fc1f98 + +echo +echo "Download and install Android development tools ..." +echo + +if [ ! -e $ANDROID_SDK_FILENAME ]; then + echo "Downloading: Android SDK ..." + curl -L -O $ANDROID_SDK_URL +else + echo $ANDROID_SDK_SHA1 $ANDROID_SDK_FILENAME > $ANDROID_SDK_FILENAME.sha1 + if [ $(shasum -a 256 < $ANDROID_SDK_FILENAME | awk '{print $1;}') != $ANDROID_SDK_SHA1 ]; then + echo "Downloading: Android SDK ..." + curl -L -O $ANDROID_SDK_URL + fi +fi + +if [ ! -d $ANDROID_SDK_DIR ]; then + echo "Extracting: Android SDK ..." + mkdir -p $ANDROID_SDK_DIR && tar -xf $ANDROID_SDK_FILENAME -C $ANDROID_SDK_DIR + echo +fi + +if [ ! -e $ANDROID_NDK_FILENAME ]; then + echo "Downloading: Android NDK ..." + curl -L -O $ANDROID_NDK_URL +else + echo $ANDROID_NDK_MD5 $ANDROID_NDK_FILENAME > $ANDROID_NDK_FILENAME.md5 + if [ $(shasum -a 1 < $ANDROID_NDK_FILENAME | awk '{print $1;}') != $ANDROID_NDK_SHA1 ]; then + echo "Downloading: Android NDK ..." + curl -L -O $ANDROID_NDK_URL + fi +fi + +if [ ! -d $ANDROID_NDK_DIR ]; then + echo "Extracting: Android NDK ..." + tar -xf $ANDROID_NDK_FILENAME + mv android-ndk-$ANDROID_NDK_RELEASE $ANDROID_NDK_DIR + echo +fi + +echo "Installing: Android Tools ..." +#$ANDROID_SDK_DIR/tools/bin/sdkmanager --all +yes | $ANDROID_SDK_DIR/tools/bin/sdkmanager --licenses > /dev/null +$ANDROID_SDK_DIR/tools/bin/sdkmanager 'tools' > /dev/null +$ANDROID_SDK_DIR/tools/bin/sdkmanager 'platform-tools' > /dev/null +$ANDROID_SDK_DIR/tools/bin/sdkmanager 'build-tools;26.0.2' > /dev/null +echo + +EXPORT_VAL="export ANDROID_HOME=$ANDROID_SDK_PATH" +if ! grep -q "^$EXPORT_VAL" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +EXPORT_VAL="export ANDROID_NDK_ROOT=$ANDROID_NDK_PATH" +if ! grep -q "^$EXPORT_VAL" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools" +if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools.*" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +EXPORT_VAL="export PATH=$PATH:$ANDROID_SDK_PATH/tools/bin" +if ! grep -q "^export PATH=.*$ANDROID_SDK_PATH/tools/bin.*" $BASH_RC; then + echo $EXPORT_VAL >> $BASH_RC +fi +#eval $EXPORT_VAL + +echo +echo "Done!" +echo diff --git a/misc/travis/ccache-osx.sh b/misc/travis/ccache-osx.sh new file mode 100755 index 0000000000..5ce7a80cbc --- /dev/null +++ b/misc/travis/ccache-osx.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +echo +echo "Download and install ccache ..." +echo + +echo "Downloading sources ..." +curl -L -O https://www.samba.org/ftp/ccache/ccache-3.3.4.tar.gz # latest version available here: https://ccache.samba.org/download.html + +echo "Extracting to build directory ..." +tar xzf ccache-3.3.4.tar.gz +cd ccache-3.3.4 + +echo "Compiling sources ..." +./configure --prefix=/usr/local --with-bundled-zlib > /dev/null +make + +echo "Installing ..." + +mkdir /usr/local/opt/ccache + +mkdir /usr/local/opt/ccache/bin +cp ccache /usr/local/opt/ccache/bin +ln -s /usr/local/opt/ccache/bin/ccache /usr/local/bin/ccache + +mkdir /usr/local/opt/ccache/libexec +links=( + clang + clang++ + cc + gcc gcc2 gcc3 gcc-3.3 gcc-4.0 gcc-4.2 gcc-4.3 gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 gcc-4.8 gcc-4.9 gcc-5 gcc-6 gcc-7 + c++ c++3 c++-3.3 c++-4.0 c++-4.2 c++-4.3 c++-4.4 c++-4.5 c++-4.6 c++-4.7 c++-4.8 c++-4.9 c++-5 c++-6 c++-7 + g++ g++2 g++3 g++-3.3 g++-4.0 g++-4.2 g++-4.3 g++-4.4 g++-4.5 g++-4.6 g++-4.7 g++-4.8 g++-4.9 g++-5 g++-6 g++-7 +) +for link in "${links[@]}"; do + ln -s ../bin/ccache /usr/local/opt/ccache/libexec/$link +done +#/usr/local/bin/ccache -M 2G +cd $TRAVIS_BUILD_DIR + +echo +echo "Done!" +echo diff --git a/misc/travis/scons-local-osx.sh b/misc/travis/scons-local-osx.sh new file mode 100755 index 0000000000..d9d7d98b38 --- /dev/null +++ b/misc/travis/scons-local-osx.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +echo +echo "Download and install Scons local package ..." +echo + +echo "Downloading sources ..." +curl -L -O http://prdownloads.sourceforge.net/scons/scons-local-3.0.0.zip # latest version available here: http://scons.org/pages/download.html + +echo "Extracting to build directory ..." +unzip -qq -n scons-local-3.0.0.zip -d $TRAVIS_BUILD_DIR/scons-local + +echo "Installing symlinks ..." +ln -s $TRAVIS_BUILD_DIR/scons-local/scons.py /usr/local/bin/scons + +echo +echo "Done!" +echo diff --git a/modules/SCsub b/modules/SCsub index d1c0cdc05c..c1cf5a6c1a 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -9,7 +9,6 @@ Export('env_modules') env.modules_sources = [ "register_module_types.gen.cpp", ] -# env.add_source_files(env.modules_sources,"*.cpp") Export('env') for x in env.module_list: diff --git a/modules/bullet/config.py b/modules/bullet/config.py index b00ea18328..0a31c2e503 100644 --- a/modules/bullet/config.py +++ b/modules/bullet/config.py @@ -3,4 +3,12 @@ def can_build(platform): def configure(env): pass - + +def get_doc_classes(): + return [ + "BulletPhysicsDirectBodyState", + "BulletPhysicsServer", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml b/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml new file mode 100644 index 0000000000..831b346942 --- /dev/null +++ b/modules/bullet/doc_classes/BulletPhysicsDirectBodyState.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="BulletPhysicsDirectBodyState" inherits="PhysicsDirectBodyState" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/modules/bullet/doc_classes/BulletPhysicsServer.xml b/modules/bullet/doc_classes/BulletPhysicsServer.xml new file mode 100644 index 0000000000..4b5c2e6d83 --- /dev/null +++ b/modules/bullet/doc_classes/BulletPhysicsServer.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="BulletPhysicsServer" inherits="PhysicsServer" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/modules/dds/config.py b/modules/dds/config.py index fb920482f5..5f133eba90 100644 --- a/modules/dds/config.py +++ b/modules/dds/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/enet/config.py b/modules/enet/config.py index fb920482f5..8031fbb4b6 100644 --- a/modules/enet/config.py +++ b/modules/enet/config.py @@ -1,7 +1,13 @@ - def can_build(platform): return True - def configure(env): pass + +def get_doc_classes(): + return [ + "NetworkedMultiplayerENet", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/doc/classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml index 02c919bd83..70ef6aef20 100644 --- a/doc/classes/NetworkedMultiplayerENet.xml +++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core" version="3.0.alpha.custom_build"> +<class name="NetworkedMultiplayerENet" inherits="NetworkedMultiplayerPeer" category="Core" version="3.0-alpha"> <brief_description> PacketPeer implementation using the ENet library. </brief_description> diff --git a/modules/etc/config.py b/modules/etc/config.py index 7dc2cb59c1..395fc1bb02 100644 --- a/modules/etc/config.py +++ b/modules/etc/config.py @@ -1,8 +1,6 @@ - def can_build(platform): return True - def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that diff --git a/modules/freetype/config.py b/modules/freetype/config.py index fb920482f5..5f133eba90 100644 --- a/modules/freetype/config.py +++ b/modules/freetype/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 88588417d1..2755930a55 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -40,11 +40,13 @@ def _build_gdnative_api_struct_header(api): '\tunsigned int minor;', '} godot_gdnative_api_version;', '', - 'typedef struct godot_gdnative_api_struct {', + 'typedef struct godot_gdnative_api_struct godot_gdnative_api_struct;', + '', + 'struct godot_gdnative_api_struct {', '\tunsigned int type;', '\tgodot_gdnative_api_version version;', '\tconst godot_gdnative_api_struct *next;', - '} godot_gdnative_api_struct;', + '};', '', 'enum GDNATIVE_API_TYPES {', '\tGDNATIVE_' + api['core']['type'] + ',' diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp index e2a7019fa4..02f2ee7424 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp +++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp @@ -166,11 +166,11 @@ void ARVRInterfaceGDNative::uninitialize() { interface->uninitialize(data); } -Size2 ARVRInterfaceGDNative::get_recommended_render_targetsize() { +Size2 ARVRInterfaceGDNative::get_render_targetsize() { ERR_FAIL_COND_V(interface == NULL, Size2()); - godot_vector2 result = interface->get_recommended_render_targetsize(data); + godot_vector2 result = interface->get_render_targetsize(data); Vector2 *vec = (Vector2 *)&result; return *vec; diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.h b/modules/gdnative/arvr/arvr_interface_gdnative.h index e45b51e070..96f7b580d5 100644 --- a/modules/gdnative/arvr/arvr_interface_gdnative.h +++ b/modules/gdnative/arvr/arvr_interface_gdnative.h @@ -68,7 +68,7 @@ public: virtual void set_anchor_detection_is_enabled(bool p_enable); /** rendering and internal **/ - virtual Size2 get_recommended_render_targetsize(); + virtual Size2 get_render_targetsize(); virtual bool is_stereo(); virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform); diff --git a/modules/gdnative/config.py b/modules/gdnative/config.py index df3556249d..68148c4d87 100644 --- a/modules/gdnative/config.py +++ b/modules/gdnative/config.py @@ -1,4 +1,3 @@ - def can_build(platform): return True @@ -6,7 +5,13 @@ def configure(env): env.use_ptrcall = True def get_doc_classes(): - return ["GDNative", "GDNativeLibrary", "NativeScript", "ARVRInterfaceGDNative"] + return [ + "ARVRInterfaceGDNative", + "GDNative", + "GDNativeLibrary", + "NativeScript", + "PluginScript", + ] def get_doc_path(): - return "doc_classes" + return "doc_classes" diff --git a/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml index 308a7d5946..10957a3394 100644 --- a/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml +++ b/modules/gdnative/doc_classes/ARVRInterfaceGDNative.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ARVRInterfaceGDNative" inherits="ARVRInterface" category="Core" version="3.0.alpha.custom_build"> +<class name="ARVRInterfaceGDNative" inherits="ARVRInterface" category="Core" version="3.0-alpha"> <brief_description> GDNative wrapper for an ARVR interface </brief_description> diff --git a/modules/gdnative/doc_classes/GDNative.xml b/modules/gdnative/doc_classes/GDNative.xml index 83a1cf06f0..7a36d09aec 100644 --- a/modules/gdnative/doc_classes/GDNative.xml +++ b/modules/gdnative/doc_classes/GDNative.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNative" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="GDNative" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index 361c89e6b3..e271665fd4 100644 --- a/modules/gdnative/doc_classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNativeLibrary" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="GDNativeLibrary" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> @@ -9,37 +9,51 @@ <demos> </demos> <methods> - <method name="get_active_library_path" qualifiers="const"> + <method name="get_config_file"> + <return type="ConfigFile"> + </return> + <description> + </description> + </method> + <method name="get_current_dependencies" qualifiers="const"> + <return type="PoolStringArray"> + </return> + <description> + </description> + </method> + <method name="get_current_library_path" qualifiers="const"> <return type="String"> </return> <description> </description> </method> - <method name="get_library_path" qualifiers="const"> + <method name="get_symbol_prefix" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="platform" type="String"> - </argument> <description> </description> </method> - <method name="is_singleton_gdnative" qualifiers="const"> + <method name="is_current_library_statically_linked" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_singleton" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="set_library_path"> + <method name="set_load_once"> <return type="void"> </return> - <argument index="0" name="platform" type="String"> - </argument> - <argument index="1" name="path" type="String"> + <argument index="0" name="load_once" type="bool"> </argument> <description> </description> </method> - <method name="set_singleton_gdnative"> + <method name="set_singleton"> <return type="void"> </return> <argument index="0" name="singleton" type="bool"> @@ -47,9 +61,27 @@ <description> </description> </method> + <method name="set_symbol_prefix"> + <return type="void"> + </return> + <argument index="0" name="symbol_prefix" type="String"> + </argument> + <description> + </description> + </method> + <method name="should_load_once" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> </methods> <members> - <member name="singleton_gdnative" type="bool" setter="set_singleton_gdnative" getter="is_singleton_gdnative"> + <member name="load_once" type="bool" setter="set_load_once" getter="should_load_once"> + </member> + <member name="singleton" type="bool" setter="set_singleton" getter="is_singleton"> + </member> + <member name="symbol_prefix" type="String" setter="set_symbol_prefix" getter="get_symbol_prefix"> </member> </members> <constants> diff --git a/modules/gdnative/doc_classes/NativeScript.xml b/modules/gdnative/doc_classes/NativeScript.xml index b040cfd966..eb4e13f748 100644 --- a/modules/gdnative/doc_classes/NativeScript.xml +++ b/modules/gdnative/doc_classes/NativeScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="NativeScript" inherits="Script" category="Core" version="3.0.alpha.custom_build"> +<class name="NativeScript" inherits="Script" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/PluginScript.xml b/modules/gdnative/doc_classes/PluginScript.xml index 334921016b..a5ab422d3c 100644 --- a/doc/classes/PluginScript.xml +++ b/modules/gdnative/doc_classes/PluginScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="PluginScript" inherits="Script" category="Core" version="3.0.alpha.custom_build"> +<class name="PluginScript" inherits="Script" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/gdnative/gd_native_library_editor.cpp b/modules/gdnative/gd_native_library_editor.cpp index c37b7f473d..fda5dcdcad 100644 --- a/modules/gdnative/gd_native_library_editor.cpp +++ b/modules/gdnative/gd_native_library_editor.cpp @@ -44,7 +44,7 @@ void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory } Ref<GDNativeLibrary> lib = ResourceLoader::load(p_dir->get_file_path(i)); - if (lib.is_valid() && lib->is_singleton_gdnative()) { + if (lib.is_valid() && lib->is_singleton()) { String path = p_dir->get_file_path(i); TreeItem *ti = libraries->create_item(libraries->get_root()); ti->set_text(0, path.get_file()); diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 832a0cb859..44d6dffc85 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -37,161 +37,56 @@ #include "scene/main/scene_tree.h" -const String init_symbol = "godot_gdnative_init"; -const String terminate_symbol = "godot_gdnative_terminate"; +const String init_symbol = "gdnative_init"; +const String terminate_symbol = "gdnative_terminate"; +const String default_symbol_prefix = "godot_"; // Defined in gdnative_api_struct.gen.cpp extern const godot_gdnative_core_api_struct api_struct; -String GDNativeLibrary::platform_names[NUM_PLATFORMS + 1] = { - "X11_32bit", - "X11_64bit", - "Windows_32bit", - "Windows_64bit", - "OSX", - - "Android", - - "iOS_32bit", - "iOS_64bit", - - "WebAssembly", - - "" -}; -String GDNativeLibrary::platform_lib_ext[NUM_PLATFORMS + 1] = { - "so", - "so", - "dll", - "dll", - "dylib", - - "so", - - "dylib", - "dylib", - - "wasm", - - "" -}; - -GDNativeLibrary::Platform GDNativeLibrary::current_platform = -#if defined(X11_ENABLED) - (sizeof(void *) == 8 ? X11_64BIT : X11_32BIT); -#elif defined(WINDOWS_ENABLED) - (sizeof(void *) == 8 ? WINDOWS_64BIT : WINDOWS_32BIT); -#elif defined(OSX_ENABLED) - OSX; -#elif defined(IPHONE_ENABLED) - (sizeof(void *) == 8 ? IOS_64BIT : IOS_32BIT); -#elif defined(ANDROID_ENABLED) - ANDROID; -#elif defined(JAVASCRIPT_ENABLED) - WASM; -#else - NUM_PLATFORMS; -#endif - -GDNativeLibrary::GDNativeLibrary() - : library_paths(), singleton_gdnative(false) { -} +Map<String, Vector<Ref<GDNative> > > *GDNativeLibrary::loaded_libraries = NULL; -GDNativeLibrary::~GDNativeLibrary() { -} - -void GDNativeLibrary::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_library_path", "platform", "path"), &GDNativeLibrary::set_library_path); - ClassDB::bind_method(D_METHOD("get_library_path", "platform"), &GDNativeLibrary::get_library_path); - ClassDB::bind_method(D_METHOD("get_active_library_path"), &GDNativeLibrary::get_active_library_path); +GDNativeLibrary::GDNativeLibrary() { + config_file.instance(); - ClassDB::bind_method(D_METHOD("is_singleton_gdnative"), &GDNativeLibrary::is_singleton_gdnative); - ClassDB::bind_method(D_METHOD("set_singleton_gdnative", "singleton"), &GDNativeLibrary::set_singleton_gdnative); + symbol_prefix = default_symbol_prefix; - ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "singleton_gdnative"), "set_singleton_gdnative", "is_singleton_gdnative"); -} - -bool GDNativeLibrary::_set(const StringName &p_name, const Variant &p_value) { - String name = p_name; - if (name.begins_with("platform/")) { - set_library_path(name.get_slice("/", 1), p_value); - return true; - } - return false; -} - -bool GDNativeLibrary::_get(const StringName &p_name, Variant &r_ret) const { - String name = p_name; - if (name.begins_with("platform/")) { - r_ret = get_library_path(name.get_slice("/", 1)); - return true; + if (GDNativeLibrary::loaded_libraries == NULL) { + GDNativeLibrary::loaded_libraries = memnew((Map<String, Vector<Ref<GDNative> > >)); } - return false; } -void GDNativeLibrary::_get_property_list(List<PropertyInfo> *p_list) const { - for (int i = 0; i < NUM_PLATFORMS; i++) { - p_list->push_back(PropertyInfo(Variant::STRING, - "platform/" + platform_names[i], - PROPERTY_HINT_FILE, - "*." + platform_lib_ext[i])); - } +GDNativeLibrary::~GDNativeLibrary() { } -void GDNativeLibrary::set_library_path(StringName p_platform, String p_path) { - int i; - for (i = 0; i <= NUM_PLATFORMS; i++) { - if (i == NUM_PLATFORMS) break; - if (platform_names[i] == p_platform) { - break; - } - } - - if (i == NUM_PLATFORMS) { - ERR_EXPLAIN(String("No such platform: ") + p_platform); - ERR_FAIL(); - } +void GDNativeLibrary::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_config_file"), &GDNativeLibrary::get_config_file); - library_paths[i] = p_path; -} + ClassDB::bind_method(D_METHOD("get_current_library_path"), &GDNativeLibrary::get_current_library_path); + ClassDB::bind_method(D_METHOD("get_current_dependencies"), &GDNativeLibrary::get_current_dependencies); + ClassDB::bind_method(D_METHOD("is_current_library_statically_linked"), &GDNativeLibrary::is_current_library_statically_linked); -String GDNativeLibrary::get_library_path(StringName p_platform) const { - int i; - for (i = 0; i <= NUM_PLATFORMS; i++) { - if (i == NUM_PLATFORMS) break; - if (platform_names[i] == p_platform) { - break; - } - } + ClassDB::bind_method(D_METHOD("should_load_once"), &GDNativeLibrary::should_load_once); + ClassDB::bind_method(D_METHOD("is_singleton"), &GDNativeLibrary::is_singleton); + ClassDB::bind_method(D_METHOD("get_symbol_prefix"), &GDNativeLibrary::get_symbol_prefix); - if (i == NUM_PLATFORMS) { - ERR_EXPLAIN(String("No such platform: ") + p_platform); - ERR_FAIL_V(""); - } + ClassDB::bind_method(D_METHOD("set_load_once", "load_once"), &GDNativeLibrary::set_load_once); + ClassDB::bind_method(D_METHOD("set_singleton", "singleton"), &GDNativeLibrary::set_singleton); + ClassDB::bind_method(D_METHOD("set_symbol_prefix", "symbol_prefix"), &GDNativeLibrary::set_symbol_prefix); - return library_paths[i]; -} - -String GDNativeLibrary::get_active_library_path() const { - if (GDNativeLibrary::current_platform != NUM_PLATFORMS) { - return library_paths[GDNativeLibrary::current_platform]; - } - return ""; + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "load_once"), "set_load_once", "should_load_once"); + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "singleton"), "set_singleton", "is_singleton"); + ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "symbol_prefix"), "set_symbol_prefix", "get_symbol_prefix"); } GDNative::GDNative() { native_handle = NULL; + initialized = false; } GDNative::~GDNative() { } -extern "C" void _api_anchor(); - -void GDNative::_compile_dummy_for_api() { - _api_anchor(); -} - void GDNative::_bind_methods() { ClassDB::bind_method(D_METHOD("set_library", "library"), &GDNative::set_library); ClassDB::bind_method(D_METHOD("get_library"), &GDNative::get_library); @@ -220,8 +115,8 @@ bool GDNative::initialize() { return false; } - String lib_path = library->get_active_library_path(); - if (lib_path.empty()) { + String lib_path = library->get_current_library_path(); + if (lib_path.empty() && !library->is_current_library_statically_linked()) { ERR_PRINT("No library set for this platform"); return false; } @@ -230,16 +125,34 @@ bool GDNative::initialize() { #else String path = ProjectSettings::get_singleton()->globalize_path(lib_path); #endif + + if (library->should_load_once()) { + if (GDNativeLibrary::loaded_libraries->has(lib_path)) { + // already loaded. Don't load again. + // copy some of the stuff instead + this->native_handle = (*GDNativeLibrary::loaded_libraries)[lib_path][0]->native_handle; + initialized = true; + return true; + } + } + Error err = OS::get_singleton()->open_dynamic_library(path, native_handle); - if (err != OK) { + if (err != OK && !library->is_current_library_statically_linked()) { return false; } void *library_init; - err = get_symbol(init_symbol, library_init); + + // we cheat here a little bit. you saw nothing + initialized = true; + + err = get_symbol(library->get_symbol_prefix() + init_symbol, library_init); + + initialized = false; if (err || !library_init) { - OS::get_singleton()->close_dynamic_library(native_handle); + if (!library->is_current_library_statically_linked()) + OS::get_singleton()->close_dynamic_library(native_handle); native_handle = NULL; ERR_PRINT("Failed to obtain godot_gdnative_init symbol"); return false; @@ -260,18 +173,42 @@ bool GDNative::initialize() { library_init_fpointer(&options); + initialized = true; + + if (library->should_load_once() && !GDNativeLibrary::loaded_libraries->has(lib_path)) { + Vector<Ref<GDNative> > gdnatives; + gdnatives.resize(1); + gdnatives[0] = Ref<GDNative>(this); + GDNativeLibrary::loaded_libraries->insert(lib_path, gdnatives); + } + return true; } bool GDNative::terminate() { - if (native_handle == NULL) { + if (!initialized) { ERR_PRINT("No valid library handle, can't terminate GDNative object"); return false; } + if (library->should_load_once()) { + Vector<Ref<GDNative> > *gdnatives = &(*GDNativeLibrary::loaded_libraries)[library->get_current_library_path()]; + if (gdnatives->size() > 1) { + // there are other GDNative's still using this library, so we actually don't terminte + gdnatives->erase(Ref<GDNative>(this)); + initialized = false; + return true; + } else if (gdnatives->size() == 1) { + // we're the last one, terminate! + gdnatives->clear(); + // wew this looks scary, but all it does is remove the entry completely + GDNativeLibrary::loaded_libraries->erase(GDNativeLibrary::loaded_libraries->find(library->get_current_library_path())); + } + } + void *library_terminate; - Error error = get_symbol(terminate_symbol, library_terminate); + Error error = get_symbol(library->get_symbol_prefix() + terminate_symbol, library_terminate); if (error || !library_terminate) { OS::get_singleton()->close_dynamic_library(native_handle); native_handle = NULL; @@ -281,13 +218,13 @@ bool GDNative::terminate() { godot_gdnative_terminate_fn library_terminate_pointer; library_terminate_pointer = (godot_gdnative_terminate_fn)library_terminate; - // TODO(karroffel): remove this? Should be part of NativeScript, not - // GDNative IMO godot_gdnative_terminate_options options; options.in_editor = Engine::get_singleton()->is_editor_hint(); library_terminate_pointer(&options); + initialized = false; + // GDNativeScriptLanguage::get_singleton()->initialized_libraries.erase(p_native_lib->path); OS::get_singleton()->close_dynamic_library(native_handle); @@ -297,7 +234,7 @@ bool GDNative::terminate() { } bool GDNative::is_initialized() { - return (native_handle != NULL); + return initialized; } void GDNativeCallRegistry::register_native_call_type(StringName p_call_type, native_call_cb p_callback) { @@ -342,7 +279,7 @@ Variant GDNative::call_native(StringName p_native_call_type, StringName p_proced Error GDNative::get_symbol(StringName p_procedure_name, void *&r_handle) { - if (native_handle == NULL) { + if (!initialized) { ERR_PRINT("No valid library handle, can't get symbol from GDNative object"); return ERR_CANT_OPEN; } @@ -355,3 +292,159 @@ Error GDNative::get_symbol(StringName p_procedure_name, void *&r_handle) { return result; } + +RES GDNativeLibraryResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error) { + Ref<GDNativeLibrary> lib; + lib.instance(); + + Ref<ConfigFile> config = lib->get_config_file(); + + Error err = config->load(p_path); + + if (r_error) { + *r_error = err; + } + + lib->set_singleton(config->get_value("general", "singleton", false)); + lib->set_load_once(config->get_value("general", "load_once", true)); + lib->set_symbol_prefix(config->get_value("general", "symbol_prefix", default_symbol_prefix)); + + String entry_lib_path; + { + + List<String> entry_keys; + config->get_section_keys("entry", &entry_keys); + + for (List<String>::Element *E = entry_keys.front(); E; E = E->next()) { + String key = E->get(); + + Vector<String> tags = key.split("."); + + bool skip = false; + for (int i = 0; i < tags.size(); i++) { + bool has_feature = OS::get_singleton()->has_feature(tags[i]); + + if (!has_feature) { + skip = true; + break; + } + } + + if (skip) { + continue; + } + + entry_lib_path = config->get_value("entry", key); + break; + } + } + + Vector<String> dependency_paths; + { + + List<String> dependency_keys; + config->get_section_keys("dependencies", &dependency_keys); + + for (List<String>::Element *E = dependency_keys.front(); E; E = E->next()) { + String key = E->get(); + + Vector<String> tags = key.split("."); + + bool skip = false; + for (int i = 0; i < tags.size(); i++) { + bool has_feature = OS::get_singleton()->has_feature(tags[i]); + + if (!has_feature) { + skip = true; + break; + } + } + + if (skip) { + continue; + } + + dependency_paths = config->get_value("dependencies", key); + break; + } + } + + bool is_statically_linked = false; + { + + List<String> static_linking_keys; + config->get_section_keys("static_linking", &static_linking_keys); + + for (List<String>::Element *E = static_linking_keys.front(); E; E = E->next()) { + String key = E->get(); + + Vector<String> tags = key.split("."); + + bool skip = false; + + for (int i = 0; i < tags.size(); i++) { + bool has_feature = OS::get_singleton()->has_feature(tags[i]); + + if (!has_feature) { + skip = true; + break; + } + } + + if (skip) { + continue; + } + + is_statically_linked = config->get_value("static_linking", key); + break; + } + } + + lib->current_library_path = entry_lib_path; + lib->current_dependencies = dependency_paths; + lib->current_library_statically_linked = is_statically_linked; + + return lib; +} + +void GDNativeLibraryResourceLoader::get_recognized_extensions(List<String> *p_extensions) const { + p_extensions->push_back("gdnlib"); +} + +bool GDNativeLibraryResourceLoader::handles_type(const String &p_type) const { + return p_type == "GDNativeLibrary"; +} + +String GDNativeLibraryResourceLoader::get_resource_type(const String &p_path) const { + String el = p_path.get_extension().to_lower(); + if (el == "gdnlib") + return "GDNativeLibrary"; + return ""; +} + +Error GDNativeLibraryResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { + + Ref<GDNativeLibrary> lib = p_resource; + + if (lib.is_null()) { + return ERR_INVALID_DATA; + } + + Ref<ConfigFile> config = lib->get_config_file(); + + config->set_value("general", "singleton", lib->is_singleton()); + config->set_value("general", "load_once", lib->should_load_once()); + config->set_value("general", "symbol_prefix", lib->get_symbol_prefix()); + + return config->save(p_path); +} + +bool GDNativeLibraryResourceSaver::recognize(const RES &p_resource) const { + return Object::cast_to<GDNativeLibrary>(*p_resource) != NULL; +} + +void GDNativeLibraryResourceSaver::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { + if (Object::cast_to<GDNativeLibrary>(*p_resource) != NULL) { + p_extensions->push_back("gdnlib"); + } +} diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index e44cc55a79..061dff9267 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -38,66 +38,69 @@ #include "gdnative/gdnative.h" #include "gdnative_api_struct.gen.h" -class GDNativeLibrary : public Resource { - GDCLASS(GDNativeLibrary, Resource) - - enum Platform { - X11_32BIT, - X11_64BIT, - WINDOWS_32BIT, - WINDOWS_64BIT, - // NOTE(karroffel): I heard OSX 32 bit is dead, so 64 only - OSX, - - // Android .so files must be located in directories corresponding to Android ABI names: - // https://developer.android.com/ndk/guides/abis.html - // Android runtime will select the matching library depending on the device. - // The value here must simply point to the .so name, for example: - // "res://libmy_gdnative.so" or "libmy_gdnative.so", - // while in the project the actual paths can be "lib/android/armeabi-v7a/libmy_gdnative.so", - // "lib/android/arm64-v8a/libmy_gdnative.so". - ANDROID, - - IOS_32BIT, - IOS_64BIT, - - // TODO(karroffel): figure out how to deal with web stuff at all... - WASM, - - // TODO(karroffel): does UWP have different libs?? - // UWP, +#include "io/config_file.h" - NUM_PLATFORMS +class GDNativeLibraryResourceLoader; +class GDNative; - }; +class GDNativeLibrary : public Resource { + GDCLASS(GDNativeLibrary, Resource) - static String platform_names[NUM_PLATFORMS + 1]; - static String platform_lib_ext[NUM_PLATFORMS + 1]; + static Map<String, Vector<Ref<GDNative> > > *loaded_libraries; - static Platform current_platform; + friend class GDNativeLibraryResourceLoader; + friend class GDNative; - String library_paths[NUM_PLATFORMS]; + Ref<ConfigFile> config_file; - bool singleton_gdnative; + String current_library_path; + Vector<String> current_dependencies; + bool current_library_statically_linked; -protected: - bool _set(const StringName &p_name, const Variant &p_value); - bool _get(const StringName &p_name, Variant &r_ret) const; - void _get_property_list(List<PropertyInfo> *p_list) const; + bool singleton; + bool load_once; + String symbol_prefix; public: GDNativeLibrary(); ~GDNativeLibrary(); - static void _bind_methods(); + _FORCE_INLINE_ Ref<ConfigFile> get_config_file() { return config_file; } + + // things that change per-platform + // so there are no setters for this + _FORCE_INLINE_ String get_current_library_path() const { + return current_library_path; + } + _FORCE_INLINE_ Vector<String> get_current_dependencies() const { + return current_dependencies; + } + _FORCE_INLINE_ bool is_current_library_statically_linked() const { + return current_library_statically_linked; + } - void set_library_path(StringName p_platform, String p_path); - String get_library_path(StringName p_platform) const; + // things that are a property of the library itself, not platform specific + _FORCE_INLINE_ bool should_load_once() const { + return load_once; + } + _FORCE_INLINE_ bool is_singleton() const { + return singleton; + } + _FORCE_INLINE_ String get_symbol_prefix() const { + return symbol_prefix; + } - String get_active_library_path() const; + _FORCE_INLINE_ void set_load_once(bool p_load_once) { + load_once = p_load_once; + } + _FORCE_INLINE_ void set_singleton(bool p_singleton) { + singleton = p_singleton; + } + _FORCE_INLINE_ void set_symbol_prefix(String p_symbol_prefix) { + symbol_prefix = p_symbol_prefix; + } - _FORCE_INLINE_ bool is_singleton_gdnative() const { return singleton_gdnative; } - _FORCE_INLINE_ void set_singleton_gdnative(bool p_singleton) { singleton_gdnative = p_singleton; } + static void _bind_methods(); }; typedef godot_variant (*native_call_cb)(void *, godot_array *); @@ -124,10 +127,9 @@ class GDNative : public Reference { Ref<GDNativeLibrary> library; - // TODO(karroffel): different platforms? WASM???? void *native_handle; - void _compile_dummy_for_api(); + bool initialized; public: GDNative(); @@ -148,4 +150,19 @@ public: Error get_symbol(StringName p_procedure_name, void *&r_handle); }; +class GDNativeLibraryResourceLoader : public ResourceFormatLoader { +public: + virtual RES load(const String &p_path, const String &p_original_path, Error *r_error); + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual bool handles_type(const String &p_type) const; + virtual String get_resource_type(const String &p_path) const; +}; + +class GDNativeLibraryResourceSaver : public ResourceFormatSaver { +public: + virtual Error save(const String &p_path, const RES &p_resource, uint32_t p_flags); + virtual bool recognize(const RES &p_resource) const; + virtual void get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const; +}; + #endif // GDNATIVE_H diff --git a/modules/gdnative/gdnative/array.cpp b/modules/gdnative/gdnative/array.cpp index 90bc4dc031..e0d9514985 100644 --- a/modules/gdnative/gdnative/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -41,9 +41,6 @@ extern "C" { #endif -void _array_api_anchor() { -} - void GDAPI godot_array_new(godot_array *r_dest) { Array *dest = (Array *)r_dest; memnew_placement(dest, Array); diff --git a/modules/gdnative/gdnative/basis.cpp b/modules/gdnative/gdnative/basis.cpp index 28af93f942..39ca754dc7 100644 --- a/modules/gdnative/gdnative/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _basis_api_anchor() {} - void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis) { const Vector3 *x_axis = (const Vector3 *)p_x_axis; const Vector3 *y_axis = (const Vector3 *)p_y_axis; diff --git a/modules/gdnative/gdnative/color.cpp b/modules/gdnative/gdnative/color.cpp index 2a5c0887a1..281a4c416f 100644 --- a/modules/gdnative/gdnative/color.cpp +++ b/modules/gdnative/gdnative/color.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _color_api_anchor() {} - void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a) { Color *dest = (Color *)r_dest; diff --git a/modules/gdnative/gdnative/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp index 7f8320622d..8363416946 100644 --- a/modules/gdnative/gdnative/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -38,8 +38,6 @@ extern "C" { #endif -void _dictionary_api_anchor() {} - void GDAPI godot_dictionary_new(godot_dictionary *r_dest) { Dictionary *dest = (Dictionary *)r_dest; memnew_placement(dest, Dictionary); diff --git a/modules/gdnative/gdnative/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index 64a7c33cf8..6dfa7ec20b 100644 --- a/modules/gdnative/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -30,57 +30,16 @@ #include "gdnative/gdnative.h" #include "class_db.h" +#include "engine.h" #include "error_macros.h" #include "global_constants.h" #include "os/os.h" -#include "project_settings.h" #include "variant.h" #ifdef __cplusplus extern "C" { #endif -extern "C" void _string_api_anchor(); -extern "C" void _string_name_api_anchor(); -extern "C" void _vector2_api_anchor(); -extern "C" void _rect2_api_anchor(); -extern "C" void _vector3_api_anchor(); -extern "C" void _transform2d_api_anchor(); -extern "C" void _plane_api_anchor(); -extern "C" void _quat_api_anchor(); -extern "C" void _basis_api_anchor(); -extern "C" void _rect3_api_anchor(); -extern "C" void _transform_api_anchor(); -extern "C" void _color_api_anchor(); -extern "C" void _node_path_api_anchor(); -extern "C" void _rid_api_anchor(); -extern "C" void _dictionary_api_anchor(); -extern "C" void _array_api_anchor(); -extern "C" void _pool_arrays_api_anchor(); -extern "C" void _variant_api_anchor(); - -void _api_anchor() { - - _string_api_anchor(); - _string_name_api_anchor(); - _vector2_api_anchor(); - _rect2_api_anchor(); - _vector3_api_anchor(); - _transform2d_api_anchor(); - _plane_api_anchor(); - _quat_api_anchor(); - _rect3_api_anchor(); - _basis_api_anchor(); - _transform_api_anchor(); - _color_api_anchor(); - _node_path_api_anchor(); - _rid_api_anchor(); - _dictionary_api_anchor(); - _array_api_anchor(); - _pool_arrays_api_anchor(); - _variant_api_anchor(); -} - void GDAPI godot_object_destroy(godot_object *p_o) { memdelete((Object *)p_o); } @@ -88,7 +47,7 @@ void GDAPI godot_object_destroy(godot_object *p_o) { // Singleton API godot_object GDAPI *godot_global_get_singleton(char *p_name) { - return (godot_object *)ProjectSettings::get_singleton()->get_singleton_object(String(p_name)); + return (godot_object *)Engine::get_singleton()->get_singleton_object(String(p_name)); } // result shouldn't be freed void GDAPI *godot_get_stack_bottom() { @@ -133,14 +92,6 @@ godot_variant GDAPI godot_method_bind_call(godot_method_bind *p_method_bind, god return ret; } -// @Todo -/* -void GDAPI godot_method_bind_varcall(godot_method_bind *p_method_bind) -{ - -} -*/ - godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname) { ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname)); if (class_info) diff --git a/modules/gdnative/gdnative/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp index 50fade5b94..2bd278e050 100644 --- a/modules/gdnative/gdnative/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _node_path_api_anchor() {} - void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from) { NodePath *dest = (NodePath *)r_dest; const String *from = (const String *)p_from; diff --git a/modules/gdnative/gdnative/plane.cpp b/modules/gdnative/gdnative/plane.cpp index a5e05ffa6b..c92efb8d99 100644 --- a/modules/gdnative/gdnative/plane.cpp +++ b/modules/gdnative/gdnative/plane.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _plane_api_anchor() {} - void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d) { Plane *dest = (Plane *)r_dest; diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp index 731e930908..562cc344a9 100644 --- a/modules/gdnative/gdnative/pool_arrays.cpp +++ b/modules/gdnative/gdnative/pool_arrays.cpp @@ -41,9 +41,6 @@ extern "C" { #endif -void _pool_arrays_api_anchor() { -} - #define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr) // byte diff --git a/modules/gdnative/gdnative/quat.cpp b/modules/gdnative/gdnative/quat.cpp index 7db7847da1..2d012c069f 100644 --- a/modules/gdnative/gdnative/quat.cpp +++ b/modules/gdnative/gdnative/quat.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _quat_api_anchor() {} - void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w) { Quat *dest = (Quat *)r_dest; diff --git a/modules/gdnative/gdnative/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index ecd8cce9ca..b0b0e28138 100644 --- a/modules/gdnative/gdnative/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _rect2_api_anchor() {} - void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size) { const Vector2 *position = (const Vector2 *)p_pos; const Vector2 *size = (const Vector2 *)p_size; diff --git a/modules/gdnative/gdnative/rect3.cpp b/modules/gdnative/gdnative/rect3.cpp index d34d964db9..8e088743b4 100644 --- a/modules/gdnative/gdnative/rect3.cpp +++ b/modules/gdnative/gdnative/rect3.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _rect3_api_anchor() {} - void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size) { const Vector3 *pos = (const Vector3 *)p_pos; const Vector3 *size = (const Vector3 *)p_size; diff --git a/modules/gdnative/gdnative/rid.cpp b/modules/gdnative/gdnative/rid.cpp index f05c39906c..c6e8d82494 100644 --- a/modules/gdnative/gdnative/rid.cpp +++ b/modules/gdnative/gdnative/rid.cpp @@ -37,8 +37,6 @@ extern "C" { #endif -void _rid_api_anchor() {} - void GDAPI godot_rid_new(godot_rid *r_dest) { RID *dest = (RID *)r_dest; memnew_placement(dest, RID); diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 619003083d..781b8754bd 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -39,9 +39,6 @@ extern "C" { #endif -void _string_api_anchor() { -} - void GDAPI godot_string_new(godot_string *r_dest) { String *dest = (String *)r_dest; memnew_placement(dest, String); diff --git a/modules/gdnative/gdnative/string_name.cpp b/modules/gdnative/gdnative/string_name.cpp index 5c00fdfc2f..5c79e0acbd 100644 --- a/modules/gdnative/gdnative/string_name.cpp +++ b/modules/gdnative/gdnative/string_name.cpp @@ -38,9 +38,6 @@ extern "C" { #endif -void _string_name_api_anchor() { -} - void GDAPI godot_string_name_new(godot_string_name *r_dest, const godot_string *p_name) { StringName *dest = (StringName *)r_dest; const String *name = (const String *)p_name; diff --git a/modules/gdnative/gdnative/transform.cpp b/modules/gdnative/gdnative/transform.cpp index d7a3e78d3f..96b2ec8a7a 100644 --- a/modules/gdnative/gdnative/transform.cpp +++ b/modules/gdnative/gdnative/transform.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _transform_api_anchor() {} - void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin) { const Vector3 *x_axis = (const Vector3 *)p_x_axis; const Vector3 *y_axis = (const Vector3 *)p_y_axis; diff --git a/modules/gdnative/gdnative/transform2d.cpp b/modules/gdnative/gdnative/transform2d.cpp index dcb54f7a53..0a6334516b 100644 --- a/modules/gdnative/gdnative/transform2d.cpp +++ b/modules/gdnative/gdnative/transform2d.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _transform2d_api_anchor() {} - void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos) { const Vector2 *pos = (const Vector2 *)p_pos; Transform2D *dest = (Transform2D *)r_dest; diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 9ba4166c1d..0c31bc643c 100644 --- a/modules/gdnative/gdnative/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _variant_api_anchor() {} - #define memnew_placement_custom(m_placement, m_class, m_constr) _post_initialize(new (m_placement, sizeof(m_class), "") m_constr) // Constructors diff --git a/modules/gdnative/gdnative/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index 67f858997f..7a5b29e0c4 100644 --- a/modules/gdnative/gdnative/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _vector2_api_anchor() {} - void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y) { Vector2 *dest = (Vector2 *)r_dest; diff --git a/modules/gdnative/gdnative/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index c85a3f1c08..11ffb3320b 100644 --- a/modules/gdnative/gdnative/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -36,8 +36,6 @@ extern "C" { #endif -void _vector3_api_anchor() {} - void GDAPI godot_vector3_new(godot_vector3 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z) { Vector3 *dest = (Vector3 *)r_dest; diff --git a/modules/gdnative/include/arvr/godot_arvr.h b/modules/gdnative/include/arvr/godot_arvr.h index c12251439d..be13ac954b 100644 --- a/modules/gdnative/include/arvr/godot_arvr.h +++ b/modules/gdnative/include/arvr/godot_arvr.h @@ -47,7 +47,7 @@ typedef struct { godot_bool (*is_initialized)(const void *); godot_bool (*initialize)(void *); void (*uninitialize)(void *); - godot_vector2 (*get_recommended_render_targetsize)(const void *); + godot_vector2 (*get_render_targetsize)(const void *); godot_transform (*get_transform_for_eye)(void *, godot_int, godot_transform *); void (*fill_projection_for_eye)(void *, godot_real *, godot_int, godot_real, godot_real, godot_real); void (*commit_for_eye)(void *, godot_int, godot_rid *, godot_rect2 *); diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 8fa96fd3af..a479eced16 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -53,7 +53,7 @@ extern "C" { // This is for libraries *using* the header, NOT GODOT EXPOSING STUFF!! #ifdef _WIN32 -#define GDN_EXPORT __declspec(dllexport) +#define GDN_EXPORT #else #define GDN_EXPORT #endif diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index 63fb71feb6..f9d699fb59 100644 --- a/modules/gdnative/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp @@ -32,9 +32,9 @@ #ifdef TOOLS_ENABLED #include "core/class_db.h" +#include "core/engine.h" #include "core/global_constants.h" #include "core/pair.h" -#include "core/project_settings.h" #include "os/file_access.h" // helper stuff @@ -177,7 +177,7 @@ List<ClassAPI> generate_c_api_classes() { if (name.begins_with("_")) { name.remove(0); } - class_api.is_singleton = ProjectSettings::get_singleton()->has_singleton(name); + class_api.is_singleton = Engine::get_singleton()->has_singleton(name); } class_api.is_instanciable = !class_api.is_singleton && ClassDB::can_instance(class_name); diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index c1df7def2e..c2c7c27f25 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -40,6 +40,8 @@ #include "scene/main/scene_tree.h" #include "scene/resources/scene_format_text.h" +#include <stdlib.h> + #ifndef NO_THREADS #include "os/thread.h" #endif @@ -52,7 +54,11 @@ #include "editor/editor_node.h" #endif -////// Script stuff +// +// +// Script stuff +// +// void NativeScript::_bind_methods() { ClassDB::bind_method(D_METHOD("set_class_name", "class_name"), &NativeScript::set_class_name); @@ -108,7 +114,7 @@ void NativeScript::set_library(Ref<GDNativeLibrary> p_library) { return; } library = p_library; - lib_path = library->get_active_library_path(); + lib_path = library->get_current_library_path(); #ifndef NO_THREADS if (Thread::get_caller_id() != Thread::get_main_id()) { @@ -414,7 +420,6 @@ Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::Call } } -// TODO(karroffel): implement this NativeScript::NativeScript() { library = Ref<GDNative>(); lib_path = ""; @@ -424,7 +429,6 @@ NativeScript::NativeScript() { #endif } -// TODO(karroffel): implement this NativeScript::~NativeScript() { NSL->unregister_script(this); @@ -433,7 +437,11 @@ NativeScript::~NativeScript() { #endif } -////// ScriptInstance stuff +// +// +// ScriptInstance stuff +// +// #define GET_SCRIPT_DESC() script->get_script_desc() @@ -691,7 +699,6 @@ NativeScriptInstance::RPCMode NativeScriptInstance::get_rpc_mode(const StringNam return RPC_MODE_DISABLED; } -// TODO(karroffel): implement this NativeScriptInstance::RPCMode NativeScriptInstance::get_rset_mode(const StringName &p_variable) const { NativeScriptDesc *script_data = GET_SCRIPT_DESC(); @@ -774,15 +781,14 @@ NativeScriptInstance::~NativeScriptInstance() { } } -////// ScriptingLanguage stuff +// +// +// ScriptingLanguage stuff +// +// NativeScriptLanguage *NativeScriptLanguage::singleton; -extern "C" void _native_script_hook(); -void NativeScriptLanguage::_hacky_api_anchor() { - _native_script_hook(); -} - void NativeScriptLanguage::_unload_stuff() { for (Map<String, Map<StringName, NativeScriptDesc> >::Element *L = library_classes.front(); L; L = L->next()) { for (Map<StringName, NativeScriptDesc>::Element *C = L->get().front(); C; C = C->next()) { @@ -819,9 +825,7 @@ NativeScriptLanguage::NativeScriptLanguage() { #endif } -// TODO(karroffel): implement this NativeScriptLanguage::~NativeScriptLanguage() { - // _unload_stuff(); // NOTE(karroffel): This gets called in ::finish() for (Map<String, Ref<GDNative> >::Element *L = NSL->library_gdnatives.front(); L; L = L->next()) { @@ -847,7 +851,6 @@ void _add_reload_node() { #endif } -// TODO(karroffel): implement this void NativeScriptLanguage::init() { #if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED) @@ -860,6 +863,7 @@ void NativeScriptLanguage::init() { if (generate_c_api(E->next()->get()) != OK) { ERR_PRINT("Failed to generate C API\n"); } + exit(0); } #endif @@ -886,11 +890,9 @@ void NativeScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) co void NativeScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const { } -// TODO(karroffel): implement this Ref<Script> NativeScriptLanguage::get_template(const String &p_class_name, const String &p_base_class_name) const { NativeScript *s = memnew(NativeScript); s->set_class_name(p_class_name); - // TODO(karroffel): use p_base_class_name return Ref<NativeScript>(s); } bool NativeScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const { @@ -988,7 +990,7 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { MutexLock lock(mutex); #endif // See if this library was "registered" already. - const String &lib_path = lib->get_active_library_path(); + const String &lib_path = lib->get_current_library_path(); ERR_EXPLAIN(lib->get_name() + " does not have a library for the current platform"); ERR_FAIL_COND(lib_path.length() == 0); Map<String, Ref<GDNative> >::Element *E = library_gdnatives.find(lib_path); @@ -998,7 +1000,7 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { gdn.instance(); gdn->set_library(lib); - // TODO(karroffel): check the return value? + // TODO check the return value? gdn->initialize(); library_gdnatives.insert(lib_path, gdn); @@ -1010,7 +1012,7 @@ void NativeScriptLanguage::init_library(const Ref<GDNativeLibrary> &lib) { void *proc_ptr; - Error err = gdn->get_symbol(_init_call_name, proc_ptr); + Error err = gdn->get_symbol(lib->get_symbol_prefix() + _init_call_name, proc_ptr); if (err != OK) { ERR_PRINT(String("No " + _init_call_name + " in \"" + lib_path + "\" found").utf8().get_data()); @@ -1051,7 +1053,7 @@ void NativeScriptLanguage::call_libraries_cb(const StringName &name) { if (L->get()->is_initialized()) { void *proc_ptr; - Error err = L->get()->get_symbol(name, proc_ptr); + Error err = L->get()->get_symbol(L->get()->get_library()->get_symbol_prefix() + name, proc_ptr); if (!err) { ((void (*)())proc_ptr)(); @@ -1140,7 +1142,7 @@ void NativeReloadNode::_notification(int p_what) { // here the library registers all the classes and stuff. void *proc_ptr; - Error err = L->get()->get_symbol("godot_nativescript_init", proc_ptr); + Error err = L->get()->get_symbol(L->get()->get_library()->get_symbol_prefix() + "nativescript_init", proc_ptr); if (err != OK) { ERR_PRINT(String("No godot_nativescript_init in \"" + L->key() + "\" found").utf8().get_data()); } else { diff --git a/modules/gdnative/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index e8fc9e6880..f0f14e2f30 100644 --- a/modules/gdnative/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -229,15 +229,15 @@ public: Map<String, Set<NativeScript *> > library_script_users; const StringName _init_call_type = "nativescript_init"; - const StringName _init_call_name = "godot_nativescript_init"; + const StringName _init_call_name = "nativescript_init"; const StringName _noarg_call_type = "nativescript_no_arg"; - const StringName _frame_call_name = "godot_nativescript_frame"; + const StringName _frame_call_name = "nativescript_frame"; #ifndef NO_THREADS - const StringName _thread_enter_call_name = "godot_nativescript_thread_enter"; - const StringName _thread_exit_call_name = "godot_nativescript_thread_exit"; + const StringName _thread_enter_call_name = "nativescript_thread_enter"; + const StringName _thread_exit_call_name = "nativescript_thread_exit"; #endif NativeScriptLanguage(); diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 19a62b9c4f..29b0a6719c 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -48,7 +48,7 @@ #include "gd_native_library_editor.h" // Class used to discover singleton gdnative files -void actual_discoverer_handler(); +static void actual_discoverer_handler(); class GDNativeSingletonDiscover : public Object { // GDCLASS(GDNativeSingletonDiscover, Object) @@ -66,7 +66,7 @@ class GDNativeSingletonDiscover : public Object { } }; -Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { +static Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { Set<String> file_paths; @@ -81,7 +81,7 @@ Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { } Ref<GDNativeLibrary> lib = ResourceLoader::load(p_dir->get_file_path(i)); - if (lib.is_valid() && lib->is_singleton_gdnative()) { + if (lib.is_valid() && lib->is_singleton()) { file_paths.insert(p_dir->get_file_path(i)); } } @@ -98,7 +98,7 @@ Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { return file_paths; } -void actual_discoverer_handler() { +static void actual_discoverer_handler() { EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); Set<String> file_paths = get_gdnative_singletons(dir); @@ -115,7 +115,125 @@ void actual_discoverer_handler() { ProjectSettings::get_singleton()->save(); } -GDNativeSingletonDiscover *discoverer = NULL; +static GDNativeSingletonDiscover *discoverer = NULL; + +class GDNativeExportPlugin : public EditorExportPlugin { + +protected: + virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features); +}; + +void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_type, const Set<String> &p_features) { + if (p_type != "GDNativeLibrary") { + return; + } + + Ref<GDNativeLibrary> lib = ResourceLoader::load(p_path); + + if (lib.is_null()) { + return; + } + + Ref<ConfigFile> config = lib->get_config_file(); + + String entry_lib_path; + { + + List<String> entry_keys; + config->get_section_keys("entry", &entry_keys); + + for (List<String>::Element *E = entry_keys.front(); E; E = E->next()) { + String key = E->get(); + + Vector<String> tags = key.split("."); + + bool skip = false; + for (int i = 0; i < tags.size(); i++) { + bool has_feature = p_features.has(tags[i]); + + if (!has_feature) { + skip = true; + break; + } + } + + if (skip) { + continue; + } + + entry_lib_path = config->get_value("entry", key); + break; + } + } + + Vector<String> dependency_paths; + { + + List<String> dependency_keys; + config->get_section_keys("dependencies", &dependency_keys); + + for (List<String>::Element *E = dependency_keys.front(); E; E = E->next()) { + String key = E->get(); + + Vector<String> tags = key.split("."); + + bool skip = false; + for (int i = 0; i < tags.size(); i++) { + bool has_feature = p_features.has(tags[i]); + + if (!has_feature) { + skip = true; + break; + } + } + + if (skip) { + continue; + } + + dependency_paths = config->get_value("dependencies", key); + break; + } + } + + bool is_statically_linked = false; + { + + List<String> static_linking_keys; + config->get_section_keys("static_linking", &static_linking_keys); + + for (List<String>::Element *E = static_linking_keys.front(); E; E = E->next()) { + String key = E->get(); + + Vector<String> tags = key.split("."); + + bool skip = false; + + for (int i = 0; i < tags.size(); i++) { + bool has_feature = p_features.has(tags[i]); + + if (!has_feature) { + skip = true; + break; + } + } + + if (skip) { + continue; + } + + is_statically_linked = config->get_value("static_linking", key); + break; + } + } + + if (!is_statically_linked) + add_shared_object(entry_lib_path); + + for (int i = 0; i < dependency_paths.size(); i++) { + add_shared_object(dependency_paths[i]); + } +} static void editor_init_callback() { @@ -125,11 +243,16 @@ static void editor_init_callback() { discoverer = memnew(GDNativeSingletonDiscover); EditorFileSystem::get_singleton()->connect("filesystem_changed", discoverer, "get_class"); + + Ref<GDNativeExportPlugin> export_plugin; + export_plugin.instance(); + + EditorExport::get_singleton()->add_export_plugin(export_plugin); } #endif -godot_variant cb_standard_varcall(void *p_procedure_handle, godot_array *p_args) { +static godot_variant cb_standard_varcall(void *p_procedure_handle, godot_array *p_args) { godot_gdnative_procedure_fn proc; proc = (godot_gdnative_procedure_fn)p_procedure_handle; @@ -141,6 +264,9 @@ GDNativeCallRegistry *GDNativeCallRegistry::singleton; Vector<Ref<GDNative> > singleton_gdnatives; +GDNativeLibraryResourceLoader *resource_loader_gdnlib = NULL; +GDNativeLibraryResourceSaver *resource_saver_gdnlib = NULL; + void register_gdnative_types() { #ifdef TOOLS_ENABLED @@ -153,6 +279,12 @@ void register_gdnative_types() { ClassDB::register_class<GDNativeLibrary>(); ClassDB::register_class<GDNative>(); + resource_loader_gdnlib = memnew(GDNativeLibraryResourceLoader); + resource_saver_gdnlib = memnew(GDNativeLibraryResourceSaver); + + ResourceLoader::add_resource_format_loader(resource_loader_gdnlib); + ResourceSaver::add_resource_format_saver(resource_saver_gdnlib); + GDNativeCallRegistry::singleton = memnew(GDNativeCallRegistry); GDNativeCallRegistry::singleton->register_native_call_type("standard_varcall", cb_standard_varcall); @@ -185,11 +317,11 @@ void register_gdnative_types() { void *proc_ptr; Error err = singleton_gdnatives[i]->get_symbol( - "godot_gdnative_singleton", + lib->get_symbol_prefix() + "gdnative_singleton", proc_ptr); if (err != OK) { - ERR_PRINT((String("No godot_gdnative_singleton in \"" + singleton_gdnatives[i]->get_library()->get_active_library_path()) + "\" found").utf8().get_data()); + ERR_PRINT((String("No godot_gdnative_singleton in \"" + singleton_gdnatives[i]->get_library()->get_current_library_path()) + "\" found").utf8().get_data()); } else { ((void (*)())proc_ptr)(); } @@ -224,6 +356,9 @@ void unregister_gdnative_types() { } #endif + memdelete(resource_loader_gdnlib); + memdelete(resource_saver_gdnlib); + // This is for printing out the sizes of the core types /* diff --git a/modules/gdscript/config.py b/modules/gdscript/config.py index 5698a37295..6e8994d643 100644 --- a/modules/gdscript/config.py +++ b/modules/gdscript/config.py @@ -1,8 +1,15 @@ - - def can_build(platform): return True - def configure(env): pass + +def get_doc_classes(): + return [ + "GDFunctionState", + "GDNativeClass", + "GDScript", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/doc/classes/GDFunctionState.xml b/modules/gdscript/doc_classes/GDFunctionState.xml index 801ca718e7..e1aafa8a5b 100644 --- a/doc/classes/GDFunctionState.xml +++ b/modules/gdscript/doc_classes/GDFunctionState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDFunctionState" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="GDFunctionState" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> State of a function call after yielding. </brief_description> diff --git a/doc/classes/GDNativeClass.xml b/modules/gdscript/doc_classes/GDNativeClass.xml index 5a3f353720..95789e1b63 100644 --- a/doc/classes/GDNativeClass.xml +++ b/modules/gdscript/doc_classes/GDNativeClass.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDNativeClass" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="GDNativeClass" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/GDScript.xml b/modules/gdscript/doc_classes/GDScript.xml index 2faa0ff968..13d45aa520 100644 --- a/doc/classes/GDScript.xml +++ b/modules/gdscript/doc_classes/GDScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GDScript" inherits="Script" category="Core" version="3.0.alpha.custom_build"> +<class name="GDScript" inherits="Script" category="Core" version="3.0-alpha"> <brief_description> A script implemented in the GDScript programming language. </brief_description> diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index de8e35c406..9b7201f5f7 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -337,6 +337,11 @@ void GDScriptLanguage::get_public_constants(List<Pair<String, Variant> > *p_cons pi.second = Math_PI; p_constants->push_back(pi); + Pair<String, Variant> tau; + tau.first = "TAU"; + tau.second = Math_TAU; + p_constants->push_back(tau); + Pair<String, Variant> infinity; infinity.first = "INF"; infinity.second = Math_INF; @@ -360,7 +365,7 @@ String GDScriptLanguage::make_function(const String &p_class, const String &p_na } s += " "; } - s += "):\n\tpass # replace with function body\n"; + s += "):\n" + _get_indentation() + "pass # replace with function body\n"; return s; } @@ -2771,31 +2776,31 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol } //global - for (Map<StringName, int>::Element *E = GDScriptLanguage::get_singleton()->get_global_map().front(); E; E = E->next()) { - if (E->key() == p_symbol) { - - Variant value = GDScriptLanguage::get_singleton()->get_global_array()[E->get()]; - if (value.get_type() == Variant::OBJECT) { - Object *obj = value; - if (obj) { - - if (Object::cast_to<GDNativeClass>(obj)) { - r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS; - r_result.class_name = Object::cast_to<GDNativeClass>(obj)->get_name(); - - } else { - r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS; - r_result.class_name = obj->get_class(); - } - return OK; + Map<StringName, int> classes = GDScriptLanguage::get_singleton()->get_global_map(); + if (classes.has(p_symbol)) { + Variant value = GDScriptLanguage::get_singleton()->get_global_array()[classes[p_symbol]]; + if (value.get_type() == Variant::OBJECT) { + Object *obj = value; + if (obj) { + if (Object::cast_to<GDNativeClass>(obj)) { + r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS; + r_result.class_name = Object::cast_to<GDNativeClass>(obj)->get_name(); + } else { + r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS; + r_result.class_name = obj->get_class(); } - } else { - r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT; - r_result.class_name = "@Global Scope"; - r_result.class_member = p_symbol; + // proxy class remove the underscore. + if (r_result.class_name.begins_with("_")) { + r_result.class_name = r_result.class_name.right(1); + } return OK; } + } else { + r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT; + r_result.class_name = "@GlobalScope"; + r_result.class_member = p_symbol; + return OK; } } } diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 94385dc0d0..d7e83c3a33 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -362,6 +362,13 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool constant->value = Math_PI; tokenizer->advance(); expr = constant; + } else if (tokenizer->get_token() == GDTokenizer::TK_CONST_TAU) { + + //constant defined by tokenizer + ConstantNode *constant = alloc_node<ConstantNode>(); + constant->value = Math_TAU; + tokenizer->advance(); + expr = constant; } else if (tokenizer->get_token() == GDTokenizer::TK_CONST_INF) { //constant defined by tokenizer diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 3f3818ffb9..e5d834c9e7 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "gd_script.h" +#include "engine.h" #include "gd_compiler.h" #include "global_constants.h" #include "io/file_access_encrypted.h" @@ -1324,6 +1325,7 @@ void GDScriptLanguage::init() { } _add_global(StaticCString::create("PI"), Math_PI); + _add_global(StaticCString::create("TAU"), Math_TAU); _add_global(StaticCString::create("INF"), Math_INF); _add_global(StaticCString::create("NAN"), Math_NAN); @@ -1346,9 +1348,9 @@ void GDScriptLanguage::init() { //populate singletons - List<ProjectSettings::Singleton> singletons; - ProjectSettings::get_singleton()->get_singletons(&singletons); - for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) { + List<Engine::Singleton> singletons; + Engine::get_singleton()->get_singletons(&singletons); + for (List<Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) { _add_global(E->get().name, E->get().ptr); } @@ -1597,17 +1599,18 @@ void GDScriptLanguage::reload_tool_script(const Ref<Script> &p_script, bool p_so Object *obj = E->get()->placeholders.front()->get()->get_owner(); //save instance info - List<Pair<StringName, Variant> > state; if (obj->get_script_instance()) { + map.insert(obj->get_instance_id(), List<Pair<StringName, Variant> >()); + List<Pair<StringName, Variant> > &state = map[obj->get_instance_id()]; obj->get_script_instance()->get_property_state(state); - map[obj->get_instance_id()] = state; obj->set_script(RefPtr()); } else { // no instance found. Let's remove it so we don't loop forever E->get()->placeholders.erase(E->get()->placeholders.front()->get()); } } + #endif for (Map<ObjectID, List<Pair<StringName, Variant> > >::Element *F = E->get()->pending_reload_state.front(); F; F = F->next()) { @@ -1700,6 +1703,7 @@ void GDScriptLanguage::get_reserved_words(List<String> *p_words) const { "bool", "null", "PI", + "TAU", "INF", "NAN", "self", diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 5f85158232..e241eacd4f 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -123,6 +123,7 @@ const char *GDTokenizer::token_names[TK_MAX] = { "'$'", "'\\n'", "PI", + "TAU", "_", "INF", "NAN", @@ -217,6 +218,7 @@ static const _kws _keyword_list[] = { { GDTokenizer::TK_CF_PASS, "pass" }, { GDTokenizer::TK_SELF, "self" }, { GDTokenizer::TK_CONST_PI, "PI" }, + { GDTokenizer::TK_CONST_TAU, "TAU" }, { GDTokenizer::TK_WILDCARD, "_" }, { GDTokenizer::TK_CONST_INF, "INF" }, { GDTokenizer::TK_CONST_NAN, "NAN" }, @@ -280,6 +282,7 @@ bool GDTokenizer::is_token_literal(int p_offset, bool variable_safe) const { case TK_CF_PASS: case TK_SELF: case TK_CONST_PI: + case TK_CONST_TAU: case TK_WILDCARD: case TK_CONST_INF: case TK_CONST_NAN: @@ -882,6 +885,9 @@ void GDTokenizerText::_advance() { return; } sign_found = true; + } else if (GETCHAR(i) == '_') { + i++; + continue; // Included for readability, shouldn't be a part of the string } else break; @@ -894,7 +900,7 @@ void GDTokenizerText::_advance() { return; } - INCPOS(str.length()); + INCPOS(i); if (hexa_found) { int64_t val = str.hex_to_int64(); _make_constant(val); diff --git a/modules/gdscript/gd_tokenizer.h b/modules/gdscript/gd_tokenizer.h index c935ce45a1..f4b579def4 100644 --- a/modules/gdscript/gd_tokenizer.h +++ b/modules/gdscript/gd_tokenizer.h @@ -128,6 +128,7 @@ public: TK_DOLLAR, TK_NEWLINE, TK_CONST_PI, + TK_CONST_TAU, TK_WILDCARD, TK_CONST_INF, TK_CONST_NAN, diff --git a/modules/gridmap/config.py b/modules/gridmap/config.py index b3dbb9f46a..a93f4edb81 100644 --- a/modules/gridmap/config.py +++ b/modules/gridmap/config.py @@ -1,14 +1,13 @@ - - def can_build(platform): return True - def configure(env): pass def get_doc_classes(): - return ["GridMap"] + return [ + "GridMap", + ] def get_doc_path(): - return "doc_classes" + return "doc_classes" diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index 5b0fe56f25..ee8ecfff66 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GridMap" inherits="Spatial" category="Core" version="3.0.alpha.custom_build"> +<class name="GridMap" inherits="Spatial" category="Core" version="3.0-alpha"> <brief_description> Node for 3D tile-based maps. </brief_description> diff --git a/modules/hdr/config.py b/modules/hdr/config.py index fb920482f5..5f133eba90 100644 --- a/modules/hdr/config.py +++ b/modules/hdr/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/jpg/config.py b/modules/jpg/config.py index fb920482f5..5f133eba90 100644 --- a/modules/jpg/config.py +++ b/modules/jpg/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/mobile_vr/config.py b/modules/mobile_vr/config.py index cf96c66125..4e1155f0c6 100644 --- a/modules/mobile_vr/config.py +++ b/modules/mobile_vr/config.py @@ -1,12 +1,14 @@ def can_build(platform): - # should probably change this to only be true on iOS and Android - return True + # should probably change this to only be true on iOS and Android + return True def configure(env): - pass + pass def get_doc_classes(): - return ["MobileVRInterface"] + return [ + "MobileVRInterface", + ] def get_doc_path(): - return "doc_classes" + return "doc_classes" diff --git a/modules/mobile_vr/doc_classes/MobileVRInterface.xml b/modules/mobile_vr/doc_classes/MobileVRInterface.xml index c945a99a9a..c99934aea9 100644 --- a/modules/mobile_vr/doc_classes/MobileVRInterface.xml +++ b/modules/mobile_vr/doc_classes/MobileVRInterface.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="MobileVRInterface" inherits="ARVRInterface" category="Core" version="3.0.alpha.custom_build"> +<class name="MobileVRInterface" inherits="ARVRInterface" category="Core" version="3.0-alpha"> <brief_description> Generic mobile VR implementation </brief_description> diff --git a/modules/mobile_vr/mobile_interface.cpp b/modules/mobile_vr/mobile_interface.cpp index 93d5c22ef8..3a0b83d534 100644 --- a/modules/mobile_vr/mobile_interface.cpp +++ b/modules/mobile_vr/mobile_interface.cpp @@ -156,17 +156,6 @@ void MobileVRInterface::set_position_from_sensors() { has_gyro = true; }; -#ifdef ANDROID_ENABLED - ///@TODO needs testing, i don't have a gyro, potentially can be removed depending on what comes out of issue #8101 - // On Android x and z axis seem inverted - gyro.x = -gyro.x; - gyro.z = -gyro.z; - grav.x = -grav.x; - grav.z = -grav.z; - magneto.x = -magneto.x; - magneto.z = -magneto.z; -#endif - if (has_gyro) { // start with applying our gyro (do NOT smooth our gyro!) Basis rotate; @@ -334,7 +323,7 @@ void MobileVRInterface::uninitialize() { }; }; -Size2 MobileVRInterface::get_recommended_render_targetsize() { +Size2 MobileVRInterface::get_render_targetsize() { _THREAD_SAFE_METHOD_ // we use half our window size diff --git a/modules/mobile_vr/mobile_interface.h b/modules/mobile_vr/mobile_interface.h index 747377ae46..b652edc1c6 100644 --- a/modules/mobile_vr/mobile_interface.h +++ b/modules/mobile_vr/mobile_interface.h @@ -137,7 +137,7 @@ public: virtual bool initialize(); virtual void uninitialize(); - virtual Size2 get_recommended_render_targetsize(); + virtual Size2 get_render_targetsize(); virtual bool is_stereo(); virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform); virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far); diff --git a/modules/mono/config.py b/modules/mono/config.py index 7ad135e0b9..b4e6433256 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -177,7 +177,11 @@ def configure(env): def get_doc_classes(): - return ["@C#", "CSharpScript", "GodotSharp"] + return [ + "@C#", + "CSharpScript", + "GodotSharp", + ] def get_doc_path(): diff --git a/modules/mono/doc_classes/@C#.xml b/modules/mono/doc_classes/@C#.xml index 487ba9835f..5d27b32200 100644 --- a/modules/mono/doc_classes/@C#.xml +++ b/modules/mono/doc_classes/@C#.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="@C#" category="Core" version="3.0.alpha.custom_build"> +<class name="@C#" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/mono/doc_classes/CSharpScript.xml b/modules/mono/doc_classes/CSharpScript.xml index 5f21c9774d..ccc24b832c 100644 --- a/modules/mono/doc_classes/CSharpScript.xml +++ b/modules/mono/doc_classes/CSharpScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="CSharpScript" inherits="Script" category="Core" version="3.0.alpha.custom_build"> +<class name="CSharpScript" inherits="Script" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/mono/doc_classes/GodotSharp.xml b/modules/mono/doc_classes/GodotSharp.xml index e7e06ddd8f..9edbd18fc1 100644 --- a/modules/mono/doc_classes/GodotSharp.xml +++ b/modules/mono/doc_classes/GodotSharp.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="GodotSharp" inherits="Object" category="Core" version="3.0.alpha.custom_build"> +<class name="GodotSharp" inherits="Object" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index eb504ec021..a293cc2c50 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -31,12 +31,12 @@ #ifdef DEBUG_METHODS_ENABLED +#include "engine.h" #include "global_constants.h" #include "io/compression.h" #include "os/dir_access.h" #include "os/file_access.h" #include "os/os.h" -#include "project_settings.h" #include "ucaps.h" #include "../glue/cs_compressed.gen.h" @@ -320,9 +320,9 @@ Error BindingsGenerator::generate_cs_core_project(const String &p_output_dir, bo int global_constants_count = GlobalConstants::get_global_constant_count(); if (global_constants_count > 0) { - Map<String, DocData::ClassDoc>::Element *match = EditorHelp::get_doc_data()->class_list.find("@Global Scope"); + Map<String, DocData::ClassDoc>::Element *match = EditorHelp::get_doc_data()->class_list.find("@GlobalScope"); - ERR_EXPLAIN("Could not find `@Global Scope` in DocData"); + ERR_EXPLAIN("Could not find `@GlobalScope` in DocData"); ERR_FAIL_COND_V(!match, ERR_BUG); const DocData::ClassDoc &global_scope_doc = match->value(); @@ -1169,7 +1169,7 @@ Error BindingsGenerator::generate_glue(const String &p_output_dir) { output.push_back("Object* "); output.push_back(singleton_icall_name); - output.push_back("() " OPEN_BLOCK "\treturn ProjectSettings::get_singleton()->get_singleton_object(\""); + output.push_back("() " OPEN_BLOCK "\treturn Engine::get_singleton()->get_singleton_object(\""); output.push_back(itype.proxy_name); output.push_back("\");\n" CLOSE_BLOCK "\n"); } @@ -1505,7 +1505,7 @@ void BindingsGenerator::_populate_object_type_interfaces() { TypeInterface itype = TypeInterface::create_object_type(type_cname, api_type); itype.base_name = ClassDB::get_parent_class(type_cname); - itype.is_singleton = ProjectSettings::get_singleton()->has_singleton(itype.proxy_name); + itype.is_singleton = Engine::get_singleton()->has_singleton(itype.proxy_name); itype.is_instantiable = ClassDB::can_instance(type_cname) && !itype.is_singleton; itype.is_reference = ClassDB::is_parent_class(type_cname, refclass_name); itype.memory_own = itype.is_reference; diff --git a/modules/mono/glue/glue_header.h b/modules/mono/glue/glue_header.h index 0751a0160f..75a4eb2b40 100644 --- a/modules/mono/glue/glue_header.h +++ b/modules/mono/glue/glue_header.h @@ -35,10 +35,10 @@ #include "bind/core_bind.h" #include "class_db.h" +#include "engine.h" #include "io/marshalls.h" #include "object.h" #include "os/os.h" -#include "project_settings.h" #include "reference.h" #include "variant_parser.h" diff --git a/modules/mono/register_types.cpp b/modules/mono/register_types.cpp index 2656de5b14..217460a439 100644 --- a/modules/mono/register_types.cpp +++ b/modules/mono/register_types.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "register_types.h" -#include "project_settings.h" +#include "engine.h" #include "csharp_script.h" @@ -45,7 +45,7 @@ void register_mono_types() { _godotsharp = memnew(_GodotSharp); ClassDB::register_class<_GodotSharp>(); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("GodotSharp", _GodotSharp::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("GodotSharp", _GodotSharp::get_singleton())); script_language_cs = memnew(CSharpLanguage); script_language_cs->set_language_index(ScriptServer::get_language_count()); diff --git a/modules/ogg/config.py b/modules/ogg/config.py index ef5daca05c..5f133eba90 100644 --- a/modules/ogg/config.py +++ b/modules/ogg/config.py @@ -1,8 +1,5 @@ - def can_build(platform): -# return True - return False - + return True def configure(env): pass diff --git a/modules/openssl/config.py b/modules/openssl/config.py index fb920482f5..5f133eba90 100644 --- a/modules/openssl/config.py +++ b/modules/openssl/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/opus/SCsub b/modules/opus/SCsub index fee06bd267..6f643ef08c 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -3,6 +3,9 @@ Import('env') Import('env_modules') + +stub = True + env_opus = env_modules.Clone() # Thirdparty source files @@ -212,5 +215,9 @@ if env['builtin_opus']: if env['builtin_libogg']: env_opus.Append(CPPPATH=["#thirdparty/libogg"]) -# Module files -env_opus.add_source_files(env.modules_sources, "*.cpp") +if not stub: + # Module files + env_opus.add_source_files(env.modules_sources, "*.cpp") +else: + # Module files + env_opus.add_source_files(env.modules_sources, "stub/register_types.cpp") diff --git a/modules/opus/config.py b/modules/opus/config.py index ef5daca05c..60f8d838d6 100644 --- a/modules/opus/config.py +++ b/modules/opus/config.py @@ -1,8 +1,13 @@ - def can_build(platform): -# return True - return False - + return True def configure(env): pass + +def get_doc_classes(): + return [ + "AudioStreamOpus", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/modules/opus/stub/register_types.cpp b/modules/opus/stub/register_types.cpp new file mode 100644 index 0000000000..c5ae3e274e --- /dev/null +++ b/modules/opus/stub/register_types.cpp @@ -0,0 +1,36 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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_types.h" + +// Dummy module as libvorbis is needed by other modules (theora ...) + +void register_opus_types() {} + +void unregister_opus_types() {} diff --git a/modules/opus/stub/register_types.h b/modules/opus/stub/register_types.h new file mode 100644 index 0000000000..4517dc5df7 --- /dev/null +++ b/modules/opus/stub/register_types.h @@ -0,0 +1,31 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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. */ +/*************************************************************************/ +void register_opus_types(); +void unregister_opus_types(); diff --git a/modules/pbm/config.py b/modules/pbm/config.py index fb920482f5..5f133eba90 100644 --- a/modules/pbm/config.py +++ b/modules/pbm/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/pvr/config.py b/modules/pvr/config.py index fb920482f5..5f133eba90 100644 --- a/modules/pvr/config.py +++ b/modules/pvr/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/recast/config.py b/modules/recast/config.py index d42f07b2a9..fc074cf661 100644 --- a/modules/recast/config.py +++ b/modules/recast/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return platform != "android" - def configure(env): pass diff --git a/modules/regex/config.py b/modules/regex/config.py index 5347cfd243..cb2da26738 100644 --- a/modules/regex/config.py +++ b/modules/regex/config.py @@ -1,9 +1,14 @@ -#!/usr/bin/env python - - def can_build(platform): return True - def configure(env): pass + +def get_doc_classes(): + return [ + "RegEx", + "RegExMatch", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml new file mode 100644 index 0000000000..4cf272fe8c --- /dev/null +++ b/modules/regex/doc_classes/RegEx.xml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="RegEx" inherits="Reference" category="Core" version="3.0-alpha"> + <brief_description> + Class for searching text for patterns using regular expressions. + </brief_description> + <description> + Regular Expression (or regex) is a compact programming language that can be used to recognise strings that follow a specific pattern, such as URLs, email addresses, complete sentences, etc. For instance, a regex of [code]ab[0-9][/code] would find any string that is [code]ab[/code] followed by any number from [code]0[/code] to [code]9[/code]. For a more in-depth look, you can easily find various tutorials and detailed explainations on the Internet. + To begin, the RegEx object needs to be compiled with the search pattern using [method compile] before it can be used. + [codeblock] + var regex = RegEx.new() + regex.compile("\\w-(\\d+)") + [/codeblock] + The search pattern must be escaped first for gdscript before it is escaped for the expression. For example, [code]compile("\\d+")[/code] would be read by RegEx as [code]\d+[/code]. Similarly, [code]compile("\"(?:\\\\.|[^\"])*\"")[/code] would be read as [code]"(?:\\.|[^"])*"[/code] + Using [method search] you can find the pattern within the given text. If a pattern is found, [RegExMatch] is returned and you can retrieve details of the results using fuctions such as [method RegExMatch.get_string] and [method RegExMatch.get_start]. + [codeblock] + var regex = RegEx.new() + regex.compile("\\w-(\\d+)") + var result = regex.search("abc n-0123") + if result: + print(result.get_string()) # Would print n-0123 + [/codeblock] + The results of capturing groups [code]()[/code] can be retrieved by passing the group number to the various functions in [RegExMatch]. Group 0 is the default and would always refer to the entire pattern. In the above example, calling [code]result.get_string(1)[/code] would give you [code]0123[/code]. + This version of RegEx also supports named capturing groups, and the names can be used to retrieve the results. If two or more groups have the same name, the name would only refer to the first one with a match. + [codeblock] + var regex = RegEx.new() + regex.compile("d(?<digit>[0-9]+)|x(?<digit>[0-9a-f]+)") + var result = regex.search("the number is x2f") + if result: + print(result.get_string("digit")) # Would print 2f + [/codeblock] + If you need to process multiple results, [method search_all] generates a list of all non-overlapping results. This can be combined with a for-loop for convenience. + [codeblock] + for result in regex.search_all("d01, d03, d0c, x3f and x42"): + print(result.get_string("digit")) + # Would print 01 03 3f 42 + # Note that d0c would not match + [/codeblock] + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="clear"> + <return type="void"> + </return> + <description> + This method resets the state of the object, as it was freshly created. Namely, it unassigns the regular expression of this object. + </description> + </method> + <method name="compile"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="pattern" type="String"> + </argument> + <description> + Compiles and assign the search pattern to use. Returns OK if the compilation is successful. If an error is encountered the details are printed to STDOUT and FAILED is returned. + </description> + </method> + <method name="get_group_count" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the number of capturing groups in compiled pattern. + </description> + </method> + <method name="get_names" qualifiers="const"> + <return type="Array"> + </return> + <description> + Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance. + </description> + </method> + <method name="get_pattern" qualifiers="const"> + <return type="String"> + </return> + <description> + Returns the original search pattern that was compiled. + </description> + </method> + <method name="is_valid" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns whether this object has a valid search pattern assigned. + </description> + </method> + <method name="search" qualifiers="const"> + <return type="RegExMatch"> + </return> + <argument index="0" name="subject" type="String"> + </argument> + <argument index="1" name="offset" type="int" default="0"> + </argument> + <argument index="2" name="end" type="int" default="-1"> + </argument> + <description> + Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching result if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be. + </description> + </method> + <method name="search_all" qualifiers="const"> + <return type="Array"> + </return> + <argument index="0" name="subject" type="String"> + </argument> + <argument index="1" name="offset" type="int" default="0"> + </argument> + <argument index="2" name="end" type="int" default="-1"> + </argument> + <description> + Searches the text for the compiled pattern. Returns an array of [RegExMatch] containers for each non-overlapping result. If no results were found an empty array is returned instead. The region to search within can be specified without modifying where the start and end anchor would be. + </description> + </method> + <method name="sub" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="subject" type="String"> + </argument> + <argument index="1" name="replacement" type="String"> + </argument> + <argument index="2" name="all" type="bool" default="false"> + </argument> + <argument index="3" name="offset" type="int" default="0"> + </argument> + <argument index="4" name="end" type="int" default="-1"> + </argument> + <description> + Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as [code]\1[/code] and [code]\g<name>[/code] expanded and resolved. By default only the first instance is replaced but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml new file mode 100644 index 0000000000..354febf89a --- /dev/null +++ b/modules/regex/doc_classes/RegExMatch.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="RegExMatch" inherits="Reference" category="Core" version="3.0-alpha"> + <brief_description> + Contains the results of a regex search. + </brief_description> + <description> + Contains the results of a single regex match returned by [method RegEx.search] and [method.RegEx.search_all]. It can be used to find the position and range of the match and its capturing groups, and it can extract its sub-string for you. + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="get_end" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="name" type="Variant" default="0"> + </argument> + <description> + Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + Returns -1 if the group did not match or doesn't exist. + </description> + </method> + <method name="get_group_count" qualifiers="const"> + <return type="int"> + </return> + <description> + Returns the number of capturing groups. + </description> + </method> + <method name="get_names" qualifiers="const"> + <return type="Dictionary"> + </return> + <description> + Returns a dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. + </description> + </method> + <method name="get_start" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="name" type="Variant" default="0"> + </argument> + <description> + Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + Returns -1 if the group did not match or doesn't exist. + </description> + </method> + <method name="get_string" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="name" type="Variant" default="0"> + </argument> + <description> + Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + Returns an empty string if the group did not match or doesn't exist. + </description> + </method> + <method name="get_strings" qualifiers="const"> + <return type="Array"> + </return> + <description> + Returns an [Array] of the match and its capturing groups. + </description> + </method> + <method name="get_subject" qualifiers="const"> + <return type="String"> + </return> + <description> + Returns the source string used with the search pattern to find this matching result. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index 00e8ce0f54..daadfcc659 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -324,6 +324,21 @@ Ref<RegExMatch> RegEx::search(const String &p_subject, int p_offset, int p_end) return result; } +Array RegEx::search_all(const String &p_subject, int p_offset, int p_end) const { + + int last_end = -1; + Array result; + Ref<RegExMatch> match = search(p_subject, p_offset, p_end); + while (match.is_valid()) { + if (last_end == match->get_end(0)) + break; + result.push_back(match); + last_end = match->get_end(0); + match = search(p_subject, match->get_end(0), p_end); + } + return result; +} + String RegEx::sub(const String &p_subject, const String &p_replacement, bool p_all, int p_offset, int p_end) const { ERR_FAIL_COND_V(!is_valid(), String()); @@ -489,6 +504,7 @@ void RegEx::_bind_methods() { ClassDB::bind_method(D_METHOD("clear"), &RegEx::clear); ClassDB::bind_method(D_METHOD("compile", "pattern"), &RegEx::compile); ClassDB::bind_method(D_METHOD("search", "subject", "offset", "end"), &RegEx::search, DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(D_METHOD("search_all", "subject", "offset", "end"), &RegEx::search_all, DEFVAL(0), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("sub", "subject", "replacement", "all", "offset", "end"), &RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); ClassDB::bind_method(D_METHOD("is_valid"), &RegEx::is_valid); ClassDB::bind_method(D_METHOD("get_pattern"), &RegEx::get_pattern); diff --git a/modules/regex/regex.h b/modules/regex/regex.h index bfa9c84042..21387222f2 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -88,6 +88,7 @@ public: void _init(const String &p_pattern = ""); Ref<RegExMatch> search(const String &p_subject, int p_offset = 0, int p_end = -1) const; + Array search_all(const String &p_subject, int p_offset = 0, int p_end = -1) const; String sub(const String &p_subject, const String &p_replacement, bool p_all = false, int p_offset = 0, int p_end = -1) const; bool is_valid() const; diff --git a/modules/squish/config.py b/modules/squish/config.py index 9b7729bda4..97c95999c8 100644 --- a/modules/squish/config.py +++ b/modules/squish/config.py @@ -1,8 +1,6 @@ - def can_build(platform): return True - def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that diff --git a/modules/stb_vorbis/config.py b/modules/stb_vorbis/config.py index fb920482f5..defe8d0c94 100644 --- a/modules/stb_vorbis/config.py +++ b/modules/stb_vorbis/config.py @@ -1,7 +1,14 @@ - def can_build(platform): return True - def configure(env): pass + +def get_doc_classes(): + return [ + "AudioStreamOGGVorbis", + "ResourceImporterOGGVorbis", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/doc/classes/AudioStreamOGGVorbis.xml b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml index 679438b66b..ee6c28c36a 100644 --- a/doc/classes/AudioStreamOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="AudioStreamOGGVorbis" inherits="AudioStream" category="Core" version="3.0.alpha.custom_build"> +<class name="AudioStreamOGGVorbis" inherits="AudioStream" category="Core" version="3.0-alpha"> <brief_description> OGG Vorbis audio stream driver. </brief_description> diff --git a/doc/classes/ResourceImporterOGGVorbis.xml b/modules/stb_vorbis/doc_classes/ResourceImporterOGGVorbis.xml index eef626cee7..ce16632d6e 100644 --- a/doc/classes/ResourceImporterOGGVorbis.xml +++ b/modules/stb_vorbis/doc_classes/ResourceImporterOGGVorbis.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceImporterOGGVorbis" inherits="ResourceImporter" category="Core" version="3.0.alpha.custom_build"> +<class name="ResourceImporterOGGVorbis" inherits="ResourceImporter" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/svg/config.py b/modules/svg/config.py index fb920482f5..5f133eba90 100644 --- a/modules/svg/config.py +++ b/modules/svg/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/tga/config.py b/modules/tga/config.py index fb920482f5..5f133eba90 100644 --- a/modules/tga/config.py +++ b/modules/tga/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/modules/theora/config.py b/modules/theora/config.py index 8eefe81288..34d34f8be2 100644 --- a/modules/theora/config.py +++ b/modules/theora/config.py @@ -1,8 +1,14 @@ - def can_build(platform): -# return True - return False - + return True def configure(env): pass + +def get_doc_classes(): + return [ + "ResourceImporterTheora", + "VideoStreamTheora", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/modules/theora/doc_classes/ResourceImporterTheora.xml b/modules/theora/doc_classes/ResourceImporterTheora.xml new file mode 100644 index 0000000000..497c938826 --- /dev/null +++ b/modules/theora/doc_classes/ResourceImporterTheora.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ResourceImporterTheora" inherits="ResourceImporter" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/modules/theora/doc_classes/VideoStreamTheora.xml b/modules/theora/doc_classes/VideoStreamTheora.xml new file mode 100644 index 0000000000..8f155b786f --- /dev/null +++ b/modules/theora/doc_classes/VideoStreamTheora.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VideoStreamTheora" inherits="VideoStream" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="get_file"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="set_file"> + <return type="void"> + </return> + <argument index="0" name="file" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="file" type="String" setter="set_file" getter="get_file"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/modules/theora/register_types.cpp b/modules/theora/register_types.cpp index ae6961b3da..c51b87b8fc 100644 --- a/modules/theora/register_types.cpp +++ b/modules/theora/register_types.cpp @@ -28,19 +28,18 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_types.h" - +#include "resource_importer_theora.h" #include "video_stream_theora.h" -static ResourceFormatLoaderVideoStreamTheora *theora_stream_loader = NULL; - void register_theora_types() { - theora_stream_loader = memnew(ResourceFormatLoaderVideoStreamTheora); - ResourceLoader::add_resource_format_loader(theora_stream_loader); +#ifdef TOOLS_ENABLED + Ref<ResourceImporterTheora> theora_import; + theora_import.instance(); + ResourceFormatImporter::get_singleton()->add_importer(theora_import); +#endif ClassDB::register_class<VideoStreamTheora>(); } void unregister_theora_types() { - - memdelete(theora_stream_loader); } diff --git a/modules/theora/resource_importer_theora.cpp b/modules/theora/resource_importer_theora.cpp new file mode 100644 index 0000000000..c25c0e7427 --- /dev/null +++ b/modules/theora/resource_importer_theora.cpp @@ -0,0 +1,89 @@ +/*************************************************************************/ +/* resource_importer_theora.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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 "resource_importer_theora.h" + +#include "io/resource_saver.h" +#include "os/file_access.h" +#include "scene/resources/texture.h" + +String ResourceImporterTheora::get_importer_name() const { + + return "Theora"; +} + +String ResourceImporterTheora::get_visible_name() const { + + return "Theora"; +} +void ResourceImporterTheora::get_recognized_extensions(List<String> *p_extensions) const { + + p_extensions->push_back("ogv"); + p_extensions->push_back("ogm"); +} + +String ResourceImporterTheora::get_save_extension() const { + return "ogvstr"; +} + +String ResourceImporterTheora::get_resource_type() const { + + return "VideoStreamTheora"; +} + +bool ResourceImporterTheora::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { + + return true; +} + +int ResourceImporterTheora::get_preset_count() const { + return 0; +} +String ResourceImporterTheora::get_preset_name(int p_idx) const { + + return String(); +} + +void ResourceImporterTheora::get_import_options(List<ImportOption> *r_options, int p_preset) const { + + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "loop"), true)); +} + +Error ResourceImporterTheora::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) { + + VideoStreamTheora *stream = memnew(VideoStreamTheora); + stream->set_file(p_source_file); + + Ref<VideoStreamTheora> ogv_stream = Ref<VideoStreamTheora>(stream); + + return ResourceSaver::save(p_save_path + ".ogvstr", ogv_stream); +} + +ResourceImporterTheora::ResourceImporterTheora() { +} diff --git a/modules/theora/resource_importer_theora.h b/modules/theora/resource_importer_theora.h new file mode 100644 index 0000000000..8bf0ad38c4 --- /dev/null +++ b/modules/theora/resource_importer_theora.h @@ -0,0 +1,57 @@ +/*************************************************************************/ +/* resource_importer_theora.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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. */ +/*************************************************************************/ +#ifndef RESOURCEIMPORTEROGGTHEORA_H +#define RESOURCEIMPORTEROGGTHEORA_H + +#include "video_stream_theora.h" + +#include "core/io/resource_import.h" + +class ResourceImporterTheora : public ResourceImporter { + GDCLASS(ResourceImporterTheora, ResourceImporter) +public: + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; + virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; + + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL); + + ResourceImporterTheora(); +}; + +#endif // RESOURCEIMPORTEROGGTHEORA_H diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index c75bec31df..bc8ca23d60 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -406,20 +406,19 @@ void VideoStreamPlaybackTheora::update(float p_delta) { ogg_packet op; bool no_theora = false; + bool buffer_full = false; - while (vorbis_p) { + while (vorbis_p && !audio_done && !buffer_full) { int ret; float **pcm; - bool buffer_full = false; - /* if there's pending, decoded audio, grab it */ ret = vorbis_synthesis_pcmout(&vd, &pcm); if (ret > 0) { const int AUXBUF_LEN = 4096; int to_read = ret; - int16_t aux_buffer[AUXBUF_LEN]; + float aux_buffer[AUXBUF_LEN]; while (to_read) { @@ -429,11 +428,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) { for (int j = 0; j < m; j++) { for (int i = 0; i < vi.channels; i++) { - - int val = Math::fast_ftoi(pcm[i][j] * 32767.f); - if (val > 32767) val = 32767; - if (val < -32768) val = -32768; - aux_buffer[count++] = val; + aux_buffer[count++] = pcm[i][j]; } } @@ -602,10 +597,9 @@ bool VideoStreamPlaybackTheora::is_playing() const { void VideoStreamPlaybackTheora::set_paused(bool p_paused) { paused = p_paused; - //pau = !p_paused; }; -bool VideoStreamPlaybackTheora::is_paused(bool p_paused) const { +bool VideoStreamPlaybackTheora::is_paused() const { return paused; }; @@ -733,32 +727,10 @@ VideoStreamPlaybackTheora::~VideoStreamPlaybackTheora() { memdelete(file); }; -RES ResourceFormatLoaderVideoStreamTheora::load(const String &p_path, const String &p_original_path, Error *r_error) { - if (r_error) - *r_error = ERR_FILE_CANT_OPEN; - - VideoStreamTheora *stream = memnew(VideoStreamTheora); - stream->set_file(p_path); - - if (r_error) - *r_error = OK; - - return Ref<VideoStreamTheora>(stream); -} +void VideoStreamTheora::_bind_methods() { -void ResourceFormatLoaderVideoStreamTheora::get_recognized_extensions(List<String> *p_extensions) const { + ClassDB::bind_method(D_METHOD("set_file", "file"), &VideoStreamTheora::set_file); + ClassDB::bind_method(D_METHOD("get_file"), &VideoStreamTheora::get_file); - p_extensions->push_back("ogm"); - p_extensions->push_back("ogv"); -} -bool ResourceFormatLoaderVideoStreamTheora::handles_type(const String &p_type) const { - return (p_type == "VideoStream" || p_type == "VideoStreamTheora"); -} - -String ResourceFormatLoaderVideoStreamTheora::get_resource_type(const String &p_path) const { - - String exl = p_path.get_extension().to_lower(); - if (exl == "ogm" || exl == "ogv") - return "VideoStreamTheora"; - return ""; + ADD_PROPERTY(PropertyInfo(Variant::STRING, "file", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_file", "get_file"); } diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index 484a1a7fb9..ec0e5aa34a 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -36,6 +36,7 @@ #include "os/thread.h" #include "ring_buffer.h" #include "scene/resources/video_stream.h" +#include "servers/audio_server.h" #include <theora/theoradec.h> #include <vorbis/codec.h> @@ -129,7 +130,7 @@ public: virtual bool is_playing() const; virtual void set_paused(bool p_paused); - virtual bool is_paused(bool p_paused) const; + virtual bool is_paused() const; virtual void set_loop(bool p_enable); virtual bool has_loop() const; @@ -161,10 +162,14 @@ public: class VideoStreamTheora : public VideoStream { GDCLASS(VideoStreamTheora, VideoStream); + RES_BASE_EXTENSION("ogvstr"); String file; int audio_track; +protected: + static void _bind_methods(); + public: Ref<VideoStreamPlayback> instance_playback() { Ref<VideoStreamPlaybackTheora> pb = memnew(VideoStreamPlaybackTheora); @@ -174,17 +179,10 @@ public: } void set_file(const String &p_file) { file = p_file; } + String get_file() { return file; } void set_audio_track(int p_track) { audio_track = p_track; } VideoStreamTheora() { audio_track = 0; } }; -class ResourceFormatLoaderVideoStreamTheora : public ResourceFormatLoader { -public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String &p_type) const; - virtual String get_resource_type(const String &p_path) const; -}; - #endif diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py index 3e16fd725e..e12bb398ce 100644 --- a/modules/tinyexr/config.py +++ b/modules/tinyexr/config.py @@ -1,8 +1,6 @@ - def can_build(platform): return True - def configure(env): # Tools only, disabled for non-tools # TODO: Find a cleaner way to achieve that diff --git a/modules/visual_script/config.py b/modules/visual_script/config.py index 5698a37295..6b1ce41014 100644 --- a/modules/visual_script/config.py +++ b/modules/visual_script/config.py @@ -1,8 +1,57 @@ - - def can_build(platform): return True - def configure(env): pass + +def get_doc_classes(): + return [ + "VisualScriptBasicTypeConstant", + "VisualScriptBuiltinFunc", + "VisualScriptClassConstant", + "VisualScriptComment", + "VisualScriptCondition", + "VisualScriptConstant", + "VisualScriptConstructor", + "VisualScriptCustomNode", + "VisualScriptDeconstruct", + "VisualScriptEditor", + "VisualScriptEmitSignal", + "VisualScriptEngineSingleton", + "VisualScriptExpression", + "VisualScriptFunctionCall", + "VisualScriptFunctionState", + "VisualScriptFunction", + "VisualScriptGlobalConstant", + "VisualScriptIndexGet", + "VisualScriptIndexSet", + "VisualScriptInputAction", + "VisualScriptIterator", + "VisualScriptLocalVarSet", + "VisualScriptLocalVar", + "VisualScriptMathConstant", + "VisualScriptNode", + "VisualScriptOperator", + "VisualScriptPreload", + "VisualScriptPropertyGet", + "VisualScriptPropertySet", + "VisualScriptResourcePath", + "VisualScriptReturn", + "VisualScriptSceneNode", + "VisualScriptSceneTree", + "VisualScriptSelect", + "VisualScriptSelf", + "VisualScriptSequence", + "VisualScriptSubCall", + "VisualScriptSwitch", + "VisualScriptTypeCast", + "VisualScriptVariableGet", + "VisualScriptVariableSet", + "VisualScriptWhile", + "VisualScript", + "VisualScriptYieldSignal", + "VisualScriptYield", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/doc/classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index 8961ff1564..80b1ed86d7 100644 --- a/doc/classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScript" inherits="Script" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScript" inherits="Script" category="Core" version="3.0-alpha"> <brief_description> A script implemented in the Visual Script programming environment. </brief_description> diff --git a/doc/classes/VisualScriptBasicTypeConstant.xml b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml index cc09815481..6c028e5f28 100644 --- a/doc/classes/VisualScriptBasicTypeConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptBasicTypeConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptBasicTypeConstant" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptBasicTypeConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node representing a constant from the base types. </brief_description> diff --git a/doc/classes/VisualScriptBuiltinFunc.xml b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml index 5891b24bfd..27231574d7 100644 --- a/doc/classes/VisualScriptBuiltinFunc.xml +++ b/modules/visual_script/doc_classes/VisualScriptBuiltinFunc.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptBuiltinFunc" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptBuiltinFunc" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node used to call built-in functions. </brief_description> @@ -151,64 +151,68 @@ <constant name="MATH_DB2LINEAR" value="39"> Convert the input from decibel volume to linear volume. </constant> - <constant name="LOGIC_MAX" value="40"> + <constant name="MATH_WRAP" value="40"> + </constant> + <constant name="MATH_WRAPF" value="41"> + </constant> + <constant name="LOGIC_MAX" value="42"> Return the greater of the two numbers, also known as their maximum. </constant> - <constant name="LOGIC_MIN" value="41"> + <constant name="LOGIC_MIN" value="43"> Return the lesser of the two numbers, also known as their minimum. </constant> - <constant name="LOGIC_CLAMP" value="42"> + <constant name="LOGIC_CLAMP" value="44"> Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to `min(max(input, range_low), range_high)` </constant> - <constant name="LOGIC_NEAREST_PO2" value="43"> + <constant name="LOGIC_NEAREST_PO2" value="45"> Return the nearest power of 2 to the input. </constant> - <constant name="OBJ_WEAKREF" value="44"> + <constant name="OBJ_WEAKREF" value="46"> Create a [WeakRef] from the input. </constant> - <constant name="FUNC_FUNCREF" value="45"> + <constant name="FUNC_FUNCREF" value="47"> Create a [FuncRef] from the input. </constant> - <constant name="TYPE_CONVERT" value="46"> + <constant name="TYPE_CONVERT" value="48"> Convert between types. </constant> - <constant name="TYPE_OF" value="47"> + <constant name="TYPE_OF" value="49"> Return the type of the input as an integer. Check [enum Variant.Type] for the integers that might be returned. </constant> - <constant name="TYPE_EXISTS" value="48"> + <constant name="TYPE_EXISTS" value="50"> Checks if a type is registered in the [ClassDB]. </constant> - <constant name="TEXT_CHAR" value="49"> + <constant name="TEXT_CHAR" value="51"> Return a character with the given ascii value. </constant> - <constant name="TEXT_STR" value="50"> + <constant name="TEXT_STR" value="52"> Convert the input to a string. </constant> - <constant name="TEXT_PRINT" value="51"> + <constant name="TEXT_PRINT" value="53"> Print the given string to the output window. </constant> - <constant name="TEXT_PRINTERR" value="52"> + <constant name="TEXT_PRINTERR" value="54"> Print the given string to the standard error output. </constant> - <constant name="TEXT_PRINTRAW" value="53"> + <constant name="TEXT_PRINTRAW" value="55"> Print the given string to the standard output, without adding a newline. </constant> - <constant name="VAR_TO_STR" value="54"> + <constant name="VAR_TO_STR" value="56"> Serialize a [Variant] to a string. </constant> - <constant name="STR_TO_VAR" value="55"> + <constant name="STR_TO_VAR" value="57"> Deserialize a [Variant] from a string serialized using [VAR_TO_STR]. </constant> - <constant name="VAR_TO_BYTES" value="56"> + <constant name="VAR_TO_BYTES" value="58"> Serialize a [Variant] to a [PoolByteArray]. </constant> - <constant name="BYTES_TO_VAR" value="57"> + <constant name="BYTES_TO_VAR" value="59"> Deserialize a [Variant] from a [PoolByteArray] serialized using [VAR_TO_BYTES]. </constant> - <constant name="COLORN" value="58"> + <constant name="COLORN" value="60"> Return the [Color] with the given name and alpha ranging from 0 to 1. Note: names are defined in color_names.inc. </constant> - <constant name="FUNC_MAX" value="59"> + <constant name="FUNC_MAX" value="61"> The maximum value the [member function] property can have. </constant> </constants> diff --git a/doc/classes/VisualScriptClassConstant.xml b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml index 0377fa8f09..e6498e92ad 100644 --- a/doc/classes/VisualScriptClassConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptClassConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptClassConstant" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptClassConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Gets a constant from a given class. </brief_description> diff --git a/doc/classes/VisualScriptComment.xml b/modules/visual_script/doc_classes/VisualScriptComment.xml index 69126052d0..ea4545f8ef 100644 --- a/doc/classes/VisualScriptComment.xml +++ b/modules/visual_script/doc_classes/VisualScriptComment.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptComment" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptComment" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node used to annotate the script. </brief_description> diff --git a/doc/classes/VisualScriptCondition.xml b/modules/visual_script/doc_classes/VisualScriptCondition.xml index a776c9bc9b..2a30c604a5 100644 --- a/doc/classes/VisualScriptCondition.xml +++ b/modules/visual_script/doc_classes/VisualScriptCondition.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptCondition" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptCondition" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node which branches the flow. </brief_description> diff --git a/doc/classes/VisualScriptConstant.xml b/modules/visual_script/doc_classes/VisualScriptConstant.xml index 2a704adecf..51c6d19238 100644 --- a/doc/classes/VisualScriptConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptConstant" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Gets a contant's value. </brief_description> diff --git a/doc/classes/VisualScriptConstructor.xml b/modules/visual_script/doc_classes/VisualScriptConstructor.xml index 3b1fc5e385..91df52e893 100644 --- a/doc/classes/VisualScriptConstructor.xml +++ b/modules/visual_script/doc_classes/VisualScriptConstructor.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptConstructor" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptConstructor" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node which calls a base type constructor. </brief_description> diff --git a/doc/classes/VisualScriptCustomNode.xml b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml index e321c8854a..38c325cfb7 100644 --- a/doc/classes/VisualScriptCustomNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptCustomNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptCustomNode" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptCustomNode" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A scripted Visual Script node. </brief_description> diff --git a/doc/classes/VisualScriptDeconstruct.xml b/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml index cd7d79ae56..cbed3ba22c 100644 --- a/doc/classes/VisualScriptDeconstruct.xml +++ b/modules/visual_script/doc_classes/VisualScriptDeconstruct.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptDeconstruct" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptDeconstruct" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node which deconstructs a base type instance into its parts. </brief_description> diff --git a/modules/visual_script/doc_classes/VisualScriptEditor.xml b/modules/visual_script/doc_classes/VisualScriptEditor.xml new file mode 100644 index 0000000000..70d52b2bd7 --- /dev/null +++ b/modules/visual_script/doc_classes/VisualScriptEditor.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualScriptEditor" inherits="Object" category="Core" version="3.0.alpha.custom_build"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="add_custom_node"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <argument index="1" name="category" type="String"> + </argument> + <argument index="2" name="script" type="Script"> + </argument> + <description> + Add a custom Visual Script node to the editor. It'll be placed under "Custom Nodes" with the [code]category[/code] as the parameter. + </description> + </method> + <method name="remove_custom_node"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <argument index="1" name="category" type="String"> + </argument> + <description> + Remove a custom Visual Script node from the editor. Custom nodes already placed on scripts won't be removed. + </description> + </method> + </methods> + <signals> + <signal name="custom_nodes_updated"> + <description> + Emitted when a custom Visual Script node is added or removed. + </description> + </signal> + </signals> + <constants> + </constants> +</class> diff --git a/doc/classes/VisualScriptEmitSignal.xml b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml index 8d132ed321..669276f0d0 100644 --- a/doc/classes/VisualScriptEmitSignal.xml +++ b/modules/visual_script/doc_classes/VisualScriptEmitSignal.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptEmitSignal" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptEmitSignal" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Emits a specified signal. </brief_description> diff --git a/doc/classes/VisualScriptEngineSingleton.xml b/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml index 6606f10f11..6703ff4eda 100644 --- a/doc/classes/VisualScriptEngineSingleton.xml +++ b/modules/visual_script/doc_classes/VisualScriptEngineSingleton.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptEngineSingleton" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptEngineSingleton" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> A Visual Script node returning a singleton from [@GlobalScope] </brief_description> diff --git a/doc/classes/VisualScriptExpression.xml b/modules/visual_script/doc_classes/VisualScriptExpression.xml index 1ca943a8a8..fb3b6ef19d 100644 --- a/doc/classes/VisualScriptExpression.xml +++ b/modules/visual_script/doc_classes/VisualScriptExpression.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptExpression" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptExpression" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptFunction.xml b/modules/visual_script/doc_classes/VisualScriptFunction.xml index 946231eaad..d77169679b 100644 --- a/doc/classes/VisualScriptFunction.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunction.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptFunction" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptFunction" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptFunctionCall.xml b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml index 36c808afce..7a0a7c9f55 100644 --- a/doc/classes/VisualScriptFunctionCall.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionCall.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptFunctionCall" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptFunctionCall" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptFunctionState.xml b/modules/visual_script/doc_classes/VisualScriptFunctionState.xml index d5c06682ef..9b30f62236 100644 --- a/doc/classes/VisualScriptFunctionState.xml +++ b/modules/visual_script/doc_classes/VisualScriptFunctionState.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptFunctionState" inherits="Reference" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptFunctionState" inherits="Reference" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptGlobalConstant.xml b/modules/visual_script/doc_classes/VisualScriptGlobalConstant.xml index 52bf8c2821..961244fe88 100644 --- a/doc/classes/VisualScriptGlobalConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptGlobalConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptGlobalConstant" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptGlobalConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptIndexGet.xml b/modules/visual_script/doc_classes/VisualScriptIndexGet.xml index c0226b6677..c5229f7678 100644 --- a/doc/classes/VisualScriptIndexGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptIndexGet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptIndexGet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptIndexGet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptIndexSet.xml b/modules/visual_script/doc_classes/VisualScriptIndexSet.xml index 440b4801b4..27646b4a5f 100644 --- a/doc/classes/VisualScriptIndexSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptIndexSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptIndexSet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptIndexSet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptInputAction.xml b/modules/visual_script/doc_classes/VisualScriptInputAction.xml index b555a0228b..7f6d13264e 100644 --- a/doc/classes/VisualScriptInputAction.xml +++ b/modules/visual_script/doc_classes/VisualScriptInputAction.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptInputAction" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptInputAction" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptIterator.xml b/modules/visual_script/doc_classes/VisualScriptIterator.xml index 1f9a4fddde..fc905d6c39 100644 --- a/doc/classes/VisualScriptIterator.xml +++ b/modules/visual_script/doc_classes/VisualScriptIterator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptIterator" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptIterator" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Steps through items in a given input. </brief_description> diff --git a/doc/classes/VisualScriptLocalVar.xml b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml index 3101b3e34b..ff77dfac0d 100644 --- a/doc/classes/VisualScriptLocalVar.xml +++ b/modules/visual_script/doc_classes/VisualScriptLocalVar.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptLocalVar" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptLocalVar" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Gets a local variable's value. </brief_description> diff --git a/doc/classes/VisualScriptLocalVarSet.xml b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml index e039a7204e..07b01d4576 100644 --- a/doc/classes/VisualScriptLocalVarSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptLocalVarSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptLocalVarSet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptLocalVarSet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Changes a local variable's value. </brief_description> diff --git a/doc/classes/VisualScriptMathConstant.xml b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml index 86744e5caf..817bcb5ce2 100644 --- a/doc/classes/VisualScriptMathConstant.xml +++ b/modules/visual_script/doc_classes/VisualScriptMathConstant.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptMathConstant" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptMathConstant" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Commonly used mathematical constants. </brief_description> @@ -42,12 +42,12 @@ <constant name="MATH_CONSTANT_PI" value="1"> Pi: [code]3.141593[/code] </constant> - <constant name="MATH_CONSTANT_2PI" value="2"> - Pi times two: [code]6.283185[/code] - </constant> - <constant name="MATH_CONSTANT_HALF_PI" value="3"> + <constant name="MATH_CONSTANT_HALF_PI" value="2"> Pi divided by two: [code]1.570796[/code] </constant> + <constant name="MATH_CONSTANT_TAU" value="3"> + Tau: [code]6.283185[/code] + </constant> <constant name="MATH_CONSTANT_E" value="4"> Natural log: [code]2.718282[/code] </constant> diff --git a/doc/classes/VisualScriptNode.xml b/modules/visual_script/doc_classes/VisualScriptNode.xml index 74ec9bdc2e..f6f2867172 100644 --- a/doc/classes/VisualScriptNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptNode" inherits="Resource" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptNode" inherits="Resource" category="Core" version="3.0-alpha"> <brief_description> A node which is part of a [VisualScript]. </brief_description> diff --git a/doc/classes/VisualScriptOperator.xml b/modules/visual_script/doc_classes/VisualScriptOperator.xml index de08075af2..bf4032c09c 100644 --- a/doc/classes/VisualScriptOperator.xml +++ b/modules/visual_script/doc_classes/VisualScriptOperator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptOperator" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptOperator" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptPreload.xml b/modules/visual_script/doc_classes/VisualScriptPreload.xml index b683439751..4a71e23809 100644 --- a/doc/classes/VisualScriptPreload.xml +++ b/modules/visual_script/doc_classes/VisualScriptPreload.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptPreload" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptPreload" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Creates a new [Resource] or loads one from the filesystem. </brief_description> diff --git a/doc/classes/VisualScriptPropertyGet.xml b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml index c790a59b0c..eb5c52f4be 100644 --- a/doc/classes/VisualScriptPropertyGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertyGet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptPropertyGet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptPropertyGet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptPropertySet.xml b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml index 88d47a7463..794caa2518 100644 --- a/doc/classes/VisualScriptPropertySet.xml +++ b/modules/visual_script/doc_classes/VisualScriptPropertySet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptPropertySet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptPropertySet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptResourcePath.xml b/modules/visual_script/doc_classes/VisualScriptResourcePath.xml index e4b881b659..274a852c3e 100644 --- a/doc/classes/VisualScriptResourcePath.xml +++ b/modules/visual_script/doc_classes/VisualScriptResourcePath.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptResourcePath" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptResourcePath" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptReturn.xml b/modules/visual_script/doc_classes/VisualScriptReturn.xml index ad18e96230..4ac586a02c 100644 --- a/doc/classes/VisualScriptReturn.xml +++ b/modules/visual_script/doc_classes/VisualScriptReturn.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptReturn" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptReturn" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Exits a function and returns an optional value. </brief_description> diff --git a/doc/classes/VisualScriptSceneNode.xml b/modules/visual_script/doc_classes/VisualScriptSceneNode.xml index b71bd9adfb..e8fdb69c6a 100644 --- a/doc/classes/VisualScriptSceneNode.xml +++ b/modules/visual_script/doc_classes/VisualScriptSceneNode.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSceneNode" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSceneNode" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Node reference. </brief_description> diff --git a/doc/classes/VisualScriptSceneTree.xml b/modules/visual_script/doc_classes/VisualScriptSceneTree.xml index 55e27460ab..e74c330623 100644 --- a/doc/classes/VisualScriptSceneTree.xml +++ b/modules/visual_script/doc_classes/VisualScriptSceneTree.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSceneTree" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSceneTree" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptSelect.xml b/modules/visual_script/doc_classes/VisualScriptSelect.xml index f265c57645..6a62e364f3 100644 --- a/doc/classes/VisualScriptSelect.xml +++ b/modules/visual_script/doc_classes/VisualScriptSelect.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSelect" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSelect" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Chooses between two input values. </brief_description> diff --git a/doc/classes/VisualScriptSelf.xml b/modules/visual_script/doc_classes/VisualScriptSelf.xml index 723b138722..f39a02bf84 100644 --- a/doc/classes/VisualScriptSelf.xml +++ b/modules/visual_script/doc_classes/VisualScriptSelf.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSelf" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSelf" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Outputs a reference to the current instance. </brief_description> diff --git a/doc/classes/VisualScriptSequence.xml b/modules/visual_script/doc_classes/VisualScriptSequence.xml index 845da4e50b..51238070d5 100644 --- a/doc/classes/VisualScriptSequence.xml +++ b/modules/visual_script/doc_classes/VisualScriptSequence.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSequence" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSequence" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Executes a series of Sequence ports. </brief_description> diff --git a/doc/classes/VisualScriptSubCall.xml b/modules/visual_script/doc_classes/VisualScriptSubCall.xml index 297ec96781..381095f49b 100644 --- a/doc/classes/VisualScriptSubCall.xml +++ b/modules/visual_script/doc_classes/VisualScriptSubCall.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSubCall" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSubCall" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptSwitch.xml b/modules/visual_script/doc_classes/VisualScriptSwitch.xml index 2540ae54cc..3c8a79f686 100644 --- a/doc/classes/VisualScriptSwitch.xml +++ b/modules/visual_script/doc_classes/VisualScriptSwitch.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptSwitch" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptSwitch" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Branches program flow based on a given input's value. </brief_description> diff --git a/doc/classes/VisualScriptTypeCast.xml b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml index 3008426900..417c0a5159 100644 --- a/doc/classes/VisualScriptTypeCast.xml +++ b/modules/visual_script/doc_classes/VisualScriptTypeCast.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptTypeCast" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptTypeCast" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptVariableGet.xml b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml index 5b45dd0cc4..1cad4480a6 100644 --- a/doc/classes/VisualScriptVariableGet.xml +++ b/modules/visual_script/doc_classes/VisualScriptVariableGet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptVariableGet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptVariableGet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Gets a variable's value. </brief_description> diff --git a/doc/classes/VisualScriptVariableSet.xml b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml index 51f85f6881..fa3befa21d 100644 --- a/doc/classes/VisualScriptVariableSet.xml +++ b/modules/visual_script/doc_classes/VisualScriptVariableSet.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptVariableSet" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptVariableSet" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Changes a variable's value. </brief_description> diff --git a/doc/classes/VisualScriptWhile.xml b/modules/visual_script/doc_classes/VisualScriptWhile.xml index 60bf161339..f948660997 100644 --- a/doc/classes/VisualScriptWhile.xml +++ b/modules/visual_script/doc_classes/VisualScriptWhile.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptWhile" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptWhile" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> Conditional loop. </brief_description> diff --git a/doc/classes/VisualScriptYield.xml b/modules/visual_script/doc_classes/VisualScriptYield.xml index a0d95f151a..5474ee8b78 100644 --- a/doc/classes/VisualScriptYield.xml +++ b/modules/visual_script/doc_classes/VisualScriptYield.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptYield" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptYield" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/doc/classes/VisualScriptYieldSignal.xml b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml index f4202edf2b..a3b6982075 100644 --- a/doc/classes/VisualScriptYieldSignal.xml +++ b/modules/visual_script/doc_classes/VisualScriptYieldSignal.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualScriptYieldSignal" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build"> +<class name="VisualScriptYieldSignal" inherits="VisualScriptNode" category="Core" version="3.0-alpha"> <brief_description> </brief_description> <description> diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index c50ba17c35..b6ce10381d 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "register_types.h" +#include "core/engine.h" #include "io/resource_loader.h" #include "visual_script.h" #include "visual_script_builtin_funcs.h" @@ -40,6 +41,9 @@ #include "visual_script_yield_nodes.h" VisualScriptLanguage *visual_script_language = NULL; +#ifdef TOOLS_ENABLED +static _VisualScriptEditor *vs_editor_singleton = NULL; +#endif void register_visual_script_types() { @@ -107,6 +111,10 @@ void register_visual_script_types() { register_visual_script_expression_node(); #ifdef TOOLS_ENABLED + ClassDB::register_class<_VisualScriptEditor>(); + vs_editor_singleton = memnew(_VisualScriptEditor); + Engine::get_singleton()->add_singleton(Engine::Singleton("VisualScriptEditor", _VisualScriptEditor::get_singleton())); + VisualScriptEditor::register_editor(); #endif } @@ -119,6 +127,9 @@ void unregister_visual_script_types() { #ifdef TOOLS_ENABLED VisualScriptEditor::free_clipboard(); + if (vs_editor_singleton) { + memdelete(vs_editor_singleton); + } #endif if (visual_script_language) memdelete(visual_script_language); diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 765fe4c2f2..0834bc81d9 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2644,6 +2644,11 @@ void VisualScriptLanguage::add_register_func(const String &p_name, VisualScriptN register_funcs[p_name] = p_func; } +void VisualScriptLanguage::remove_register_func(const String &p_name) { + ERR_FAIL_COND(!register_funcs.has(p_name)); + register_funcs.erase(p_name); +} + Ref<VisualScriptNode> VisualScriptLanguage::create_node_from_name(const String &p_name) { ERR_FAIL_COND_V(!register_funcs.has(p_name), Ref<VisualScriptNode>()); diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 0f60b103c9..3e31876941 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -600,6 +600,7 @@ public: virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max); void add_register_func(const String &p_name, VisualScriptNodeRegisterFunc p_func); + void remove_register_func(const String &p_name); Ref<VisualScriptNode> create_node_from_name(const String &p_name); void get_registered_node_names(List<String> *r_names); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 03015df844..86cf5b27e6 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "visual_script_editor.h" +#include "core/script_language.h" #include "editor/editor_node.h" #include "editor/editor_resource_preview.h" #include "os/input.h" @@ -2764,6 +2765,23 @@ void VisualScriptEditor::_default_value_edited(Node *p_button, int p_id, int p_i default_value_edit->set_position(Object::cast_to<Control>(p_button)->get_global_position() + Vector2(0, Object::cast_to<Control>(p_button)->get_size().y)); default_value_edit->set_size(Size2(1, 1)); + + if (pinfo.type == Variant::NODE_PATH) { + + Node *edited_scene = get_tree()->get_edited_scene_root(); + Node *script_node = _find_script_node(edited_scene, edited_scene, script); + + if (script_node) { + //pick a node relative to the script, IF the script exists + pinfo.hint = PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE; + pinfo.hint_string = script_node->get_path(); + } else { + //pick a path relative to edited scene + pinfo.hint = PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE; + pinfo.hint_string = get_tree()->get_edited_scene_root()->get_path(); + } + } + if (default_value_edit->edit(NULL, pinfo.name, pinfo.type, existing, pinfo.hint, pinfo.hint_string)) { if (pinfo.hint == PROPERTY_HINT_MULTILINE_TEXT) default_value_edit->popup_centered_ratio(); @@ -3241,6 +3259,8 @@ void VisualScriptEditor::_bind_methods() { ClassDB::bind_method("_member_rmb_selected", &VisualScriptEditor::_member_rmb_selected); ClassDB::bind_method("_member_option", &VisualScriptEditor::_member_option); + + ClassDB::bind_method("_update_available_nodes", &VisualScriptEditor::_update_available_nodes); } VisualScriptEditor::VisualScriptEditor() { @@ -3425,6 +3445,8 @@ VisualScriptEditor::VisualScriptEditor() { members->connect("item_rmb_selected", this, "_member_rmb_selected"); members->set_allow_rmb_select(true); member_popup->connect("id_pressed", this, "_member_option"); + + _VisualScriptEditor::get_singleton()->connect("custom_nodes_updated", this, "_update_available_nodes"); } VisualScriptEditor::~VisualScriptEditor() { @@ -3468,4 +3490,42 @@ void VisualScriptEditor::register_editor() { EditorNode::add_plugin_init_callback(register_editor_callback); } +Ref<VisualScriptNode> _VisualScriptEditor::create_node_custom(const String &p_name) { + + Ref<VisualScriptCustomNode> node; + node.instance(); + node->set_script(singleton->custom_nodes[p_name]); + return node; +} + +_VisualScriptEditor *_VisualScriptEditor::singleton = NULL; +Map<String, RefPtr> _VisualScriptEditor::custom_nodes; + +_VisualScriptEditor::_VisualScriptEditor() { + singleton = this; +} + +_VisualScriptEditor::~_VisualScriptEditor() { + custom_nodes.clear(); +} + +void _VisualScriptEditor::add_custom_node(const String &p_name, const String &p_category, const Ref<Script> &p_script) { + String node_name = "custom/" + p_category + "/" + p_name; + custom_nodes.insert(node_name, p_script.get_ref_ptr()); + VisualScriptLanguage::singleton->add_register_func(node_name, &_VisualScriptEditor::create_node_custom); + emit_signal("custom_nodes_updated"); +} + +void _VisualScriptEditor::remove_custom_node(const String &p_name, const String &p_category) { + String node_name = "custom/" + p_category + "/" + p_name; + custom_nodes.erase(node_name); + VisualScriptLanguage::singleton->remove_register_func(node_name); + emit_signal("custom_nodes_updated"); +} + +void _VisualScriptEditor::_bind_methods() { + ClassDB::bind_method(D_METHOD("add_custom_node", "name", "category", "script"), &_VisualScriptEditor::add_custom_node); + ClassDB::bind_method(D_METHOD("remove_custom_node", "name", "category"), &_VisualScriptEditor::remove_custom_node); + ADD_SIGNAL(MethodInfo("custom_nodes_updated")); +} #endif diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index db54d10300..3d037e82ea 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -278,6 +278,29 @@ public: VisualScriptEditor(); ~VisualScriptEditor(); }; + +// Singleton +class _VisualScriptEditor : public Object { + GDCLASS(_VisualScriptEditor, Object); + + friend class VisualScriptLanguage; + +protected: + static void _bind_methods(); + static _VisualScriptEditor *singleton; + + static Map<String, RefPtr> custom_nodes; + static Ref<VisualScriptNode> create_node_custom(const String &p_name); + +public: + static _VisualScriptEditor *get_singleton() { return singleton; } + + void add_custom_node(const String &p_name, const String &p_category, const Ref<Script> &p_script); + void remove_custom_node(const String &p_name, const String &p_category); + + _VisualScriptEditor(); + ~_VisualScriptEditor(); +}; #endif #endif // VISUALSCRIPT_EDITOR_H diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 897e910f20..07dca4b904 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -564,6 +564,9 @@ Error VisualScriptExpression::_get_token(Token &r_token) { } else if (id == "PI") { r_token.type = TK_CONSTANT; r_token.value = Math_PI; + } else if (id == "TAU") { + r_token.type = TK_CONSTANT; + r_token.value = Math_TAU; } else if (id == "INF") { r_token.type = TK_CONSTANT; r_token.value = Math_INF; diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index a5dc6ffc13..cbe4438cdf 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -29,9 +29,9 @@ /*************************************************************************/ #include "visual_script_func_nodes.h" +#include "engine.h" #include "io/resource_loader.h" #include "os/os.h" -#include "project_settings.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" #include "visual_script_nodes.h" @@ -344,7 +344,7 @@ void VisualScriptFunctionCall::set_singleton(const StringName &p_type) { return; singleton = p_type; - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); if (obj) { base_type = obj->get_class(); } @@ -380,7 +380,7 @@ void VisualScriptFunctionCall::_update_method_cache() { } else if (call_mode == CALL_MODE_SINGLETON) { - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); if (obj) { type = obj->get_class(); script = obj->get_script(); @@ -565,11 +565,11 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const if (call_mode != CALL_MODE_SINGLETON) { property.usage = 0; } else { - List<ProjectSettings::Singleton> names; - ProjectSettings::get_singleton()->get_singletons(&names); + List<Engine::Singleton> names; + Engine::get_singleton()->get_singletons(&names); property.hint = PROPERTY_HINT_ENUM; String sl; - for (List<ProjectSettings::Singleton>::Element *E = names.front(); E; E = E->next()) { + for (List<Engine::Singleton>::Element *E = names.front(); E; E = E->next()) { if (sl != String()) sl += ","; sl += E->get().name; @@ -603,7 +603,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const property.hint_string = itos(get_visual_script()->get_instance_id()); } else if (call_mode == CALL_MODE_SINGLETON) { - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); if (obj) { property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE; property.hint_string = itos(obj->get_instance_id()); @@ -879,7 +879,7 @@ public: } break; case VisualScriptFunctionCall::CALL_MODE_SINGLETON: { - Object *object = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *object = Engine::get_singleton()->get_singleton_object(singleton); if (!object) { r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; r_error_str = "Invalid singleton name: '" + String(singleton) + "'"; diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index d3cd839cf3..05ff629d1b 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "visual_script_nodes.h" +#include "engine.h" #include "global_constants.h" #include "os/input.h" #include "os/os.h" @@ -1776,8 +1777,8 @@ VisualScriptBasicTypeConstant::VisualScriptBasicTypeConstant() { const char *VisualScriptMathConstant::const_name[MATH_CONSTANT_MAX] = { "One", "PI", - "PIx2", "PI/2", + "TAU", "E", "Sqrt2", "INF", @@ -1787,8 +1788,8 @@ const char *VisualScriptMathConstant::const_name[MATH_CONSTANT_MAX] = { double VisualScriptMathConstant::const_value[MATH_CONSTANT_MAX] = { 1.0, Math_PI, - Math_PI * 2, Math_PI * 0.5, + Math_TAU, 2.71828182845904523536, Math::sqrt(2.0), Math_INF, @@ -1886,8 +1887,8 @@ void VisualScriptMathConstant::_bind_methods() { BIND_ENUM_CONSTANT(MATH_CONSTANT_ONE); BIND_ENUM_CONSTANT(MATH_CONSTANT_PI); - BIND_ENUM_CONSTANT(MATH_CONSTANT_2PI); BIND_ENUM_CONSTANT(MATH_CONSTANT_HALF_PI); + BIND_ENUM_CONSTANT(MATH_CONSTANT_TAU); BIND_ENUM_CONSTANT(MATH_CONSTANT_E); BIND_ENUM_CONSTANT(MATH_CONSTANT_SQRT2); BIND_ENUM_CONSTANT(MATH_CONSTANT_INF); @@ -1976,13 +1977,13 @@ public: VisualScriptNodeInstance *VisualScriptEngineSingleton::instance(VisualScriptInstance *p_instance) { VisualScriptNodeInstanceEngineSingleton *instance = memnew(VisualScriptNodeInstanceEngineSingleton); - instance->singleton = ProjectSettings::get_singleton()->get_singleton_object(singleton); + instance->singleton = Engine::get_singleton()->get_singleton_object(singleton); return instance; } VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output_type(TypeGuess *p_inputs, int p_output) const { - Object *obj = ProjectSettings::get_singleton()->get_singleton_object(singleton); + Object *obj = Engine::get_singleton()->get_singleton_object(singleton); TypeGuess tg; tg.type = Variant::OBJECT; if (obj) { @@ -2000,11 +2001,11 @@ void VisualScriptEngineSingleton::_bind_methods() { String cc; - List<ProjectSettings::Singleton> singletons; + List<Engine::Singleton> singletons; - ProjectSettings::get_singleton()->get_singletons(&singletons); + Engine::get_singleton()->get_singletons(&singletons); - for (List<ProjectSettings::Singleton>::Element *E = singletons.front(); E; E = E->next()) { + for (List<Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) { if (E->get().name == "VS" || E->get().name == "PS" || E->get().name == "PS2D" || E->get().name == "AS" || E->get().name == "TS" || E->get().name == "SS" || E->get().name == "SS2D") continue; //skip these, too simple named diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 421409b265..6648f57e7b 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -474,8 +474,8 @@ public: enum MathConstant { MATH_CONSTANT_ONE, MATH_CONSTANT_PI, - MATH_CONSTANT_2PI, MATH_CONSTANT_HALF_PI, + MATH_CONSTANT_TAU, MATH_CONSTANT_E, MATH_CONSTANT_SQRT2, MATH_CONSTANT_INF, diff --git a/modules/vorbis/SCsub b/modules/vorbis/SCsub index 9d2d0feb92..55a112585b 100644 --- a/modules/vorbis/SCsub +++ b/modules/vorbis/SCsub @@ -5,6 +5,8 @@ Import('env_modules') env_vorbis = env_modules.Clone() +stub = True + # Thirdparty source files if env['builtin_libvorbis']: thirdparty_dir = "#thirdparty/libvorbis/" @@ -45,5 +47,9 @@ if env['builtin_libvorbis']: if env['builtin_libogg']: env_vorbis.Append(CPPPATH=["#thirdparty/libogg"]) -# Godot source files -env_vorbis.add_source_files(env.modules_sources, "*.cpp") +if not stub: + # Module files + env_vorbis.add_source_files(env.modules_sources, "*.cpp") +else: + # Module files + env_vorbis.add_source_files(env.modules_sources, "stub/register_types.cpp") diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 6235799fc2..9fb6fa8197 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -106,8 +106,6 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_buffer, int p_frames) { break; } -//printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t)); - #ifdef BIG_ENDIAN_ENABLED long ret = ov_read(&vf, (char *)p_buffer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, ¤t_section); #else @@ -359,7 +357,7 @@ void AudioStreamPlaybackOGGVorbis::set_paused(bool p_paused) { paused = p_paused; } -bool AudioStreamPlaybackOGGVorbis::is_paused(bool p_paused) const { +bool AudioStreamPlaybackOGGVorbis::is_paused() const { return paused; } diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index 79eadec56e..5000d03fd4 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -85,7 +85,7 @@ public: virtual void set_loop_restart_time(float p_time) { loop_restart_time = p_time; } virtual void set_paused(bool p_paused); - virtual bool is_paused(bool p_paused) const; + virtual bool is_paused() const; virtual void set_loop(bool p_enable); virtual bool has_loop() const; diff --git a/modules/vorbis/config.py b/modules/vorbis/config.py index ef5daca05c..5f133eba90 100644 --- a/modules/vorbis/config.py +++ b/modules/vorbis/config.py @@ -1,8 +1,5 @@ - def can_build(platform): -# return True - return False - + return True def configure(env): pass diff --git a/modules/vorbis/stub/register_types.cpp b/modules/vorbis/stub/register_types.cpp new file mode 100644 index 0000000000..b93d890436 --- /dev/null +++ b/modules/vorbis/stub/register_types.cpp @@ -0,0 +1,36 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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_types.h" + +// Dummy module as libvorbis is needed by other modules (theora ...) + +void register_vorbis_types() {} + +void unregister_vorbis_types() {} diff --git a/modules/vorbis/stub/register_types.h b/modules/vorbis/stub/register_types.h new file mode 100644 index 0000000000..e7cde7a66c --- /dev/null +++ b/modules/vorbis/stub/register_types.h @@ -0,0 +1,31 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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. */ +/*************************************************************************/ +void register_vorbis_types(); +void unregister_vorbis_types(); diff --git a/modules/webm/config.py b/modules/webm/config.py index ef5daca05c..0374bb36f7 100644 --- a/modules/webm/config.py +++ b/modules/webm/config.py @@ -1,8 +1,14 @@ - def can_build(platform): -# return True - return False - + return True def configure(env): pass + +def get_doc_classes(): + return [ + "ResourceImporterWebm", + "VideoStreamWebm", + ] + +def get_doc_path(): + return "doc_classes" diff --git a/modules/webm/doc_classes/ResourceImporterWebm.xml b/modules/webm/doc_classes/ResourceImporterWebm.xml new file mode 100644 index 0000000000..dcba351e37 --- /dev/null +++ b/modules/webm/doc_classes/ResourceImporterWebm.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="ResourceImporterWebm" inherits="ResourceImporter" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + </methods> + <constants> + </constants> +</class> diff --git a/modules/webm/doc_classes/VideoStreamWebm.xml b/modules/webm/doc_classes/VideoStreamWebm.xml new file mode 100644 index 0000000000..9a430f6b0d --- /dev/null +++ b/modules/webm/doc_classes/VideoStreamWebm.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VideoStreamWebm" inherits="VideoStream" category="Core" version="3.0-alpha"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <demos> + </demos> + <methods> + <method name="get_file"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="set_file"> + <return type="void"> + </return> + <argument index="0" name="file" type="String"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="file" type="String" setter="set_file" getter="get_file"> + </member> + </members> + <constants> + </constants> +</class> diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index fd8d762a5e..73ba17d184 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -298,7 +298,7 @@ if webm_cpu_x86: if not yasm_found: webm_cpu_x86 = False - print "YASM is necessary for WebM SIMD optimizations." + print("YASM is necessary for WebM SIMD optimizations.") webm_simd_optimizations = False @@ -345,7 +345,7 @@ if webm_cpu_arm: webm_simd_optimizations = True if webm_simd_optimizations == False: - print "WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!" + print("WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!") env_libvpx.add_source_files(env.modules_sources, libvpx_sources) diff --git a/modules/webm/register_types.cpp b/modules/webm/register_types.cpp index 892d1b8420..669c9997f1 100644 --- a/modules/webm/register_types.cpp +++ b/modules/webm/register_types.cpp @@ -28,19 +28,18 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_types.h" - +#include "resource_importer_webm.h" #include "video_stream_webm.h" -static ResourceFormatLoaderVideoStreamWebm *webm_stream_loader = NULL; - void register_webm_types() { - webm_stream_loader = memnew(ResourceFormatLoaderVideoStreamWebm); - ResourceLoader::add_resource_format_loader(webm_stream_loader); +#ifdef TOOLS_ENABLED + Ref<ResourceImporterWebm> webm_import; + webm_import.instance(); + ResourceFormatImporter::get_singleton()->add_importer(webm_import); +#endif ClassDB::register_class<VideoStreamWebm>(); } void unregister_webm_types() { - - memdelete(webm_stream_loader); } diff --git a/modules/webm/resource_importer_webm.cpp b/modules/webm/resource_importer_webm.cpp new file mode 100644 index 0000000000..5db3d4df2e --- /dev/null +++ b/modules/webm/resource_importer_webm.cpp @@ -0,0 +1,95 @@ +/*************************************************************************/ +/* resource_importer_webm.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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 "resource_importer_webm.h" + +#include "io/resource_saver.h" +#include "os/file_access.h" +#include "scene/resources/texture.h" +#include "video_stream_webm.h" + +String ResourceImporterWebm::get_importer_name() const { + + return "Webm"; +} + +String ResourceImporterWebm::get_visible_name() const { + + return "Webm"; +} +void ResourceImporterWebm::get_recognized_extensions(List<String> *p_extensions) const { + + p_extensions->push_back("webm"); +} + +String ResourceImporterWebm::get_save_extension() const { + return "webmstr"; +} + +String ResourceImporterWebm::get_resource_type() const { + + return "VideoStreamWebm"; +} + +bool ResourceImporterWebm::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const { + + return true; +} + +int ResourceImporterWebm::get_preset_count() const { + return 0; +} +String ResourceImporterWebm::get_preset_name(int p_idx) const { + + return String(); +} + +void ResourceImporterWebm::get_import_options(List<ImportOption> *r_options, int p_preset) const { + + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "loop"), true)); +} + +Error ResourceImporterWebm::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) { + + FileAccess *f = FileAccess::open(p_source_file, FileAccess::READ); + if (!f) { + ERR_FAIL_COND_V(!f, ERR_CANT_OPEN); + } + memdelete(f); + + VideoStreamWebm *stream = memnew(VideoStreamWebm); + stream->set_file(p_source_file); + + Ref<VideoStreamWebm> webm_stream = Ref<VideoStreamWebm>(stream); + + return ResourceSaver::save(p_save_path + ".webmstr", webm_stream); +} + +ResourceImporterWebm::ResourceImporterWebm() { +} diff --git a/modules/webm/resource_importer_webm.h b/modules/webm/resource_importer_webm.h new file mode 100644 index 0000000000..4cedd1598d --- /dev/null +++ b/modules/webm/resource_importer_webm.h @@ -0,0 +1,55 @@ +/*************************************************************************/ +/* resource_importer_webm.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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. */ +/*************************************************************************/ +#ifndef RESOURCEIMPORTERWEBM_H +#define RESOURCEIMPORTERWEBM_H + +#include "io/resource_import.h" + +class ResourceImporterWebm : public ResourceImporter { + GDCLASS(ResourceImporterWebm, ResourceImporter) +public: + virtual String get_importer_name() const; + virtual String get_visible_name() const; + virtual void get_recognized_extensions(List<String> *p_extensions) const; + virtual String get_save_extension() const; + virtual String get_resource_type() const; + + virtual int get_preset_count() const; + virtual String get_preset_name(int p_idx) const; + + virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const; + virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const; + + virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL); + + ResourceImporterWebm(); +}; + +#endif // RESOURCEIMPORTERWEBM_H diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index 2ec6b27471..0fc9df5b58 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -35,10 +35,13 @@ #include "mkvparser/mkvparser.h" #include "os/file_access.h" +#include "os/os.h" #include "project_settings.h" #include "thirdparty/misc/yuv2rgb.h" +#include "servers/audio_server.h" + #include <string.h> class MkvReader : public mkvparser::IMkvReader { @@ -47,6 +50,8 @@ public: MkvReader(const String &p_file) { file = FileAccess::open(p_file, FileAccess::READ); + + ERR_EXPLAIN("Failed loading resource: '" + p_file + "';"); ERR_FAIL_COND(!file); } ~MkvReader() { @@ -113,14 +118,14 @@ bool VideoStreamPlaybackWebm::open_file(const String &p_file) { webm = memnew(WebMDemuxer(new MkvReader(file_name), 0, audio_track)); if (webm->isOpen()) { - video = memnew(VPXDecoder(*webm, 8)); //TODO: Detect CPU threads + video = memnew(VPXDecoder(*webm, OS::get_singleton()->get_processor_count())); if (video->isOpen()) { audio = memnew(OpusVorbisDecoder(*webm)); if (audio->isOpen()) { audio_frame = memnew(WebMFrame); - pcm = (int16_t *)memalloc(sizeof(int16_t) * audio->getBufferSamples() * webm->getChannels()); + pcm = (float *)memalloc(sizeof(float) * audio->getBufferSamples() * webm->getChannels()); } else { memdelete(audio); @@ -183,7 +188,7 @@ void VideoStreamPlaybackWebm::set_paused(bool p_paused) { paused = p_paused; } -bool VideoStreamPlaybackWebm::is_paused(bool p_paused) const { +bool VideoStreamPlaybackWebm::is_paused() const { return paused; } @@ -222,11 +227,18 @@ Ref<Texture> VideoStreamPlaybackWebm::get_texture() { return texture; } + void VideoStreamPlaybackWebm::update(float p_delta) { if ((!playing || paused) || !video) return; + time += p_delta; + + if (time < video_pos) { + return; + } + bool audio_buffer_full = false; if (samples_offset > -1) { @@ -245,13 +257,15 @@ void VideoStreamPlaybackWebm::update(float p_delta) { } const bool hasAudio = (audio && mix_callback); - while ((hasAudio && (!audio_buffer_full || !has_enough_video_frames())) || (!hasAudio && video_frames_pos == 0)) { + while ((hasAudio && !audio_buffer_full && !has_enough_video_frames()) || + (!hasAudio && video_frames_pos == 0)) { - if (hasAudio && !audio_buffer_full && audio_frame->isValid() && audio->getPCMS16(*audio_frame, pcm, num_decoded_samples) && num_decoded_samples > 0) { + if (hasAudio && !audio_buffer_full && audio_frame->isValid() && + audio->getPCMF(*audio_frame, pcm, num_decoded_samples) && num_decoded_samples > 0) { const int mixed = mix_callback(mix_udata, pcm, num_decoded_samples); - if (mixed != num_decoded_samples) { + if (mixed != num_decoded_samples) { samples_offset = mixed; audio_buffer_full = true; } @@ -273,72 +287,61 @@ void VideoStreamPlaybackWebm::update(float p_delta) { ++video_frames_pos; }; - const double video_delay = video->getFramesDelay() * video_frame_delay; - - bool want_this_frame = false; - while (video_frames_pos > 0 && !want_this_frame) { + bool video_frame_done = false; + while (video_frames_pos > 0 && !video_frame_done) { WebMFrame *video_frame = video_frames[0]; - if (video_frame->time <= time + video_delay) { - if (video->decode(*video_frame)) { + // It seems VPXDecoder::decode has to be executed even though we might skip this frame + if (video->decode(*video_frame)) { - VPXDecoder::IMAGE_ERROR err; - VPXDecoder::Image image; + VPXDecoder::IMAGE_ERROR err; + VPXDecoder::Image image; - while ((err = video->getImage(image)) != VPXDecoder::NO_FRAME) { + if (should_process(*video_frame)) { - want_this_frame = (time - video_frame->time <= video_frame_delay); + if ((err = video->getImage(image)) != VPXDecoder::NO_FRAME) { - if (want_this_frame) { + if (err == VPXDecoder::NO_ERROR && image.w == webm->getWidth() && image.h == webm->getHeight()) { - if (err == VPXDecoder::NO_ERROR && image.w == webm->getWidth() && image.h == webm->getHeight()) { + PoolVector<uint8_t>::Write w = frame_data.write(); + bool converted = false; - PoolVector<uint8_t>::Write w = frame_data.write(); - bool converted = false; + if (image.chromaShiftW == 1 && image.chromaShiftH == 1) { - if (image.chromaShiftW == 1 && image.chromaShiftH == 1) { + yuv420_2_rgb8888(w.ptr(), image.planes[0], image.planes[2], image.planes[1], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2, 0); + // libyuv::I420ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); + converted = true; + } else if (image.chromaShiftW == 1 && image.chromaShiftH == 0) { - yuv420_2_rgb8888(w.ptr(), image.planes[0], image.planes[2], image.planes[1], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2, 0); - // libyuv::I420ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); - converted = true; - } else if (image.chromaShiftW == 1 && image.chromaShiftH == 0) { + yuv422_2_rgb8888(w.ptr(), image.planes[0], image.planes[2], image.planes[1], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2, 0); + // libyuv::I422ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); + converted = true; + } else if (image.chromaShiftW == 0 && image.chromaShiftH == 0) { - yuv422_2_rgb8888(w.ptr(), image.planes[0], image.planes[2], image.planes[1], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2, 0); - // libyuv::I422ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); - converted = true; - } else if (image.chromaShiftW == 0 && image.chromaShiftH == 0) { + yuv444_2_rgb8888(w.ptr(), image.planes[0], image.planes[2], image.planes[1], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2, 0); + // libyuv::I444ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); + converted = true; + } else if (image.chromaShiftW == 2 && image.chromaShiftH == 0) { - yuv444_2_rgb8888(w.ptr(), image.planes[0], image.planes[2], image.planes[1], image.w, image.h, image.linesize[0], image.linesize[1], image.w << 2, 0); - // libyuv::I444ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); - converted = true; - } else if (image.chromaShiftW == 2 && image.chromaShiftH == 0) { - - // libyuv::I411ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); - // converted = true; - } - - if (converted) - texture->set_data(Image(image.w, image.h, 0, Image::FORMAT_RGBA8, frame_data)); //Zero copy send to visual server + // libyuv::I411ToARGB(image.planes[0], image.linesize[0], image.planes[2], image.linesize[2], image.planes[1], image.linesize[1], w.ptr(), image.w << 2, image.w, image.h); + // converted = true; } - break; + if (converted) { + Ref<Image> img = memnew(Image(image.w, image.h, 0, Image::FORMAT_RGBA8, frame_data)); + texture->set_data(img); //Zero copy send to visual server + video_frame_done = true; + } } } } - - video_frame_delay = video_frame->time - video_pos; - video_pos = video_frame->time; - - memmove(video_frames, video_frames + 1, (--video_frames_pos) * sizeof(void *)); - video_frames[video_frames_pos] = video_frame; - } else { - - break; } - } - time += p_delta; + video_pos = video_frame->time; + memmove(video_frames, video_frames + 1, (--video_frames_pos) * sizeof(void *)); + video_frames[video_frames_pos] = video_frame; + } if (video_frames_pos == 0 && webm->isEOS()) stop(); @@ -372,6 +375,11 @@ inline bool VideoStreamPlaybackWebm::has_enough_video_frames() const { return false; } +bool VideoStreamPlaybackWebm::should_process(WebMFrame &video_frame) { + const double audio_delay = AudioServer::get_singleton()->get_output_delay(); + return video_frame.time >= time + audio_delay + delay_compensation; +} + void VideoStreamPlaybackWebm::delete_pointers() { if (pcm) @@ -395,34 +403,6 @@ void VideoStreamPlaybackWebm::delete_pointers() { /**/ -RES ResourceFormatLoaderVideoStreamWebm::load(const String &p_path, const String &p_original_path, Error *r_error) { - - Ref<VideoStreamWebm> stream = memnew(VideoStreamWebm); - stream->set_file(p_path); - if (r_error) - *r_error = OK; - return stream; -} - -void ResourceFormatLoaderVideoStreamWebm::get_recognized_extensions(List<String> *p_extensions) const { - - p_extensions->push_back("webm"); -} -bool ResourceFormatLoaderVideoStreamWebm::handles_type(const String &p_type) const { - - return (p_type == "VideoStream" || p_type == "VideoStreamWebm"); -} - -String ResourceFormatLoaderVideoStreamWebm::get_resource_type(const String &p_path) const { - - const String exl = p_path.get_extension().to_lower(); - if (exl == "webm") - return "VideoStreamWebm"; - return ""; -} - -/**/ - VideoStreamWebm::VideoStreamWebm() : audio_track(0) {} @@ -439,6 +419,19 @@ void VideoStreamWebm::set_file(const String &p_file) { file = p_file; } +String VideoStreamWebm::get_file() { + + return file; +} + +void VideoStreamWebm::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_file", "file"), &VideoStreamWebm::set_file); + ClassDB::bind_method(D_METHOD("get_file"), &VideoStreamWebm::get_file); + + ADD_PROPERTY(PropertyInfo(Variant::STRING, "file", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_file", "get_file"); +} + void VideoStreamWebm::set_audio_track(int p_track) { audio_track = p_track; diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index fc0720967a..f7dd16a38f 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -60,7 +60,7 @@ class VideoStreamPlaybackWebm : public VideoStreamPlayback { PoolVector<uint8_t> frame_data; Ref<ImageTexture> texture; - int16_t *pcm; + float *pcm; public: VideoStreamPlaybackWebm(); @@ -74,7 +74,7 @@ public: virtual bool is_playing() const; virtual void set_paused(bool p_paused); - virtual bool is_paused(bool p_paused) const; + virtual bool is_paused() const; virtual void set_loop(bool p_enable); virtual bool has_loop() const; @@ -95,6 +95,7 @@ public: private: inline bool has_enough_video_frames() const; + bool should_process(WebMFrame &video_frame); void delete_pointers(); }; @@ -103,27 +104,21 @@ private: class VideoStreamWebm : public VideoStream { - GDCLASS(VideoStreamWebm, VideoStream) + GDCLASS(VideoStreamWebm, VideoStream); + RES_BASE_EXTENSION("webmstr"); String file; int audio_track; +protected: + static void _bind_methods(); + public: VideoStreamWebm(); virtual Ref<VideoStreamPlayback> instance_playback(); virtual void set_file(const String &p_file); + String get_file(); virtual void set_audio_track(int p_track); }; - -/**/ - -class ResourceFormatLoaderVideoStreamWebm : public ResourceFormatLoader { - -public: - virtual RES load(const String &p_path, const String &p_original_path, Error *r_error); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String &p_type) const; - virtual String get_resource_type(const String &p_path) const; -}; diff --git a/modules/webp/config.py b/modules/webp/config.py index fb920482f5..5f133eba90 100644 --- a/modules/webp/config.py +++ b/modules/webp/config.py @@ -1,7 +1,5 @@ - def can_build(platform): return True - def configure(env): pass diff --git a/platform/android/detect.py b/platform/android/detect.py index 966de832e8..a3ada5cf51 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -173,8 +173,15 @@ def configure(env): # For Clang to find NDK tools in preference of those system-wide env.PrependENVPath('PATH', tools_path) - env['CC'] = compiler_path + '/clang' - env['CXX'] = compiler_path + '/clang++' + ccache_path = os.environ.get("CCACHE") + if ccache_path == None: + env['CC'] = compiler_path + '/clang' + env['CXX'] = compiler_path + '/clang++' + else: + # there aren't any ccache wrappers available for Android, + # to enable caching we need to prepend the path to the ccache binary + env['CC'] = ccache_path + ' ' + compiler_path + '/clang' + env['CXX'] = ccache_path + ' ' + compiler_path + '/clang++' env['AR'] = tools_path + "/ar" env['RANLIB'] = tools_path + "/ranlib" env['AS'] = tools_path + "/as" diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 8235683496..9d056bca7c 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -35,6 +35,7 @@ #include <EGL/egl.h> #include <GLES2/gl2.h> +#include "engine.h" #include "file_access_android.h" #include "main/main.h" #include "os_android.h" @@ -669,6 +670,14 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) { ASensorEventQueue_setEventRate(engine->sensorEventQueue, engine->accelerometerSensor, (1000L / 60) * 1000); } + // start monitoring gravity + if (engine->gravitySensor != NULL) { + ASensorEventQueue_enableSensor(engine->sensorEventQueue, + engine->gravitySensor); + // We'd like to get 60 events per second (in us). + ASensorEventQueue_setEventRate(engine->sensorEventQueue, + engine->gravitySensor, (1000L / 60) * 1000); + } // Also start monitoring the magnetometer. if (engine->magnetometerSensor != NULL) { ASensorEventQueue_enableSensor(engine->sensorEventQueue, @@ -694,6 +703,10 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) { ASensorEventQueue_disableSensor(engine->sensorEventQueue, engine->accelerometerSensor); } + if (engine->gravitySensor != NULL) { + ASensorEventQueue_disableSensor(engine->sensorEventQueue, + engine->gravitySensor); + } if (engine->magnetometerSensor != NULL) { ASensorEventQueue_disableSensor(engine->sensorEventQueue, engine->magnetometerSensor); @@ -729,6 +742,8 @@ void android_main(struct android_app *app) { engine.sensorManager = ASensorManager_getInstance(); engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager, ASENSOR_TYPE_ACCELEROMETER); + engine.gravitySensor = ASensorManager_getDefaultSensor(engine.sensorManager, + ASENSOR_TYPE_GRAVITY); engine.magnetometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager, ASENSOR_TYPE_MAGNETIC_FIELD); engine.gyroscopeSensor = ASensorManager_getDefaultSensor(engine.sensorManager, @@ -828,7 +843,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv s->set_instance(env->NewGlobalRef(p_object)); jni_singletons[singname] = s; - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton(singname, s)); + Engine::get_singleton()->add_singleton(Engine::Singleton(singname, s)); } static Variant::Type get_jni_type(const String &p_type) { diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 59fefc498f..41dcba5c2c 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -219,6 +219,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC private SensorManager mSensorManager; private Sensor mAccelerometer; + private Sensor mGravity; private Sensor mMagnetometer; private Sensor mGyroscope; @@ -435,6 +436,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME); + mGravity = mSensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY); + mSensorManager.registerListener(this, mGravity, SensorManager.SENSOR_DELAY_GAME); mMagnetometer = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); mSensorManager.registerListener(this, mMagnetometer, SensorManager.SENSOR_DELAY_GAME); mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); @@ -667,6 +670,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC } }); mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_GAME); + mSensorManager.registerListener(this, mGravity, SensorManager.SENSOR_DELAY_GAME); mSensorManager.registerListener(this, mMagnetometer, SensorManager.SENSOR_DELAY_GAME); mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME); @@ -734,13 +738,16 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC @Override public void run() { if (typeOfSensor == Sensor.TYPE_ACCELEROMETER) { - GodotLib.accelerometer(x,y,z); + GodotLib.accelerometer(-x,y,-z); + } + if (typeOfSensor == Sensor.TYPE_GRAVITY) { + GodotLib.gravity(-x,y,-z); } if (typeOfSensor == Sensor.TYPE_MAGNETIC_FIELD) { - GodotLib.magnetometer(x,y,z); + GodotLib.magnetometer(-x,y,-z); } if (typeOfSensor == Sensor.TYPE_GYROSCOPE) { - GodotLib.gyroscope(x,y,z); + GodotLib.gyroscope(x,-y,z); } } }); diff --git a/platform/android/java/src/org/godotengine/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java index e0ed4cd38c..6b84ad6555 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java @@ -53,6 +53,7 @@ public class GodotLib { public static native void step(); public static native void touch(int what,int pointer,int howmany, int[] arr); public static native void accelerometer(float x, float y, float z); + public static native void gravity(float x, float y, float z); public static native void magnetometer(float x, float y, float z); public static native void gyroscope(float x, float y, float z); public static native void key(int p_scancode, int p_unicode_char, boolean p_pressed); diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index 0b193f5882..90144d9b4d 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -34,6 +34,7 @@ #include "audio_driver_jandroid.h" #include "core/os/keyboard.h" #include "dir_access_jandroid.h" +#include "engine.h" #include "file_access_android.h" #include "file_access_jandroid.h" #include "java_class_wrapper.h" @@ -608,6 +609,7 @@ static bool resized = false; static bool resized_reload = false; static Size2 new_size; static Vector3 accelerometer; +static Vector3 gravity; static Vector3 magnetometer; static Vector3 gyroscope; static HashMap<String, JNISingleton *> jni_singletons; @@ -952,7 +954,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jo __android_log_print(ANDROID_LOG_INFO, "godot", "*****SETUP OK"); java_class_wrapper = memnew(JavaClassWrapper(_godot_instance)); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaClassWrapper", java_class_wrapper)); + Engine::get_singleton()->add_singleton(Engine::Singleton("JavaClassWrapper", java_class_wrapper)); _initialize_java_modules(); } @@ -1012,6 +1014,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job os_android->process_accelerometer(accelerometer); + os_android->process_gravity(gravity); + os_android->process_magnetometer(magnetometer); os_android->process_gyroscope(gyroscope); @@ -1386,6 +1390,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv accelerometer = Vector3(x, y, z); } +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gravity(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z) { + gravity = Vector3(x, y, z); +} + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z) { magnetometer = Vector3(x, y, z); } @@ -1419,7 +1427,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv *env s->set_instance(env->NewGlobalRef(p_object)); jni_singletons[singname] = s; - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton(singname, s)); + Engine::get_singleton()->add_singleton(Engine::Singleton(singname, s)); ProjectSettings::get_singleton()->set(singname, s); } diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h index 0aa2489813..4790c65617 100644 --- a/platform/android/java_glue.h +++ b/platform/android/java_glue.h @@ -50,6 +50,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv *env, j JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyconnectionchanged(JNIEnv *env, jobject obj, jint p_device, jboolean p_connected, jstring p_name); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_audio(JNIEnv *env, jobject obj); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_accelerometer(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z); +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gravity(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_magnetometer(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_gyroscope(JNIEnv *env, jobject obj, jfloat x, jfloat y, jfloat z); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_focusin(JNIEnv *env, jobject obj); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 970e0cdf68..2578bd6d96 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -490,6 +490,11 @@ void OS_Android::process_accelerometer(const Vector3 &p_accelerometer) { input->set_accelerometer(p_accelerometer); } +void OS_Android::process_gravity(const Vector3 &p_gravity) { + + input->set_gravity(p_gravity); +} + void OS_Android::process_magnetometer(const Vector3 &p_magnetometer) { input->set_magnetometer(p_magnetometer); @@ -636,7 +641,7 @@ String OS_Android::get_data_dir() const { } return "."; - //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); + //return Engine::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); } void OS_Android::set_screen_orientation(ScreenOrientation p_orientation) { diff --git a/platform/android/os_android.h b/platform/android/os_android.h index fee91b9a55..750afa7a14 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -219,6 +219,7 @@ public: virtual String get_system_dir(SystemDir p_dir) const; void process_accelerometer(const Vector3 &p_accelerometer); + void process_gravity(const Vector3 &p_gravity); void process_magnetometer(const Vector3 &p_magnetometer); void process_gyroscope(const Vector3 &p_gyroscope); void process_touch(int p_what, int p_pointer, const Vector<TouchPos> &p_points); diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 993a93ff89..d426b478bf 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -76,11 +76,22 @@ def configure(env): env['ENV']['PATH'] = env['IPHONEPATH'] + "/Developer/usr/bin/:" + env['ENV']['PATH'] - env['CC'] = '$IPHONEPATH/usr/bin/${ios_triple}clang' - env['CXX'] = '$IPHONEPATH/usr/bin/${ios_triple}clang++' - env['AR'] = '$IPHONEPATH/usr/bin/${ios_triple}ar' - env['RANLIB'] = '$IPHONEPATH/usr/bin/${ios_triple}ranlib' - env['S_compiler'] = '$IPHONEPATH/Developer/usr/bin/gcc' + compiler_path = '$IPHONEPATH/usr/bin/${ios_triple}' + s_compiler_path = '$IPHONEPATH/Developer/usr/bin/' + + ccache_path = os.environ.get("CCACHE") + if ccache_path == None: + env['CC'] = compiler_path + 'clang' + env['CXX'] = compiler_path + 'clang++' + env['S_compiler'] = s_compiler_path + 'gcc' + else: + # there aren't any ccache wrappers available for iOS, + # to enable caching we need to prepend the path to the ccache binary + env['CC'] = ccache_path + ' ' + compiler_path + 'clang' + env['CXX'] = ccache_path + ' ' + compiler_path + 'clang++' + env['S_compiler'] = ccache_path + ' ' + s_compiler_path + 'gcc' + env['AR'] = compiler_path + 'ar' + env['RANLIB'] = compiler_path + 'ranlib' ## Compile flags diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 0685e961c3..d0865a35b9 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -138,28 +138,28 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_ /* #ifdef IOS_SCORELOOP_ENABLED scoreloop = memnew(ScoreloopIOS); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Scoreloop", scoreloop)); + Engine::get_singleton()->add_singleton(Engine::Singleton("Scoreloop", scoreloop)); scoreloop->connect(); #endif */ #ifdef GAME_CENTER_ENABLED game_center = memnew(GameCenter); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("GameCenter", game_center)); + Engine::get_singleton()->add_singleton(Engine::Singleton("GameCenter", game_center)); game_center->connect(); #endif #ifdef STOREKIT_ENABLED store_kit = memnew(InAppStore); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InAppStore", store_kit)); + Engine::get_singleton()->add_singleton(Engine::Singleton("InAppStore", store_kit)); #endif #ifdef ICLOUD_ENABLED icloud = memnew(ICloud); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ICloud", icloud)); + Engine::get_singleton()->add_singleton(Engine::Singleton("ICloud", icloud)); //icloud->connect(); #endif - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("iOS", memnew(iOS))); + Engine::get_singleton()->add_singleton(Engine::Singleton("iOS", memnew(iOS))); }; MainLoop *OSIPhone::get_main_loop() const { diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index cfc0741318..e3015d87b9 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -7,6 +7,7 @@ javascript_files = [ "audio_driver_javascript.cpp", "javascript_main.cpp", "power_javascript.cpp", + "http_client_javascript.cpp", "javascript_eval.cpp", ] @@ -42,6 +43,12 @@ else: js = env.Program(['#bin/godot'] + implicit_targets, javascript_objects, PROGSUFFIX=env['PROGSUFFIX'] + '.js')[0]; zip_files.append(InstallAs(zip_dir.File('godot.js'), js)) +js_libraries = [] +js_libraries.append(env.File('http_request.js')) +for lib in js_libraries: + env.Append(LINKFLAGS=['--js-library', lib.path]) +env.Depends(js, js_libraries) + postjs = env.File('engine.js') env.Depends(js, [prejs, postjs]) env.Append(LINKFLAGS=['--pre-js', prejs.path]) diff --git a/platform/javascript/http_client.h.inc b/platform/javascript/http_client.h.inc new file mode 100644 index 0000000000..9e4edf7848 --- /dev/null +++ b/platform/javascript/http_client.h.inc @@ -0,0 +1,48 @@ +/*************************************************************************/ +/* http_client.h.inc */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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. */ +/*************************************************************************/ + +// HTTPClient's additional private members in the javascript platform + +Error prepare_request(Method p_method, const String &p_url, const Vector<String> &p_headers); + +int xhr_id; +int read_limit; +int response_read_offset; +Status status; + +String host; +int port; +bool use_tls; +String username; +String password; + +int polled_response_code; +String polled_response_header; +PoolByteArray polled_response; diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp new file mode 100644 index 0000000000..0b105dcb40 --- /dev/null +++ b/platform/javascript/http_client_javascript.cpp @@ -0,0 +1,282 @@ +/*************************************************************************/ +/* http_client_javascript.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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 "http_request.h" +#include "io/http_client.h" + +Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, bool p_verify_host) { + + close(); + if (p_ssl && !p_verify_host) { + WARN_PRINT("Disabling HTTPClient's host verification is not supported for the HTML5 platform, host will be verified"); + } + + host = p_host; + if (host.begins_with("http://")) { + host.replace_first("http://", ""); + } else if (host.begins_with("https://")) { + host.replace_first("https://", ""); + } + + status = host.is_valid_ip_address() ? STATUS_CONNECTING : STATUS_RESOLVING; + port = p_port; + use_tls = p_ssl; + return OK; +} + +void HTTPClient::set_connection(const Ref<StreamPeer> &p_connection) { + + ERR_EXPLAIN("Accessing an HTTPClient's StreamPeer is not supported for the HTML5 platform"); + ERR_FAIL(); +} + +Ref<StreamPeer> HTTPClient::get_connection() const { + + ERR_EXPLAIN("Accessing an HTTPClient's StreamPeer is not supported for the HTML5 platform"); + ERR_FAIL_V(REF()); +} + +Error HTTPClient::prepare_request(Method p_method, const String &p_url, const Vector<String> &p_headers) { + + ERR_FAIL_INDEX_V(p_method, METHOD_MAX, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(host.empty(), ERR_UNCONFIGURED); + ERR_FAIL_COND_V(port < 0, ERR_UNCONFIGURED); + + static const char *_methods[HTTPClient::METHOD_MAX] = { + "GET", + "HEAD", + "POST", + "PUT", + "DELETE", + "OPTIONS", + "TRACE", + "CONNECT" + }; + + String url = (use_tls ? "https://" : "http://") + host + ":" + itos(port) + "/" + p_url; + godot_xhr_reset(xhr_id); + godot_xhr_open(xhr_id, _methods[p_method], url.utf8().get_data(), + username.empty() ? NULL : username.utf8().get_data(), + password.empty() ? NULL : password.utf8().get_data()); + + for (int i = 0; i < p_headers.size(); i++) { + int header_separator = p_headers[i].find(": "); + ERR_FAIL_COND_V(header_separator < 0, ERR_INVALID_PARAMETER); + godot_xhr_set_request_header(xhr_id, + p_headers[i].left(header_separator).utf8().get_data(), + p_headers[i].right(header_separator + 2).utf8().get_data()); + } + response_read_offset = 0; + status = STATUS_REQUESTING; + return OK; +} + +Error HTTPClient::request_raw(Method p_method, const String &p_url, const Vector<String> &p_headers, const PoolVector<uint8_t> &p_body) { + + Error err = prepare_request(p_method, p_url, p_headers); + if (err != OK) + return err; + PoolByteArray::Read read = p_body.read(); + godot_xhr_send_data(xhr_id, read.ptr(), p_body.size()); + return OK; +} + +Error HTTPClient::request(Method p_method, const String &p_url, const Vector<String> &p_headers, const String &p_body) { + + Error err = prepare_request(p_method, p_url, p_headers); + if (err != OK) + return err; + godot_xhr_send_string(xhr_id, p_body.utf8().get_data()); + return OK; +} + +void HTTPClient::close() { + + host = ""; + port = -1; + use_tls = false; + status = STATUS_DISCONNECTED; + polled_response.resize(0); + polled_response_code = 0; + polled_response_header = String(); + godot_xhr_reset(xhr_id); +} + +HTTPClient::Status HTTPClient::get_status() const { + + return status; +} + +bool HTTPClient::has_response() const { + + return !polled_response_header.empty(); +} + +bool HTTPClient::is_response_chunked() const { + + // TODO evaluate using moz-chunked-arraybuffer, fetch & ReadableStream + return false; +} + +int HTTPClient::get_response_code() const { + + return polled_response_code; +} + +Error HTTPClient::get_response_headers(List<String> *r_response) { + + if (!polled_response_header.size()) + return ERR_INVALID_PARAMETER; + + Vector<String> header_lines = polled_response_header.split("\r\n", false); + for (int i = 0; i < header_lines.size(); ++i) { + r_response->push_back(header_lines[i]); + } + polled_response_header = String(); + return OK; +} + +int HTTPClient::get_response_body_length() const { + + return polled_response.size(); +} + +PoolByteArray HTTPClient::read_response_body_chunk() { + + ERR_FAIL_COND_V(status != STATUS_BODY, PoolByteArray()); + + int to_read = MIN(read_limit, polled_response.size() - response_read_offset); + PoolByteArray chunk; + chunk.resize(to_read); + PoolByteArray::Write write = chunk.write(); + PoolByteArray::Read read = polled_response.read(); + memcpy(write.ptr(), read.ptr() + response_read_offset, to_read); + write = PoolByteArray::Write(); + read = PoolByteArray::Read(); + response_read_offset += to_read; + + if (response_read_offset == polled_response.size()) { + status = STATUS_CONNECTED; + polled_response.resize(0); + polled_response_code = 0; + polled_response_header = String(); + godot_xhr_reset(xhr_id); + } + + return chunk; +} + +void HTTPClient::set_blocking_mode(bool p_enable) { + + ERR_EXPLAIN("HTTPClient blocking mode is not supported for the HTML5 platform"); + ERR_FAIL_COND(p_enable); +} + +bool HTTPClient::is_blocking_mode_enabled() const { + + return false; +} + +void HTTPClient::set_read_chunk_size(int p_size) { + + read_limit = p_size; +} + +Error HTTPClient::poll() { + + switch (status) { + + case STATUS_DISCONNECTED: + return ERR_UNCONFIGURED; + + case STATUS_RESOLVING: + status = STATUS_CONNECTING; + return OK; + + case STATUS_CONNECTING: + status = STATUS_CONNECTED; + return OK; + + case STATUS_CONNECTED: + case STATUS_BODY: + return OK; + + case STATUS_CONNECTION_ERROR: + return ERR_CONNECTION_ERROR; + + case STATUS_REQUESTING: + polled_response_code = godot_xhr_get_status(xhr_id); + int response_length = godot_xhr_get_response_length(xhr_id); + if (response_length == 0) { + godot_xhr_ready_state_t ready_state = godot_xhr_get_ready_state(xhr_id); + if (ready_state == XHR_READY_STATE_HEADERS_RECEIVED || ready_state == XHR_READY_STATE_LOADING) { + return OK; + } else { + status = STATUS_CONNECTION_ERROR; + return ERR_CONNECTION_ERROR; + } + } + + status = STATUS_BODY; + + PoolByteArray bytes; + int len = godot_xhr_get_response_headers_length(xhr_id); + bytes.resize(len); + PoolByteArray::Write write = bytes.write(); + godot_xhr_get_response_headers(xhr_id, reinterpret_cast<char *>(write.ptr()), len); + write = PoolByteArray::Write(); + + PoolByteArray::Read read = bytes.read(); + polled_response_header = String::utf8(reinterpret_cast<const char *>(read.ptr())); + read = PoolByteArray::Read(); + + polled_response.resize(response_length); + write = polled_response.write(); + godot_xhr_get_response(xhr_id, write.ptr(), response_length); + write = PoolByteArray::Write(); + break; + } + return OK; +} + +HTTPClient::HTTPClient() { + + xhr_id = godot_xhr_new(); + read_limit = 4096; + status = STATUS_DISCONNECTED; + port = -1; + use_tls = false; + polled_response_code = 0; +} + +HTTPClient::~HTTPClient() { + + godot_xhr_free(xhr_id); +} diff --git a/platform/javascript/http_request.h b/platform/javascript/http_request.h new file mode 100644 index 0000000000..06d9239004 --- /dev/null +++ b/platform/javascript/http_request.h @@ -0,0 +1,74 @@ +/*************************************************************************/ +/* http_request.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 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. */ +/*************************************************************************/ +#ifndef HTTP_REQUEST_H +#define HTTP_REQUEST_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stddef.h" + +typedef enum { + XHR_READY_STATE_UNSENT = 0, + XHR_READY_STATE_OPENED = 1, + XHR_READY_STATE_HEADERS_RECEIVED = 2, + XHR_READY_STATE_LOADING = 3, + XHR_READY_STATE_DONE = 4, +} godot_xhr_ready_state_t; + +extern int godot_xhr_new(); +extern void godot_xhr_reset(int p_xhr_id); +extern bool godot_xhr_free(int p_xhr_id); + +extern int godot_xhr_open(int p_xhr_id, const char *p_method, const char *p_url, const char *p_user = NULL, const char *p_password = NULL); + +extern void godot_xhr_set_request_header(int p_xhr_id, const char *p_header, const char *p_value); + +extern void godot_xhr_send_null(int p_xhr_id); +extern void godot_xhr_send_string(int p_xhr_id, const char *p_data); +extern void godot_xhr_send_data(int p_xhr_id, const void *p_data, int p_len); +extern void godot_xhr_abort(int p_xhr_id); + +/* this is an HTTPClient::ResponseCode, not ::Status */ +extern int godot_xhr_get_status(int p_xhr_id); +extern godot_xhr_ready_state_t godot_xhr_get_ready_state(int p_xhr_id); + +extern int godot_xhr_get_response_headers_length(int p_xhr_id); +extern void godot_xhr_get_response_headers(int p_xhr_id, char *r_dst, int p_len); + +extern int godot_xhr_get_response_length(int p_xhr_id); +extern void godot_xhr_get_response(int p_xhr_id, void *r_dst, int p_len); + +#ifdef __cplusplus +} +#endif + +#endif /* HTTP_REQUEST_H */ diff --git a/platform/javascript/http_request.js b/platform/javascript/http_request.js new file mode 100644 index 0000000000..f30240b41b --- /dev/null +++ b/platform/javascript/http_request.js @@ -0,0 +1,145 @@ +/*************************************************************************/ +/* http_request.js */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/*************************************************************************/ +var GodotHTTPRequest = { + + $GodotHTTPRequest: { + + requests: [], + + getUnusedRequestId: function() { + var idMax = GodotHTTPRequest.requests.length; + for (var potentialId = 0; potentialId < idMax; ++potentialId) { + if (GodotHTTPRequest.requests[potentialId] instanceof XMLHttpRequest) { + continue; + } + return potentialId; + } + GodotHTTPRequest.requests.push(null) + return idMax; + }, + + setupRequest: function(xhr) { + xhr.responseType = 'arraybuffer'; + }, + }, + + godot_xhr_new: function() { + var newId = GodotHTTPRequest.getUnusedRequestId(); + GodotHTTPRequest.requests[newId] = new XMLHttpRequest; + GodotHTTPRequest.setupRequest(GodotHTTPRequest.requests[newId]); + return newId; + }, + + godot_xhr_reset: function(xhrId) { + GodotHTTPRequest.requests[xhrId] = new XMLHttpRequest; + GodotHTTPRequest.setupRequest(GodotHTTPRequest.requests[xhrId]); + }, + + godot_xhr_free: function(xhrId) { + GodotHTTPRequest.requests[xhrId].abort(); + GodotHTTPRequest.requests[xhrId] = null; + }, + + godot_xhr_open: function(xhrId, method, url, user, password) { + user = user > 0 ? UTF8ToString(user) : null; + password = password > 0 ? UTF8ToString(password) : null; + GodotHTTPRequest.requests[xhrId].open(UTF8ToString(method), UTF8ToString(url), true, user, password); + }, + + godot_xhr_set_request_header: function(xhrId, header, value) { + GodotHTTPRequest.requests[xhrId].setRequestHeader(UTF8ToString(header), UTF8ToString(value)); + }, + + godot_xhr_send_null: function(xhrId) { + GodotHTTPRequest.requests[xhrId].send(); + }, + + godot_xhr_send_string: function(xhrId, strPtr) { + if (!strPtr) { + Module.printErr("Failed to send string per XHR: null pointer"); + return; + } + GodotHTTPRequest.requests[xhrId].send(UTF8ToString(strPtr)); + }, + + godot_xhr_send_data: function(xhrId, ptr, len) { + if (!ptr) { + Module.printErr("Failed to send data per XHR: null pointer"); + return; + } + if (len < 0) { + Module.printErr("Failed to send data per XHR: buffer length less than 0"); + return; + } + GodotHTTPRequest.requests[xhrId].send(HEAPU8.subarray(ptr, ptr + len)); + }, + + godot_xhr_abort: function(xhrId) { + GodotHTTPRequest.requests[xhrId].abort(); + }, + + godot_xhr_get_status: function(xhrId) { + return GodotHTTPRequest.requests[xhrId].status; + }, + + godot_xhr_get_ready_state: function(xhrId) { + return GodotHTTPRequest.requests[xhrId].readyState; + }, + + godot_xhr_get_response_headers_length: function(xhrId) { + var headers = GodotHTTPRequest.requests[xhrId].getAllResponseHeaders(); + return headers === null ? 0 : lengthBytesUTF8(headers); + }, + + godot_xhr_get_response_headers: function(xhrId, dst, len) { + var str = GodotHTTPRequest.requests[xhrId].getAllResponseHeaders(); + if (str === null) + return; + var buf = new Uint8Array(len + 1); + stringToUTF8Array(str, buf, 0, buf.length); + buf = buf.subarray(0, -1); + HEAPU8.set(buf, dst); + }, + + godot_xhr_get_response_length: function(xhrId) { + var body = GodotHTTPRequest.requests[xhrId].response; + return body === null ? 0 : body.byteLength; + }, + + godot_xhr_get_response: function(xhrId, dst, len) { + var buf = GodotHTTPRequest.requests[xhrId].response; + if (buf === null) + return; + buf = new Uint8Array(buf).subarray(0, len); + HEAPU8.set(buf, dst); + }, +}; + +autoAddDeps(GodotHTTPRequest, "$GodotHTTPRequest"); +mergeInto(LibraryManager.library, GodotHTTPRequest); diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index e5bdcec30d..77d81aec5d 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -29,8 +29,8 @@ /*************************************************************************/ #include "os_javascript.h" +#include "core/engine.h" #include "core/io/file_access_buffered_fa.h" -#include "core/project_settings.h" #include "dom_keys.h" #include "drivers/gles3/rasterizer_gles3.h" #include "drivers/unix/dir_access_unix.h" @@ -166,14 +166,15 @@ static EM_BOOL _mousebutton_callback(int event_type, const EmscriptenMouseEvent } int mask = _input->get_mouse_button_mask(); + int button_flag = 1 << (ev->get_button_index() - 1); if (ev->is_pressed()) { // since the event is consumed, focus manually if (!is_canvas_focused()) { focus_canvas(); } - mask |= ev->get_button_index(); - } else if (mask & ev->get_button_index()) { - mask &= ~ev->get_button_index(); + mask |= button_flag; + } else if (mask & button_flag) { + mask &= ~button_flag; } else { // release event, but press was outside the canvas, so ignore return false; @@ -513,7 +514,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i #ifdef JAVASCRIPT_EVAL_ENABLED javascript_eval = memnew(JavaScript); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval)); + Engine::get_singleton()->add_singleton(Engine::Singleton("JavaScript", javascript_eval)); #endif visual_server->init(); @@ -895,7 +896,6 @@ String OS_JavaScript::get_data_dir() const { return get_data_dir_func(); */ return "/userfs"; - //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); }; String OS_JavaScript::get_executable_path() const { diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 31032659b6..c24bd98bf6 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -84,8 +84,15 @@ def configure(env): else: # 64-bit, default basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" - env['CC'] = basecmd + "cc" - env['CXX'] = basecmd + "c++" + ccache_path = os.environ.get("CCACHE") + if ccache_path == None: + env['CC'] = basecmd + "cc" + env['CXX'] = basecmd + "c++" + else: + # there aren't any ccache wrappers available for OS X cross-compile, + # to enable caching we need to prepend the path to the ccache binary + env['CC'] = ccache_path + ' ' + basecmd + "cc" + env['CXX'] = ccache_path + ' ' + basecmd + "c++" env['AR'] = basecmd + "ar" env['RANLIB'] = basecmd + "ranlib" env['AS'] = basecmd + "as" diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 64b6d202a1..8571f0dc65 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -165,7 +165,7 @@ Error ContextGL_Win::initialize() { WGL_CONTEXT_MAJOR_VERSION_ARB, 3, //we want a 3.3 context WGL_CONTEXT_MINOR_VERSION_ARB, 3, //and it shall be forward compatible so that we can only use up to date functionality - WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB | _WGL_CONTEXT_DEBUG_BIT_ARB, + WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB /*| _WGL_CONTEXT_DEBUG_BIT_ARB*/, 0 }; //zero indicates the end of the array diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index b41ba7f590..fa45c61f68 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -178,6 +178,12 @@ CanvasItemMaterial::LightMode CanvasItemMaterial::get_light_mode() const { void CanvasItemMaterial::_validate_property(PropertyInfo &property) const { } +RID CanvasItemMaterial::get_shader_rid() const { + + ERR_FAIL_COND_V(!shader_map.has(current_key), RID()); + return shader_map[current_key].shader; +} + void CanvasItemMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_blend_mode", "blend_mode"), &CanvasItemMaterial::set_blend_mode); diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index cb8ee761e6..1a043c204f 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -121,6 +121,8 @@ public: static void finish_shaders(); static void flush_changes(); + RID get_shader_rid() const; + CanvasItemMaterial(); virtual ~CanvasItemMaterial(); }; diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index c0ca358717..bc70feaffb 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -410,7 +410,7 @@ static bool planeBoxOverlap(Vector3 normal, float d, Vector3 maxbox) { rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \ if (min > rad || max < -rad) return false; -/*======================== Z-tests ========================*/ + /*======================== Z-tests ========================*/ #define AXISTEST_Z12(a, b, fa, fb) \ p1 = a * v1.x - b * v1.y; \ @@ -891,7 +891,7 @@ void GIProbe::_fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z, Bak } } -Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_color) { +Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_color_mul, const Color &p_color_add) { Vector<Color> ret; @@ -899,7 +899,7 @@ Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_colo ret.resize(bake_texture_size * bake_texture_size); for (int i = 0; i < bake_texture_size * bake_texture_size; i++) { - ret[i] = p_color; + ret[i] = p_color_add; } return ret; @@ -919,9 +919,10 @@ Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_colo for (int i = 0; i < bake_texture_size * bake_texture_size; i++) { Color c; - c.r = (r[i * 4 + 0] / 255.0) * p_color.r; - c.g = (r[i * 4 + 1] / 255.0) * p_color.g; - c.b = (r[i * 4 + 2] / 255.0) * p_color.b; + c.r = (r[i * 4 + 0] / 255.0) * p_color_mul.r + p_color_add.r; + c.g = (r[i * 4 + 1] / 255.0) * p_color_mul.g + p_color_add.g; + c.b = (r[i * 4 + 2] / 255.0) * p_color_mul.b + p_color_add.b; + c.a = r[i * 4 + 3] / 255.0; ret[i] = c; @@ -951,17 +952,15 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater if (albedo_tex.is_valid()) { img_albedo = albedo_tex->get_data(); + mc.albedo = _get_bake_texture(img_albedo, mat->get_albedo(), Color(0, 0, 0)); // albedo texture, color is multiplicative } else { + mc.albedo = _get_bake_texture(img_albedo, Color(1, 1, 1), mat->get_albedo()); // no albedo texture, color is additive } - mc.albedo = _get_bake_texture(img_albedo, mat->get_albedo()); - - Ref<ImageTexture> emission_tex = mat->get_texture(SpatialMaterial::TEXTURE_EMISSION); + Ref<Texture> emission_tex = mat->get_texture(SpatialMaterial::TEXTURE_EMISSION); Color emission_col = mat->get_emission(); - emission_col.r *= mat->get_emission_energy(); - emission_col.g *= mat->get_emission_energy(); - emission_col.b *= mat->get_emission_energy(); + float emission_energy = mat->get_emission_energy(); Ref<Image> img_emission; @@ -970,13 +969,17 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater img_emission = emission_tex->get_data(); } - mc.emission = _get_bake_texture(img_emission, emission_col); + if (mat->get_emission_operator() == SpatialMaterial::EMISSION_OP_ADD) { + mc.emission = _get_bake_texture(img_emission, Color(1, 1, 1) * emission_energy, emission_col * emission_energy); + } else { + mc.emission = _get_bake_texture(img_emission, emission_col * emission_energy, Color(0, 0, 0)); + } } else { Ref<Image> empty; - mc.albedo = _get_bake_texture(empty, Color(0.7, 0.7, 0.7)); - mc.emission = _get_bake_texture(empty, Color(0, 0, 0)); + mc.albedo = _get_bake_texture(empty, Color(0, 0, 0), Color(1, 1, 1)); + mc.emission = _get_bake_texture(empty, Color(0, 0, 0), Color(0, 0, 0)); } p_baker->material_cache[p_material] = mc; diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index 50d0c33d4f..8f13960b67 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -178,7 +178,7 @@ private: int color_scan_cell_width; int bake_texture_size; - Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color); + Vector<Color> _get_bake_texture(Ref<Image> p_image, const Color &p_color_mul, const Color &p_color_add); Baker::MaterialCache _get_material_cache(Ref<Material> p_material, Baker *p_baker); void _plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, const Vector3 *p_vtx, const Vector2 *p_uv, const Baker::MaterialCache &p_material, const Rect3 &p_aabb, Baker *p_baker); void _plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material); diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 80b7748078..6be3ff88d9 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -545,7 +545,14 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, f } else { - next_pos = Math::fposmod(next_pos, len); + float looped_next_pos = Math::fposmod(next_pos, len); + if (looped_next_pos == 0 && next_pos != 0) { + // Loop multiples of the length to it, rather than 0 + // so state at time=length is previewable in the editor + next_pos = len; + } else { + next_pos = looped_next_pos; + } } cd.pos = next_pos; diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp index 058b162e83..08b01c6a4c 100644 --- a/scene/audio/audio_player.cpp +++ b/scene/audio/audio_player.cpp @@ -31,20 +31,7 @@ #include "engine.h" -void AudioStreamPlayer::_mix_audio() { - - if (!stream_playback.is_valid()) { - return; - } - - if (!active) { - return; - } - - if (setseek >= 0.0) { - stream_playback->start(setseek); - setseek = -1.0; //reset seek - } +void AudioStreamPlayer::_mix_internal(bool p_fadeout) { int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus); @@ -52,19 +39,24 @@ void AudioStreamPlayer::_mix_audio() { AudioFrame *buffer = mix_buffer.ptr(); int buffer_size = mix_buffer.size(); + if (p_fadeout) { + buffer_size = MIN(buffer_size, 16); //short fadeout ramp + } + //mix stream_playback->mix(buffer, 1.0, buffer_size); //multiply volume interpolating to avoid clicks if this changes + float target_volume = p_fadeout ? -80.0 : volume_db; float vol = Math::db2linear(mix_volume_db); - float vol_inc = (Math::db2linear(volume_db) - vol) / float(buffer_size); + float vol_inc = (Math::db2linear(target_volume) - vol) / float(buffer_size); for (int i = 0; i < buffer_size; i++) { buffer[i] *= vol; vol += vol_inc; } //set volume for next mix - mix_volume_db = volume_db; + mix_volume_db = target_volume; AudioFrame *targets[4] = { NULL, NULL, NULL, NULL }; @@ -95,6 +87,30 @@ void AudioStreamPlayer::_mix_audio() { } } +void AudioStreamPlayer::_mix_audio() { + + if (!stream_playback.is_valid()) { + return; + } + + if (!active) { + return; + } + + if (setseek >= 0.0) { + if (stream_playback->is_playing()) { + + //fade out to avoid pops + _mix_internal(true); + } + stream_playback->start(setseek); + setseek = -1.0; //reset seek + mix_volume_db = volume_db; //reset ramp + } + + _mix_internal(false); +} + void AudioStreamPlayer::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { @@ -163,7 +179,7 @@ float AudioStreamPlayer::get_volume_db() const { void AudioStreamPlayer::play(float p_from_pos) { if (stream_playback.is_valid()) { - mix_volume_db = volume_db; //reset volume ramp + //mix_volume_db = volume_db; do not reset volume ramp here, can cause clicks setseek = p_from_pos; active = true; set_process_internal(true); diff --git a/scene/audio/audio_player.h b/scene/audio/audio_player.h index 4bfc44730d..6e9d623433 100644 --- a/scene/audio/audio_player.h +++ b/scene/audio/audio_player.h @@ -59,6 +59,7 @@ private: MixTarget mix_target; + void _mix_internal(bool p_fadeout); void _mix_audio(); static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer *>(self)->_mix_audio(); } diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 623a110263..e9e9dcc859 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -754,7 +754,7 @@ void ItemList::_notification(int p_what) { int width = size.width - bg->get_minimum_size().width; if (scroll_bar->is_visible()) { - width -= mw + bg->get_margin(MARGIN_RIGHT); + width -= mw; } draw_style_box(bg, Rect2(Point2(), size)); @@ -1107,7 +1107,7 @@ void ItemList::_notification(int p_what) { } for (int i = 0; i < separators.size(); i++) { - draw_line(Vector2(bg->get_margin(MARGIN_LEFT), base_ofs.y + separators[i]), Vector2(size.width - bg->get_margin(MARGIN_RIGHT), base_ofs.y + separators[i]), guide_color); + draw_line(Vector2(bg->get_margin(MARGIN_LEFT), base_ofs.y + separators[i]), Vector2(width, base_ofs.y + separators[i]), guide_color); } } } diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 1ad1e3f638..9022d67a4a 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -347,12 +347,11 @@ void ScrollContainer::update_scrollbars() { } else { v_scroll->show(); + v_scroll->set_max(min.height); + v_scroll->set_page(size.height - hmin.height); scroll.y = v_scroll->get_value(); } - v_scroll->set_max(min.height); - v_scroll->set_page(size.height - hmin.height); - if (!scroll_h || min.width <= size.width - vmin.width) { h_scroll->hide(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f4876668f6..6da34cd263 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -894,17 +894,18 @@ void TextEdit::_notification(int p_what) { is_hex_notation = false; } - // check for dot or 'x' for hex notation in floating point number - if ((str[j] == '.' || str[j] == 'x') && !in_word && prev_is_number && !is_number) { + // check for dot or underscore or 'x' for hex notation in floating point number + if ((str[j] == '.' || str[j] == 'x' || str[j] == '_') && !in_word && prev_is_number && !is_number) { is_number = true; is_symbol = false; + is_char = false; if (str[j] == 'x' && str[j - 1] == '0') { is_hex_notation = true; } } - if (!in_word && _is_char(str[j])) { + if (!in_word && _is_char(str[j]) && !is_number) { in_word = true; } @@ -3668,6 +3669,11 @@ void TextEdit::set_readonly(bool p_readonly) { readonly = p_readonly; } +bool TextEdit::is_readonly() const { + + return readonly; +} + void TextEdit::set_wrap(bool p_wrap) { wrap = p_wrap; @@ -3900,7 +3906,12 @@ void TextEdit::select(int p_from_line, int p_from_column, int p_to_line, int p_t update(); } - +void TextEdit::swap_lines(int line1, int line2) { + String tmp = get_line(line1); + String tmp2 = get_line(line2); + set_line(line2, tmp); + set_line(line1, tmp2); +} bool TextEdit::is_selection_active() const { return selection.active; @@ -4914,6 +4925,8 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("cursor_is_block_mode"), &TextEdit::cursor_is_block_mode); ClassDB::bind_method(D_METHOD("set_readonly", "enable"), &TextEdit::set_readonly); + ClassDB::bind_method(D_METHOD("is_readonly"), &TextEdit::is_readonly); + ClassDB::bind_method(D_METHOD("set_wrap", "enable"), &TextEdit::set_wrap); ClassDB::bind_method(D_METHOD("set_max_chars", "amount"), &TextEdit::set_max_chars); ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &TextEdit::set_context_menu_enabled); @@ -4964,6 +4977,8 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("menu_option", "option"), &TextEdit::menu_option); ClassDB::bind_method(D_METHOD("get_menu"), &TextEdit::get_menu); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "readonly"), "set_readonly", "is_readonly"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_current_line"), "set_highlight_current_line", "is_highlight_current_line_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), "set_syntax_coloring", "is_syntax_coloring_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), "set_show_line_numbers", "is_show_line_numbers_enabled"); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 094474b264..50f005ed6a 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -448,6 +448,7 @@ public: bool cursor_is_block_mode() const; void set_readonly(bool p_readonly); + bool is_readonly() const; void set_max_chars(int p_max_chars); void set_wrap(bool p_wrap); @@ -463,6 +464,7 @@ public: void select_all(); void select(int p_from_line, int p_from_column, int p_to_line, int p_to_column); void deselect(); + void swap_lines(int line1, int line2); void set_search_text(const String &p_search_text); void set_search_flags(uint32_t p_flags); diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 190ccd50d5..1b6bd30b58 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -42,44 +42,127 @@ void VideoPlayer::sp_set_mix_rate(int p_rate) { server_mix_rate = p_rate; } -bool VideoPlayer::sp_mix(int32_t *p_buffer, int p_frames) { - - if (resampler.is_ready()) { +bool VideoPlayer::mix(AudioFrame *p_buffer, int p_frames) { + + // Check the amount resampler can really handle. + // If it cannot, wait "wait_resampler_phase_limit" times. + // This mechanism contributes to smoother pause/unpause operation. + if (p_frames <= resampler.get_num_of_ready_frames() || + wait_resampler_limit <= wait_resampler) { + wait_resampler = 0; return resampler.mix(p_buffer, p_frames); } - + wait_resampler++; return false; } -int VideoPlayer::_audio_mix_callback(void *p_udata, const int16_t *p_data, int p_frames) { +// Called from main thread (eg VideoStreamPlaybackWebm::update) +int VideoPlayer::_audio_mix_callback(void *p_udata, const float *p_data, int p_frames) { VideoPlayer *vp = (VideoPlayer *)p_udata; - int todo = MIN(vp->resampler.get_todo(), p_frames); + int todo = MIN(vp->resampler.get_writer_space(), p_frames); - int16_t *wb = vp->resampler.get_write_buffer(); + float *wb = vp->resampler.get_write_buffer(); int c = vp->resampler.get_channel_count(); for (int i = 0; i < todo * c; i++) { wb[i] = p_data[i]; } vp->resampler.write(todo); + return todo; } +// Called from audio thread +void VideoPlayer::_mix_audio() { + + if (!stream.is_valid()) { + return; + } + if (!playback.is_valid() || !playback->is_playing() || playback->is_paused()) { + return; + } + + AudioFrame *buffer = mix_buffer.ptr(); + int buffer_size = mix_buffer.size(); + + // Resample + if (!mix(buffer, buffer_size)) + return; + + AudioFrame vol = AudioFrame(volume, volume); + + // Copy to server's audio buffer + switch (AudioServer::get_singleton()->get_speaker_mode()) { + + case AudioServer::SPEAKER_MODE_STEREO: { + AudioFrame *target = AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 0); + + for (int j = 0; j < buffer_size; j++) { + + target[j] += buffer[j] * vol; + } + + } break; + case AudioServer::SPEAKER_SURROUND_51: { + + AudioFrame *targets[2] = { + AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 1), + AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 2), + }; + + for (int j = 0; j < buffer_size; j++) { + + AudioFrame frame = buffer[j] * vol; + targets[0][j] = frame; + targets[1][j] = frame; + } + } break; + case AudioServer::SPEAKER_SURROUND_71: { + + AudioFrame *targets[3] = { + AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 1), + AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 2), + AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 3) + }; + + for (int j = 0; j < buffer_size; j++) { + + AudioFrame frame = buffer[j] * vol; + targets[0][j] += frame; + targets[1][j] += frame; + targets[2][j] += frame; + } + + } break; + } +} + void VideoPlayer::_notification(int p_notification) { switch (p_notification) { case NOTIFICATION_ENTER_TREE: { + AudioServer::get_singleton()->add_callback(_mix_audios, this); + if (stream.is_valid() && autoplay && !Engine::get_singleton()->is_editor_hint()) { play(); } + + } break; + + case NOTIFICATION_EXIT_TREE: { + + AudioServer::get_singleton()->remove_callback(_mix_audios, this); + } break; case NOTIFICATION_INTERNAL_PROCESS: { + bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus); + if (stream.is_null()) return; if (paused) @@ -87,10 +170,11 @@ void VideoPlayer::_notification(int p_notification) { if (!playback->is_playing()) return; - double audio_time = USEC_TO_SEC(OS::get_singleton()->get_ticks_usec()); //AudioServer::get_singleton()->get_mix_time(); + double audio_time = USEC_TO_SEC(OS::get_singleton()->get_ticks_usec()); double delta = last_audio_time == 0 ? 0 : audio_time - last_audio_time; last_audio_time = audio_time; + if (delta == 0) return; @@ -135,6 +219,9 @@ bool VideoPlayer::has_expand() const { void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) { stop(); + AudioServer::get_singleton()->lock(); + mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size()); + AudioServer::get_singleton()->unlock(); stream = p_stream; if (stream.is_valid()) { @@ -309,6 +396,40 @@ bool VideoPlayer::has_autoplay() const { return autoplay; }; +void VideoPlayer::set_bus(const StringName &p_bus) { + + //if audio is active, must lock this + AudioServer::get_singleton()->lock(); + bus = p_bus; + AudioServer::get_singleton()->unlock(); +} + +StringName VideoPlayer::get_bus() const { + + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (AudioServer::get_singleton()->get_bus_name(i) == bus) { + return bus; + } + } + return "Master"; +} + +void VideoPlayer::_validate_property(PropertyInfo &property) const { + + if (property.name == "bus") { + + String options; + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (i > 0) + options += ","; + String name = AudioServer::get_singleton()->get_bus_name(i); + options += name; + } + + property.hint_string = options; + } +} + void VideoPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_stream", "stream"), &VideoPlayer::set_stream); @@ -345,6 +466,9 @@ void VideoPlayer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_buffering_msec", "msec"), &VideoPlayer::set_buffering_msec); ClassDB::bind_method(D_METHOD("get_buffering_msec"), &VideoPlayer::get_buffering_msec); + ClassDB::bind_method(D_METHOD("set_bus", "bus"), &VideoPlayer::set_bus); + ClassDB::bind_method(D_METHOD("get_bus"), &VideoPlayer::get_bus); + ClassDB::bind_method(D_METHOD("get_video_texture"), &VideoPlayer::get_video_texture); ADD_PROPERTY(PropertyInfo(Variant::INT, "audio_track", PROPERTY_HINT_RANGE, "0,128,1"), "set_audio_track", "get_audio_track"); @@ -354,6 +478,7 @@ void VideoPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "has_autoplay"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused"), "set_paused", "is_paused"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand"), "set_expand", "has_expand"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); } VideoPlayer::VideoPlayer() { @@ -372,6 +497,9 @@ VideoPlayer::VideoPlayer() { // internal_stream.player=this; // stream_rid=AudioServer::get_singleton()->audio_stream_create(&internal_stream); last_audio_time = 0; + + wait_resampler = 0; + wait_resampler_limit = 2; }; VideoPlayer::~VideoPlayer() { diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index f04e90365f..74e2f14e58 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -33,17 +33,24 @@ #include "scene/gui/control.h" #include "scene/resources/video_stream.h" #include "servers/audio/audio_rb_resampler.h" +#include "servers/audio_server.h" class VideoPlayer : public Control { GDCLASS(VideoPlayer, Control); + struct Output { + + AudioFrame vol; + int bus_index; + Viewport *viewport; //pointer only used for reference to previous mix + }; Ref<VideoStreamPlayback> playback; Ref<VideoStream> stream; int sp_get_channel_count() const; void sp_set_mix_rate(int p_rate); //notify the stream of the mix rate - bool sp_mix(int32_t *p_buffer, int p_frames); + bool mix(AudioFrame *p_buffer, int p_frames); RID stream_rid; @@ -51,6 +58,8 @@ class VideoPlayer : public Control { Ref<Image> last_frame; AudioRBResampler resampler; + Vector<AudioFrame> mix_buffer; + int wait_resampler, wait_resampler_limit; bool paused; bool autoplay; @@ -61,12 +70,18 @@ class VideoPlayer : public Control { int buffering_ms; int server_mix_rate; int audio_track; + int bus_index; + + StringName bus; - static int _audio_mix_callback(void *p_udata, const int16_t *p_data, int p_frames); + void _mix_audio(); + static int _audio_mix_callback(void *p_udata, const float *p_data, int p_frames); + static void _mix_audios(void *self) { reinterpret_cast<VideoPlayer *>(self)->_mix_audio(); } protected: static void _bind_methods(); void _notification(int p_notification); + void _validate_property(PropertyInfo &property) const; public: Size2 get_minimum_size() const; @@ -104,6 +119,9 @@ public: void set_buffering_msec(int p_msec); int get_buffering_msec() const; + void set_bus(const StringName &p_bus); + StringName get_bus() const; + VideoPlayer(); ~VideoPlayer(); }; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index e6e11de177..d38c688241 100755 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2067,7 +2067,7 @@ int Node::get_position_in_parent() const { return data.pos; } -Node *Node::_duplicate(int p_flags) const { +Node *Node::duplicate(int p_flags) const { Node *node = NULL; @@ -2170,17 +2170,6 @@ Node *Node::_duplicate(int p_flags) const { return node; } -Node *Node::duplicate(int p_flags) const { - - Node *dupe = _duplicate(p_flags); - - if (dupe && (p_flags & DUPLICATE_SIGNALS)) { - _duplicate_signals(this, dupe); - } - - return dupe; -} - void Node::_duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p_reown_map) const { if (get_owner() != get_parent()->get_owner()) @@ -2422,7 +2411,9 @@ void Node::_replace_connections_target(Node *p_new_target) { if (c.flags & CONNECT_PERSIST) { c.source->disconnect(c.signal, this, c.method); - ERR_CONTINUE(!p_new_target->has_method(c.method)); + bool valid = p_new_target->has_method(c.method) || p_new_target->get_script().is_null() || Ref<Script>(p_new_target->get_script())->has_method(c.method); + ERR_EXPLAIN("Attempt to connect signal \'" + c.source->get_class() + "." + c.signal + "\' to nonexistent method \'" + c.target->get_class() + "." + c.method + "\'"); + ERR_CONTINUE(!valid); c.source->connect(c.signal, p_new_target, c.method, c.binds, c.flags); } } diff --git a/scene/main/node.h b/scene/main/node.h index c43e96063f..e8901f7b6e 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -169,7 +169,6 @@ private: void _duplicate_signals(const Node *p_original, Node *p_copy) const; void _duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p_reown_map) const; - Node *_duplicate(int p_flags) const; Array _get_children() const; Array _get_groups() const; diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index fdc3b79db6..f81f460521 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -31,17 +31,23 @@ void AudioStreamPlaybackSample::start(float p_from_pos) { - for (int i = 0; i < 2; i++) { - ima_adpcm[i].step_index = 0; - ima_adpcm[i].predictor = 0; - ima_adpcm[i].loop_step_index = 0; - ima_adpcm[i].loop_predictor = 0; - ima_adpcm[i].last_nibble = -1; - ima_adpcm[i].loop_pos = 0x7FFFFFFF; - ima_adpcm[i].window_ofs = 0; + if (base->format == AudioStreamSample::FORMAT_IMA_ADPCM) { + //no seeking in IMA_ADPCM + for (int i = 0; i < 2; i++) { + ima_adpcm[i].step_index = 0; + ima_adpcm[i].predictor = 0; + ima_adpcm[i].loop_step_index = 0; + ima_adpcm[i].loop_predictor = 0; + ima_adpcm[i].last_nibble = -1; + ima_adpcm[i].loop_pos = 0x7FFFFFFF; + ima_adpcm[i].window_ofs = 0; + } + + offset = 0; + } else { + seek(p_from_pos); } - seek(p_from_pos); sign = 1; active = true; } @@ -373,6 +379,14 @@ void AudioStreamPlaybackSample::mix(AudioFrame *p_buffer, float p_rate_scale, in dst_buff += target; } + + if (todo) { + //bit was missing from mix + int todo_ofs = p_frames - todo; + for (int i = todo_ofs; i < p_frames; i++) { + p_buffer[i] = AudioFrame(0, 0); + } + } } float AudioStreamPlaybackSample::get_length() const { diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index ce439fece6..cd28c9d203 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -836,39 +836,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_constant("autohide", "HSplitContainer", 1 * scale); theme->set_constant("autohide", "VSplitContainer", 1 * scale); - // HButtonArray - theme->set_stylebox("normal", "HButtonArray", sb_button_normal); - theme->set_stylebox("selected", "HButtonArray", sb_button_pressed); - theme->set_stylebox("hover", "HButtonArray", sb_button_hover); - - theme->set_font("font", "HButtonArray", default_font); - theme->set_font("font_selected", "HButtonArray", default_font); - - theme->set_color("font_color", "HButtonArray", control_font_color_low); - theme->set_color("font_color_selected", "HButtonArray", control_font_color_hover); - - theme->set_constant("icon_separator", "HButtonArray", 2 * scale); - theme->set_constant("button_separator", "HButtonArray", 4 * scale); - - theme->set_stylebox("focus", "HButtonArray", focus); - - // VButtonArray - - theme->set_stylebox("normal", "VButtonArray", sb_button_normal); - theme->set_stylebox("selected", "VButtonArray", sb_button_pressed); - theme->set_stylebox("hover", "VButtonArray", sb_button_hover); - - theme->set_font("font", "VButtonArray", default_font); - theme->set_font("font_selected", "VButtonArray", default_font); - - theme->set_color("font_color", "VButtonArray", control_font_color_low); - theme->set_color("font_color_selected", "VButtonArray", control_font_color_hover); - - theme->set_constant("icon_separator", "VButtonArray", 2 * scale); - theme->set_constant("button_separator", "VButtonArray", 4 * scale); - - theme->set_stylebox("focus", "VButtonArray", focus); - // ReferenceRect Ref<StyleBoxTexture> ttnc = make_stylebox(full_panel_bg_png, 8, 8, 8, 8); diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index 91263fb125..4aa47cb664 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -333,8 +333,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { //blit to image and texture { - - Image img(tex.texture_size, tex.texture_size, 0, Image::FORMAT_LA8, tex.imgdata); + Ref<Image> img = memnew(Image(tex.texture_size, tex.texture_size, 0, Image::FORMAT_LA8, tex.imgdata)); if (tex.texture.is_null()) { tex.texture.instance(); @@ -518,7 +517,7 @@ bool ResourceFormatLoaderDynamicFont::handles_type(const String &p_type) const { String ResourceFormatLoaderDynamicFont::get_resource_type(const String &p_path) const { - String el = p_path.extension().to_lower(); + String el = p_path.get_extension().to_lower(); if (el == "ttf") return "DynamicFontData"; return ""; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 232f690074..fe59450f2e 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1184,7 +1184,8 @@ Environment::Environment() { bg_energy = 1.0; bg_canvas_max_layer = 0; ambient_energy = 1.0; - ambient_sky_contribution = 1.0; + //ambient_sky_contribution = 1.0; + set_ambient_light_sky_contribution(1.0); tone_mapper = TONE_MAPPER_LINEAR; tonemap_exposure = 1.0; diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 12434b39fa..286840656b 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -723,7 +723,11 @@ void SpatialMaterial::_update_shader() { } else { code += "\tvec3 emission_tex = texture(texture_emission,base_uv).rgb;\n"; } - code += "\tEMISSION = (emission.rgb+emission_tex)*emission_energy;\n"; + if (emission_op == EMISSION_OP_ADD) { + code += "\tEMISSION = (emission.rgb+emission_tex)*emission_energy;\n"; + } else { + code += "\tEMISSION = (emission.rgb*emission_tex)*emission_energy;\n"; + } } if (features[FEATURE_REFRACTION] && !flags[FLAG_UV1_USE_TRIPLANAR]) { //refraction not supported with triplanar @@ -1635,6 +1639,19 @@ float SpatialMaterial::get_distance_fade_min_distance() const { return distance_fade_min_distance; } +void SpatialMaterial::set_emission_operator(EmissionOperator p_op) { + + if (emission_op == p_op) + return; + emission_op = p_op; + _queue_shader_change(); +} + +SpatialMaterial::EmissionOperator SpatialMaterial::get_emission_operator() const { + + return emission_op; +} + RID SpatialMaterial::get_shader_rid() const { ERR_FAIL_COND_V(!shader_map.has(current_key), RID()); @@ -1769,6 +1786,9 @@ void SpatialMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_grow", "amount"), &SpatialMaterial::set_grow); ClassDB::bind_method(D_METHOD("get_grow"), &SpatialMaterial::get_grow); + ClassDB::bind_method(D_METHOD("set_emission_operator", "operator"), &SpatialMaterial::set_emission_operator); + ClassDB::bind_method(D_METHOD("get_emission_operator"), &SpatialMaterial::get_emission_operator); + ClassDB::bind_method(D_METHOD("set_ao_light_affect", "amount"), &SpatialMaterial::set_ao_light_affect); ClassDB::bind_method(D_METHOD("get_ao_light_affect"), &SpatialMaterial::get_ao_light_affect); @@ -1854,6 +1874,7 @@ void SpatialMaterial::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "emission_enabled"), "set_feature", "get_feature", FEATURE_EMISSION); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "emission", PROPERTY_HINT_COLOR_NO_ALPHA), "set_emission", "get_emission"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_emission_energy", "get_emission_energy"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "emission_operator", PROPERTY_HINT_ENUM, "Add,Multiply"), "set_emission_operator", "get_emission_operator"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "emission_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_EMISSION); ADD_GROUP("NormalMap", "normal_"); @@ -2022,6 +2043,9 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(TEXTURE_CHANNEL_BLUE); BIND_ENUM_CONSTANT(TEXTURE_CHANNEL_ALPHA); BIND_ENUM_CONSTANT(TEXTURE_CHANNEL_GRAYSCALE); + + BIND_ENUM_CONSTANT(EMISSION_OP_ADD); + BIND_ENUM_CONSTANT(EMISSION_OP_MULTIPLY); } SpatialMaterial::SpatialMaterial() @@ -2057,6 +2081,7 @@ SpatialMaterial::SpatialMaterial() set_particles_anim_v_frames(1); set_particles_anim_loop(false); set_alpha_scissor_threshold(0.98); + emission_op = EMISSION_OP_ADD; proximity_fade_enabled = false; distance_fade_enabled = false; diff --git a/scene/resources/material.h b/scene/resources/material.h index 2425f1a174..877d4dfd41 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -215,6 +215,11 @@ public: TEXTURE_CHANNEL_GRAYSCALE }; + enum EmissionOperator { + EMISSION_OP_ADD, + EMISSION_OP_MULTIPLY + }; + private: union MaterialKey { @@ -234,6 +239,7 @@ private: uint64_t grow : 1; uint64_t proximity_fade : 1; uint64_t distance_fade : 1; + uint64_t emission_op : 1; }; uint64_t key; @@ -278,6 +284,7 @@ private: mk.grow = grow_enabled; mk.proximity_fade = proximity_fade_enabled; mk.distance_fade = distance_fade_enabled; + mk.emission_op = emission_op; return mk; } @@ -394,6 +401,7 @@ private: SpecularMode specular_mode; DiffuseMode diffuse_mode; BillboardMode billboard_mode; + EmissionOperator emission_op; TextureChannel metallic_texture_channel; TextureChannel roughness_texture_channel; @@ -571,6 +579,9 @@ public: void set_distance_fade_min_distance(float p_distance); float get_distance_fade_min_distance() const; + void set_emission_operator(EmissionOperator p_op); + EmissionOperator get_emission_operator() const; + void set_metallic_texture_channel(TextureChannel p_channel); TextureChannel get_metallic_texture_channel() const; void set_roughness_texture_channel(TextureChannel p_channel); @@ -603,6 +614,7 @@ VARIANT_ENUM_CAST(SpatialMaterial::DiffuseMode) VARIANT_ENUM_CAST(SpatialMaterial::SpecularMode) VARIANT_ENUM_CAST(SpatialMaterial::BillboardMode) VARIANT_ENUM_CAST(SpatialMaterial::TextureChannel) +VARIANT_ENUM_CAST(SpatialMaterial::EmissionOperator) ////////////////////// diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index db5d87d703..3e86daf3a7 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -574,7 +574,6 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { ERR_FAIL_COND_V(!d.has("format"), false); uint32_t format = d["format"]; - ERR_FAIL_COND_V(!d.has("primitive"), false); uint32_t primitive = d["primitive"]; ERR_FAIL_COND_V(!d.has("vertex_count"), false); @@ -598,8 +597,8 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { Rect3 aabb = d["aabb"]; Vector<Rect3> bone_aabb; - if (d.has("bone_aabb")) { - Array baabb = d["bone_aabb"]; + if (d.has("skeleton_aabb")) { + Array baabb = d["skeleton_aabb"]; bone_aabb.resize(baabb.size()); for (int i = 0; i < baabb.size(); i++) { @@ -921,6 +920,12 @@ String ArrayMesh::surface_get_name(int p_idx) const { return surfaces[p_idx].name; } +void ArrayMesh::surface_update_region(int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) { + + ERR_FAIL_INDEX(p_surface, surfaces.size()); + VS::get_singleton()->mesh_surface_update_region(mesh, p_surface, p_offset, p_data); +} + void ArrayMesh::surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb) { ERR_FAIL_INDEX(p_idx, surfaces.size()); @@ -1042,6 +1047,7 @@ void ArrayMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("add_surface_from_arrays", "primitive", "arrays", "blend_shapes", "compress_flags"), &ArrayMesh::add_surface_from_arrays, DEFVAL(Array()), DEFVAL(ARRAY_COMPRESS_DEFAULT)); ClassDB::bind_method(D_METHOD("get_surface_count"), &ArrayMesh::get_surface_count); ClassDB::bind_method(D_METHOD("surface_remove", "surf_idx"), &ArrayMesh::surface_remove); + ClassDB::bind_method(D_METHOD("surface_update_region", "surf_idx", "offset", "data"), &ArrayMesh::surface_update_region); ClassDB::bind_method(D_METHOD("surface_get_array_len", "surf_idx"), &ArrayMesh::surface_get_array_len); ClassDB::bind_method(D_METHOD("surface_get_array_index_len", "surf_idx"), &ArrayMesh::surface_get_array_index_len); ClassDB::bind_method(D_METHOD("surface_get_format", "surf_idx"), &ArrayMesh::surface_get_format); @@ -1090,6 +1096,14 @@ void ArrayMesh::_bind_methods() { BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX); } +void ArrayMesh::reload_from_file() { + for (int i = 0; i < get_surface_count(); i++) { + surface_remove(i); + } + Resource::reload_from_file(); + String path = get_path(); +} + ArrayMesh::ArrayMesh() { mesh = VisualServer::get_singleton()->mesh_create(); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index f4edb258b6..75927079c7 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -95,6 +95,7 @@ public: ARRAY_FLAG_USE_2D_VERTICES = ARRAY_COMPRESS_INDEX << 1, ARRAY_FLAG_USE_16_BIT_BONES = ARRAY_COMPRESS_INDEX << 2, + ARRAY_FLAG_USE_DYNAMIC_UPDATE = ARRAY_COMPRESS_INDEX << 3, ARRAY_COMPRESS_DEFAULT = ARRAY_COMPRESS_VERTEX | ARRAY_COMPRESS_NORMAL | ARRAY_COMPRESS_TANGENT | ARRAY_COMPRESS_COLOR | ARRAY_COMPRESS_TEX_UV | ARRAY_COMPRESS_TEX_UV2 | ARRAY_COMPRESS_WEIGHTS @@ -185,6 +186,8 @@ public: void set_blend_shape_mode(BlendShapeMode p_mode); BlendShapeMode get_blend_shape_mode() const; + void surface_update_region(int p_surface, int p_offset, const PoolVector<uint8_t> &p_data); + int get_surface_count() const; void surface_remove(int p_idx); @@ -213,6 +216,8 @@ public: void center_geometry(); void regen_normalmaps(); + virtual void reload_from_file(); + ArrayMesh(); ~ArrayMesh(); diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index ba356d89b1..8e3899315c 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -1299,14 +1299,16 @@ void QuadMesh::_create_mesh_array(Array &p_arr) const { tangents.resize(4 * 4); uvs.resize(4); - for (int i = 0; i < 4; i++) { + Vector2 _size = Vector2(size.x / 2.0f, size.y / 2.0f); - static const Vector3 quad_faces[4] = { - Vector3(-1, -1, 0), - Vector3(-1, 1, 0), - Vector3(1, 1, 0), - Vector3(1, -1, 0), - }; + Vector3 quad_faces[4] = { + Vector3(-_size.x, -_size.y, 0), + Vector3(-_size.x, _size.y, 0), + Vector3(_size.x, _size.y, 0), + Vector3(_size.x, -_size.y, 0), + }; + + for (int i = 0; i < 4; i++) { faces.set(i, quad_faces[i]); normals.set(i, Vector3(0, 0, 1)); @@ -1325,18 +1327,30 @@ void QuadMesh::_create_mesh_array(Array &p_arr) const { uvs.set(i, quad_uv[i]); } - p_arr[ARRAY_VERTEX] = faces; - p_arr[ARRAY_NORMAL] = normals; - p_arr[ARRAY_TANGENT] = tangents; - p_arr[ARRAY_TEX_UV] = uvs; + p_arr[VS::ARRAY_VERTEX] = faces; + p_arr[VS::ARRAY_NORMAL] = normals; + p_arr[VS::ARRAY_TANGENT] = tangents; + p_arr[VS::ARRAY_TEX_UV] = uvs; }; void QuadMesh::_bind_methods() { - // nothing here yet... + ClassDB::bind_method(D_METHOD("set_size", "size"), &QuadMesh::set_size); + ClassDB::bind_method(D_METHOD("get_size"), &QuadMesh::get_size); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size"); } QuadMesh::QuadMesh() { primitive_type = PRIMITIVE_TRIANGLE_FAN; + size = Size2(1.0, 1.0); +} + +void QuadMesh::set_size(const Size2 &p_size) { + size = p_size; + _request_update(); +} + +Size2 QuadMesh::get_size() const { + return size; } /** diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 38a5695883..f0c8935261 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -263,7 +263,7 @@ class QuadMesh : public PrimitiveMesh { GDCLASS(QuadMesh, PrimitiveMesh) private: - // nothing? really? Maybe add size some day atleast... :) + Size2 size; protected: static void _bind_methods(); @@ -271,6 +271,9 @@ protected: public: QuadMesh(); + + void set_size(const Size2 &p_size); + Size2 get_size() const; }; /** diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index 3f79858056..fbe52909e7 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -40,7 +40,7 @@ protected: static void _bind_methods(); public: - typedef int (*AudioMixCallback)(void *p_udata, const int16_t *p_data, int p_frames); + typedef int (*AudioMixCallback)(void *p_udata, const float *p_data, int p_frames); virtual void stop() = 0; virtual void play() = 0; @@ -48,7 +48,7 @@ public: virtual bool is_playing() const = 0; virtual void set_paused(bool p_paused) = 0; - virtual bool is_paused(bool p_paused) const = 0; + virtual bool is_paused() const = 0; virtual void set_loop(bool p_enable) = 0; virtual bool has_loop() const = 0; diff --git a/servers/arvr/arvr_interface.cpp b/servers/arvr/arvr_interface.cpp index 55707def7c..458459a843 100644 --- a/servers/arvr/arvr_interface.cpp +++ b/servers/arvr/arvr_interface.cpp @@ -43,7 +43,7 @@ void ARVRInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tracking_status"), &ARVRInterface::get_tracking_status); - ClassDB::bind_method(D_METHOD("get_recommended_render_targetsize"), &ARVRInterface::get_recommended_render_targetsize); + ClassDB::bind_method(D_METHOD("get_render_targetsize"), &ARVRInterface::get_render_targetsize); ClassDB::bind_method(D_METHOD("is_stereo"), &ARVRInterface::is_stereo); ADD_GROUP("Interface", "interface_"); diff --git a/servers/arvr/arvr_interface.h b/servers/arvr/arvr_interface.h index 880f6e4595..1599c1a64f 100644 --- a/servers/arvr/arvr_interface.h +++ b/servers/arvr/arvr_interface.h @@ -103,7 +103,7 @@ public: /** rendering and internal **/ - virtual Size2 get_recommended_render_targetsize() = 0; /* returns the recommended render target size per eye for this device */ + virtual Size2 get_render_targetsize() = 0; /* returns the recommended render target size per eye for this device */ virtual bool is_stereo() = 0; /* returns true if this interface requires stereo rendering (for VR HMDs) or mono rendering (for mobile AR) */ virtual Transform get_transform_for_eye(ARVRInterface::Eyes p_eye, const Transform &p_cam_transform) = 0; /* get each eyes camera transform, also implement EYE_MONO */ virtual CameraMatrix get_projection_for_eye(ARVRInterface::Eyes p_eye, real_t p_aspect, real_t p_z_near, real_t p_z_far) = 0; /* get each eyes projection matrix */ diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index ede080b424..1e73d6753c 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -49,15 +49,13 @@ void ARVRServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_interface_count"), &ARVRServer::get_interface_count); ClassDB::bind_method(D_METHOD("get_interface", "idx"), &ARVRServer::get_interface); + ClassDB::bind_method(D_METHOD("get_interfaces"), &ARVRServer::get_interfaces); ClassDB::bind_method(D_METHOD("find_interface", "name"), &ARVRServer::find_interface); ClassDB::bind_method(D_METHOD("get_tracker_count"), &ARVRServer::get_tracker_count); ClassDB::bind_method(D_METHOD("get_tracker", "idx"), &ARVRServer::get_tracker); ClassDB::bind_method(D_METHOD("set_primary_interface", "interface"), &ARVRServer::set_primary_interface); - ClassDB::bind_method(D_METHOD("add_interface", "interface"), &ARVRServer::add_interface); - ClassDB::bind_method(D_METHOD("remove_interface", "interface"), &ARVRServer::remove_interface); - BIND_ENUM_CONSTANT(TRACKER_CONTROLLER); BIND_ENUM_CONSTANT(TRACKER_BASESTATION); BIND_ENUM_CONSTANT(TRACKER_ANCHOR); @@ -191,6 +189,21 @@ Ref<ARVRInterface> ARVRServer::find_interface(const String &p_name) const { return interfaces[idx]; }; +Array ARVRServer::get_interfaces() const { + Array ret; + + for (int i = 0; i < interfaces.size(); i++) { + Dictionary iface_info; + + iface_info["id"] = i; + iface_info["name"] = interfaces[i]->get_name(); + + ret.push_back(iface_info); + }; + + return ret; +}; + /* A little extra info on the tracker ids, these are unique per tracker type so we get soem consistency in recognising our trackers, specifically controllers. diff --git a/servers/arvr_server.h b/servers/arvr_server.h index 948895cb27..9b84ee2e99 100644 --- a/servers/arvr_server.h +++ b/servers/arvr_server.h @@ -137,6 +137,7 @@ public: int get_interface_count() const; Ref<ARVRInterface> get_interface(int p_index) const; Ref<ARVRInterface> find_interface(const String &p_name) const; + Array get_interfaces() const; /* note, more then one interface can technically be active, especially on mobile, but only one interface is used for diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp index 113e356612..b0b94a1f49 100644 --- a/servers/audio/audio_rb_resampler.cpp +++ b/servers/audio/audio_rb_resampler.cpp @@ -28,6 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "audio_rb_resampler.h" +#include "core/math/math_funcs.h" +#include "os/os.h" +#include "servers/audio_server.h" int AudioRBResampler::get_channel_count() const { @@ -37,8 +40,11 @@ int AudioRBResampler::get_channel_count() const { return channels; } +// Linear interpolation based sample rate convertion (low quality) +// Note that AudioStreamPlaybackResampled::mix has better algorithm, +// but it wasn't obvious to integrate that with VideoPlayer template <int C> -uint32_t AudioRBResampler::_resample(int32_t *p_dest, int p_todo, int32_t p_increment) { +uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_increment) { uint32_t read = offset & MIX_FRAC_MASK; @@ -47,186 +53,128 @@ uint32_t AudioRBResampler::_resample(int32_t *p_dest, int p_todo, int32_t p_incr offset = (offset + p_increment) & (((1 << (rb_bits + MIX_FRAC_BITS)) - 1)); read += p_increment; uint32_t pos = offset >> MIX_FRAC_BITS; - uint32_t frac = offset & MIX_FRAC_MASK; -#ifndef FAST_AUDIO + float frac = float(offset & MIX_FRAC_MASK) / float(MIX_FRAC_LEN); ERR_FAIL_COND_V(pos >= rb_len, 0); -#endif uint32_t pos_next = (pos + 1) & rb_mask; - //printf("rb pos %i\n",pos); // since this is a template with a known compile time value (C), conditionals go away when compiling. if (C == 1) { - int32_t v0 = rb[pos]; - int32_t v0n = rb[pos_next]; -#ifndef FAST_AUDIO - v0 += (v0n - v0) * (int32_t)frac >> MIX_FRAC_BITS; -#endif - v0 <<= 16; - p_dest[i] = v0; + float v0 = rb[pos]; + float v0n = rb[pos_next]; + v0 += (v0n - v0) * frac; + p_dest[i] = AudioFrame(v0, v0); } + if (C == 2) { - int32_t v0 = rb[(pos << 1) + 0]; - int32_t v1 = rb[(pos << 1) + 1]; - int32_t v0n = rb[(pos_next << 1) + 0]; - int32_t v1n = rb[(pos_next << 1) + 1]; - -#ifndef FAST_AUDIO - v0 += (v0n - v0) * (int32_t)frac >> MIX_FRAC_BITS; - v1 += (v1n - v1) * (int32_t)frac >> MIX_FRAC_BITS; -#endif - v0 <<= 16; - v1 <<= 16; - p_dest[(i << 1) + 0] = v0; - p_dest[(i << 1) + 1] = v1; + float v0 = rb[(pos << 1) + 0]; + float v1 = rb[(pos << 1) + 1]; + float v0n = rb[(pos_next << 1) + 0]; + float v1n = rb[(pos_next << 1) + 1]; + + v0 += (v0n - v0) * frac; + v1 += (v1n - v1) * frac; + p_dest[i] = AudioFrame(v0, v1); } + // For now, channels higher than stereo are almost ignored if (C == 4) { - int32_t v0 = rb[(pos << 2) + 0]; - int32_t v1 = rb[(pos << 2) + 1]; - int32_t v2 = rb[(pos << 2) + 2]; - int32_t v3 = rb[(pos << 2) + 3]; - int32_t v0n = rb[(pos_next << 2) + 0]; - int32_t v1n = rb[(pos_next << 2) + 1]; - int32_t v2n = rb[(pos_next << 2) + 2]; - int32_t v3n = rb[(pos_next << 2) + 3]; - -#ifndef FAST_AUDIO - v0 += (v0n - v0) * (int32_t)frac >> MIX_FRAC_BITS; - v1 += (v1n - v1) * (int32_t)frac >> MIX_FRAC_BITS; - v2 += (v2n - v2) * (int32_t)frac >> MIX_FRAC_BITS; - v3 += (v3n - v3) * (int32_t)frac >> MIX_FRAC_BITS; -#endif - v0 <<= 16; - v1 <<= 16; - v2 <<= 16; - v3 <<= 16; - p_dest[(i << 2) + 0] = v0; - p_dest[(i << 2) + 1] = v1; - p_dest[(i << 2) + 2] = v2; - p_dest[(i << 2) + 3] = v3; + float v0 = rb[(pos << 2) + 0]; + float v1 = rb[(pos << 2) + 1]; + float v2 = rb[(pos << 2) + 2]; + float v3 = rb[(pos << 2) + 3]; + float v0n = rb[(pos_next << 2) + 0]; + float v1n = rb[(pos_next << 2) + 1]; + float v2n = rb[(pos_next << 2) + 2]; + float v3n = rb[(pos_next << 2) + 3]; + + v0 += (v0n - v0) * frac; + v1 += (v1n - v1) * frac; + v2 += (v2n - v2) * frac; + v3 += (v3n - v3) * frac; + p_dest[i] = AudioFrame(v0, v1); } if (C == 6) { - int32_t v0 = rb[(pos * 6) + 0]; - int32_t v1 = rb[(pos * 6) + 1]; - int32_t v2 = rb[(pos * 6) + 2]; - int32_t v3 = rb[(pos * 6) + 3]; - int32_t v4 = rb[(pos * 6) + 4]; - int32_t v5 = rb[(pos * 6) + 5]; - int32_t v0n = rb[(pos_next * 6) + 0]; - int32_t v1n = rb[(pos_next * 6) + 1]; - int32_t v2n = rb[(pos_next * 6) + 2]; - int32_t v3n = rb[(pos_next * 6) + 3]; - int32_t v4n = rb[(pos_next * 6) + 4]; - int32_t v5n = rb[(pos_next * 6) + 5]; - -#ifndef FAST_AUDIO - v0 += (v0n - v0) * (int32_t)frac >> MIX_FRAC_BITS; - v1 += (v1n - v1) * (int32_t)frac >> MIX_FRAC_BITS; - v2 += (v2n - v2) * (int32_t)frac >> MIX_FRAC_BITS; - v3 += (v3n - v3) * (int32_t)frac >> MIX_FRAC_BITS; - v4 += (v4n - v4) * (int32_t)frac >> MIX_FRAC_BITS; - v5 += (v5n - v5) * (int32_t)frac >> MIX_FRAC_BITS; -#endif - v0 <<= 16; - v1 <<= 16; - v2 <<= 16; - v3 <<= 16; - v4 <<= 16; - v5 <<= 16; - p_dest[(i * 6) + 0] = v0; - p_dest[(i * 6) + 1] = v1; - p_dest[(i * 6) + 2] = v2; - p_dest[(i * 6) + 3] = v3; - p_dest[(i * 6) + 4] = v4; - p_dest[(i * 6) + 5] = v5; + float v0 = rb[(pos * 6) + 0]; + float v1 = rb[(pos * 6) + 1]; + float v2 = rb[(pos * 6) + 2]; + float v3 = rb[(pos * 6) + 3]; + float v4 = rb[(pos * 6) + 4]; + float v5 = rb[(pos * 6) + 5]; + float v0n = rb[(pos_next * 6) + 0]; + float v1n = rb[(pos_next * 6) + 1]; + float v2n = rb[(pos_next * 6) + 2]; + float v3n = rb[(pos_next * 6) + 3]; + float v4n = rb[(pos_next * 6) + 4]; + float v5n = rb[(pos_next * 6) + 5]; + + p_dest[i] = AudioFrame(v0, v1); } } - return read >> MIX_FRAC_BITS; //rb_read_pos=offset>>MIX_FRAC_BITS; + return read >> MIX_FRAC_BITS; //rb_read_pos = offset >> MIX_FRAC_BITS; } -bool AudioRBResampler::mix(int32_t *p_dest, int p_frames) { +bool AudioRBResampler::mix(AudioFrame *p_dest, int p_frames) { if (!rb) return false; - int write_pos_cache = rb_write_pos; - int32_t increment = (src_mix_rate * MIX_FRAC_LEN) / target_mix_rate; - - int rb_todo; - - if (write_pos_cache == rb_read_pos) { - return false; //out of buffer - - } else if (rb_read_pos < write_pos_cache) { - - rb_todo = write_pos_cache - rb_read_pos; //-1? - } else { - - rb_todo = (rb_len - rb_read_pos) + write_pos_cache; //-1? - } - - int todo = MIN(((int64_t(rb_todo) << MIX_FRAC_BITS) / increment) + 1, p_frames); + int read_space = get_reader_space(); + int target_todo = MIN(get_num_of_ready_frames(), p_frames); { - - int read = 0; + int src_read = 0; switch (channels) { - case 1: read = _resample<1>(p_dest, todo, increment); break; - case 2: read = _resample<2>(p_dest, todo, increment); break; - case 4: read = _resample<4>(p_dest, todo, increment); break; - case 6: read = _resample<6>(p_dest, todo, increment); break; + case 1: src_read = _resample<1>(p_dest, target_todo, increment); break; + case 2: src_read = _resample<2>(p_dest, target_todo, increment); break; + case 4: src_read = _resample<4>(p_dest, target_todo, increment); break; + case 6: src_read = _resample<6>(p_dest, target_todo, increment); break; } - //end of stream, fadeout - int remaining = p_frames - todo; - if (remaining && todo > 0) { - - //print_line("fadeout"); - for (uint32_t c = 0; c < channels; c++) { + if (src_read > read_space) + src_read = read_space; - for (int i = 0; i < todo; i++) { + rb_read_pos = (rb_read_pos + src_read) & rb_mask; - int32_t samp = p_dest[i * channels + c] >> 8; - uint32_t mul = (todo - i) * 256 / todo; - //print_line("mul: "+itos(i)+" "+itos(mul)); - p_dest[i * channels + c] = samp * mul; - } + // Create fadeout effect for the end of stream (note that it can be because of slow writer) + if (p_frames - target_todo > 0) { + for (int i = 0; i < target_todo; i++) { + p_dest[i] = p_dest[i] * float(target_todo - i) / float(target_todo); } } - //zero out what remains there to avoid glitches - for (uint32_t i = todo * channels; i < int(p_frames) * channels; i++) { - - p_dest[i] = 0; + // Fill zeros (silence) for the rest of frames + for (uint32_t i = target_todo; i < p_frames; i++) { + p_dest[i] = AudioFrame(0, 0); } - - if (read > rb_todo) - read = rb_todo; - - rb_read_pos = (rb_read_pos + read) & rb_mask; } return true; } +int AudioRBResampler::get_num_of_ready_frames() { + if (!is_ready()) + return 0; + int32_t increment = (src_mix_rate * MIX_FRAC_LEN) / target_mix_rate; + int read_space = get_reader_space(); + return (int64_t(read_space) << MIX_FRAC_BITS) / increment; +} + Error AudioRBResampler::setup(int p_channels, int p_src_mix_rate, int p_target_mix_rate, int p_buffer_msec, int p_minbuff_needed) { ERR_FAIL_COND_V(p_channels != 1 && p_channels != 2 && p_channels != 4 && p_channels != 6, ERR_INVALID_PARAMETER); - //float buffering_sec = int(GLOBAL_DEF("audio/stream_buffering_ms",500))/1000.0; int desired_rb_bits = nearest_shift(MAX((p_buffer_msec / 1000.0) * p_src_mix_rate, p_minbuff_needed)); bool recreate = !rb; if (rb && (uint32_t(desired_rb_bits) != rb_bits || channels != uint32_t(p_channels))) { - //recreate memdelete_arr(rb); memdelete_arr(read_buf); @@ -239,8 +187,8 @@ Error AudioRBResampler::setup(int p_channels, int p_src_mix_rate, int p_target_m rb_bits = desired_rb_bits; rb_len = (1 << rb_bits); rb_mask = rb_len - 1; - rb = memnew_arr(int16_t, rb_len * p_channels); - read_buf = memnew_arr(int16_t, rb_len * p_channels); + rb = memnew_arr(float, rb_len *p_channels); + read_buf = memnew_arr(float, rb_len *p_channels); } src_mix_rate = p_src_mix_rate; diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h index bc1f924ab5..08c7a5a668 100644 --- a/servers/audio/audio_rb_resampler.h +++ b/servers/audio/audio_rb_resampler.h @@ -31,6 +31,7 @@ #define AUDIO_RB_RESAMPLER_H #include "os/memory.h" +#include "servers/audio_server.h" #include "typedefs.h" struct AudioRBResampler { @@ -53,11 +54,11 @@ struct AudioRBResampler { MIX_FRAC_MASK = MIX_FRAC_LEN - 1, }; - int16_t *read_buf; - int16_t *rb; + float *read_buf; + float *rb; template <int C> - uint32_t _resample(int32_t *p_dest, int p_todo, int32_t p_increment); + uint32_t _resample(AudioFrame *p_dest, int p_todo, int32_t p_increment); public: _FORCE_INLINE_ void flush() { @@ -71,33 +72,48 @@ public: } _FORCE_INLINE_ int get_total() const { - return rb_len - 1; } - _FORCE_INLINE_ int get_todo() const { //return amount of frames to mix - - int todo; - int read_pos_cache = rb_read_pos; + _FORCE_INLINE_ int get_writer_space() const { + int space, r, w; - if (read_pos_cache == rb_write_pos) { - todo = rb_len - 1; - } else if (read_pos_cache > rb_write_pos) { + r = rb_read_pos; + w = rb_write_pos; - todo = read_pos_cache - rb_write_pos - 1; + if (r == w) { + space = rb_len - 1; + } else if (w < r) { + space = r - w - 1; } else { + space = (rb_len - r) + w - 1; + } + + return space; + } + + _FORCE_INLINE_ int get_reader_space() const { + int space, r, w; - todo = (rb_len - rb_write_pos) + read_pos_cache - 1; + r = rb_read_pos; + w = rb_write_pos; + + if (r == w) { + space = 0; + } else if (w < r) { + space = rb_len - r + w; + } else { + space = w - r; } - return todo; + return space; } _FORCE_INLINE_ bool has_data() const { return rb && rb_read_pos != rb_write_pos; } - _FORCE_INLINE_ int16_t *get_write_buffer() { return read_buf; } + _FORCE_INLINE_ float *get_write_buffer() { return read_buf; } _FORCE_INLINE_ void write(uint32_t p_frames) { ERR_FAIL_COND(p_frames >= rb_len); @@ -151,7 +167,8 @@ public: Error setup(int p_channels, int p_src_mix_rate, int p_target_mix_rate, int p_buffer_msec, int p_minbuff_needed = -1); void clear(); - bool mix(int32_t *p_dest, int p_frames); + bool mix(AudioFrame *p_dest, int p_frames); + int get_num_of_ready_frames(); AudioRBResampler(); ~AudioRBResampler(); diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 697abead68..6a10d7539d 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -876,6 +876,8 @@ void AudioServer::init() { #ifdef TOOLS_ENABLED set_edited(false); //avoid editors from thinking this was edited #endif + + GLOBAL_DEF("audio/video_delay_compensation_ms", 0); } void AudioServer::load_default_bus_layout() { diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index 76fb5bc46b..88cd728a94 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -678,6 +678,7 @@ void PhysicsServer::_bind_methods() { BIND_ENUM_CONSTANT(BODY_MODE_STATIC); BIND_ENUM_CONSTANT(BODY_MODE_KINEMATIC); BIND_ENUM_CONSTANT(BODY_MODE_RIGID); + BIND_ENUM_CONSTANT(BODY_MODE_SOFT); BIND_ENUM_CONSTANT(BODY_MODE_CHARACTER); BIND_ENUM_CONSTANT(BODY_PARAM_BOUNCE); diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 1ba9e7b174..99493afc40 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_server_types.h" +#include "engine.h" #include "project_settings.h" #include "arvr/arvr_interface.h" @@ -171,9 +172,9 @@ void unregister_server_types() { } void register_server_singletons() { - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("VisualServer", VisualServer::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("AudioServer", AudioServer::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("PhysicsServer", PhysicsServer::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Physics2DServer", Physics2DServer::get_singleton())); - ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ARVRServer", ARVRServer::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("VisualServer", VisualServer::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("AudioServer", AudioServer::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("PhysicsServer", PhysicsServer::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("Physics2DServer", Physics2DServer::get_singleton())); + Engine::get_singleton()->add_singleton(Engine::Singleton("ARVRServer", ARVRServer::get_singleton())); } diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 164baa8c9b..333fe1e72a 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -242,6 +242,8 @@ public: virtual void mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) = 0; virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const = 0; + virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) = 0; + virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) = 0; virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const = 0; diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 69e2d1c162..9432d3fdd9 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -120,6 +120,8 @@ void VisualServerRaster::draw() { frame_drawn_callbacks.pop_front(); } + + emit_signal("frame_drawn_in_thread"); } void VisualServerRaster::sync() { } diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index b579f4032f..67375e81b6 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -73,521 +73,6 @@ class VisualServerRaster : public VisualServer { List<FrameDrawnCallbacks> frame_drawn_callbacks; -// FIXME: Kept as reference for future implementation -#if 0 - struct Room { - - bool occlude_exterior; - BSP_Tree bounds; - Room() { occlude_exterior=true; } - }; - - - BalloonAllocator<> octree_allocator; - - struct OctreeAllocator { - - static BalloonAllocator<> *allocator; - - _FORCE_INLINE_ static void *alloc(size_t p_size) { return allocator->alloc(p_size); } - _FORCE_INLINE_ static void free(void *p_ptr) { return allocator->free(p_ptr); } - - }; - - struct Portal { - - bool enabled; - float disable_distance; - Color disable_color; - float connect_range; - Vector<Point2> shape; - Rect2 bounds; - - - Portal() { enabled=true; disable_distance=50; disable_color=Color(); connect_range=0.8; } - }; - - struct BakedLight { - - Rasterizer::BakedLightData data; - PoolVector<int> sampler; - Rect3 octree_aabb; - Size2i octree_tex_size; - Size2i light_tex_size; - - }; - - struct BakedLightSampler { - - float params[BAKED_LIGHT_SAMPLER_MAX]; - int resolution; - Vector<Vector3> dp_cache; - - BakedLightSampler() { - params[BAKED_LIGHT_SAMPLER_STRENGTH]=1.0; - params[BAKED_LIGHT_SAMPLER_ATTENUATION]=1.0; - params[BAKED_LIGHT_SAMPLER_RADIUS]=1.0; - params[BAKED_LIGHT_SAMPLER_DETAIL_RATIO]=0.1; - resolution=16; - } - }; - - void _update_baked_light_sampler_dp_cache(BakedLightSampler * blsamp); - struct Camera { - - enum Type { - PERSPECTIVE, - ORTHOGONAL - }; - Type type; - float fov; - float znear,zfar; - float size; - uint32_t visible_layers; - bool vaspect; - RID env; - - Transform transform; - - Camera() { - - visible_layers=0xFFFFFFFF; - fov=60; - type=PERSPECTIVE; - znear=0.1; zfar=100; - size=1.0; - vaspect=false; - - } - }; - - - struct Instance; - typedef Set<Instance*,Comparator<Instance*>,OctreeAllocator> InstanceSet; - struct Scenario; - - struct Instance { - - enum { - - MAX_LIGHTS=4 - }; - - RID self; - OctreeElementID octree_id; - Scenario *scenario; - bool update; - bool update_aabb; - bool update_materials; - Instance *update_next; - InstanceType base_type; - - RID base_rid; - - Rect3 aabb; - Rect3 transformed_aabb; - uint32_t object_ID; - bool visible; - bool visible_in_all_rooms; - uint32_t layer_mask; - float draw_range_begin; - float draw_range_end; - float extra_margin; - - - - Rasterizer::InstanceData data; - - - Set<Instance*> auto_rooms; - Set<Instance*> valid_auto_rooms; - Instance *room; - List<Instance*>::Element *RE; - Instance *baked_light; - List<Instance*>::Element *BLE; - Instance *sampled_light; - bool exterior; - - uint64_t last_render_pass; - uint64_t last_frame_pass; - - uint64_t version; // changes to this, and changes to base increase version - - InstanceSet lights; - bool light_cache_dirty; - - - - struct RoomInfo { - - Transform affine_inverse; - Room *room; - List<Instance*> owned_geometry_instances; - List<Instance*> owned_portal_instances; - List<Instance*> owned_room_instances; - List<Instance*> owned_light_instances; //not used, but just for the sake of it - Set<Instance*> disconnected_child_portals; - Set<Instance*> owned_autoroom_geometry; - uint64_t last_visited_pass; - RoomInfo() { last_visited_pass=0; } - - }; - - struct PortalInfo { - - Portal *portal; - Set<Instance*> candidate_set; - Instance *connected; - uint64_t last_visited_pass; - - Plane plane_cache; - Vector<Vector3> transformed_point_cache; - - - PortalInfo() { connected=NULL; last_visited_pass=0;} - }; - - struct LightInfo { - - RID instance; - int light_set_index; - uint64_t last_version; - uint64_t last_add_pass; - List<RID>::Element *D; // directional light in scenario - InstanceSet affected; - bool enabled; - float dtc; //distance to camera, used for sorting - - - LightInfo() { - - D=NULL; - light_set_index=-1; - last_add_pass=0; - enabled=true; - } - }; - - struct BakedLightInfo { - - BakedLight *baked_light; - Transform affine_inverse; - List<Instance*> owned_instances; - }; - - struct BakedLightSamplerInfo { - - Set<Instance*> baked_lights; - Set<Instance*> owned_instances; - BakedLightSampler *sampler; - int resolution; - Vector<Color> light_buffer; - RID sampled_light; - uint64_t last_pass; - Transform xform; // viewspace normal to lightspace, might not use one. - BakedLightSamplerInfo() { - sampler=NULL; - last_pass=0; - resolution=0; - } - }; - - struct ParticlesInfo { - - RID instance; - }; - - - RoomInfo *room_info; - LightInfo *light_info; - ParticlesInfo *particles_info; - PortalInfo * portal_info; - BakedLightInfo * baked_light_info; - BakedLightSamplerInfo * baked_light_sampler_info; - - - Instance() { - octree_id=0; - update_next=0; - object_ID=0; - last_render_pass=0; - last_frame_pass=0; - light_info=0; - particles_info=0; - update_next=NULL; - update=false; - visible=true; - data.cast_shadows=SHADOW_CASTING_SETTING_ON; - data.receive_shadows=true; - data.depth_scale=false; - data.billboard=false; - data.billboard_y=false; - data.baked_light=NULL; - data.baked_light_octree_xform=NULL; - data.baked_lightmap_id=-1; - version=1; - room_info=NULL; - room=NULL; - RE=NULL; - portal_info=NULL; - exterior=false; - layer_mask=1; - draw_range_begin=0; - draw_range_end=0; - extra_margin=0; - visible_in_all_rooms=false; - update_aabb=false; - update_materials=false; - - baked_light=NULL; - baked_light_info=NULL; - baked_light_sampler_info=NULL; - sampled_light=NULL; - BLE=NULL; - - light_cache_dirty=true; - - } - - ~Instance() { - - if (light_info) - memdelete(light_info); - if (particles_info) - memdelete(particles_info); - if (room_info) - memdelete(room_info); - if (portal_info) - memdelete(portal_info); - if (baked_light_info) - memdelete(baked_light_info); - }; - }; - - struct _InstanceLightsort { - - bool operator()(const Instance* p_A, const Instance* p_B) const { return p_A->light_info->dtc < p_B->light_info->dtc; } - }; - - struct Scenario { - - - ScenarioDebugMode debug; - RID self; - // well wtf, balloon allocator is slower? - typedef ::Octree<Instance,true> Octree; - - Octree octree; - - List<RID> directional_lights; - RID environment; - RID fallback_environment; - - Instance *dirty_instances; - - Scenario() { dirty_instances=NULL; debug=SCENARIO_DEBUG_DISABLED; } - }; - - - - mutable RID_Owner<Rasterizer::ShaderMaterial> canvas_item_material_owner; - - - - struct Viewport { - - RID self; - RID parent; - - VisualServer::ViewportRect rect; - RID camera; - RID scenario; - RID viewport_data; - - RenderTargetUpdateMode render_target_update_mode; - RID render_target; - RID render_target_texture; - - Rect2 rt_to_screen_rect; - - bool hide_scenario; - bool hide_canvas; - bool transparent_bg; - bool queue_capture; - bool render_target_vflip; - bool render_target_clear_on_new_frame; - bool render_target_clear; - bool disable_environment; - - Image capture; - - bool rendered_in_prev_frame; - - struct CanvasKey { - - int layer; - RID canvas; - bool operator<(const CanvasKey& p_canvas) const { if (layer==p_canvas.layer) return canvas < p_canvas.canvas; return layer<p_canvas.layer; } - CanvasKey() { layer=0; } - CanvasKey(const RID& p_canvas, int p_layer) { canvas=p_canvas; layer=p_layer; } - }; - - struct CanvasData { - - Canvas *canvas; - Transform2D transform; - int layer; - }; - - Transform2D global_transform; - - Map<RID,CanvasData> canvas_map; - - SelfList<Viewport> update_list; - - Viewport() : update_list(this) { transparent_bg=false; render_target_update_mode=RENDER_TARGET_UPDATE_WHEN_VISIBLE; queue_capture=false; rendered_in_prev_frame=false; render_target_vflip=false; render_target_clear_on_new_frame=true; render_target_clear=true; disable_environment=false; } - }; - - SelfList<Viewport>::List viewport_update_list; - - Map<RID,int> screen_viewports; - - struct CullRange { - - Plane nearp; - float min,max; - float z_near,z_far; - - void add_aabb(const Rect3& p_aabb) { - - - } - }; - - struct Cursor { - - Point2 pos; - float rot; - RID texture; - Point2 center; - bool visible; - Rect2 region; - Cursor() { - - rot = 0; - visible = false; - region = Rect2(); - }; - }; - - Rect2 canvas_clip; - Color clear_color; - Cursor cursors[MAX_CURSORS]; - RID default_cursor_texture; - - static void* instance_pair(void *p_self, OctreeElementID,Instance *p_A,int, OctreeElementID,Instance *p_B,int); - static void instance_unpair(void *p_self, OctreeElementID,Instance *p_A,int, OctreeElementID,Instance *p_B,int,void*); - - Instance *instance_cull_result[MAX_INSTANCE_CULL]; - Instance *instance_shadow_cull_result[MAX_INSTANCE_CULL]; //used for generating shadowmaps - Instance *light_cull_result[MAX_LIGHTS_CULLED]; - int light_cull_count; - - Instance *exterior_portal_cull_result[MAX_EXTERIOR_PORTALS]; - int exterior_portal_cull_count; - bool exterior_visited; - - Instance *light_sampler_cull_result[MAX_LIGHT_SAMPLERS]; - int light_samplers_culled; - - Instance *room_cull_result[MAX_ROOM_CULL]; - int room_cull_count; - bool room_cull_enabled; - bool light_discard_enabled; - bool shadows_enabled; - int black_margin[4]; - RID black_image[4]; - - Vector<Vector3> aabb_random_points; - Vector<Vector3> transformed_aabb_random_points; - - void _instance_validate_autorooms(Instance *p_geometry); - - void _portal_disconnect(Instance *p_portal,bool p_cleanup=false); - void _portal_attempt_connect(Instance *p_portal); - void _dependency_queue_update(RID p_rid, bool p_update_aabb=false, bool p_update_materials=false); - _FORCE_INLINE_ void _instance_queue_update(Instance *p_instance,bool p_update_aabb=false,bool p_update_materials=false); - void _update_instances(); - void _update_instance_aabb(Instance *p_instance); - void _update_instance(Instance *p_instance); - void _free_attached_instances(RID p_rid,bool p_free_scenario=false); - void _clean_up_owner(RID_OwnerBase *p_owner,String p_type); - - Instance *instance_update_list; - - //RID default_scenario; - //RID default_viewport; - - RID test_cube; - - - mutable RID_Owner<Room> room_owner; - mutable RID_Owner<Portal> portal_owner; - - mutable RID_Owner<BakedLight> baked_light_owner; - mutable RID_Owner<BakedLightSampler> baked_light_sampler_owner; - - mutable RID_Owner<Camera> camera_owner; - mutable RID_Owner<Viewport> viewport_owner; - - mutable RID_Owner<Scenario> scenario_owner; - mutable RID_Owner<Instance> instance_owner; - - mutable RID_Owner<Canvas> canvas_owner; - mutable RID_Owner<CanvasItem> canvas_item_owner; - - Map< RID, Set<RID> > instance_dependency_map; - Map< RID, Set<Instance*> > skeleton_dependency_map; - - - ViewportRect viewport_rect; - _FORCE_INLINE_ void _instance_draw(Instance *p_instance); - - bool _test_portal_cull(Camera *p_camera, Instance *p_portal_from, Instance *p_portal_to); - void _cull_portal(Camera *p_camera, Instance *p_portal,Instance *p_from_portal); - void _cull_room(Camera *p_camera, Instance *p_room,Instance *p_from_portal=NULL); - void _process_sampled_light(const Transform &p_camera, Instance *p_sampled_light, bool p_linear_colorspace); - - void _render_no_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario); - void _render_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario); - static void _render_canvas_item_viewport(VisualServer* p_self,void *p_vp,const Rect2& p_rect); - void _render_canvas_item_tree(CanvasItem *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, const Color &p_modulate, Rasterizer::CanvasLight *p_lights); - void _render_canvas_item(CanvasItem *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, float p_opacity, int p_z, Rasterizer::CanvasItem **z_list, Rasterizer::CanvasItem **z_last_list, CanvasItem *p_canvas_clip, CanvasItem *p_material_owner); - void _render_canvas(Canvas *p_canvas, const Transform2D &p_transform, Rasterizer::CanvasLight *p_lights, Rasterizer::CanvasLight *p_masked_lights); - void _light_mask_canvas_items(int p_z,Rasterizer::CanvasItem *p_canvas_item,Rasterizer::CanvasLight *p_masked_lights); - - Vector<Vector3> _camera_generate_endpoints(Instance *p_light,Camera *p_camera,float p_range_min, float p_range_max); - Vector<Plane> _camera_generate_orthogonal_planes(Instance *p_light,Camera *p_camera,float p_range_min, float p_range_max); - - void _light_instance_update_lispsm_shadow(Instance *p_light,Scenario *p_scenario,Camera *p_camera,const CullRange& p_cull_range); - void _light_instance_update_pssm_shadow(Instance *p_light,Scenario *p_scenario,Camera *p_camera,const CullRange& p_cull_range); - - void _light_instance_update_shadow(Instance *p_light,Scenario *p_scenario,Camera *p_camera,const CullRange& p_cull_range); - - uint64_t render_pass; - int changes; - bool draw_extra_frame; - - void _draw_viewport_camera(Viewport *p_viewport, bool p_ignore_camera); - void _draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ofs_y,int p_parent_w,int p_parent_h); - void _draw_viewports(); - void _draw_cursors_and_margins(); - - - Rasterizer *rasterizer; - -#endif - void _draw_margins(); static void _changes_changed() {} @@ -726,6 +211,8 @@ public: BIND2(mesh_set_blend_shape_mode, RID, BlendShapeMode) BIND1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID) + BIND4(mesh_surface_update_region, RID, int, int, const PoolVector<uint8_t> &) + BIND3(mesh_surface_set_material, RID, int, RID) BIND2RC(RID, mesh_surface_get_material, RID, int) diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 92c431e393..fbf593f5b9 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -268,7 +268,7 @@ void VisualServerViewport::draw_viewports() { if (vp->use_arvr && arvr_interface.is_valid()) { // override our size, make sure it matches our required size - Size2 size = arvr_interface->get_recommended_render_targetsize(); + Size2 size = arvr_interface->get_render_targetsize(); VSG::storage->render_target_set_size(vp->render_target, size.x, size.y); // render mono or left eye first diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 80a1ef3879..1dddef7bd4 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -144,6 +144,8 @@ public: FUNC2(mesh_set_blend_shape_mode, RID, BlendShapeMode) FUNC1RC(BlendShapeMode, mesh_get_blend_shape_mode, RID) + FUNC4(mesh_surface_update_region, RID, int, int, const PoolVector<uint8_t> &) + FUNC3(mesh_surface_set_material, RID, int, RID) FUNC2RC(RID, mesh_surface_get_material, RID, int) diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 2234ddda0d..039bbedbcc 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1856,6 +1856,8 @@ void VisualServer::_bind_methods() { BIND_ENUM_CONSTANT(FEATURE_SHADERS); BIND_ENUM_CONSTANT(FEATURE_MULTITHREADED); + + ADD_SIGNAL(MethodInfo("frame_drawn_in_thread")); } void VisualServer::_canvas_item_add_style_box(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector<float> &p_margins, const Color &p_modulate) { diff --git a/servers/visual_server.h b/servers/visual_server.h index 7b0976b100..a36ba4a50a 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -227,6 +227,7 @@ public: ARRAY_FLAG_USE_2D_VERTICES = ARRAY_COMPRESS_INDEX << 1, ARRAY_FLAG_USE_16_BIT_BONES = ARRAY_COMPRESS_INDEX << 2, + ARRAY_FLAG_USE_DYNAMIC_UPDATE = ARRAY_COMPRESS_INDEX << 3, ARRAY_COMPRESS_DEFAULT = ARRAY_COMPRESS_VERTEX | ARRAY_COMPRESS_NORMAL | ARRAY_COMPRESS_TANGENT | ARRAY_COMPRESS_COLOR | ARRAY_COMPRESS_TEX_UV | ARRAY_COMPRESS_TEX_UV2 | ARRAY_COMPRESS_WEIGHTS @@ -259,6 +260,8 @@ public: virtual void mesh_set_blend_shape_mode(RID p_mesh, BlendShapeMode p_mode) = 0; virtual BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const = 0; + virtual void mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) = 0; + virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material) = 0; virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const = 0; diff --git a/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp b/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp index 06447aca57..c9e71eb733 100644 --- a/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp +++ b/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp @@ -122,6 +122,43 @@ bool OpusVorbisDecoder::getPCMS16(WebMFrame &frame, short *buffer, int &numOutSa return false; } +bool OpusVorbisDecoder::getPCMF(WebMFrame &frame, float *buffer, int &numOutSamples) { + if (m_vorbis) { + m_vorbis->op.packet = frame.buffer; + m_vorbis->op.bytes = frame.bufferSize; + + if (vorbis_synthesis(&m_vorbis->block, &m_vorbis->op)) + return false; + if (vorbis_synthesis_blockin(&m_vorbis->dspState, &m_vorbis->block)) + return false; + + const int maxSamples = getBufferSamples(); + int samplesCount, count = 0; + float **pcm; + while ((samplesCount = vorbis_synthesis_pcmout(&m_vorbis->dspState, &pcm))) { + const int toConvert = samplesCount <= maxSamples ? samplesCount : maxSamples; + for (int c = 0; c < m_channels; ++c) { + float *samples = pcm[c]; + for (int i = 0, j = c; i < toConvert; ++i, j += m_channels) { + buffer[count + j] = samples[i]; + } + } + vorbis_synthesis_read(&m_vorbis->dspState, toConvert); + count += toConvert; + } + + numOutSamples = count; + return true; + } else if (m_opus) { + const int samples = opus_decode_float(m_opus, frame.buffer, frame.bufferSize, buffer, m_numSamples, 0); + if (samples >= 0) { + numOutSamples = samples; + return true; + } + } + return false; +} + bool OpusVorbisDecoder::openVorbis(const WebMDemuxer &demuxer) { size_t extradataSize = 0; diff --git a/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp b/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp index bcdca731ee..b7619d6a25 100644 --- a/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp +++ b/thirdparty/libsimplewebm/OpusVorbisDecoder.hpp @@ -44,7 +44,7 @@ public: { return m_numSamples; } - + bool getPCMF(WebMFrame &frame, float *buffer, int &numOutSamples); bool getPCMS16(WebMFrame &frame, short *buffer, int &numOutSamples); private: |