feat: updated engine

This commit is contained in:
Sara Gerretsen 2026-07-10 17:04:34 +02:00
parent cbe99774ff
commit f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions

View file

@ -33,6 +33,7 @@
#include "gdscript.h"
#include "gdscript_function.h"
#include "core/object/method_bind.h"
#include "core/string/string_builder.h"
static String _get_variant_string(const Variant &p_variant) {
@ -162,7 +163,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
Variant::Type builtin_type = (Variant::Type)_code_ptr[ip + 4];
StringName native_type = get_global_name(_code_ptr[ip + 5]);
if (script_type.is_valid() && script_type->is_valid()) {
if (script_type.is_valid() && script_type->is_script_valid()) {
text += "script(";
text += GDScript::debug_get_script_name(script_type);
text += ")";
@ -187,7 +188,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
Variant::Type key_builtin_type = (Variant::Type)_code_ptr[ip + 5];
StringName key_native_type = get_global_name(_code_ptr[ip + 6]);
if (key_script_type.is_valid() && key_script_type->is_valid()) {
if (key_script_type.is_valid() && key_script_type->is_script_valid()) {
text += "script(";
text += GDScript::debug_get_script_name(key_script_type);
text += ")";
@ -203,7 +204,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
Variant::Type value_builtin_type = (Variant::Type)_code_ptr[ip + 7];
StringName value_native_type = get_global_name(_code_ptr[ip + 8]);
if (value_script_type.is_valid() && value_script_type->is_valid()) {
if (value_script_type.is_valid() && value_script_type->is_script_valid()) {
text += "script(";
text += GDScript::debug_get_script_name(value_script_type);
text += ")";
@ -577,7 +578,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
StringName native_type = get_global_name(_code_ptr[ip + argc + 5]);
String type_name;
if (script_type.is_valid() && script_type->is_valid()) {
if (script_type.is_valid() && script_type->is_script_valid()) {
type_name = "script(" + GDScript::debug_get_script_name(script_type) + ")";
} else if (native_type != StringName()) {
type_name = native_type;
@ -632,7 +633,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
StringName key_native_type = get_global_name(_code_ptr[ip + argc * 2 + 6]);
String key_type_name;
if (key_script_type.is_valid() && key_script_type->is_valid()) {
if (key_script_type.is_valid() && key_script_type->is_script_valid()) {
key_type_name = "script(" + GDScript::debug_get_script_name(key_script_type) + ")";
} else if (key_native_type != StringName()) {
key_type_name = key_native_type;
@ -645,7 +646,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
StringName value_native_type = get_global_name(_code_ptr[ip + argc * 2 + 8]);
String value_type_name;
if (value_script_type.is_valid() && value_script_type->is_valid()) {
if (value_script_type.is_valid() && value_script_type->is_script_valid()) {
value_type_name = "script(" + GDScript::debug_get_script_name(value_script_type) + ")";
} else if (value_native_type != StringName()) {
value_type_name = value_native_type;
@ -752,7 +753,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
text += " = ";
text += Variant::get_type_name(type);
text += ".";
text += _global_names_ptr[_code_ptr[ip + 2 + instr_var_args]].operator String();
text += _global_names_ptr[_code_ptr[ip + 2 + instr_var_args]].string();
text += "(";
for (int i = 0; i < argc; i++) {
@ -1003,7 +1004,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
text += DADDR(1 + captures_count);
text += "create lambda from ";
text += lambda->name.operator String();
text += lambda->name.string();
text += "function, captures (";
for (int i = 0; i < captures_count; i++) {
@ -1023,7 +1024,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
text += DADDR(1 + captures_count);
text += "create self lambda from ";
text += lambda->name.operator String();
text += lambda->name.string();
text += "function, captures (";
for (int i = 0; i < captures_count; i++) {
@ -1116,56 +1117,56 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
incr += 3;
} break;
#define DISASSEMBLE_ITERATE(m_type) \
case OPCODE_ITERATE_##m_type: { \
text += "for-loop (typed "; \
text += #m_type; \
text += ") "; \
text += DADDR(3); \
text += " in "; \
text += DADDR(2); \
text += " counter "; \
text += DADDR(1); \
text += " end "; \
#define DISASSEMBLE_ITERATE(m_type) \
case OPCODE_ITERATE_##m_type: { \
text += "for-loop (typed "; \
text += #m_type; \
text += ") "; \
text += DADDR(3); \
text += " in "; \
text += DADDR(2); \
text += " counter "; \
text += DADDR(1); \
text += " end "; \
text += itos(_code_ptr[ip + 4]); \
incr += 5; \
incr += 5; \
} break
#define DISASSEMBLE_ITERATE_BEGIN(m_type) \
case OPCODE_ITERATE_BEGIN_##m_type: { \
text += "for-init (typed "; \
text += #m_type; \
text += ") "; \
text += DADDR(3); \
text += " in "; \
text += DADDR(2); \
text += " counter "; \
text += DADDR(1); \
text += " end "; \
text += itos(_code_ptr[ip + 4]); \
incr += 5; \
text += "for-init (typed "; \
text += #m_type; \
text += ") "; \
text += DADDR(3); \
text += " in "; \
text += DADDR(2); \
text += " counter "; \
text += DADDR(1); \
text += " end "; \
text += itos(_code_ptr[ip + 4]); \
incr += 5; \
} break
#define DISASSEMBLE_ITERATE_TYPES(m_macro) \
m_macro(INT); \
m_macro(FLOAT); \
m_macro(VECTOR2); \
m_macro(VECTOR2I); \
m_macro(VECTOR3); \
m_macro(VECTOR3I); \
m_macro(STRING); \
m_macro(DICTIONARY); \
m_macro(ARRAY); \
m_macro(PACKED_BYTE_ARRAY); \
m_macro(PACKED_INT32_ARRAY); \
m_macro(PACKED_INT64_ARRAY); \
m_macro(PACKED_FLOAT32_ARRAY); \
m_macro(PACKED_FLOAT64_ARRAY); \
m_macro(PACKED_STRING_ARRAY); \
m_macro(PACKED_VECTOR2_ARRAY); \
m_macro(PACKED_VECTOR3_ARRAY); \
m_macro(PACKED_COLOR_ARRAY); \
m_macro(PACKED_VECTOR4_ARRAY); \
m_macro(INT); \
m_macro(FLOAT); \
m_macro(VECTOR2); \
m_macro(VECTOR2I); \
m_macro(VECTOR3); \
m_macro(VECTOR3I); \
m_macro(STRING); \
m_macro(DICTIONARY); \
m_macro(ARRAY); \
m_macro(PACKED_BYTE_ARRAY); \
m_macro(PACKED_INT32_ARRAY); \
m_macro(PACKED_INT64_ARRAY); \
m_macro(PACKED_FLOAT32_ARRAY); \
m_macro(PACKED_FLOAT64_ARRAY); \
m_macro(PACKED_STRING_ARRAY); \
m_macro(PACKED_VECTOR2_ARRAY); \
m_macro(PACKED_VECTOR3_ARRAY); \
m_macro(PACKED_COLOR_ARRAY); \
m_macro(PACKED_VECTOR4_ARRAY); \
m_macro(OBJECT)
case OPCODE_ITERATE_BEGIN: {
@ -1256,11 +1257,11 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
#define DISASSEMBLE_TYPE_ADJUST(m_v_type) \
case OPCODE_TYPE_ADJUST_##m_v_type: { \
text += "type adjust ("; \
text += #m_v_type; \
text += ") "; \
text += DADDR(1); \
incr += 2; \
text += "type adjust ("; \
text += #m_v_type; \
text += ") "; \
text += DADDR(1); \
incr += 2; \
} break
DISASSEMBLE_TYPE_ADJUST(BOOL);