feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -694,11 +694,62 @@ struct _VariantCall {
|
|||
return s;
|
||||
}
|
||||
|
||||
static void func_PackedByteArray_bswap16(PackedByteArray *p_instance, int64_t p_offset, int64_t p_count) {
|
||||
size_t sz = p_instance->size();
|
||||
if (sz == 0 || p_count == 0) {
|
||||
return;
|
||||
}
|
||||
ERR_FAIL_COND(p_offset < 0 || p_offset > int64_t(sz) - 2);
|
||||
if (p_count < 0) {
|
||||
p_count = floor((sz - p_offset) / 2);
|
||||
}
|
||||
ERR_FAIL_COND(p_count > floor((sz - p_offset) / 2));
|
||||
|
||||
uint16_t *w = (uint16_t *)(p_instance->ptrw() + p_offset);
|
||||
for (int64_t i = 0; i < p_count; i++) {
|
||||
w[i] = BSWAP16(w[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void func_PackedByteArray_bswap32(PackedByteArray *p_instance, int64_t p_offset, int64_t p_count) {
|
||||
size_t sz = p_instance->size();
|
||||
if (sz == 0 || p_count == 0) {
|
||||
return;
|
||||
}
|
||||
ERR_FAIL_COND(p_offset < 0 || p_offset > int64_t(sz) - 4);
|
||||
if (p_count < 0) {
|
||||
p_count = floor((sz - p_offset) / 4);
|
||||
}
|
||||
ERR_FAIL_COND(p_count > floor((sz - p_offset) / 4));
|
||||
|
||||
uint32_t *w = (uint32_t *)(p_instance->ptrw() + p_offset);
|
||||
for (int64_t i = 0; i < p_count; i++) {
|
||||
w[i] = BSWAP32(w[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void func_PackedByteArray_bswap64(PackedByteArray *p_instance, int64_t p_offset, int64_t p_count) {
|
||||
size_t sz = p_instance->size();
|
||||
if (sz == 0 || p_count == 0) {
|
||||
return;
|
||||
}
|
||||
ERR_FAIL_COND(p_offset < 0 || p_offset > int64_t(sz) - 8);
|
||||
if (p_count < 0) {
|
||||
p_count = floor((sz - p_offset) / 8);
|
||||
}
|
||||
ERR_FAIL_COND(p_count > floor((sz - p_offset) / 8));
|
||||
|
||||
uint64_t *w = (uint64_t *)(p_instance->ptrw() + p_offset);
|
||||
for (int64_t i = 0; i < p_count; i++) {
|
||||
w[i] = BSWAP64(w[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static String func_PackedByteArray_get_string_from_utf8(PackedByteArray *p_instance) {
|
||||
String s;
|
||||
if (p_instance->size() > 0) {
|
||||
const uint8_t *r = p_instance->ptr();
|
||||
s.parse_utf8((const char *)r, p_instance->size());
|
||||
s.append_utf8((const char *)r, p_instance->size());
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
@ -707,7 +758,7 @@ struct _VariantCall {
|
|||
String s;
|
||||
if (p_instance->size() > 0) {
|
||||
const uint8_t *r = p_instance->ptr();
|
||||
s.parse_utf16((const char16_t *)r, floor((double)p_instance->size() / (double)sizeof(char16_t)));
|
||||
s.append_utf16((const char16_t *)r, floor((double)p_instance->size() / (double)sizeof(char16_t)));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
@ -716,7 +767,7 @@ struct _VariantCall {
|
|||
String s;
|
||||
if (p_instance->size() > 0) {
|
||||
const uint8_t *r = p_instance->ptr();
|
||||
s = String((const char32_t *)r, floor((double)p_instance->size() / (double)sizeof(char32_t)));
|
||||
s.append_utf32(Span((const char32_t *)r, floor((double)p_instance->size() / (double)sizeof(char32_t))));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
|
@ -726,14 +777,22 @@ struct _VariantCall {
|
|||
if (p_instance->size() > 0) {
|
||||
const uint8_t *r = p_instance->ptr();
|
||||
#ifdef WINDOWS_ENABLED
|
||||
s.parse_utf16((const char16_t *)r, floor((double)p_instance->size() / (double)sizeof(char16_t)));
|
||||
s.append_utf16((const char16_t *)r, floor((double)p_instance->size() / (double)sizeof(char16_t)));
|
||||
#else
|
||||
s = String((const char32_t *)r, floor((double)p_instance->size() / (double)sizeof(char32_t)));
|
||||
s.append_utf32(Span((const char32_t *)r, floor((double)p_instance->size() / (double)sizeof(char32_t))));
|
||||
#endif
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static String func_PackedByteArray_get_string_from_multibyte_char(PackedByteArray *p_instance, const String &p_encoding) {
|
||||
String s;
|
||||
if (p_instance->size() > 0) {
|
||||
s = OS::get_singleton()->multibyte_to_string(p_encoding, *p_instance);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static PackedByteArray func_PackedByteArray_compress(PackedByteArray *p_instance, int p_mode) {
|
||||
PackedByteArray compressed;
|
||||
|
||||
|
|
@ -1731,6 +1790,10 @@ static void _register_variant_builtin_methods_string() {
|
|||
bind_string_method(format, sarray("values", "placeholder"), varray("{_}"));
|
||||
bind_string_methodv(replace, static_cast<String (String::*)(const String &, const String &) const>(&String::replace), sarray("what", "forwhat"), varray());
|
||||
bind_string_methodv(replacen, static_cast<String (String::*)(const String &, const String &) const>(&String::replacen), sarray("what", "forwhat"), varray());
|
||||
bind_string_method(replace_char, sarray("key", "with"), varray());
|
||||
bind_string_methodv(replace_chars, static_cast<String (String::*)(const String &, char32_t) const>(&String::replace_chars), sarray("keys", "with"), varray());
|
||||
bind_string_method(remove_char, sarray("what"), varray());
|
||||
bind_string_methodv(remove_chars, static_cast<String (String::*)(const String &) const>(&String::remove_chars), sarray("chars"), varray());
|
||||
bind_string_method(repeat, sarray("count"), varray());
|
||||
bind_string_method(reverse, sarray(), varray());
|
||||
bind_string_method(insert, sarray("position", "what"), varray());
|
||||
|
|
@ -1739,6 +1802,7 @@ static void _register_variant_builtin_methods_string() {
|
|||
bind_string_method(to_camel_case, sarray(), varray());
|
||||
bind_string_method(to_pascal_case, sarray(), varray());
|
||||
bind_string_method(to_snake_case, sarray(), varray());
|
||||
bind_string_method(to_kebab_case, sarray(), varray());
|
||||
bind_string_methodv(split, static_cast<Vector<String> (String::*)(const String &, bool, int) const>(&String::split), sarray("delimiter", "allow_empty", "maxsplit"), varray("", true, 0));
|
||||
bind_string_methodv(rsplit, static_cast<Vector<String> (String::*)(const String &, bool, int) const>(&String::rsplit), sarray("delimiter", "allow_empty", "maxsplit"), varray("", true, 0));
|
||||
bind_string_method(split_floats, sarray("delimiter", "allow_empty"), varray(true));
|
||||
|
|
@ -1780,6 +1844,7 @@ static void _register_variant_builtin_methods_string() {
|
|||
bind_string_method(xml_unescape, sarray(), varray());
|
||||
bind_string_method(uri_encode, sarray(), varray());
|
||||
bind_string_method(uri_decode, sarray(), varray());
|
||||
bind_string_method(uri_file_decode, sarray(), varray());
|
||||
bind_string_method(c_escape, sarray(), varray());
|
||||
bind_string_method(c_unescape, sarray(), varray());
|
||||
bind_string_method(json_escape, sarray(), varray());
|
||||
|
|
@ -1813,8 +1878,9 @@ static void _register_variant_builtin_methods_string() {
|
|||
bind_string_method(to_utf8_buffer, sarray(), varray());
|
||||
bind_string_method(to_utf16_buffer, sarray(), varray());
|
||||
bind_string_method(to_utf32_buffer, sarray(), varray());
|
||||
bind_string_method(hex_decode, sarray(), varray());
|
||||
bind_string_method(to_wchar_buffer, sarray(), varray());
|
||||
bind_string_method(to_multibyte_char_buffer, sarray("encoding"), varray(String()));
|
||||
bind_string_method(hex_decode, sarray(), varray());
|
||||
|
||||
bind_static_method(String, num_scientific, sarray("number"), varray());
|
||||
bind_static_method(String, num, sarray("number", "decimals"), varray(-1));
|
||||
|
|
@ -2449,12 +2515,14 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedByteArray, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedByteArray, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedByteArray, count, sarray("value"), varray());
|
||||
bind_method(PackedByteArray, erase, sarray("value"), varray());
|
||||
|
||||
bind_function(PackedByteArray, get_string_from_ascii, _VariantCall::func_PackedByteArray_get_string_from_ascii, sarray(), varray());
|
||||
bind_function(PackedByteArray, get_string_from_utf8, _VariantCall::func_PackedByteArray_get_string_from_utf8, sarray(), varray());
|
||||
bind_function(PackedByteArray, get_string_from_utf16, _VariantCall::func_PackedByteArray_get_string_from_utf16, sarray(), varray());
|
||||
bind_function(PackedByteArray, get_string_from_utf32, _VariantCall::func_PackedByteArray_get_string_from_utf32, sarray(), varray());
|
||||
bind_function(PackedByteArray, get_string_from_wchar, _VariantCall::func_PackedByteArray_get_string_from_wchar, sarray(), varray());
|
||||
bind_function(PackedByteArray, get_string_from_multibyte_char, _VariantCall::func_PackedByteArray_get_string_from_multibyte_char, sarray("encoding"), varray(String()));
|
||||
bind_function(PackedByteArray, hex_encode, _VariantCall::func_PackedByteArray_hex_encode, sarray(), varray());
|
||||
bind_function(PackedByteArray, compress, _VariantCall::func_PackedByteArray_compress, sarray("compression_mode"), varray(0));
|
||||
bind_function(PackedByteArray, decompress, _VariantCall::func_PackedByteArray_decompress, sarray("buffer_size", "compression_mode"), varray(0));
|
||||
|
|
@ -2480,6 +2548,10 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_function(PackedByteArray, to_float32_array, _VariantCall::func_PackedByteArray_decode_float_array, sarray(), varray());
|
||||
bind_function(PackedByteArray, to_float64_array, _VariantCall::func_PackedByteArray_decode_double_array, sarray(), varray());
|
||||
|
||||
bind_functionnc(PackedByteArray, bswap16, _VariantCall::func_PackedByteArray_bswap16, sarray("offset", "count"), varray(0, -1));
|
||||
bind_functionnc(PackedByteArray, bswap32, _VariantCall::func_PackedByteArray_bswap32, sarray("offset", "count"), varray(0, -1));
|
||||
bind_functionnc(PackedByteArray, bswap64, _VariantCall::func_PackedByteArray_bswap64, sarray("offset", "count"), varray(0, -1));
|
||||
|
||||
bind_functionnc(PackedByteArray, encode_u8, _VariantCall::func_PackedByteArray_encode_u8, sarray("byte_offset", "value"), varray());
|
||||
bind_functionnc(PackedByteArray, encode_s8, _VariantCall::func_PackedByteArray_encode_s8, sarray("byte_offset", "value"), varray());
|
||||
bind_functionnc(PackedByteArray, encode_u16, _VariantCall::func_PackedByteArray_encode_u16, sarray("byte_offset", "value"), varray());
|
||||
|
|
@ -2515,6 +2587,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedInt32Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedInt32Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedInt32Array, count, sarray("value"), varray());
|
||||
bind_method(PackedInt32Array, erase, sarray("value"), varray());
|
||||
|
||||
/* Int64 Array */
|
||||
|
||||
|
|
@ -2538,6 +2611,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedInt64Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedInt64Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedInt64Array, count, sarray("value"), varray());
|
||||
bind_method(PackedInt64Array, erase, sarray("value"), varray());
|
||||
|
||||
/* Float32 Array */
|
||||
|
||||
|
|
@ -2561,6 +2635,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedFloat32Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedFloat32Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedFloat32Array, count, sarray("value"), varray());
|
||||
bind_method(PackedFloat32Array, erase, sarray("value"), varray());
|
||||
|
||||
/* Float64 Array */
|
||||
|
||||
|
|
@ -2584,6 +2659,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedFloat64Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedFloat64Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedFloat64Array, count, sarray("value"), varray());
|
||||
bind_method(PackedFloat64Array, erase, sarray("value"), varray());
|
||||
|
||||
/* String Array */
|
||||
|
||||
|
|
@ -2607,6 +2683,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedStringArray, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedStringArray, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedStringArray, count, sarray("value"), varray());
|
||||
bind_method(PackedStringArray, erase, sarray("value"), varray());
|
||||
|
||||
/* Vector2 Array */
|
||||
|
||||
|
|
@ -2630,6 +2707,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedVector2Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedVector2Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedVector2Array, count, sarray("value"), varray());
|
||||
bind_method(PackedVector2Array, erase, sarray("value"), varray());
|
||||
|
||||
/* Vector3 Array */
|
||||
|
||||
|
|
@ -2653,6 +2731,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedVector3Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedVector3Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedVector3Array, count, sarray("value"), varray());
|
||||
bind_method(PackedVector3Array, erase, sarray("value"), varray());
|
||||
|
||||
/* Color Array */
|
||||
|
||||
|
|
@ -2676,6 +2755,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedColorArray, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedColorArray, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedColorArray, count, sarray("value"), varray());
|
||||
bind_method(PackedColorArray, erase, sarray("value"), varray());
|
||||
|
||||
/* Vector4 Array */
|
||||
|
||||
|
|
@ -2699,6 +2779,7 @@ static void _register_variant_builtin_methods_array() {
|
|||
bind_method(PackedVector4Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedVector4Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedVector4Array, count, sarray("value"), varray());
|
||||
bind_method(PackedVector4Array, erase, sarray("value"), varray());
|
||||
}
|
||||
|
||||
static void _register_variant_builtin_constants() {
|
||||
|
|
@ -2715,7 +2796,7 @@ static void _register_variant_builtin_constants() {
|
|||
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "ZERO", Vector3(0, 0, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "ONE", Vector3(1, 1, 1));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "INF", Vector3(INFINITY, INFINITY, INFINITY));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "INF", Vector3(Math::INF, Math::INF, Math::INF));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "LEFT", Vector3(-1, 0, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "RIGHT", Vector3(1, 0, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR3, "UP", Vector3(0, 1, 0));
|
||||
|
|
@ -2737,7 +2818,7 @@ static void _register_variant_builtin_constants() {
|
|||
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR4, "ZERO", Vector4(0, 0, 0, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR4, "ONE", Vector4(1, 1, 1, 1));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR4, "INF", Vector4(INFINITY, INFINITY, INFINITY, INFINITY));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR4, "INF", Vector4(Math::INF, Math::INF, Math::INF, Math::INF));
|
||||
|
||||
_VariantCall::add_enum_constant(Variant::VECTOR3I, "Axis", "AXIS_X", Vector3i::AXIS_X);
|
||||
_VariantCall::add_enum_constant(Variant::VECTOR3I, "Axis", "AXIS_Y", Vector3i::AXIS_Y);
|
||||
|
|
@ -2772,7 +2853,7 @@ static void _register_variant_builtin_constants() {
|
|||
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "ZERO", Vector2(0, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "ONE", Vector2(1, 1));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "INF", Vector2(INFINITY, INFINITY));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "INF", Vector2(Math::INF, Math::INF));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "LEFT", Vector2(-1, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "RIGHT", Vector2(1, 0));
|
||||
_VariantCall::add_variant_constant(Variant::VECTOR2, "UP", Vector2(0, -1));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue