summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/SCsub13
-rw-r--r--core/bind/core_bind.cpp25
-rw-r--r--core/bind/core_bind.h5
-rw-r--r--core/engine.cpp75
-rw-r--r--core/engine.h5
-rw-r--r--core/io/translation_loader_po.cpp2
-rw-r--r--core/project_settings.cpp1
-rw-r--r--core/script_debugger_remote.cpp60
-rw-r--r--core/script_language.cpp2
-rw-r--r--core/script_language.h2
-rw-r--r--core/variant_call.cpp2
11 files changed, 169 insertions, 23 deletions
diff --git a/core/SCsub b/core/SCsub
index 383aaf0e12..c4f1cdbe97 100644
--- a/core/SCsub
+++ b/core/SCsub
@@ -2,6 +2,8 @@
Import('env')
+import methods
+
env.core_sources = []
@@ -93,6 +95,17 @@ env.add_source_files(env.core_sources, "*.cpp")
import make_binders
env.Command(['method_bind.gen.inc', 'method_bind_ext.gen.inc'], 'make_binders.py', make_binders.run)
+# Authors
+env.Depends('#core/authors.gen.h', "../AUTHORS.md")
+env.Command('#core/authors.gen.h', "../AUTHORS.md", methods.make_authors_header)
+
+# Donors
+env.Depends('#core/donors.gen.h', "../DONORS.md")
+env.Command('#core/donors.gen.h', "../DONORS.md", methods.make_donors_header)
+
+# License
+env.Depends('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"])
+env.Command('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], methods.make_license_header)
# Chain load SCsubs
SConscript('os/SCsub')
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 3270b33f1c..14e3804840 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -2710,6 +2710,26 @@ Dictionary _Engine::get_version_info() const {
return Engine::get_singleton()->get_version_info();
}
+Dictionary _Engine::get_author_info() const {
+ return Engine::get_singleton()->get_author_info();
+}
+
+Array _Engine::get_copyright_info() const {
+ return Engine::get_singleton()->get_copyright_info();
+}
+
+Dictionary _Engine::get_donor_info() const {
+ return Engine::get_singleton()->get_donor_info();
+}
+
+Dictionary _Engine::get_license_info() const {
+ return Engine::get_singleton()->get_license_info();
+}
+
+String _Engine::get_license_text() const {
+ return Engine::get_singleton()->get_license_text();
+}
+
bool _Engine::is_in_physics_frame() const {
return Engine::get_singleton()->is_in_physics_frame();
}
@@ -2752,6 +2772,11 @@ void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_main_loop"), &_Engine::get_main_loop);
ClassDB::bind_method(D_METHOD("get_version_info"), &_Engine::get_version_info);
+ ClassDB::bind_method(D_METHOD("get_author_info"), &_Engine::get_author_info);
+ ClassDB::bind_method(D_METHOD("get_copyright_info"), &_Engine::get_copyright_info);
+ ClassDB::bind_method(D_METHOD("get_donor_info"), &_Engine::get_donor_info);
+ ClassDB::bind_method(D_METHOD("get_license_info"), &_Engine::get_license_info);
+ ClassDB::bind_method(D_METHOD("get_license_text"), &_Engine::get_license_text);
ClassDB::bind_method(D_METHOD("is_in_physics_frame"), &_Engine::is_in_physics_frame);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index a363f5970f..1de5e43b27 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -689,6 +689,11 @@ public:
MainLoop *get_main_loop() const;
Dictionary get_version_info() const;
+ Dictionary get_author_info() const;
+ Array get_copyright_info() const;
+ Dictionary get_donor_info() const;
+ Dictionary get_license_info() const;
+ String get_license_text() const;
bool is_in_physics_frame() const;
diff --git a/core/engine.cpp b/core/engine.cpp
index b2c34a853c..7c8024b946 100644
--- a/core/engine.cpp
+++ b/core/engine.cpp
@@ -30,6 +30,9 @@
#include "engine.h"
+#include "authors.gen.h"
+#include "donors.gen.h"
+#include "license.gen.h"
#include "version.h"
#include "version_hash.gen.h"
@@ -111,6 +114,78 @@ Dictionary Engine::get_version_info() const {
return dict;
}
+static Array array_from_info(const char *const *info_list) {
+ Array arr;
+ for (int i = 0; info_list[i] != NULL; i++) {
+ arr.push_back(info_list[i]);
+ }
+ return arr;
+}
+
+static Array array_from_info_count(const char *const *info_list, int info_count) {
+ Array arr;
+ for (int i = 0; i < info_count; i++) {
+ arr.push_back(info_list[i]);
+ }
+ return arr;
+}
+
+Dictionary Engine::get_author_info() const {
+ Dictionary dict;
+
+ dict["lead_developers"] = array_from_info(AUTHORS_LEAD_DEVELOPERS);
+ dict["project_managers"] = array_from_info(AUTHORS_PROJECT_MANAGERS);
+ dict["founders"] = array_from_info(AUTHORS_FOUNDERS);
+ dict["developers"] = array_from_info(AUTHORS_DEVELOPERS);
+
+ return dict;
+}
+
+Array Engine::get_copyright_info() const {
+ Array components;
+ for (int component_index = 0; component_index < COPYRIGHT_INFO_COUNT; component_index++) {
+ const ComponentCopyright &cp_info = COPYRIGHT_INFO[component_index];
+ Dictionary component_dict;
+ component_dict["name"] = cp_info.name;
+ Array parts;
+ for (int i = 0; i < cp_info.part_count; i++) {
+ const ComponentCopyrightPart &cp_part = cp_info.parts[i];
+ Dictionary part_dict;
+ part_dict["files"] = array_from_info_count(cp_part.files, cp_part.file_count);
+ part_dict["copyright"] = array_from_info_count(cp_part.copyright_statements, cp_part.copyright_count);
+ part_dict["license"] = cp_part.license;
+ parts.push_back(part_dict);
+ }
+ component_dict["parts"] = parts;
+
+ components.push_back(component_dict);
+ }
+ return components;
+}
+
+Dictionary Engine::get_donor_info() const {
+ Dictionary donors;
+ donors["platinum_sponsors"] = array_from_info(DONORS_SPONSOR_PLAT);
+ donors["gold_sponsors"] = array_from_info(DONORS_SPONSOR_GOLD);
+ donors["mini_sponsors"] = array_from_info(DONORS_SPONSOR_MINI);
+ donors["gold_donors"] = array_from_info(DONORS_GOLD);
+ donors["silver_donors"] = array_from_info(DONORS_SILVER);
+ donors["bronze_donors"] = array_from_info(DONORS_BRONZE);
+ return donors;
+}
+
+Dictionary Engine::get_license_info() const {
+ Dictionary licenses;
+ for (int i = 0; i < LICENSE_COUNT; i++) {
+ licenses[LICENSE_NAMES[i]] = LICENSE_BODIES[i];
+ }
+ return licenses;
+}
+
+String Engine::get_license_text() const {
+ return String(GODOT_LICENSE_TEXT);
+}
+
void Engine::add_singleton(const Singleton &p_singleton) {
singletons.push_back(p_singleton);
diff --git a/core/engine.h b/core/engine.h
index 665992699a..031ba29cd6 100644
--- a/core/engine.h
+++ b/core/engine.h
@@ -118,6 +118,11 @@ public:
#endif
Dictionary get_version_info() const;
+ Dictionary get_author_info() const;
+ Array get_copyright_info() const;
+ Dictionary get_donor_info() const;
+ Dictionary get_license_info() const;
+ String get_license_text() const;
Engine();
};
diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp
index e01e2a84c5..16d5e3c282 100644
--- a/core/io/translation_loader_po.cpp
+++ b/core/io/translation_loader_po.cpp
@@ -175,7 +175,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
String prop = c.substr(0, p).strip_edges();
String value = c.substr(p + 1, c.length()).strip_edges();
- if (prop == "X-Language") {
+ if (prop == "X-Language" || prop == "Language") {
translation->set_locale(value);
}
}
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index ef485cb3b2..ac4a4b7d15 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -1071,7 +1071,6 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_mode", 2);
GLOBAL_DEF("debug/settings/profiler/max_functions", 16384);
- GLOBAL_DEF("debug/settings/performance/update_frequency_msec", 250);
//assigning here, because using GLOBAL_GET on every block for compressing can be slow
Compression::zstd_long_distance_matching = GLOBAL_DEF("compression/formats/zstd/long_distance_matching", false);
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 7a30a33c67..0473e2cc71 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -567,22 +567,46 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) {
if (ScriptInstance *si = obj->get_script_instance()) {
if (!si->get_script().is_null()) {
- Set<StringName> members;
- si->get_script()->get_members(&members);
- for (Set<StringName>::Element *E = members.front(); E; E = E->next()) {
-
- Variant m;
- if (si->get(E->get(), m)) {
- PropertyInfo pi(m.get_type(), String("Members/") + E->get());
- properties.push_back(PropertyDesc(pi, m));
+ typedef Map<const Script *, Set<StringName> > ScriptMemberMap;
+ typedef Map<const Script *, Map<StringName, Variant> > ScriptConstantsMap;
+
+ ScriptMemberMap members;
+ members[si->get_script().ptr()] = Set<StringName>();
+ si->get_script()->get_members(&(members[si->get_script().ptr()]));
+
+ ScriptConstantsMap constants;
+ constants[si->get_script().ptr()] = Map<StringName, Variant>();
+ si->get_script()->get_constants(&(constants[si->get_script().ptr()]));
+
+ Ref<Script> base = si->get_script()->get_base_script();
+ while (base.is_valid()) {
+
+ members[base.ptr()] = Set<StringName>();
+ base->get_members(&(members[base.ptr()]));
+
+ constants[base.ptr()] = Map<StringName, Variant>();
+ base->get_constants(&(constants[base.ptr()]));
+
+ base = base->get_base_script();
+ }
+
+ for (ScriptMemberMap::Element *sm = members.front(); sm; sm = sm->next()) {
+ for (Set<StringName>::Element *E = sm->get().front(); E; E = E->next()) {
+ Variant m;
+ if (si->get(E->get(), m)) {
+ String script_path = sm->key() == si->get_script().ptr() ? "" : sm->key()->get_path().get_file() + "/";
+ PropertyInfo pi(m.get_type(), "Members/" + script_path + E->get());
+ properties.push_back(PropertyDesc(pi, m));
+ }
}
}
- Map<StringName, Variant> constants;
- si->get_script()->get_constants(&constants);
- for (Map<StringName, Variant>::Element *E = constants.front(); E; E = E->next()) {
- PropertyInfo pi(E->value().get_type(), (String("Constants/") + E->key()));
- properties.push_back(PropertyDesc(pi, E->value()));
+ for (ScriptConstantsMap::Element *sc = constants.front(); sc; sc = sc->next()) {
+ for (Map<StringName, Variant>::Element *E = sc->get().front(); E; E = E->next()) {
+ String script_path = sc->key() == si->get_script().ptr() ? "" : sc->key()->get_path().get_file() + "/";
+ PropertyInfo pi(E->value().get_type(), "Constants/" + script_path + E->key());
+ properties.push_back(PropertyDesc(pi, E->value()));
+ }
}
}
}
@@ -658,8 +682,10 @@ void ScriptDebuggerRemote::_set_object_property(ObjectID p_id, const String &p_p
return;
String prop_name = p_property;
- if (p_property.begins_with("Members/"))
- prop_name = p_property.substr(8, p_property.length());
+ if (p_property.begins_with("Members/")) {
+ Vector<String> ss = p_property.split("/");
+ prop_name = ss[ss.size() - 1];
+ }
obj->set(prop_name, p_value);
}
@@ -854,7 +880,7 @@ void ScriptDebuggerRemote::idle_poll() {
if (performance) {
uint64_t pt = OS::get_singleton()->get_ticks_msec();
- if (pt - last_perf_time > update_frequency) {
+ if (pt - last_perf_time > 1000) {
last_perf_time = pt;
int max = performance->get("MONITOR_MAX");
@@ -1081,7 +1107,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() :
eh.userdata = this;
add_error_handler(&eh);
- profile_info.resize(CLAMP(int(GLOBAL_GET("debug/settings/profiler/max_functions")), 128, 65535));
+ profile_info.resize(CLAMP(int(ProjectSettings::get_singleton()->get("debug/settings/profiler/max_functions")), 128, 65535));
profile_info_ptrs.resize(profile_info.size());
}
diff --git a/core/script_language.cpp b/core/script_language.cpp
index ce9b138bb2..1dab58e29e 100644
--- a/core/script_language.cpp
+++ b/core/script_language.cpp
@@ -29,7 +29,6 @@
/*************************************************************************/
#include "script_language.h"
-#include "project_settings.h"
ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES];
int ScriptServer::_language_count = 0;
@@ -284,7 +283,6 @@ ScriptDebugger::ScriptDebugger() {
lines_left = -1;
depth = -1;
break_lang = NULL;
- update_frequency = GLOBAL_GET("debug/settings/performance/update_frequency_msec");
}
bool PlaceHolderScriptInstance::set(const StringName &p_name, const Variant &p_value) {
diff --git a/core/script_language.h b/core/script_language.h
index 64c6f2eb81..b4c55cac9e 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -352,8 +352,6 @@ class ScriptDebugger {
public:
typedef void (*RequestSceneTreeMessageFunc)(void *);
- int update_frequency;
-
struct LiveEditFuncs {
void *udata;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 4158c2a60e..e6f36ecbf1 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -763,6 +763,7 @@ struct _VariantCall {
VCALL_PTR1R(Basis, xform_inv);
VCALL_PTR0R(Basis, get_orthogonal_index);
VCALL_PTR0R(Basis, orthonormalized);
+ VCALL_PTR2R(Basis, slerp);
VCALL_PTR0R(Transform, inverse);
VCALL_PTR0R(Transform, affine_inverse);
@@ -1803,6 +1804,7 @@ void register_variant_methods() {
ADDFUNC1R(BASIS, VECTOR3, Basis, xform, VECTOR3, "v", varray());
ADDFUNC1R(BASIS, VECTOR3, Basis, xform_inv, VECTOR3, "v", varray());
ADDFUNC0R(BASIS, INT, Basis, get_orthogonal_index, varray());
+ ADDFUNC2R(BASIS, BASIS, Basis, slerp, BASIS, "b", REAL, "t", varray());
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, inverse, varray());
ADDFUNC0R(TRANSFORM, TRANSFORM, Transform, affine_inverse, varray());