diff options
Diffstat (limited to 'core')
237 files changed, 551 insertions, 1640 deletions
diff --git a/core/SCsub b/core/SCsub index 4c541d7269..c1e57f6840 100644 --- a/core/SCsub +++ b/core/SCsub @@ -18,7 +18,7 @@ gd_cpp = '#include "project_settings.h"\n' gd_cpp += gd_inc gd_cpp += "void ProjectSettings::register_global_defaults() {\n" + gd_call + "\n}\n" -f = open("global_defaults.gen.cpp", "wb") +f = open("global_defaults.gen.cpp", "w") f.write(gd_cpp) f.close() @@ -47,7 +47,7 @@ if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ): txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0" print("Invalid AES256 encryption key, not 64 bits hex: " + e) -f = open("script_encryption_key.gen.cpp", "wb") +f = open("script_encryption_key.gen.cpp", "w") f.write("#include \"project_settings.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n") f.close() diff --git a/core/allocators.h b/core/allocators.h index 3735a7746e..0b891b76a9 100644 --- a/core/allocators.h +++ b/core/allocators.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/array.cpp b/core/array.cpp index 21dab2ba90..c35bf5bf0c 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/array.h b/core/array.h index 589d52886f..777116ab56 100644 --- a/core/array.h +++ b/core/array.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 5f534f63a8..abe8b9b715 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -2354,7 +2354,7 @@ Variant _ClassDB::instance(const StringName &p_class) const { if (!obj) return Variant(); - Reference *r = obj->cast_to<Reference>(); + Reference *r = Object::cast_to<Reference>(obj); if (r) { return REF(r); } else { diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index fc280bd7ef..1a3782c471 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/class_db.cpp b/core/class_db.cpp index 6cd7586a54..4b0e1b31f0 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -538,9 +538,7 @@ void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, b minfo.arguments.push_back(method->get_argument_info(i)); } - if (method->get_argument_type(-1) != Variant::NIL) { - minfo.return_val = method->get_argument_info(-1); - } + minfo.return_val = method->get_return_info(); minfo.flags = method->get_hint_flags(); p_methods->push_back(minfo); @@ -600,14 +598,22 @@ void ClassDB::bind_integer_constant(const StringName &p_class, const StringName type->constant_map[p_name] = p_constant; #ifdef DEBUG_METHODS_ENABLED - List<StringName> *constants_list = type->enum_map.getptr(p_enum); - if (constants_list) { - constants_list->push_back(p_name); - } else { - List<StringName> new_list; - new_list.push_back(p_name); - type->enum_map[p_enum] = new_list; + String enum_name = p_enum; + if (enum_name != String()) { + if (enum_name.find(".") != -1) { + enum_name = enum_name.get_slicec('.', 1); + } + + List<StringName> *constants_list = type->enum_map.getptr(enum_name); + + if (constants_list) { + constants_list->push_back(p_name); + } else { + List<StringName> new_list; + new_list.push_back(p_name); + type->enum_map[enum_name] = new_list; + } } type->constant_order.push_back(p_name); @@ -680,7 +686,7 @@ StringName ClassDB::get_integer_constant_enum(const StringName &p_class, const S List<StringName> &constants_list = type->enum_map.get(*k); const List<StringName>::Element *found = constants_list.find(p_name); if (found) - return found->get(); + return *k; } if (p_no_inheritance) @@ -858,7 +864,7 @@ void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, cons MethodBind *mb_get = NULL; if (p_getter) { - MethodBind *mb_get = get_method(p_class, p_getter); + mb_get = get_method(p_class, p_getter); #ifdef DEBUG_METHODS_ENABLED if (!mb_get) { diff --git a/core/class_db.h b/core/class_db.h index 8d9192adcc..25a5000572 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -181,27 +181,6 @@ public: static void _add_class() { _add_class2(T::get_class_static(), T::get_parent_class_static()); -#if 0 - GLOBAL_LOCK_FUNCTION; - - StringName name = T::get_class_static(); - - ERR_FAIL_COND(types.has(name)); - - types[name]=TypeInfo(); - TypeInfo &ti=types[name]; - ti.name=name; - ti.inherits=T::get_parent_class_static(); - - if (ti.inherits) { - - ERR_FAIL_COND( !types.has(ti.inherits) ); //it MUST be registered. - ti.inherits_ptr = &types[ti.inherits]; - - } else { - ti.inherits_ptr=NULL; - } -#endif } template <class T> @@ -252,102 +231,6 @@ public: static uint64_t get_api_hash(APIType p_api); -#if 0 - template<class N, class M> - static MethodBind* bind_method(N p_method_name, M p_method, - //default arguments - ParamDef d1=ParamDef(), - ParamDef d2=ParamDef(), - ParamDef d3=ParamDef(), - ParamDef d4=ParamDef(), - ParamDef d5=ParamDef() - ) { - - return bind_methodf(METHOD_FLAGS_DEFAULT,p_method_name, p_method, d1,d2,d3,d4,d5); - } - - - - template<class N, class M> - static MethodBind* bind_methodf(uint32_t p_flags, N p_method_name, M p_method, - - - //default arguments - const ParamDef &d1=ParamDef(), - const ParamDef &d2=ParamDef(), - const ParamDef &d3=ParamDef(), - const ParamDef &d4=ParamDef(), - const ParamDef &d5=ParamDef() - ) { - - GLOBAL_LOCK_FUNCTION; - - MethodDefinition method_name=p_method_name; - - MethodBind *bind = create_method_bind(p_method); - bind->set_name(method_name.name); - ERR_FAIL_COND_V(!bind,NULL); - - String instance_type=bind->get_instance_type(); - - TypeInfo *type=types.getptr(instance_type); - if (!type) { - memdelete(bind); - ERR_FAIL_COND_V(!type,NULL); - } - - if (type->method_map.has(method_name.name)) { - memdelete(bind); - // overloading not supported - ERR_EXPLAIN("Method already bound: "+instance_type+"::"+method_name.name); - ERR_FAIL_V(NULL); - } - bind->set_argument_names(method_name.args); - type->method_map[method_name.name]=bind; - - Vector<Variant> defvals; - -#define PARSE_DEFVAL(m_defval) \ - if (d##m_defval.used) \ - defvals.insert(0, d##m_defval.val); \ - else \ - goto set_defvals; - - - PARSE_DEFVAL(1); - PARSE_DEFVAL(2); - PARSE_DEFVAL(3); - PARSE_DEFVAL(4); - PARSE_DEFVAL(5); - set_defvals: - - bind->set_default_arguments(defvals); - bind->set_hint_flags(p_flags); - - return bind; -#undef PARSE_DEFVAL - } -#else - -#if 0 - template<class N, class M> - static MethodBind* bind_method(N p_method_name, M p_method, - //default arguments - const ParamDef &d1=ParamDef(), - const ParamDef &d2=ParamDef(), - const ParamDef &d3=ParamDef(), - const ParamDef &d4=ParamDef(), - const ParamDef &d5=ParamDef() - ) { - - MethodDefinition method_name=p_method_name; - - MethodBind *bind = create_method_bind(p_method); - - return bind_methodfi(METHOD_FLAGS_DEFAULT,bind,method_name,d1,d2,d3,d4,d5); //use static function, much smaller binary usage - } -#endif - template <class N, class M> static MethodBind *bind_method(N p_method_name, M p_method) { @@ -410,26 +293,6 @@ public: return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, p_method_name, ptr, 6); } -#if 0 - template<class N, class M> - static MethodBind* bind_methodf(uint32_t p_flags, N p_method_name, M p_method, - - const ParamDef& d1=ParamDef(), - const ParamDef& d2=ParamDef(), - const ParamDef& d3=ParamDef(), - const ParamDef& d4=ParamDef(), - const ParamDef& d5=ParamDef() - ) { - - MethodDefinition method_name=p_method_name; - - MethodBind *bind = create_method_bind(p_method); - - return bind_methodfi(p_flags,bind,method_name,d1,d2,d3,d4,d5); //use static function, much smaller binary usage - } -#endif - -#endif template <class M> static MethodBind *bind_vararg_method(uint32_t p_flags, StringName p_name, M p_method, const MethodInfo &p_info = MethodInfo(), const Vector<Variant> &p_default_args = Vector<Variant>()) { @@ -457,7 +320,8 @@ public: } type->method_map[p_name] = bind; #ifdef DEBUG_METHODS_ENABLED - bind->set_return_type("Variant"); + // FIXME: <reduz> set_return_type is no longer in MethodBind, so I guess it should be moved to vararg method bind + //bind->set_return_type("Variant"); type->method_order.push_back(p_name); #endif diff --git a/core/color.cpp b/core/color.cpp index 22a5504431..356e8c168c 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/color.h b/core/color.h index 9074a0e6d6..6df114f2f2 100644 --- a/core/color.h +++ b/core/color.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index c9edd1d47b..8e2aa24c22 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index c3e44f731f..f99e16da15 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index 172249c5d7..74565d2e32 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/compressed_translation.h b/core/compressed_translation.h index c010491b3a..acccf95743 100644 --- a/core/compressed_translation.h +++ b/core/compressed_translation.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index 2f5a684373..ef9346253f 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/core_string_names.h b/core/core_string_names.h index 40f76aa9c0..2eb2b703ae 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 1fe45aff94..bb2e892951 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -200,17 +200,6 @@ uint32_t Dictionary::hash() const { Array Dictionary::keys() const { -#if 0 - Array karr; - karr.resize(size()); - const Variant *K = NULL; - int idx = 0; - while ((K = next(K))) { - karr[idx++] = (*K); - } - return karr; -#else - Array varr; varr.resize(size()); if (_p->variant_map.empty()) @@ -228,7 +217,6 @@ Array Dictionary::keys() const { } return varr; -#endif } Array Dictionary::values() const { diff --git a/core/dictionary.h b/core/dictionary.h index 27caba916f..c8177d5648 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/dvector.cpp b/core/dvector.cpp index 4bbe1aafd9..185cecd531 100644 --- a/core/dvector.cpp +++ b/core/dvector.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/dvector.h b/core/dvector.h index 66af42f7e2..1b81ceec5e 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/engine.cpp b/core/engine.cpp index c8218e47ac..d73693dc12 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/engine.h b/core/engine.h index c46ae1cb64..6f46ec8923 100644 --- a/core/engine.h +++ b/core/engine.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/error_list.h b/core/error_list.h index 14ef7bbc18..bc65ad0ee4 100644 --- a/core/error_list.h +++ b/core/error_list.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/error_macros.cpp b/core/error_macros.cpp index afbff6c52d..5919d38375 100644 --- a/core/error_macros.cpp +++ b/core/error_macros.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/error_macros.h b/core/error_macros.h index 6c803951a1..005b0e32a3 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/event_queue.cpp b/core/event_queue.cpp index c5257d5f6b..12f9942a07 100644 --- a/core/event_queue.cpp +++ b/core/event_queue.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/event_queue.h b/core/event_queue.h index a6c436909d..af1a760945 100644 --- a/core/event_queue.h +++ b/core/event_queue.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/func_ref.cpp b/core/func_ref.cpp index 5622a03665..d9a8f6bcdb 100644 --- a/core/func_ref.cpp +++ b/core/func_ref.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/func_ref.h b/core/func_ref.h index e60d5bd771..b9b1988ede 100644 --- a/core/func_ref.h +++ b/core/func_ref.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/global_constants.cpp b/core/global_constants.cpp index cd9a302ba6..224ee0e0aa 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/global_constants.h b/core/global_constants.h index ad639d0afa..350018e336 100644 --- a/core/global_constants.h +++ b/core/global_constants.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/hash_map.h b/core/hash_map.h index 2d7249e2fc..b22c6378b0 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/hashfuncs.h b/core/hashfuncs.h index 8392984565..56d40f1dd7 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/helper/math_fieldwise.cpp b/core/helper/math_fieldwise.cpp index 5545c2d642..2ce2a70866 100644 --- a/core/helper/math_fieldwise.cpp +++ b/core/helper/math_fieldwise.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/helper/math_fieldwise.h b/core/helper/math_fieldwise.h index 58489fd3bb..4671703f41 100644 --- a/core/helper/math_fieldwise.h +++ b/core/helper/math_fieldwise.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/helper/value_evaluator.h b/core/helper/value_evaluator.h index e32697ca95..bb234de989 100644 --- a/core/helper/value_evaluator.h +++ b/core/helper/value_evaluator.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/image.cpp b/core/image.cpp index 91572e44e4..bb1ce2cee3 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -343,6 +343,11 @@ int Image::get_height() const { return height; } +Vector2 Image::get_size() const { + + return Vector2(width, height); +} + bool Image::has_mipmaps() const { return mipmaps; @@ -2215,6 +2220,7 @@ void Image::_bind_methods() { ClassDB::bind_method(D_METHOD("get_width"), &Image::get_width); ClassDB::bind_method(D_METHOD("get_height"), &Image::get_height); + ClassDB::bind_method(D_METHOD("get_size"), &Image::get_size); ClassDB::bind_method(D_METHOD("has_mipmaps"), &Image::has_mipmaps); ClassDB::bind_method(D_METHOD("get_format"), &Image::get_format); ClassDB::bind_method(D_METHOD("get_data"), &Image::get_data); diff --git a/core/image.h b/core/image.h index 7acc4744e9..27df65a898 100644 --- a/core/image.h +++ b/core/image.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -177,6 +177,7 @@ private: public: int get_width() const; ///< Get image width int get_height() const; ///< Get image height + Vector2 get_size() const; bool has_mipmaps() const; int get_mipmap_count() const; diff --git a/core/input_map.cpp b/core/input_map.cpp index 8435882325..82a2eaddae 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/input_map.h b/core/input_map.h index ba93e61f5f..18e6b04d4e 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/int_types.h b/core/int_types.h index 973e0c749d..e9bcc88ee8 100644 --- a/core/int_types.h +++ b/core/int_types.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/compression.cpp b/core/io/compression.cpp index 139383710c..44fa65e11d 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/compression.h b/core/io/compression.h index 5eb7806d7b..22d8109d4f 100644 --- a/core/io/compression.h +++ b/core/io/compression.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index edd090adf2..daa6b01d6e 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/config_file.h b/core/io/config_file.h index 75a3a519a6..8ed8a069e4 100644 --- a/core/io/config_file.h +++ b/core/io/config_file.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_buffered.cpp b/core/io/file_access_buffered.cpp index 126ec7575e..859f2e3f8c 100644 --- a/core/io/file_access_buffered.cpp +++ b/core/io/file_access_buffered.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h index 0ad2d0e929..d3137058fb 100644 --- a/core/io/file_access_buffered.h +++ b/core/io/file_access_buffered.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h index 362589adf1..9e41834561 100644 --- a/core/io/file_access_buffered_fa.h +++ b/core/io/file_access_buffered_fa.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 959a5dc86f..70430ca5d3 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h index 340c298a0f..2fe1428752 100644 --- a/core/io/file_access_compressed.h +++ b/core/io/file_access_compressed.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index f2b33a01bb..cf82d04ac5 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h index 2bd3c52661..3df2806a7a 100644 --- a/core/io/file_access_encrypted.h +++ b/core/io/file_access_encrypted.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 8e719568e5..5b186b7798 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index ea858c547e..7feb16461b 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index aa67479d7e..be31076557 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h index 1e85756122..d6010cdbac 100644 --- a/core/io/file_access_network.h +++ b/core/io/file_access_network.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index c3bcfc840b..e36ff28220 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index 25473131d6..758e9afa8e 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index d748d5c773..8c99ef2983 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index c9cc2dac79..2a8ec3fca5 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 1c35c6edeb..dd56db9bf9 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/http_client.h b/core/io/http_client.h index cc5f1ed935..023370ae81 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index 7b5b4a13ea..637b95ccf8 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/image_loader.h b/core/io/image_loader.h index f79d9789bf..17a89603fa 100644 --- a/core/io/image_loader.h +++ b/core/io/image_loader.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/ip.cpp b/core/io/ip.cpp index 0e2b5ed519..60a44b2128 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/ip.h b/core/io/ip.h index 66a4a48da2..04c6811792 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index ea3041945c..da74f6c116 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/ip_address.h b/core/io/ip_address.h index da16622a9b..205efd9a0e 100644 --- a/core/io/ip_address.h +++ b/core/io/ip_address.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/json.cpp b/core/io/json.cpp index d537061c5b..2e9170bc34 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/json.h b/core/io/json.h index 75df15a077..893a88e264 100644 --- a/core/io/json.h +++ b/core/io/json.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index e701a89c78..af7db904e9 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -463,8 +463,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int obj->set(str, value); } - if (obj->cast_to<Reference>()) { - REF ref = REF(obj->cast_to<Reference>()); + if (Object::cast_to<Reference>(obj)) { + REF ref = REF(Object::cast_to<Reference>(obj)); r_variant = ref; } else { r_variant = obj; diff --git a/core/io/marshalls.h b/core/io/marshalls.h index 234ae3b183..5541e52a89 100644 --- a/core/io/marshalls.h +++ b/core/io/marshalls.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/networked_multiplayer_peer.cpp b/core/io/networked_multiplayer_peer.cpp index 402526a52c..dea6fab350 100644 --- a/core/io/networked_multiplayer_peer.cpp +++ b/core/io/networked_multiplayer_peer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/networked_multiplayer_peer.h b/core/io/networked_multiplayer_peer.h index bd951912f9..efaea46b84 100644 --- a/core/io/networked_multiplayer_peer.h +++ b/core/io/networked_multiplayer_peer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index ca00b8b480..16c73c26e7 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index 597119f7f4..b08d44ad8a 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index d1729819a8..2773d2a5a3 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index 007b810b67..5a2b54774f 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index 28382ab419..f1f5b6f538 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h index ddfa093a6b..c0a6acd859 100644 --- a/core/io/pck_packer.h +++ b/core/io/pck_packer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index fd8928b8a0..965d11e414 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,12 +28,14 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "resource_format_binary.h" -#include "image.h" -#include "io/file_access_compressed.h" -#include "io/marshalls.h" -#include "os/dir_access.h" -#include "project_settings.h" -#include "version.h" + +#include "core/image.h" +#include "core/io/file_access_compressed.h" +#include "core/io/marshalls.h" +#include "core/os/dir_access.h" +#include "core/project_settings.h" +#include "core/version.h" + //#define print_bl(m_what) print_line(m_what) #define print_bl(m_what) @@ -713,7 +715,7 @@ Error ResourceInteractiveLoaderBinary::poll() { } ERR_FAIL_COND_V(!obj, ERR_FILE_CORRUPT); - Resource *r = obj->cast_to<Resource>(); + Resource *r = Object::cast_to<Resource>(obj); if (!r) { error = ERR_FILE_CORRUPT; memdelete(obj); //bye @@ -1715,54 +1717,6 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant default: {} } } -#if 0 -Error ResourceFormatSaverBinary::_save_obj(const Object *p_object,SavedObject *so) { - - //use classic way - List<PropertyInfo> property_list; - p_object->get_property_list( &property_list ); - - for(List<PropertyInfo>::Element *E=property_list.front();E;E=E->next()) { - - if (skip_editor && E->get().name.begins_with("__editor")) - continue; - if (E->get().usage&PROPERTY_USAGE_STORAGE || (bundle_resources && E->get().usage&PROPERTY_USAGE_BUNDLE)) { - - SavedObject::SavedProperty sp; - sp.name_idx=get_string_index(E->get().name); - sp.value = p_object->get(E->get().name); - _find_resources(sp.value); - so->properties.push_back(sp); - } - } - - return OK; - -} - - - -Error ResourceFormatSaverBinary::save(const Object *p_object,const Variant &p_meta) { - - ERR_FAIL_COND_V(!f,ERR_UNCONFIGURED); - ERR_EXPLAIN("write_object should supply either an object, a meta, or both"); - ERR_FAIL_COND_V(!p_object && p_meta.get_type()==Variant::NIL, ERR_INVALID_PARAMETER); - - SavedObject *so = memnew( SavedObject ); - - if (p_object) - so->type=p_object->get_type(); - - _find_resources(p_meta); - so->meta=p_meta; - Error err = _save_obj(p_object,so); - ERR_FAIL_COND_V( err, ERR_INVALID_DATA ); - - saved_objects.push_back(so); - - return OK; -} -#endif void ResourceFormatSaverBinaryInstance::save_unicode_string(const String &p_string) { @@ -1798,7 +1752,6 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p } ERR_FAIL_COND_V(err, err); - FileAccessRef _fref(f); relative_paths = p_flags & ResourceSaver::FLAG_RELATIVE_PATHS; skip_editor = p_flags & ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES; @@ -1810,7 +1763,6 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p takeover_paths = false; local_path = p_path.get_base_dir(); - //bin_meta_idx = get_string_index("__bin_meta__"); //is often used, so create _find_resources(p_resource, true); @@ -1836,7 +1788,6 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p return ERR_CANT_CREATE; } - //f->store_32(saved_resources.size()+external_resources.size()); // load steps -not needed save_unicode_string(p_resource->get_class()); uint64_t md_at = f->get_pos(); f->store_64(0); //offset to impoty metadata @@ -1875,7 +1826,6 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p f->store_32(strings.size()); //string table size for (int i = 0; i < strings.size(); i++) { - //print_bl("saving string: "+strings[i]); save_unicode_string(strings[i]); } @@ -1944,9 +1894,8 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p } Vector<uint64_t> ofs_table; - //int saved_idx=0; - //now actually save the resources + //now actually save the resources for (List<ResourceData>::Element *E = resources.front(); E; E = E->next()) { ResourceData &rd = E->get(); diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index 1c66344e3e..1bd0d333c6 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp index 7033dbe5fb..5a4f29fe67 100644 --- a/core/io/resource_import.cpp +++ b/core/io/resource_import.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 67fd870178..bf0bf3987a 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 5347cd6ee1..f0e804e2fa 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index e6687800d7..9e059c2977 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 314259b2e9..e6187c9e3c 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h index f7fbcc1fb8..3fdd00133a 100644 --- a/core/io/resource_saver.h +++ b/core/io/resource_saver.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 7042700d92..1006158003 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index d0748a8c9e..1ee997c123 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index 24f6473330..d1fe214343 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index a81ae24e4a..bcbbeb0d48 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index ae5603aa31..0e047a8f32 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index 53c21a93fd..45c93c2d36 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 29a80ecc19..a4364fa17c 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index b4ff3246ad..a7276401e4 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 1a670b0ab0..353eabea45 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/translation_loader_po.h b/core/io/translation_loader_po.h index a731e4e0d6..a14238f1df 100644 --- a/core/io/translation_loader_po.h +++ b/core/io/translation_loader_po.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index d8b69b0951..62110bfe24 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index 297211ecc6..28c57b567f 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/io/zip_io.h b/core/io/zip_io.h index 88e680c0e0..8cf971ee08 100644 --- a/core/io/zip_io.h +++ b/core/io/zip_io.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/list.h b/core/list.h index df69b1dc40..0cad6038ff 100644 --- a/core/list.h +++ b/core/list.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/make_binders.py b/core/make_binders.py index a5cdb78443..6468c029f0 100644 --- a/core/make_binders.py +++ b/core/make_binders.py @@ -16,12 +16,11 @@ public: $ return Variant::NIL; } - virtual StringName _gen_argument_type_name(int p_arg) const { return _gen_argument_type_hint(p_arg); } - StringName _gen_argument_type_hint(int p_argument) const { - $ifret if (p_argument==-1) return GetTypeInfo<R>::get_class_name();$ - $arg if (p_argument==(@-1)) return GetTypeInfo<P@>::get_class_name(); + virtual PropertyInfo _gen_argument_type_info(int p_argument) const { + $ifret if (p_argument==-1) return GetTypeInfo<R>::get_class_info();$ + $arg if (p_argument==(@-1)) return GetTypeInfo<P@>::get_class_info(); $ - return StringName(); + return PropertyInfo(); } #endif virtual String get_instance_class() const { @@ -30,7 +29,7 @@ public: virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { - T *instance=p_object->cast_to<T>(); + T *instance=Object::cast_to<T>(p_object); r_error.error=Variant::CallError::CALL_OK; #ifdef DEBUG_METHODS_ENABLED @@ -58,7 +57,7 @@ public: #ifdef PTRCALL_ENABLED virtual void ptrcall(Object*p_object,const void** p_args,void *r_ret) { - T *instance=p_object->cast_to<T>(); + T *instance=Object::cast_to<T>(p_object); $ifret PtrToArg<R>::encode( $ (instance->*method)($arg, PtrToArg<P@>::convert(p_args[@-1])$) $ifret ,r_ret)$ ; } #endif @@ -104,14 +103,13 @@ public: return Variant::NIL; } - virtual StringName _gen_argument_type_name(int p_arg) const { return _gen_argument_type_hint(p_arg); } - - StringName _gen_argument_type_hint(int p_argument) const { - $ifret if (p_argument==-1) return GetTypeInfo<R>::get_class_name();$ - $arg if (p_argument==(@-1)) return GetTypeInfo<P@>::get_class_name(); + virtual PropertyInfo _gen_argument_type_info(int p_argument) const { + $ifret if (p_argument==-1) return GetTypeInfo<R>::get_class_info();$ + $arg if (p_argument==(@-1)) return GetTypeInfo<P@>::get_class_info(); $ - return StringName(); + return PropertyInfo(); } + #endif virtual String get_instance_class() const { return type_name; diff --git a/core/map.h b/core/map.h index ef0f75fc9b..75a38a3440 100644 --- a/core/map.h +++ b/core/map.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 04e4383f03..21516ac768 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/a_star.h b/core/math/a_star.h index ebf1407c17..d2d2166719 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/audio_frame.cpp b/core/math/audio_frame.cpp index 30a50c8add..555d3536df 100644 --- a/core/math/audio_frame.cpp +++ b/core/math/audio_frame.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h index d54f622197..cfc7331767 100644 --- a/core/math/audio_frame.h +++ b/core/math/audio_frame.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index e22bc2b05e..be950568cf 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h index 8296e57943..2e762ba4de 100644 --- a/core/math/bsp_tree.h +++ b/core/math/bsp_tree.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index a1666ccd8b..0512cdd798 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -180,19 +180,7 @@ void CameraMatrix::set_orthogonal(real_t p_size, real_t p_aspect, real_t p_znear } void CameraMatrix::set_frustum(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_near, real_t p_far) { -#if 0 - ///@TODO, give a check to this. I'm not sure if it's working. - set_identity(); - matrix[0][0]=(2*p_near) / (p_right-p_left); - matrix[0][2]=(p_right+p_left) / (p_right-p_left); - matrix[1][1]=(2*p_near) / (p_top-p_bottom); - matrix[1][2]=(p_top+p_bottom) / (p_top-p_bottom); - matrix[2][2]=-(p_far+p_near) / ( p_far-p_near); - matrix[2][3]=-(2*p_far*p_near) / (p_far-p_near); - matrix[3][2]=-1; - matrix[3][3]=0; -#else real_t *te = &matrix[0][0]; real_t x = 2 * p_near / (p_right - p_left); real_t y = 2 * p_near / (p_top - p_bottom); @@ -218,8 +206,6 @@ void CameraMatrix::set_frustum(real_t p_left, real_t p_right, real_t p_bottom, r te[13] = 0; te[14] = d; te[15] = 0; - -#endif } real_t CameraMatrix::get_z_far() const { diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index 4be8ffab8c..175d0cdb1b 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 0e292500bf..748faad28f 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/face3.h b/core/math/face3.h index 3d02ae4014..8e4a25fb7a 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 9a5811244a..7c8fb6f17d 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/geometry.h b/core/math/geometry.h index 909d8164c3..cd069bd7a3 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -105,7 +105,7 @@ public: } static void get_closest_points_between_segments(const Vector3 &p1, const Vector3 &p2, const Vector3 &q1, const Vector3 &q2, Vector3 &c1, Vector3 &c2) { -#if 1 + //do the function 'd' as defined by pb. I think is is dot product of some sort #define d_of(m, n, o, p) ((m.x - n.x) * (o.x - p.x) + (m.y - n.y) * (o.y - p.y) + (m.z - n.z) * (o.z - p.z)) @@ -120,33 +120,6 @@ public: if (mub > 1) mub = 1; c1 = p1.linear_interpolate(p2, mua); c2 = q1.linear_interpolate(q2, mub); -#else - //this is broken do not use - Vector3 u = p2 - p1; - Vector3 v = q2 - q1; - Vector3 w = p1 - q1; - float a = u.dot(u); - float b = u.dot(v); - float c = v.dot(v); // always >= 0 - float d = u.dot(w); - float e = v.dot(w); - float D = a * c - b * b; // always >= 0 - float sc, tc; - - // compute the line parameters of the two closest points - if (D < CMP_EPSILON) { // the lines are almost parallel - sc = 0.0; - tc = (b > c ? d / b : e / c); // use the largest denominator - } else { - sc = (b * e - c * d) / D; - tc = (a * e - b * d) / D; - } - - c1 = w + sc * u; - c2 = w + tc * v; -// get the difference of the two closest points -//Vector dP = w + (sc * u) - (tc * v); // = L1(sc) - L2(tc) -#endif } static real_t get_closest_distance_between_segments(const Vector3 &p_from_a, const Vector3 &p_to_a, const Vector3 &p_from_b, const Vector3 &p_to_b) { diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 956cfe5258..c77fe96ff2 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -205,33 +205,6 @@ Vector2 Vector2::clamped(real_t p_len) const { return v; } -Vector2 Vector2::cubic_interpolate_soft(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const { -#if 0 - k[0] = ((*this) (vi[0] + 1, vi[1], vi[2])) - ((*this) (vi[0], - vi[1],vi[2])); //fk = a0 - k[1] = (((*this) (vi[0] + 1, vi[1], vi[2])) - ((*this) ((int) (v(0) - - 1), vi[1],vi[2])))*0.5; //dk = a1 - k[2] = (((*this) ((int) (v(0) + 2), vi[1], vi[2])) - ((*this) (vi[0], - vi[1],vi[2])))*0.5; //dk+1 - k[3] = k[0]*3 - k[1]*2 - k[2];//a2 - k[4] = k[1] + k[2] - k[0]*2;//a3 - - //ip = a3(t-tk)³ + a2(t-tk)² + a1(t-tk) + a0 - // - //a3 = dk + dk+1 - Dk - //a2 = 3Dk - 2dk - dk+1 - //a1 = dk - //a0 = fk - // - //dk = (fk+1 - fk-1)*0.5 - //Dk = (fk+1 - fk) - - real_t dk = -#endif - - return Vector2(); -} - Vector2 Vector2::cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const { Vector2 p0 = p_pre_a; diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 6fea6c8adb..d215df8a43 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -113,7 +113,6 @@ struct Vector2 { _FORCE_INLINE_ static Vector2 linear_interpolate(const Vector2 &p_a, const Vector2 &p_b, real_t p_t); _FORCE_INLINE_ Vector2 linear_interpolate(const Vector2 &p_b, real_t p_t) const; Vector2 cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const; - Vector2 cubic_interpolate_soft(const Vector2 &p_b, const Vector2 &p_pre_a, const Vector2 &p_post_b, real_t p_t) const; Vector2 slide(const Vector2 &p_normal) const; Vector2 bounce(const Vector2 &p_normal) const; diff --git a/core/math/math_defs.h b/core/math/math_defs.h index 3d9eb63e11..904cbc1abc 100644 --- a/core/math/math_defs.h +++ b/core/math/math_defs.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 9f5a9c193a..6fb688f16b 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,16 +28,13 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "math_funcs.h" + #include "core/os/os.h" pcg32_random_t Math::default_pcg = { 12047754176567800795ULL, PCG_DEFAULT_INC_64 }; #define PHI 0x9e3779b9 -#if 0 -static uint32_t Q[4096]; -#endif - // TODO: we should eventually expose pcg.inc too uint32_t Math::rand_from_seed(uint64_t *seed) { pcg32_random_t pcg = { *seed, PCG_DEFAULT_INC_64 }; diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 2ce9a88622..9651e37f3e 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index ec82bd30d4..c7e2a8f307 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/matrix3.h b/core/math/matrix3.h index 74e6564578..be85c244bd 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/octree.h b/core/math/octree.h index 2e37056030..95a67943fd 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -851,28 +851,6 @@ void Octree<T, use_pairs, AL>::move(OctreeElementID p_id, const Rect3 &p_aabb) { ERR_FAIL_COND(!E); Element &e = E->get(); -#if 0 - - pass++; - if (!e.aabb.has_no_surface()) { - _remove_element(&e); - } - - e.aabb=p_aabb; - - if (!e.aabb.has_no_surface()) { - _ensure_valid_root(p_aabb); - - _insert_element(&e,root); - if (use_pairs) - _element_check_pairs(&e); - - } - - _optimize(); - -#else - bool old_has_surf = !e.aabb.has_no_surface(); bool new_has_surf = !p_aabb.has_no_surface(); @@ -979,7 +957,6 @@ void Octree<T, use_pairs, AL>::move(OctreeElementID p_id, const Rect3 &p_aabb) { } _optimize(); -#endif } template <class T, bool use_pairs, class AL> diff --git a/core/math/plane.cpp b/core/math/plane.cpp index 17928d07c3..08395ed07b 100644 --- a/core/math/plane.cpp +++ b/core/math/plane.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/plane.h b/core/math/plane.h index 73d584e553..559a735817 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/quat.cpp b/core/math/quat.cpp index 5984cdf657..cebc5b9522 100644 --- a/core/math/quat.cpp +++ b/core/math/quat.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -139,48 +139,6 @@ Quat Quat::inverse() const { Quat Quat::slerp(const Quat &q, const real_t &t) const { -#if 0 - - - Quat dst=q; - Quat src=*this; - - src.normalize(); - dst.normalize(); - - real_t cosine = dst.dot(src); - - if (cosine < 0 && true) { - cosine = -cosine; - dst = -dst; - } else { - dst = dst; - } - - if (Math::abs(cosine) < 1 - CMP_EPSILON) { - // Standard case (slerp) - real_t sine = Math::sqrt(1 - cosine*cosine); - real_t angle = Math::atan2(sine, cosine); - real_t inv_sine = 1.0 / sine; - real_t coeff_0 = Math::sin((1.0 - t) * angle) * inv_sine; - real_t coeff_1 = Math::sin(t * angle) * inv_sine; - Quat ret= src * coeff_0 + dst * coeff_1; - - return ret; - } else { - // There are two situations: - // 1. "rkP" and "q" are very close (cosine ~= +1), so we can do a linear - // interpolation safely. - // 2. "rkP" and "q" are almost invedste of each other (cosine ~= -1), there - // are an infinite number of possibilities interpolation. but we haven't - // have method to fix this case, so just use linear interpolation here. - Quat ret = src * (1.0 - t) + dst *t; - // taking the complement requires renormalisation - ret.normalize(); - return ret; - } -#else - Quat to1; real_t omega, cosom, sinom, scale0, scale1; @@ -221,7 +179,6 @@ Quat Quat::slerp(const Quat &q, const real_t &t) const { scale0 * y + scale1 * to1.y, scale0 * z + scale1 * to1.z, scale0 * w + scale1 * to1.w); -#endif } Quat Quat::slerpni(const Quat &q, const real_t &t) const { @@ -241,53 +198,6 @@ Quat Quat::slerpni(const Quat &q, const real_t &t) const { invFactor * from.y + newFactor * q.y, invFactor * from.z + newFactor * q.z, invFactor * from.w + newFactor * q.w); - -#if 0 - real_t to1[4]; - real_t omega, cosom, sinom, scale0, scale1; - - - // calc cosine - cosom = x * q.x + y * q.y + z * q.z - + w * q.w; - - - // adjust signs (if necessary) - if ( cosom <0.0 && false) { - cosom = -cosom;to1[0] = - q.x; - to1[1] = - q.y; - to1[2] = - q.z; - to1[3] = - q.w; - } else { - to1[0] = q.x; - to1[1] = q.y; - to1[2] = q.z; - to1[3] = q.w; - } - - - // calculate coefficients - - if ( (1.0 - cosom) > CMP_EPSILON ) { - // standard case (slerp) - omega = Math::acos(cosom); - sinom = Math::sin(omega); - scale0 = Math::sin((1.0 - t) * omega) / sinom; - scale1 = Math::sin(t * omega) / sinom; - } else { - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - scale0 = 1.0 - t; - scale1 = t; - } - // calculate final values - return Quat( - scale0 * x + scale1 * to1[0], - scale0 * y + scale1 * to1[1], - scale0 * z + scale1 * to1[2], - scale0 * w + scale1 * to1[3] - ); -#endif } Quat Quat::cubic_slerp(const Quat &q, const Quat &prep, const Quat &postq, const real_t &t) const { diff --git a/core/math/quat.h b/core/math/quat.h index 0e378eb4e4..9668f8c7a3 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 54b97ac38c..e9a383df40 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/quick_hull.h b/core/math/quick_hull.h index 49600649e3..47ed22615b 100644 --- a/core/math/quick_hull.h +++ b/core/math/quick_hull.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/rect3.cpp b/core/math/rect3.cpp index 973607f565..6f01000f61 100644 --- a/core/math/rect3.cpp +++ b/core/math/rect3.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/rect3.h b/core/math/rect3.h index 4890a19d99..c3a2f5fbfb 100644 --- a/core/math/rect3.h +++ b/core/math/rect3.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -189,8 +189,6 @@ Vector3 Rect3::get_endpoint(int p_point) const { bool Rect3::intersects_convex_shape(const Plane *p_planes, int p_plane_count) const { -#if 1 - Vector3 half_extents = size * 0.5; Vector3 ofs = position + half_extents; @@ -206,42 +204,6 @@ bool Rect3::intersects_convex_shape(const Plane *p_planes, int p_plane_count) co } return true; -#else - //cache all points to check against! - // #warning should be easy to optimize, just use the same as when taking the support and use only that point - Vector3 points[8] = { - Vector3(position.x, position.y, position.z), - Vector3(position.x, position.y, position.z + size.z), - Vector3(position.x, position.y + size.y, position.z), - Vector3(position.x, position.y + size.y, position.z + size.z), - Vector3(position.x + size.x, position.y, position.z), - Vector3(position.x + size.x, position.y, position.z + size.z), - Vector3(position.x + size.x, position.y + size.y, position.z), - Vector3(position.x + size.x, position.y + size.y, position.z + size.z), - }; - - for (int i = 0; i < p_plane_count; i++) { //for each plane - - const Plane &plane = p_planes[i]; - bool all_points_over = true; - //test if it has all points over! - - for (int j = 0; j < 8; j++) { - - if (!plane.is_point_over(points[j])) { - - all_points_over = false; - break; - } - } - - if (all_points_over) { - - return false; - } - } - return true; -#endif } bool Rect3::has_point(const Vector3 &p_point) const { diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 3a86fbfc6c..60df69a509 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/transform.h b/core/math/transform.h index 48467f2ed7..566bf482a9 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -154,8 +154,7 @@ _FORCE_INLINE_ Plane Transform::xform_inv(const Plane &p_plane) const { } _FORCE_INLINE_ Rect3 Transform::xform(const Rect3 &p_aabb) const { -/* define vertices */ -#if 1 + /* define vertices */ Vector3 x = basis.get_axis(0) * p_aabb.size.x; Vector3 y = basis.get_axis(1) * p_aabb.size.y; Vector3 z = basis.get_axis(2) * p_aabb.size.z; @@ -171,31 +170,8 @@ _FORCE_INLINE_ Rect3 Transform::xform(const Rect3 &p_aabb) const { new_aabb.expand_to(pos + y + z); new_aabb.expand_to(pos + x + y + z); return new_aabb; -#else - - Vector3 vertices[8] = { - Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z), - Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z), - Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z), - Vector3(p_aabb.position.x + p_aabb.size.x, p_aabb.position.y, p_aabb.position.z), - Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z + p_aabb.size.z), - Vector3(p_aabb.position.x, p_aabb.position.y + p_aabb.size.y, p_aabb.position.z), - Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z + p_aabb.size.z), - Vector3(p_aabb.position.x, p_aabb.position.y, p_aabb.position.z) - }; - - AABB ret; - - ret.pos = xform(vertices[0]); - - for (int i = 1; i < 8; i++) { - - ret.expand_to(xform(vertices[i])); - } - - return ret; -#endif } + _FORCE_INLINE_ Rect3 Transform::xform_inv(const Rect3 &p_aabb) const { /* define vertices */ @@ -222,4 +198,4 @@ _FORCE_INLINE_ Rect3 Transform::xform_inv(const Rect3 &p_aabb) const { return ret; } -#endif +#endif // TRANSFORM_H diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index 1df3c8c298..614104f698 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h index 166f10c577..2bf67fffcb 100644 --- a/core/math/triangle_mesh.h +++ b/core/math/triangle_mesh.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp index 4a5d0a078e..b20f2e06d5 100644 --- a/core/math/triangulate.cpp +++ b/core/math/triangulate.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/triangulate.h b/core/math/triangulate.h index 3f0ad00033..21e148249e 100644 --- a/core/math/triangulate.h +++ b/core/math/triangulate.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index efffacb36e..144234f4d1 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -125,51 +125,6 @@ Vector3 Vector3::cubic_interpolate(const Vector3 &p_b, const Vector3 &p_pre_a, c return out; } -#if 0 -Vector3 Vector3::cubic_interpolate(const Vector3& p_b,const Vector3& p_pre_a, const Vector3& p_post_b,real_t p_t) const { - - Vector3 p0=p_pre_a; - Vector3 p1=*this; - Vector3 p2=p_b; - Vector3 p3=p_post_b; - - if (true) { - - real_t ab = p0.distance_to(p1); - real_t bc = p1.distance_to(p2); - real_t cd = p2.distance_to(p3); - - //if (ab>bc) { - if (ab>0) - p0 = p1+(p0-p1)*(bc/ab); - //} - - //if (cd>bc) { - if (cd>0) - p3 = p2+(p3-p2)*(bc/cd); - //} - } - - real_t t = p_t; - real_t t2 = t * t; - real_t t3 = t2 * t; - - Vector3 out; - out.x = 0.5 * ( ( 2.0 * p1.x ) + - ( -p0.x + p2.x ) * t + - ( 2.0 * p0.x - 5.0 * p1.x + 4 * p2.x - p3.x ) * t2 + - ( -p0.x + 3.0 * p1.x - 3.0 * p2.x + p3.x ) * t3 ); - out.y = 0.5 * ( ( 2.0 * p1.y ) + - ( -p0.y + p2.y ) * t + - ( 2.0 * p0.y - 5.0 * p1.y + 4 * p2.y - p3.y ) * t2 + - ( -p0.y + 3.0 * p1.y - 3.0 * p2.y + p3.y ) * t3 ); - out.z = 0.5 * ( ( 2.0 * p1.z ) + - ( -p0.z + p2.z ) * t + - ( 2.0 * p0.z - 5.0 * p1.z + 4 * p2.z - p3.z ) * t2 + - ( -p0.z + 3.0 * p1.z - 3.0 * p2.z + p3.z ) * t3 ); - return out; -} -#endif Vector3::operator String() const { return (rtos(x) + ", " + rtos(y) + ", " + rtos(z)); diff --git a/core/math/vector3.h b/core/math/vector3.h index c58a86fbdb..74c822fcd7 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/message_queue.cpp b/core/message_queue.cpp index 564069d8bb..040fb69805 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -240,47 +240,6 @@ void MessageQueue::statistics() { } } -bool MessageQueue::print() { -#if 0 - uint32_t read_pos=0; - while (read_pos < buffer_end ) { - Message *message = (Message*)&buffer[ read_pos ]; - - Object *target = ObjectDB::get_instance(message->instance_ID); - String cname; - String cfunc; - - if (target==NULL) { - //object was deleted - //WARN_PRINT("Object was deleted while awaiting a callback") - //should it print a warning? - } else if (message->notification>=0) { - - // messages don't expect a return value - cfunc="notification # "+itos(message->notification); - cname=target->get_type(); - - } else if (!message->target.empty()) { - - cfunc="property: "+message->target; - cname=target->get_type(); - - - } else if (message->target) { - - cfunc=String(message->target)+"()"; - cname=target->get_type(); - } - - - read_pos+=sizeof(Message); - if (message->type!=TYPE_NOTIFICATION) - read_pos+=sizeof(Variant)*message->args; - } -#endif - return false; -} - int MessageQueue::get_max_buffer_usage() const { return buffer_max_used; diff --git a/core/message_queue.h b/core/message_queue.h index 843ab17d94..193d2b6907 100644 --- a/core/message_queue.h +++ b/core/message_queue.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -33,6 +33,7 @@ #include "object.h" #include "os/mutex.h" #include "os/thread_safe.h" + class MessageQueue { _THREAD_SAFE_CLASS_ @@ -85,7 +86,6 @@ public: Error push_notification(Object *p_object, int p_notification); Error push_set(Object *p_object, const StringName &p_prop, const Variant &p_value); - bool print(); void statistics(); void flush(); diff --git a/core/method_bind.cpp b/core/method_bind.cpp index 6792b62703..8cace0bbaa 100644 --- a/core/method_bind.cpp +++ b/core/method_bind.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -36,31 +36,16 @@ #ifdef DEBUG_METHODS_ENABLED PropertyInfo MethodBind::get_argument_info(int p_argument) const { - if (p_argument >= 0) { + ERR_FAIL_INDEX_V(p_argument, get_argument_count(), PropertyInfo()); - String name = p_argument < arg_names.size() ? String(arg_names[p_argument]) : String("arg" + itos(p_argument)); - PropertyInfo pi(get_argument_type(p_argument), name); - - if (!is_vararg() && pi.type == Variant::OBJECT) { - StringName type_hint = arg_type_hints[p_argument]; - - if (type_hint != StringName()) { - pi.hint = PROPERTY_HINT_RESOURCE_TYPE; - pi.hint_string = type_hint.operator String(); - } - } - return pi; + PropertyInfo info = _gen_argument_type_info(p_argument); + info.name = p_argument < arg_names.size() ? String(arg_names[p_argument]) : String("arg" + itos(p_argument)); + return info; +} - } else { +PropertyInfo MethodBind::get_return_info() const { - Variant::Type at = get_argument_type(-1); - if (at == Variant::OBJECT && ret_type) - return PropertyInfo(at, "ret", PROPERTY_HINT_RESOURCE_TYPE, ret_type); - else - return PropertyInfo(at, "ret"); - } - - return PropertyInfo(); + return _gen_argument_type_info(-1); } #endif @@ -91,16 +76,6 @@ Vector<StringName> MethodBind::get_argument_names() const { return arg_names; } -void MethodBind::set_argument_type_hints(const Vector<StringName> &p_type_hints) { - - arg_type_hints = p_type_hints; -} - -Vector<StringName> MethodBind::get_argument_type_hints() const { - - return arg_type_hints; -} - #endif void MethodBind::set_default_arguments(const Vector<Variant> &p_defargs) { @@ -114,18 +89,13 @@ void MethodBind::_generate_argument_types(int p_count) { set_argument_count(p_count); Variant::Type *argt = memnew_arr(Variant::Type, p_count + 1); - - arg_type_hints.resize(p_count); - argt[0] = _gen_argument_type(-1); // return type - set_return_type(_gen_argument_type_hint(-1)); for (int i = 0; i < p_count; i++) { argt[i + 1] = _gen_argument_type(i); - arg_type_hints[i] = _gen_argument_type_hint(i); } - set_argument_types(argt); + argument_types = argt; } #endif diff --git a/core/method_bind.h b/core/method_bind.h index 157a67ca20..f6cae6f34d 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -188,23 +188,22 @@ class MethodBind { Vector<Variant> default_arguments; int default_argument_count; int argument_count; -#ifdef DEBUG_METHODS_ENABLED - Vector<StringName> arg_names; - Vector<StringName> arg_type_hints; - Variant::Type *argument_types; - StringName ret_type; -#endif + bool _const; bool _returns; protected: +#ifdef DEBUG_METHODS_ENABLED + Variant::Type *argument_types; + Vector<StringName> arg_names; +#endif void _set_const(bool p_const); void _set_returns(bool p_returns); #ifdef DEBUG_METHODS_ENABLED virtual Variant::Type _gen_argument_type(int p_arg) const = 0; - virtual StringName _gen_argument_type_hint(int p_arg) const = 0; + virtual PropertyInfo _gen_argument_type_info(int p_arg) const = 0; void _generate_argument_types(int p_count); - void set_argument_types(Variant::Type *p_types) { argument_types = p_types; } + #endif void set_argument_count(int p_count) { argument_count = p_count; } @@ -234,9 +233,6 @@ public: #ifdef DEBUG_METHODS_ENABLED - _FORCE_INLINE_ void set_return_type(const StringName &p_type) { ret_type = p_type; } - _FORCE_INLINE_ StringName get_return_type() const { return ret_type; } - _FORCE_INLINE_ Variant::Type get_argument_type(int p_argument) const { ERR_FAIL_COND_V(p_argument < -1 || p_argument > argument_count, Variant::NIL); @@ -244,12 +240,11 @@ public: } PropertyInfo get_argument_info(int p_argument) const; + PropertyInfo get_return_info() const; - void set_argument_names(const Vector<StringName> &p_names); + void set_argument_names(const Vector<StringName> &p_names); //set by class, db, cant be inferred otherwise Vector<StringName> get_argument_names() const; - void set_argument_type_hints(const Vector<StringName> &p_type_hints); - Vector<StringName> get_argument_type_hints() const; #endif void set_hint_flags(uint32_t p_hint) { hint_flags = p_hint; } uint32_t get_hint_flags() const { return hint_flags | (is_const() ? METHOD_FLAG_CONST : 0) | (is_vararg() ? METHOD_FLAG_VARARG : 0); } @@ -257,28 +252,6 @@ public: _FORCE_INLINE_ int get_argument_count() const { return argument_count; }; -#if 0 - _FORCE_INLINE_ Variant call_safe(const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { - - r_error.error=Variant::CallError::CALL_OK; - check_call( p_args, &errorarg ); - if (!err) - return call(p_object, VARIANT_ARG_PASS ); - - VARIANT_ARGPTRS - String errstr; - String methodname = get_instance_type()+"::"+name; - if (err==CALL_ERROR_ARGUMENT_TYPE) { - errstr="Invalid Argument to call: '"+methodname+"'. Cannot convert argument "+itos(errorarg+1)+" from "+Variant::get_type_name(get_argument_type(errorarg))+" to "+Variant::get_type_name(argptr[errorarg]->get_type())+"."; - } - if (err==CALL_ERROR_EXTRA_ARGUMENT) { - errstr="Invalid call. Member function '"+methodname+"' takes "+itos(get_argument_count())+" argument, but argument "+itos(errorarg+1)+" was received."; - } - - ERR_PRINT(errstr.ascii().get_data()); - return Variant(); - } -#endif virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Variant::CallError &r_error) = 0; #ifdef PTRCALL_ENABLED @@ -305,18 +278,36 @@ public: protected: NativeCall call_method; +#ifdef DEBUG_METHODS_ENABLED + MethodInfo arguments; + +#endif public: - virtual Variant::Type _gen_argument_type(int p_arg) const { +#ifdef DEBUG_METHODS_ENABLED - return Variant::NIL; + virtual PropertyInfo _gen_argument_type_info(int p_arg) const { + + if (p_arg < 0) { + return arguments.return_val; + } else if (p_arg < arguments.arguments.size()) { + return arguments.arguments[p_arg]; + } else { + return PropertyInfo(Variant::NIL, "arg_" + itos(p_arg), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT); + } + } + + virtual Variant::Type _gen_argument_type(int p_arg) const { + return _gen_argument_type_info(p_arg).type; } - virtual StringName _gen_argument_type_hint(int p_arg) const { +#else - return "Variant"; + virtual Variant::Type _gen_argument_type(int p_arg) const { + return Variant::NIL; } +#endif virtual Variant call(Object *p_object, const Variant **p_args, int p_arg_count, Variant::CallError &r_error) { T *instance = static_cast<T *>(p_object); @@ -341,7 +332,8 @@ public: set_argument_names(names); } - set_argument_types(at); + argument_types = at; + arguments = p_info; #endif } diff --git a/core/method_ptrcall.h b/core/method_ptrcall.h index d8755fd98b..2875eb912f 100644 --- a/core/method_ptrcall.h +++ b/core/method_ptrcall.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/node_path.cpp b/core/node_path.cpp index ad2eae859d..15f950f605 100644 --- a/core/node_path.cpp +++ b/core/node_path.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/node_path.h b/core/node_path.h index 31446ab9b4..eb5b9eb6cf 100644 --- a/core/node_path.h +++ b/core/node_path.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/object.cpp b/core/object.cpp index a43a9c85b1..b220dc0563 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -65,6 +65,7 @@ PropertyInfo::operator Dictionary() const { Dictionary d; d["name"] = name; + d["class_name"] = class_name; d["type"] = type; d["hint"] = hint; d["hint_string"] = hint_string; @@ -82,6 +83,9 @@ PropertyInfo PropertyInfo::from_dict(const Dictionary &p_dict) { if (p_dict.has("name")) pi.name = p_dict["name"]; + if (p_dict.has("class_name")) + pi.class_name = p_dict["class_name"]; + if (p_dict.has("hint")) pi.hint = PropertyHint(int(p_dict["hint"])); @@ -338,35 +342,6 @@ void Object::get_valid_parents_static(List<String> *p_parents) { } void Object::_get_valid_parents_static(List<String> *p_parents) { } -#if 0 -//old style set, deprecated - -void Object::set(const String& p_name, const Variant& p_value) { - - _setv(p_name,p_value); - - /* - if (!_use_builtin_script()) - return; - */ - - bool success; - ClassDB::set_property(this,p_name,p_value,success); - if (success) { - return; - } - - if (p_name=="__meta__") { - metadata=p_value; - } else if (p_name=="script") { - set_script(p_value); - } else if (script_instance) { - script_instance->set(p_name,p_value); - } - - -} -#endif void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid) { @@ -485,34 +460,6 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const { } } -#if 0 -//old style get, deprecated -Variant Object::get(const String& p_name) const { - - Variant ret=_getv(p_name); - if (ret.get_type()!=Variant::NIL) - return ret; - - bool success; - ClassDB::get_property(const_cast<Object*>(this),p_name,ret,success); - if (success) { - return ret; - } - - if (p_name=="__meta__") - return metadata; - else if (p_name=="script") - return script; - - if (script_instance) { - return script_instance->get(p_name); - } - - return Variant(); - -} -#endif - void Object::get_property_list(List<PropertyInfo> *p_list, bool p_reversed) const { if (script_instance && p_reversed) { @@ -592,22 +539,6 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Vari return Variant(); } -#if 0 -Variant Object::_call_bind(const StringName& p_name, const Variant& p_arg1, const Variant& p_arg2, const Variant& p_arg3, const Variant& p_arg4) { - - ERR_FAIL_COND_V(p_argcount<1,Variant()); - - return call(p_name, p_arg1, p_arg2, p_arg3, p_arg4); -}; - - - - -void Object::_call_deferred_bind(const StringName& p_name, const Variant& p_arg1, const Variant& p_arg2, const Variant& p_arg3, const Variant& p_arg4) { - - call_deferred(p_name, p_arg1, p_arg2, p_arg3, p_arg4); -}; -#endif #ifdef DEBUG_ENABLED static bool _test_call_error(const StringName &p_func, const Variant::CallError &error) { @@ -650,7 +581,7 @@ void Object::call_multilevel(const StringName &p_method, const Variant **p_args, if (p_method == CoreStringNames::get_singleton()->_free) { #ifdef DEBUG_ENABLED - if (cast_to<Reference>()) { + if (Object::cast_to<Reference>(this)) { ERR_EXPLAIN("Can't 'free' a reference."); ERR_FAIL(); return; @@ -760,54 +691,6 @@ Variant Object::callv(const StringName &p_method, const Array &p_args) { } Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) { -#if 0 - if (p_name==CoreStringNames::get_singleton()->_free) { -#ifdef DEBUG_ENABLED - if (cast_to<Reference>()) { - ERR_EXPLAIN("Can't 'free' a reference."); - ERR_FAIL_V(Variant()); - } -#endif - //must be here, must be before everything, - memdelete(this); - return Variant(); - } - - VARIANT_ARGPTRS; - - int argc=0; - for(int i=0;i<VARIANT_ARG_MAX;i++) { - if (argptr[i]->get_type()==Variant::NIL) - break; - argc++; - } - - Variant::CallError error; - - Variant ret; - - if (script_instance) { - ret = script_instance->call(p_name,argptr,argc,error); - if (_test_call_error(p_name,error)) - return ret; - } - - MethodBind *method=ClassDB::get_method(get_type_name(),p_name); - - if (method) { - - - Variant ret = method->call(this,argptr,argc,error); - if (_test_call_error(p_name,error)) - return ret; - - return ret; - } else { - - } - - return Variant(); -#else VARIANT_ARGPTRS; @@ -822,52 +705,9 @@ Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) { Variant ret = call(p_name, argptr, argc, error); return ret; - -#endif } void Object::call_multilevel(const StringName &p_name, VARIANT_ARG_DECLARE) { -#if 0 - if (p_name==CoreStringNames::get_singleton()->_free) { -#ifdef DEBUG_ENABLED - if (cast_to<Reference>()) { - ERR_EXPLAIN("Can't 'free' a reference."); - ERR_FAIL(); - return; - } -#endif - //must be here, must be before everything, - memdelete(this); - return; - } - - VARIANT_ARGPTRS; - - int argc=0; - for(int i=0;i<VARIANT_ARG_MAX;i++) { - if (argptr[i]->get_type()==Variant::NIL) - break; - argc++; - } - - Variant::CallError error; - - if (script_instance) { - script_instance->call(p_name,argptr,argc,error); - _test_call_error(p_name,error); - - } - - MethodBind *method=ClassDB::get_method(get_type_name(),p_name); - - if (method) { - - method->call(this,argptr,argc,error); - _test_call_error(p_name,error); - - } - -#else VARIANT_ARGPTRS; @@ -880,8 +720,6 @@ void Object::call_multilevel(const StringName &p_name, VARIANT_ARG_DECLARE) { //Variant::CallError error; call_multilevel(p_name, argptr, argc); - -#endif } Variant Object::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { @@ -896,7 +734,7 @@ Variant Object::call(const StringName &p_method, const Variant **p_args, int p_a r_error.error = Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS; return Variant(); } - if (cast_to<Reference>()) { + if (Object::cast_to<Reference>(this)) { r_error.argument = 0; r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD; ERR_EXPLAIN("Can't 'free' a reference."); @@ -1126,22 +964,6 @@ struct _ObjectSignalDisconnectData { StringName method; }; -#if 0 -void Object::_emit_signal(const StringName& p_name,const Array& p_pargs){ - - Variant args[VARIANT_ARG_MAX]; - - int count = p_pargs.size(); - - for(int i=0;i<count;i++) { - args[i]=p_pargs[i]; - } - - emit_signal(p_name,VARIANT_ARGS_FROM_ARRAY(args)); -} - -#endif - Variant Object::_emit_signal(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; @@ -1310,21 +1132,7 @@ void Object::_add_user_signal(const String &p_name, const Array &p_args) { add_user_signal(mi); } -#if 0 -void Object::_emit_signal(const StringName& p_name,const Array& p_pargs){ - Variant args[VARIANT_ARG_MAX]; - - int count = p_pargs.size(); - - for(int i=0;i<count;i++) { - args[i]=p_pargs[i]; - } - - emit_signal(p_name,VARIANT_ARGS_FROM_ARRAY(args)); -} - -#endif Array Object::_get_signal_list() const { List<MethodInfo> signal_list; @@ -1338,6 +1146,7 @@ Array Object::_get_signal_list() const { return ret; } + Array Object::_get_signal_connection_list(const String &p_signal) const { List<Connection> conns; @@ -1468,7 +1277,7 @@ Error Object::connect(const StringName &p_signal, Object *p_to_object, const Str Signal::Target target(p_to_object->get_instance_id(), p_to_method); if (s->slot_map.has(target)) { - ERR_EXPLAIN("Signal '" + p_signal + "'' already connected to given method '" + p_to_method + "' in that object."); + ERR_EXPLAIN("Signal '" + p_signal + "' is already connected to given method '" + p_to_method + "' in that object."); ERR_FAIL_COND_V(s->slot_map.has(target), ERR_INVALID_PARAMETER); } diff --git a/core/object.h b/core/object.h index 8a858b5b00..8b13477480 100644 --- a/core/object.h +++ b/core/object.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -107,6 +107,8 @@ enum PropertyUsageFlags { PROPERTY_USAGE_ANIMATE_AS_TRIGGER = 32768, PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED = 65536, PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 1 << 17, + PROPERTY_USAGE_CLASS_IS_ENUM = 1 << 18, + PROPERTY_USAGE_NIL_IS_VARIANT = 1 << 19, PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK, PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_NETWORK | PROPERTY_USAGE_INTERNATIONALIZED, @@ -126,6 +128,7 @@ struct PropertyInfo { Variant::Type type; String name; + StringName class_name; //for classes PropertyHint hint; String hint_string; uint32_t usage; @@ -145,13 +148,27 @@ struct PropertyInfo { hint(PROPERTY_HINT_NONE), usage(PROPERTY_USAGE_DEFAULT) { } - PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT) + PropertyInfo(Variant::Type p_type, const String p_name, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = "", uint32_t p_usage = PROPERTY_USAGE_DEFAULT, const StringName &p_class_name = StringName()) : type(p_type), name(p_name), hint(p_hint), hint_string(p_hint_string), usage(p_usage) { + + if (hint == PROPERTY_HINT_RESOURCE_TYPE) { + class_name = hint_string; + } else { + class_name = p_class_name; + } } + PropertyInfo(const StringName &p_class_name) + : type(Variant::OBJECT), + hint(PROPERTY_HINT_NONE), + usage(PROPERTY_USAGE_DEFAULT) { + + class_name = p_class_name; + } + bool operator<(const PropertyInfo &p_info) const { return name < p_info.name; } @@ -168,6 +185,7 @@ struct MethodInfo { uint32_t flags; int id; + inline bool operator==(const MethodInfo &p_method) const { return id == p_method.id; } inline bool operator<(const MethodInfo &p_method) const { return id == p_method.id ? (name < p_method.name) : (id < p_method.id); } operator Dictionary() const; @@ -541,46 +559,46 @@ public: void add_change_receptor(Object *p_receptor); void remove_change_receptor(Object *p_receptor); -// TODO: ensure 'this' is never NULL since it's UB, but by now, avoid warning flood -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundefined-bool-conversion" -#endif - template <class T> - T *cast_to() { - + static T *cast_to(Object *p_object) { +#ifdef DEBUG_ENABLED + // TODO there are some legitimate reasons to pass NULL as p_object. + // we need to figure out how to deal with that in debug mode. + // This code will return NULL for a NULL input in release mode also. + ERR_FAIL_COND_V(p_object == NULL, NULL); +#endif #ifndef NO_SAFE_CAST - return SAFE_CAST<T *>(this); + return dynamic_cast<T *>(p_object); #else - if (!this) + if (!p_object) return NULL; - if (is_class_ptr(T::get_class_ptr_static())) - return static_cast<T *>(this); + if (p_object->is_class_ptr(T::get_class_ptr_static())) + return static_cast<T *>(p_object); else return NULL; #endif } template <class T> - const T *cast_to() const { - + static const T *cast_to(const Object *p_object) { +#ifdef DEBUG_ENABLED + // TODO there are some legitimate reasons to pass NULL as p_object. + // we need to figure out how to deal with that in debug mode. + // This code will return NULL for a NULL input in release mode also. + ERR_FAIL_COND_V(p_object == NULL, NULL); +#endif #ifndef NO_SAFE_CAST - return SAFE_CAST<const T *>(this); + return dynamic_cast<const T *>(p_object); #else - if (!this) + if (!p_object) return NULL; - if (is_class_ptr(T::get_class_ptr_static())) - return static_cast<const T *>(this); + if (p_object->is_class_ptr(T::get_class_ptr_static())) + return static_cast<const T *>(p_object); else return NULL; #endif } -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - enum { NOTIFICATION_POSTINITIALIZE = 0, diff --git a/core/os/copymem.h b/core/os/copymem.h index 3ad2403f9c..789dce76e7 100644 --- a/core/os/copymem.h +++ b/core/os/copymem.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index 391ae78c85..f24d6d16ca 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/dir_access.h b/core/os/dir_access.h index 4bee229555..6ad8b4c49b 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 9d1fefc925..b969b58bfb 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/file_access.h b/core/os/file_access.h index beed7551fb..8393f0530b 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/input.cpp b/core/os/input.cpp index 81ca31da25..65752662d7 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/input.h b/core/os/input.h index 6759c624e3..f98b97e647 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index cb38eb67b6..88037859aa 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -28,11 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "input_event.h" + #include "input_map.h" #include "os/keyboard.h" -/** - * - */ void InputEvent::set_id(uint32_t p_id) { id = p_id; @@ -99,25 +97,6 @@ bool InputEvent::is_action_type() const { return false; } -#if 0 -if (String(p_method) == "is_action" && p_argidx == 0) { - - List<PropertyInfo> pinfo; - ProjectSettings::get_singleton()->get_property_list(&pinfo); - - for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) { - const PropertyInfo &pi = E->get(); - - if (!pi.name.begins_with("input/")) - continue; - - String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length()); - result.insert("\"" + name + "\""); - } - -} else -#endif - void InputEvent::_bind_methods() { ClassDB::bind_method(D_METHOD("set_id", "id"), &InputEvent::set_id); @@ -483,6 +462,38 @@ bool InputEventMouseButton::action_match(const Ref<InputEvent> &p_event) const { return mb->button_index == button_index; } +String InputEventMouseButton::as_text() const { + + String button_index_string = ""; + switch (get_button_index()) { + case BUTTON_LEFT: + button_index_string = "BUTTON_LEFT"; + break; + case BUTTON_RIGHT: + button_index_string = "BUTTON_RIGHT"; + break; + case BUTTON_MIDDLE: + button_index_string = "BUTTON_MIDDLE"; + break; + case BUTTON_WHEEL_UP: + button_index_string = "BUTTON_WHEEL_UP"; + break; + case BUTTON_WHEEL_DOWN: + button_index_string = "BUTTON_WHEEL_DOWN"; + break; + case BUTTON_WHEEL_LEFT: + button_index_string = "BUTTON_WHEEL_LEFT"; + break; + case BUTTON_WHEEL_RIGHT: + button_index_string = "BUTTON_WHEEL_RIGHT"; + break; + default: + button_index_string = itos(get_button_index()); + break; + } + return "InputEventMouseButton : button_index=" + button_index_string + ", pressed=" + (pressed ? "true" : "false") + ", position=(" + String(get_position()) + "), button_mask=" + itos(get_button_mask()) + ", doubleclick=" + (doubleclick ? "true" : "false"); +} + void InputEventMouseButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_factor", "factor"), &InputEventMouseButton::set_factor); @@ -559,6 +570,26 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co return mm; } +String InputEventMouseMotion::as_text() const { + + String button_mask_string = ""; + switch (get_button_mask()) { + case BUTTON_MASK_LEFT: + button_mask_string = "BUTTON_MASK_LEFT"; + break; + case BUTTON_MASK_MIDDLE: + button_mask_string = "BUTTON_MASK_MIDDLE"; + break; + case BUTTON_MASK_RIGHT: + button_mask_string = "BUTTON_MASK_RIGHT"; + break; + default: + button_mask_string = itos(get_button_mask()); + break; + } + return "InputEventMouseMotion : button_mask=" + button_mask_string + ", position=(" + String(get_position()) + "), relative=(" + String(get_relative()) + "), speed=(" + String(get_speed()) + ")"; +} + void InputEventMouseMotion::_bind_methods() { ClassDB::bind_method(D_METHOD("set_relative", "relative"), &InputEventMouseMotion::set_relative); @@ -609,6 +640,11 @@ bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event) const return (axis == jm->axis && (axis_value < 0) == (jm->axis_value < 0)); } +String InputEventJoypadMotion::as_text() const { + + return "InputEventJoypadMotion : axis=" + itos(axis) + ", axis_value=" + String(Variant(axis_value)); +} + void InputEventJoypadMotion::_bind_methods() { ClassDB::bind_method(D_METHOD("set_axis", "axis"), &InputEventJoypadMotion::set_axis); @@ -665,6 +701,11 @@ bool InputEventJoypadButton::action_match(const Ref<InputEvent> &p_event) const return button_index == jb->button_index; } +String InputEventJoypadButton::as_text() const { + + return "InputEventJoypadButton : button_index=" + itos(button_index) + ", pressed=" + (pressed ? "true" : "false") + ", pressure=" + String(Variant(pressure)); +} + void InputEventJoypadButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_button_index", "button_index"), &InputEventJoypadButton::set_button_index); @@ -730,6 +771,11 @@ Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, co return st; } +String InputEventScreenTouch::as_text() const { + + return "InputEventScreenTouch : index=" + itos(index) + ", pressed=" + (pressed ? "true" : "false") + ", position=(" + String(get_position()) + ")"; +} + void InputEventScreenTouch::_bind_methods() { ClassDB::bind_method(D_METHOD("set_index", "index"), &InputEventScreenTouch::set_index); @@ -808,6 +854,11 @@ Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, con return sd; } +String InputEventScreenDrag::as_text() const { + + return "InputEventScreenDrag : index=" + itos(index) + ", position=(" + String(get_position()) + "), relative=(" + String(get_relative()) + "), speed=(" + String(get_speed()) + ")"; +} + void InputEventScreenDrag::_bind_methods() { ClassDB::bind_method(D_METHOD("set_index", "index"), &InputEventScreenDrag::set_index); @@ -857,6 +908,11 @@ bool InputEventAction::is_action(const StringName &p_action) const { return action == p_action; } +String InputEventAction::as_text() const { + + return "InputEventAction : action=" + action + ", pressed=(" + (pressed ? "true" : "false"); +} + void InputEventAction::_bind_methods() { ClassDB::bind_method(D_METHOD("set_action", "action"), &InputEventAction::set_action); diff --git a/core/os/input_event.h b/core/os/input_event.h index d1fd7cc90f..5dc0f91d5f 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -307,6 +307,7 @@ public: virtual bool action_match(const Ref<InputEvent> &p_event) const; virtual bool is_action_type() const { return true; } + virtual String as_text() const; InputEventMouseButton(); }; @@ -328,6 +329,7 @@ public: Vector2 get_speed() const; virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const; + virtual String as_text() const; InputEventMouseMotion(); }; @@ -352,6 +354,7 @@ public: virtual bool action_match(const Ref<InputEvent> &p_event) const; virtual bool is_action_type() const { return true; } + virtual String as_text() const; InputEventJoypadMotion(); }; @@ -378,6 +381,7 @@ public: virtual bool action_match(const Ref<InputEvent> &p_event) const; virtual bool is_action_type() const { return true; } + virtual String as_text() const; InputEventJoypadButton(); }; @@ -402,6 +406,7 @@ public: virtual bool is_pressed() const; virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const; + virtual String as_text() const; InputEventScreenTouch(); }; @@ -431,6 +436,7 @@ public: Vector2 get_speed() const; virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const; + virtual String as_text() const; InputEventScreenDrag(); }; @@ -455,6 +461,7 @@ public: virtual bool is_action(const StringName &p_action) const; virtual bool is_action_type() const { return true; } + virtual String as_text() const; InputEventAction(); }; diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 9b3e376ea6..30e7d5e791 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 1ef26de183..509ff23a93 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index 6d07e2a39c..b146d370f1 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/main_loop.h b/core/os/main_loop.h index a0125ec13c..fd76d8454f 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/memory.cpp b/core/os/memory.cpp index acc960acd9..74d5cbbea1 100644 --- a/core/os/memory.cpp +++ b/core/os/memory.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/memory.h b/core/os/memory.h index e1d7138ad5..f8b3da579b 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp index 134d313bdf..d3edc2c423 100644 --- a/core/os/mutex.cpp +++ b/core/os/mutex.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/mutex.h b/core/os/mutex.h index 80a30b0b26..9e353df33d 100644 --- a/core/os/mutex.h +++ b/core/os/mutex.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/os.cpp b/core/os/os.cpp index 3a06a3fa8f..1292b7eeed 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -171,7 +171,7 @@ static FileAccess *_OSPRF = NULL; static void _OS_printres(Object *p_obj) { - Resource *res = p_obj->cast_to<Resource>(); + Resource *res = Object::cast_to<Resource>(p_obj); if (!res) return; diff --git a/core/os/os.h b/core/os/os.h index 0fcf465655..258708eea2 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/power.h b/core/os/power.h index dbf4c75c59..59a091012e 100644 --- a/core/os/power.h +++ b/core/os/power.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/rw_lock.cpp b/core/os/rw_lock.cpp index 0427374de4..d0ad249afa 100644 --- a/core/os/rw_lock.cpp +++ b/core/os/rw_lock.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h index 253bd260ee..c13eb8147c 100644 --- a/core/os/rw_lock.h +++ b/core/os/rw_lock.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/semaphore.cpp b/core/os/semaphore.cpp index ce75186001..ea0a02ae22 100644 --- a/core/os/semaphore.cpp +++ b/core/os/semaphore.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/semaphore.h b/core/os/semaphore.h index f2be966979..c169e0212e 100644 --- a/core/os/semaphore.h +++ b/core/os/semaphore.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/shell.cpp b/core/os/shell.cpp index 9bf2d4466d..07e4924c38 100644 --- a/core/os/shell.cpp +++ b/core/os/shell.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/shell.h b/core/os/shell.h index 33044ee10e..7cb95dd5c8 100644 --- a/core/os/shell.h +++ b/core/os/shell.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/thread.cpp b/core/os/thread.cpp index bd565334c3..af8ae847dc 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/thread.h b/core/os/thread.h index 1103f67ff2..697494708e 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/thread_dummy.cpp b/core/os/thread_dummy.cpp index 88c111297d..39b5bdd9b8 100644 --- a/core/os/thread_dummy.cpp +++ b/core/os/thread_dummy.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/thread_dummy.h b/core/os/thread_dummy.h index 64941a71f8..56e7061eee 100644 --- a/core/os/thread_dummy.h +++ b/core/os/thread_dummy.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/thread_safe.cpp b/core/os/thread_safe.cpp index 486e072985..a49d412254 100644 --- a/core/os/thread_safe.cpp +++ b/core/os/thread_safe.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/os/thread_safe.h b/core/os/thread_safe.h index 0cecf33cc2..f9a1d0f62b 100644 --- a/core/os/thread_safe.h +++ b/core/os/thread_safe.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index eb4aeb758a..4040680c6d 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/packed_data_container.h b/core/packed_data_container.h index bab994fc94..e6a674d7ce 100644 --- a/core/packed_data_container.h +++ b/core/packed_data_container.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/pair.h b/core/pair.h index d517339ddf..f780c79c81 100644 --- a/core/pair.h +++ b/core/pair.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/path_remap.cpp b/core/path_remap.cpp index c5961213e8..d8fa2748bc 100644 --- a/core/path_remap.cpp +++ b/core/path_remap.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/path_remap.h b/core/path_remap.h index 95249c6334..04da4c1510 100644 --- a/core/path_remap.h +++ b/core/path_remap.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index d563925f3b..c122d21545 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/pool_allocator.h b/core/pool_allocator.h index f62e410e66..12de4d58e8 100644 --- a/core/pool_allocator.h +++ b/core/pool_allocator.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/print_string.cpp b/core/print_string.cpp index 4a4c8093ca..92a04cbf0b 100644 --- a/core/print_string.cpp +++ b/core/print_string.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/print_string.h b/core/print_string.h index c4cd610856..9f8420c31a 100644 --- a/core/print_string.h +++ b/core/print_string.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/project_settings.cpp b/core/project_settings.cpp index 4a1b35ea4a..ce1d7918db 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -733,46 +733,6 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust } return OK; - -#if 0 - Error err = file->open(dst_file,FileAccess::WRITE); - if (err) { - memdelete(file); - ERR_EXPLAIN("Couldn't save project.godot"); - ERR_FAIL_COND_V(err,err) - } - - - for(Map<String,List<String> >::Element *E=props.front();E;E=E->next()) { - - if (E!=props.front()) - file->store_string("\n"); - - if (E->key()!="") - file->store_string("["+E->key()+"]\n\n"); - for(List<String>::Element *F=E->get().front();F;F=F->next()) { - - String key = F->get(); - if (E->key()!="") - key=E->key()+"/"+key; - Variant value; - - if (p_custom.has(key)) - value=p_custom[key]; - else - value = get(key); - - file->store_string(F->get()+"="+_encode_variant(value)+"\n"); - - } - } - - file->close(); - memdelete(file); - - - return OK; -#endif } Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) { diff --git a/core/project_settings.h b/core/project_settings.h index cee3b3b5f3..5c8907c74e 100644 --- a/core/project_settings.h +++ b/core/project_settings.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/ref_ptr.cpp b/core/ref_ptr.cpp index c2128fd45d..4a27b523fb 100644 --- a/core/ref_ptr.cpp +++ b/core/ref_ptr.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -69,7 +69,7 @@ RID RefPtr::get_rid() const { Ref<Reference> *ref = reinterpret_cast<Ref<Reference> *>(&data[0]); if (ref->is_null()) return RID(); - Resource *res = (*ref)->cast_to<Resource>(); + Resource *res = Object::cast_to<Resource>(ref->ptr()); if (res) return res->get_rid(); return RID(); diff --git a/core/ref_ptr.h b/core/ref_ptr.h index b76bbab7fa..bb98f0507a 100644 --- a/core/ref_ptr.h +++ b/core/ref_ptr.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/reference.cpp b/core/reference.cpp index e9629ee7c0..bb70628cbe 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -98,7 +98,7 @@ Variant WeakRef::get_ref() const { Object *obj = ObjectDB::get_instance(ref); if (!obj) return Variant(); - Reference *r = obj->cast_to<Reference>(); + Reference *r = cast_to<Reference>(obj); if (r) { return REF(r); @@ -124,44 +124,3 @@ void WeakRef::_bind_methods() { ClassDB::bind_method(D_METHOD("get_ref"), &WeakRef::get_ref); } -#if 0 - -Reference * RefBase::get_reference_from_ref(const RefBase &p_base) { - - return p_base.get_reference(); -} -void RefBase::ref_inc(Reference *p_reference) { - - p_reference->refcount.ref(); -} -bool RefBase::ref_dec(Reference *p_reference) { - - bool ref = p_reference->refcount.unref(); - return ref; -} - -Reference *RefBase::first_ref(Reference *p_reference) { - - if (p_reference->refcount.ref()) { - - // this may fail in the scenario of two threads assigning the pointer for the FIRST TIME - // at the same time, which is never likely to happen (would be crazy to do) - // so don't do it. - - if (p_reference->refcount_init.get()>0) { - p_reference->refcount_init.unref(); - p_reference->refcount.unref(); // first referencing is already 1, so compensate for the ref above - } - - return p_reference; - } else { - - return 0; - } - -} -char * RefBase::get_refptr_data(const RefPtr &p_refptr) const { - - return p_refptr.data; -} -#endif diff --git a/core/reference.h b/core/reference.h index 69250a4701..5fe8296314 100644 --- a/core/reference.h +++ b/core/reference.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -59,21 +59,6 @@ public: ~Reference(); }; -#if 0 -class RefBase { -protected: - void ref_inc(Reference *p_reference); - bool ref_dec(Reference *p_reference); - Reference *first_ref(Reference *p_reference); - Reference * get_reference_from_ref(const RefBase &p_base); - virtual Reference * get_reference() const=0; - char * get_refptr_data(const RefPtr &p_refptr) const; -public: - - virtual ~RefBase() {} -}; -#endif - template <class T> class Ref { @@ -151,20 +136,10 @@ public: return refptr; }; -#if 0 - // go to RefPtr - operator RefPtr() const { - - return get_ref_ptr(); - } -#endif - -#if 1 operator Variant() const { return Variant(get_ref_ptr()); } -#endif void operator=(const Ref &p_from) { @@ -180,7 +155,7 @@ public: return; } Ref r; - r.reference = refb->cast_to<T>(); + r.reference = Object::cast_to<T>(refb); ref(r); r.reference = NULL; } @@ -194,7 +169,7 @@ public: return; } Ref r; - r.reference = refb->cast_to<T>(); + r.reference = Object::cast_to<T>(refb); ref(r); r.reference = NULL; } @@ -209,7 +184,7 @@ public: return; } Ref r; - r.reference = refb->cast_to<T>(); + r.reference = Object::cast_to<T>(refb); ref(r); r.reference = NULL; } @@ -230,7 +205,7 @@ public: return; } Ref r; - r.reference = refb->cast_to<T>(); + r.reference = Object::cast_to<T>(refb); ref(r); r.reference = NULL; } @@ -254,7 +229,7 @@ public: return; } Ref r; - r.reference = refb->cast_to<T>(); + r.reference = Object::cast_to<T>(refb); ref(r); r.reference = NULL; } @@ -269,7 +244,7 @@ public: return; } Ref r; - r.reference = refb->cast_to<T>(); + r.reference = Object::cast_to<T>(refb); ref(r); r.reference = NULL; } @@ -382,8 +357,8 @@ template <class T> struct GetTypeInfo<Ref<T> > { enum { VARIANT_TYPE = Variant::OBJECT }; - static inline StringName get_class_name() { - return T::get_class_static(); + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::OBJECT, String(), PROPERTY_HINT_RESOURCE_TYPE, T::get_class_static()); } }; @@ -391,8 +366,8 @@ template <class T> struct GetTypeInfo<const Ref<T> &> { enum { VARIANT_TYPE = Variant::OBJECT }; - static inline StringName get_class_name() { - return T::get_class_static(); + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::OBJECT, String(), PROPERTY_HINT_RESOURCE_TYPE, T::get_class_static()); } }; diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index e5441093ac..27c31127a4 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/register_core_types.h b/core/register_core_types.h index 794c45dff0..cf84d70930 100644 --- a/core/register_core_types.h +++ b/core/register_core_types.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/resource.cpp b/core/resource.cpp index a0b0fd24e1..37d42226b4 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/resource.h b/core/resource.h index bbf233d53e..7dc3b67291 100644 --- a/core/resource.h +++ b/core/resource.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/rid.cpp b/core/rid.cpp index ca1d2be421..cb16715936 100644 --- a/core/rid.cpp +++ b/core/rid.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/rid.h b/core/rid.h index a93d7d912e..276375167e 100644 --- a/core/rid.h +++ b/core/rid.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/ring_buffer.h b/core/ring_buffer.h index 8b32bb5e10..6c882f1ef9 100644 --- a/core/ring_buffer.h +++ b/core/ring_buffer.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index 971e9ad1d5..c330a983a7 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/safe_refcount.h b/core/safe_refcount.h index ed0620c777..802d84cccc 100644 --- a/core/safe_refcount.h +++ b/core/safe_refcount.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/script_debugger_local.cpp b/core/script_debugger_local.cpp index d2ccf495ae..c2632da38b 100644 --- a/core/script_debugger_local.cpp +++ b/core/script_debugger_local.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/script_debugger_local.h b/core/script_debugger_local.h index d32edb503b..097c7c41f3 100644 --- a/core/script_debugger_local.h +++ b/core/script_debugger_local.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 9e4f4380c9..8875732b8e 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index cf75c0eb4a..b1ef88b812 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/script_language.cpp b/core/script_language.cpp index 4664049145..9a891f9e52 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/script_language.h b/core/script_language.h index 7aba3ec0f1..342d8c8072 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -207,7 +207,7 @@ public: virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const = 0; virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; } - virtual Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, String &r_call_hint) { return ERR_UNAVAILABLE; } + virtual Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, bool &r_force, String &r_call_hint) { return ERR_UNAVAILABLE; } struct LookupResult { enum Type { diff --git a/core/self_list.h b/core/self_list.h index e229d5bf8e..053ab40162 100644 --- a/core/self_list.h +++ b/core/self_list.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/set.h b/core/set.h index 6e6f07508c..317e180869 100644 --- a/core/set.h +++ b/core/set.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/simple_type.h b/core/simple_type.h index b4a6dd1fa8..96e79966e0 100644 --- a/core/simple_type.h +++ b/core/simple_type.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/sort.h b/core/sort.h index 06c427f61e..a5e23f53df 100644 --- a/core/sort.h +++ b/core/sort.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/string_db.cpp b/core/string_db.cpp index c61fbba9b5..ef38491a6b 100644 --- a/core/string_db.cpp +++ b/core/string_db.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/string_db.h b/core/string_db.h index 18af9fb3a7..2bef29fab8 100644 --- a/core/string_db.h +++ b/core/string_db.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/translation.cpp b/core/translation.cpp index c38d5d8b4d..f1f9c72b85 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/translation.h b/core/translation.h index 8630b8a478..cf59583ad6 100644 --- a/core/translation.h +++ b/core/translation.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/type_info.h b/core/type_info.h index 0603126996..a7d3fa20c8 100644 --- a/core/type_info.h +++ b/core/type_info.h @@ -41,9 +41,9 @@ template <class T, typename = void> struct GetTypeInfo { enum { VARIANT_TYPE = Variant::NIL }; - static inline StringName get_class_name() { + static inline PropertyInfo get_class_info() { ERR_PRINT("GetTypeInfo fallback. Bug!"); - return StringName(); // Not "Nil", this is an error + return PropertyInfo(); // Not "Nil", this is an error } }; @@ -51,15 +51,15 @@ struct GetTypeInfo { template <> \ struct GetTypeInfo<m_type> { \ enum { VARIANT_TYPE = m_var_type }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo((Variant::Type)VARIANT_TYPE,String()); \ } \ }; \ template <> \ struct GetTypeInfo<const m_type &> { \ enum { VARIANT_TYPE = m_var_type }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo((Variant::Type)VARIANT_TYPE,String()); \ } \ }; @@ -105,38 +105,54 @@ MAKE_TYPE_INFO(IP_Address, Variant::STRING) class BSP_Tree; MAKE_TYPE_INFO(BSP_Tree, Variant::DICTIONARY) -#define MAKE_TYPE_INFO_WITH_NAME(m_type, m_var_type, m_class_name) \ - template <> \ - struct GetTypeInfo<m_type> { \ - enum { VARIANT_TYPE = m_var_type }; \ - static inline StringName get_class_name() { \ - return m_class_name; \ - } \ - }; \ - template <> \ - struct GetTypeInfo<const m_type &> { \ - enum { VARIANT_TYPE = m_var_type }; \ - static inline StringName get_class_name() { \ - return m_class_name; \ - } \ - }; +//for RefPtr +template <> +struct GetTypeInfo<RefPtr> { + enum { VARIANT_TYPE = Variant::OBJECT }; + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::OBJECT,String(),PROPERTY_HINT_RESOURCE_TYPE,"Reference"); + } +}; +template <> +struct GetTypeInfo<const RefPtr &> { + enum { VARIANT_TYPE = Variant::OBJECT }; + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::OBJECT,String(),PROPERTY_HINT_RESOURCE_TYPE,"Reference"); + } +}; + + +//for variant +template<> +struct GetTypeInfo<Variant> { + enum { VARIANT_TYPE = Variant::NIL }; + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::NIL,String(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_NIL_IS_VARIANT); + } +}; + +template<> +struct GetTypeInfo<const Variant&> { + enum { VARIANT_TYPE = Variant::NIL }; + static inline PropertyInfo get_class_info() { + return PropertyInfo(Variant::NIL,String(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_NIL_IS_VARIANT); + } +}; -MAKE_TYPE_INFO_WITH_NAME(RefPtr, Variant::OBJECT, "Reference") -MAKE_TYPE_INFO_WITH_NAME(Variant, Variant::NIL, "Variant") #define MAKE_TEMPLATE_TYPE_INFO(m_template, m_type, m_var_type) \ template <> \ struct GetTypeInfo<m_template<m_type> > { \ enum { VARIANT_TYPE = m_var_type }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo((Variant::Type)VARIANT_TYPE,String()); \ } \ }; \ template <> \ struct GetTypeInfo<const m_template<m_type> &> { \ enum { VARIANT_TYPE = m_var_type }; \ - static inline StringName get_class_name() { \ - return Variant::get_type_name((Variant::Type)VARIANT_TYPE); \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo((Variant::Type)VARIANT_TYPE,String()); \ } \ }; @@ -159,17 +175,18 @@ template <typename T> struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> { enum { VARIANT_TYPE = Variant::OBJECT }; - static inline StringName get_class_name() { - return T::get_class_static(); + static inline PropertyInfo get_class_info() { + return PropertyInfo(StringName(T::get_class_static())); } + }; template <typename T> struct GetTypeInfo<const T *, typename EnableIf<TypeInherits<Object, T>::value>::type> { enum { VARIANT_TYPE = Variant::OBJECT }; - static inline StringName get_class_name() { - return T::get_class_static(); + static inline PropertyInfo get_class_info() { + return PropertyInfo(StringName(T::get_class_static())); } }; @@ -177,7 +194,9 @@ struct GetTypeInfo<const T *, typename EnableIf<TypeInherits<Object, T>::value>: template <> \ struct GetTypeInfo<m_impl> { \ enum { VARIANT_TYPE = Variant::INT }; \ - static inline StringName get_class_name() { return "enum." #m_enum; } \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(Variant::INT,String(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_CLASS_IS_ENUM,String(#m_enum).replace("::",".")); \ + } \ }; #define MAKE_ENUM_TYPE_INFO(m_enum) \ @@ -190,7 +209,7 @@ template <typename T> inline StringName __constant_get_enum_name(T param, const String &p_constant) { if (GetTypeInfo<T>::VARIANT_TYPE == Variant::NIL) ERR_PRINTS("Missing VARIANT_ENUM_CAST for constant's enum: " + p_constant); - return GetTypeInfo<T>::get_class_name(); + return GetTypeInfo<T>::get_class_info().class_name; } #else diff --git a/core/typedefs.h b/core/typedefs.h index 34a1a93a3b..565e28020b 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/ucaps.h b/core/ucaps.h index cd4a581a49..f6c42f37d6 100644 --- a/core/ucaps.h +++ b/core/ucaps.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index bb70146396..4760047959 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -111,8 +111,8 @@ void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_A ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; do_op.object = p_object->get_instance_id(); - if (p_object->cast_to<Resource>()) - do_op.resref = Ref<Resource>(p_object->cast_to<Resource>()); + if (Object::cast_to<Resource>(p_object)) + do_op.resref = Ref<Resource>(Object::cast_to<Resource>(p_object)); do_op.type = Operation::TYPE_METHOD; do_op.name = p_method; @@ -135,8 +135,8 @@ void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT Operation undo_op; undo_op.object = p_object->get_instance_id(); - if (p_object->cast_to<Resource>()) - undo_op.resref = Ref<Resource>(p_object->cast_to<Resource>()); + if (Object::cast_to<Resource>(p_object)) + undo_op.resref = Ref<Resource>(Object::cast_to<Resource>(p_object)); undo_op.type = Operation::TYPE_METHOD; undo_op.name = p_method; @@ -152,8 +152,8 @@ void UndoRedo::add_do_property(Object *p_object, const String &p_property, const ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; do_op.object = p_object->get_instance_id(); - if (p_object->cast_to<Resource>()) - do_op.resref = Ref<Resource>(p_object->cast_to<Resource>()); + if (Object::cast_to<Resource>(p_object)) + do_op.resref = Ref<Resource>(Object::cast_to<Resource>(p_object)); do_op.type = Operation::TYPE_PROPERTY; do_op.name = p_property; @@ -171,8 +171,8 @@ void UndoRedo::add_undo_property(Object *p_object, const String &p_property, con Operation undo_op; undo_op.object = p_object->get_instance_id(); - if (p_object->cast_to<Resource>()) - undo_op.resref = Ref<Resource>(p_object->cast_to<Resource>()); + if (Object::cast_to<Resource>(p_object)) + undo_op.resref = Ref<Resource>(Object::cast_to<Resource>(p_object)); undo_op.type = Operation::TYPE_PROPERTY; undo_op.name = p_property; @@ -185,8 +185,8 @@ void UndoRedo::add_do_reference(Object *p_object) { ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; do_op.object = p_object->get_instance_id(); - if (p_object->cast_to<Resource>()) - do_op.resref = Ref<Resource>(p_object->cast_to<Resource>()); + if (Object::cast_to<Resource>(p_object)) + do_op.resref = Ref<Resource>(Object::cast_to<Resource>(p_object)); do_op.type = Operation::TYPE_REFERENCE; actions[current_action + 1].do_ops.push_back(do_op); @@ -202,8 +202,8 @@ void UndoRedo::add_undo_reference(Object *p_object) { Operation undo_op; undo_op.object = p_object->get_instance_id(); - if (p_object->cast_to<Resource>()) - undo_op.resref = Ref<Resource>(p_object->cast_to<Resource>()); + if (Object::cast_to<Resource>(p_object)) + undo_op.resref = Ref<Resource>(Object::cast_to<Resource>(p_object)); undo_op.type = Operation::TYPE_REFERENCE; actions[current_action + 1].undo_ops.push_back(undo_op); @@ -270,7 +270,7 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) { obj->call(op.name, VARIANT_ARGS_FROM_ARRAY(op.args)); #ifdef TOOLS_ENABLED - Resource *res = obj->cast_to<Resource>(); + Resource *res = Object::cast_to<Resource>(obj); if (res) res->set_edited(true); @@ -284,7 +284,7 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) { obj->set(op.name, op.args[0]); #ifdef TOOLS_ENABLED - Resource *res = obj->cast_to<Resource>(); + Resource *res = Object::cast_to<Resource>(obj); if (res) res->set_edited(true); #endif diff --git a/core/undo_redo.h b/core/undo_redo.h index 5b79f957da..84133c4eea 100644 --- a/core/undo_redo.h +++ b/core/undo_redo.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/ustring.cpp b/core/ustring.cpp index 0521966943..ee07c7b11b 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -1252,66 +1252,7 @@ String String::utf8(const char *p_utf8, int p_len) { return ret; }; -#if 0 -_FORCE_INLINE static int parse_utf8_char(const char *p_utf8,unsigned int *p_ucs4,int p_left) { //return len - - - int len=0; - -/* Determine the number of characters in sequence */ - if ((*p_utf8 & 0x80)==0) - len=1; - else if ((*p_utf8 & 0xE0)==0xC0) - len=2; - else if ((*p_utf8 & 0xF0)==0xE0) - len=3; - else if ((*p_utf8 & 0xF8)==0xF0) - len=4; - else if ((*p_utf8 & 0xFC)==0xF8) - len=5; - else if ((*p_utf8 & 0xFE)==0xFC) - len=6; - else - return -1; //invalid UTF8 - - if (len>p_left) - return -1; //not enough space - - if (len==2 && (*p_utf8&0x1E)==0) { - //printf("overlong rejected\n"); - return -1; //reject overlong - } - - /* Convert the first character */ - - unsigned int unichar=0; - - if (len == 1) - unichar=*p_utf8; - else { - - unichar=(0xFF >> (len +1)) & *p_utf8; - for (int i=1;i<len;i++) { - - if ((p_utf8[i] & 0xC0) != 0x80) { - //printf("invalid utf8\n"); - return -1; //invalid utf8 - } - if (unichar==0 && i==2 && ((p_utf8[i] & 0x7F) >> (7 - len)) == 0) { - //printf("no overlong\n"); - return -1; //no overlong - } - unichar = (unichar << 6) | (p_utf8[i] & 0x3F); - } - } - - *p_ucs4=unichar; - - return len; - -} -#endif bool String::parse_utf8(const char *p_utf8, int p_len) { #define _UNICERROR(m_err) print_line("unicode error: " + String(m_err)); @@ -1998,94 +1939,6 @@ double String::to_double(const char *p_str) { #else return built_in_strtod<char>(p_str); #endif -#if 0 -#if 0 - - - return atof(p_str); -#else - if (!p_str[0]) - return 0; -///@todo make more exact so saving and loading does not lose precision - - double integer=0; - double decimal=0; - double decimal_mult=0.1; - double sign=1.0; - double exp=0; - double exp_sign=1.0; - int reading=READING_SIGN; - - const char *str=p_str; - - while(*str && reading!=READING_DONE) { - - CharType c=*(str++); - switch(reading) { - case READING_SIGN: { - if (c>='0' && c<='9') - reading=READING_INT; - // let it fallthrough - else if (c=='-') { - sign=-1.0; - reading=READING_INT; - break; - } else if (c=='.') { - reading=READING_DEC; - break; - } else { - break; - } - } - case READING_INT: { - - if (c>='0' && c<='9') { - - integer*=10; - integer+=c-'0'; - } else if (c=='.') { - reading=READING_DEC; - } else if (c=='e') { - reading=READING_EXP; - } else { - reading=READING_DONE; - } - - } break; - case READING_DEC: { - - if (c>='0' && c<='9') { - - decimal+=(c-'0')*decimal_mult; - decimal_mult*=0.1; - } else if (c=='e') { - reading=READING_EXP; - } else { - reading=READING_DONE; - } - - } break; - case READING_EXP: { - - if (c>='0' && c<='9') { - - exp*=10.0; - exp+=(c-'0'); - } else if (c=='-' && exp==0) { - exp_sign=-1.0; - } else if (exp_sign>=0 && c=='+') { - //redundant... - exp_sign=1.0; - } else { - reading=READING_DONE; - } - } break; - } - } - - return sign*(integer+decimal)*Math::pow(10,exp_sign*exp); -#endif -#endif } float String::to_float() const { @@ -2096,100 +1949,6 @@ float String::to_float() const { double String::to_double(const CharType *p_str, const CharType **r_end) { return built_in_strtod<CharType>(p_str, (CharType **)r_end); -#if 0 -#if 0 - //ndef NO_USE_STDLIB - return wcstod(p_str,p_len<0?NULL:p_str+p_len); -#else - if (p_len==0 || !p_str[0]) - return 0; -///@todo make more exact so saving and loading does not lose precision - - double integer=0; - double decimal=0; - double decimal_mult=0.1; - double sign=1.0; - double exp=0; - double exp_sign=1.0; - int reading=READING_SIGN; - - const CharType *str=p_str; - const CharType *limit=&p_str[p_len]; - - while(reading!=READING_DONE && str!=limit) { - - CharType c=*(str++); - switch(reading) { - case READING_SIGN: { - if (c>='0' && c<='9') - reading=READING_INT; - // let it fallthrough - else if (c=='-') { - sign=-1.0; - reading=READING_INT; - break; - } else if (c=='.') { - reading=READING_DEC; - break; - } else if (c==0) { - reading=READING_DONE; - break; - } else { - break; - } - } - case READING_INT: { - - if (c>='0' && c<='9') { - - integer*=10; - integer+=c-'0'; - } else if (c=='.') { - reading=READING_DEC; - } else if (c=='e' || c=='E') { - reading=READING_EXP; - } else { - reading=READING_DONE; - } - - } break; - case READING_DEC: { - - if (c>='0' && c<='9') { - - decimal+=(c-'0')*decimal_mult; - decimal_mult*=0.1; - } else if (c=='e' || c=='E') { - reading=READING_EXP; - } else { - reading=READING_DONE; - } - - } break; - case READING_EXP: { - - if (c>='0' && c<='9') { - - exp*=10.0; - exp+=(c-'0'); - } else if (c=='-' && exp==0) { - exp_sign=-1.0; - } else if (exp_sign>=0 && c=='+') { - //redundant... - exp_sign=1.0; - } else { - reading=READING_DONE; - } - } break; - } - } - - if (r_end) - *r_end=str-1; - - return sign*(integer+decimal)*Math::pow(10,exp_sign*exp); -#endif -#endif } int64_t String::to_int(const CharType *p_str, int p_len) { @@ -2252,98 +2011,6 @@ double String::to_double() const { #else return built_in_strtod<CharType>(c_str()); #endif -#if 0 -#ifndef NO_USE_STDLIB - - return atof(utf8().get_data()); -#else - - double integer=0; - double decimal=0; - double decimal_mult=0.1; - double sign=1.0; - double exp=0; - double exp_sign=1.0; - int reading=READING_SIGN; - - const CharType *str=&operator[](0); - - while(*str && reading!=READING_DONE) { - - CharType c=*(str++); - switch(reading) { - case READING_SIGN: { - if (c>='0' && c<='9') - reading=READING_INT; - // let it fallthrough - else if (c=='-') { - sign=-1.0; - reading=READING_INT; - break; - } else if (c=='.') { - reading=READING_DEC; - break; - } else { - break; - } - } - case READING_INT: { - - if (c>='0' && c<='9') { - - integer*=10; - integer+=c-'0'; - } else if (c=='.') { - reading=READING_DEC; - } else if (c=='e') { - reading=READING_EXP; - } else { - reading=READING_DONE; - } - - } break; - case READING_DEC: { - - if (c>='0' && c<='9') { - - decimal+=(c-'0')*decimal_mult; - decimal_mult*=0.1; - } else if (c=='e') { - reading=READING_EXP; - } else { - reading=READING_DONE; - } - - } break; - case READING_EXP: { - - if (c>='0' && c<='9') { - - exp*=10.0; - exp+=(c-'0'); - } else if (c=='-' && exp==0) { - exp_sign=-1.0; - } else if (exp_sign>=0 && c=='+') { - //redundant... - exp_sign=1.0; - } else { - reading=READING_DONE; - } - } break; - } - } - - return sign*(integer+decimal)*Math::pow(10,exp_sign*exp); -#endif -#if 0 - - - double ret=sign*(integer+decimal)*Math::pow(10,exp_sign*exp); - - print_line(*this +" == "+rtos(ret)); - return ret; -#endif -#endif } bool operator==(const char *p_chr, const String &p_str) { diff --git a/core/ustring.h b/core/ustring.h index 1c61e12e85..ab4e325f2c 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/variant.cpp b/core/variant.cpp index 51c4b70bdc..74f6b6a711 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -1764,14 +1764,14 @@ Variant::operator Object *() const { Variant::operator Node *() const { if (type == OBJECT) - return _get_obj().obj ? _get_obj().obj->cast_to<Node>() : NULL; + return Object::cast_to<Node>(_get_obj().obj); else return NULL; } Variant::operator Control *() const { if (type == OBJECT) - return _get_obj().obj ? _get_obj().obj->cast_to<Control>() : NULL; + return Object::cast_to<Control>(_get_obj().obj); else return NULL; } diff --git a/core/variant.h b/core/variant.h index 40de1a9bce..c44608ebfa 100644 --- a/core/variant.h +++ b/core/variant.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 59d31d2586..77372d1e60 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/variant_construct_string.cpp b/core/variant_construct_string.cpp index fa8a393d08..ccbb70d689 100644 --- a/core/variant_construct_string.cpp +++ b/core/variant_construct_string.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 5fda6b1473..b6e114b853 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 5aa71f6704..65c7b7cfec 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -742,7 +742,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, return err; if (token.type == TK_PARENTHESIS_CLOSE) { - Reference *reference = obj->cast_to<Reference>(); + Reference *reference = Object::cast_to<Reference>(obj); if (reference) { value = REF(reference); } else { diff --git a/core/variant_parser.h b/core/variant_parser.h index acbe0e967f..524891cdfd 100644 --- a/core/variant_parser.h +++ b/core/variant_parser.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/vector.h b/core/vector.h index 966832ac50..03eaf65099 100644 --- a/core/vector.h +++ b/core/vector.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/version.h b/core/version.h index 43f6f1bbf9..436f30ef01 100644 --- a/core/version.h +++ b/core/version.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/vmap.h b/core/vmap.h index 66f935f58d..f0977341ec 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ diff --git a/core/vset.h b/core/vset.h index 73062e064c..7b12ae0b25 100644 --- a/core/vset.h +++ b/core/vset.h @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ |