feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -42,7 +42,7 @@
#include "core/os/thread_safe.h"
#include "core/variant/typed_array.h"
namespace core_bind {
namespace CoreBind {
////// ResourceLoader //////
@ -466,8 +466,8 @@ bool OS::is_restart_on_exit_set() const {
Vector<String> OS::get_restart_on_exit_arguments() const {
List<String> args = ::OS::get_singleton()->get_restart_on_exit_arguments();
Vector<String> args_vector;
for (List<String>::Element *E = args.front(); E; E = E->next()) {
args_vector.push_back(E->get());
for (const String &arg : args) {
args_vector.push_back(arg);
}
return args_vector;
@ -657,8 +657,8 @@ void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_system_font_path_for_text", "font_name", "text", "locale", "script", "weight", "stretch", "italic"), &OS::get_system_font_path_for_text, DEFVAL(String()), DEFVAL(String()), DEFVAL(400), DEFVAL(100), DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_executable_path"), &OS::get_executable_path);
ClassDB::bind_method(D_METHOD("read_string_from_stdin", "buffer_size"), &OS::read_string_from_stdin);
ClassDB::bind_method(D_METHOD("read_buffer_from_stdin", "buffer_size"), &OS::read_buffer_from_stdin);
ClassDB::bind_method(D_METHOD("read_string_from_stdin", "buffer_size"), &OS::read_string_from_stdin, DEFVAL(1024));
ClassDB::bind_method(D_METHOD("read_buffer_from_stdin", "buffer_size"), &OS::read_buffer_from_stdin, DEFVAL(1024));
ClassDB::bind_method(D_METHOD("get_stdin_type"), &OS::get_stdin_type);
ClassDB::bind_method(D_METHOD("get_stdout_type"), &OS::get_stdout_type);
ClassDB::bind_method(D_METHOD("get_stderr_type"), &OS::get_stderr_type);
@ -806,13 +806,11 @@ Vector<Vector2> Geometry2D::get_closest_points_between_segments(const Vector2 &p
}
Vector2 Geometry2D::get_closest_point_to_segment(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b) {
Vector2 s[2] = { p_a, p_b };
return ::Geometry2D::get_closest_point_to_segment(p_point, s);
return ::Geometry2D::get_closest_point_to_segment(p_point, p_a, p_b);
}
Vector2 Geometry2D::get_closest_point_to_segment_uncapped(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b) {
Vector2 s[2] = { p_a, p_b };
return ::Geometry2D::get_closest_point_to_segment_uncapped(p_point, s);
return ::Geometry2D::get_closest_point_to_segment_uncapped(p_point, p_a, p_b);
}
bool Geometry2D::point_is_inside_triangle(const Vector2 &s, const Vector2 &a, const Vector2 &b, const Vector2 &c) const {
@ -1069,13 +1067,11 @@ Vector<Vector3> Geometry3D::get_closest_points_between_segments(const Vector3 &p
}
Vector3 Geometry3D::get_closest_point_to_segment(const Vector3 &p_point, const Vector3 &p_a, const Vector3 &p_b) {
Vector3 s[2] = { p_a, p_b };
return ::Geometry3D::get_closest_point_to_segment(p_point, s);
return ::Geometry3D::get_closest_point_to_segment(p_point, p_a, p_b);
}
Vector3 Geometry3D::get_closest_point_to_segment_uncapped(const Vector3 &p_point, const Vector3 &p_a, const Vector3 &p_b) {
Vector3 s[2] = { p_a, p_b };
return ::Geometry3D::get_closest_point_to_segment_uncapped(p_point, s);
return ::Geometry3D::get_closest_point_to_segment_uncapped(p_point, p_a, p_b);
}
Vector3 Geometry3D::get_triangle_barycentric_coords(const Vector3 &p_point, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2) {
@ -1241,6 +1237,9 @@ Vector<uint8_t> Marshalls::base64_to_raw(const String &p_str) {
}
String Marshalls::utf8_to_base64(const String &p_str) {
if (p_str.is_empty()) {
return String();
}
CharString cstr = p_str.utf8();
String ret = CryptoCore::b64_encode_str((unsigned char *)cstr.get_data(), cstr.length());
ERR_FAIL_COND_V(ret.is_empty(), ret);
@ -1340,6 +1339,7 @@ void Thread::_start_func(void *ud) {
// When the call returns, we will reference the thread again if possible.
ObjectID th_instance_id = t->get_instance_id();
Callable target_callable = t->target_callable;
String id = t->get_id();
t = Ref<Thread>();
Callable::CallError ce;
@ -1347,7 +1347,7 @@ void Thread::_start_func(void *ud) {
target_callable.callp(nullptr, 0, ret, ce);
// If script properly kept a reference to the thread, we should be able to re-reference it now
// (well, or if the call failed, since we had to break chains anyway because the outcome isn't known upfront).
t = Ref<Thread>(ObjectDB::get_instance(th_instance_id));
t = ObjectDB::get_ref<Thread>(th_instance_id);
if (t.is_valid()) {
t->ret = ret;
t->running.clear();
@ -1357,7 +1357,7 @@ void Thread::_start_func(void *ud) {
}
if (ce.error != Callable::CallError::CALL_OK) {
ERR_FAIL_MSG(vformat("Could not call function '%s' to start thread %d: %s.", func_name, t->get_id(), Variant::get_callable_error_text(t->target_callable, nullptr, 0, ce)));
ERR_FAIL_MSG(vformat("Could not call function '%s' to start thread %s: %s.", func_name, id, Variant::get_callable_error_text(target_callable, nullptr, 0, ce)));
}
}
@ -1419,7 +1419,7 @@ void Thread::_bind_methods() {
BIND_ENUM_CONSTANT(PRIORITY_HIGH);
}
namespace special {
namespace Special {
////// ClassDB //////
@ -1438,8 +1438,8 @@ PackedStringArray ClassDB::get_class_list() const {
}
PackedStringArray ClassDB::get_inheriters_from_class(const StringName &p_class) const {
List<StringName> classes;
::ClassDB::get_inheriters_from_class(p_class, &classes);
LocalVector<StringName> classes;
::ClassDB::get_inheriters_from_class(p_class, classes);
PackedStringArray ret;
ret.resize(classes.size());
@ -1746,7 +1746,7 @@ void ClassDB::_bind_methods() {
BIND_ENUM_CONSTANT(API_NONE);
}
} // namespace special
} // namespace Special
////// Engine //////
@ -1876,8 +1876,8 @@ Vector<String> Engine::get_singleton_list() const {
List<::Engine::Singleton> singletons;
::Engine::get_singleton()->get_singletons(&singletons);
Vector<String> ret;
for (List<::Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
ret.push_back(E->get().name);
for (const ::Engine::Singleton &E : singletons) {
ret.push_back(E.name);
}
return ret;
}
@ -2190,4 +2190,4 @@ void EngineDebugger::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear_breakpoints"), &EngineDebugger::clear_breakpoints);
}
} // namespace core_bind
} // namespace CoreBind