diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-19 21:18:18 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-19 21:18:18 +0200 |
commit | ae00187b58cc5ec20ceb2c00c912820c756ed275 (patch) | |
tree | ea7afe68cf0826268484d2d8f1d5029ec6e049d4 /modules/gdscript/gdscript_byte_codegen.cpp | |
parent | 5f9175f969807410bc077fc9caa0fa53febd4319 (diff) | |
parent | aebbbda08060e0cd130c5a682cd91b6babb18c67 (diff) | |
download | redot-engine-ae00187b58cc5ec20ceb2c00c912820c756ed275.tar.gz |
Merge pull request #77129 from dalexeev/gds-fix-static-var-bugs-part-1
GDScript: Fix some bugs with static variables and functions
Diffstat (limited to 'modules/gdscript/gdscript_byte_codegen.cpp')
-rw-r--r-- | modules/gdscript/gdscript_byte_codegen.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp index 3239f64cb2..47cd3f768b 100644 --- a/modules/gdscript/gdscript_byte_codegen.cpp +++ b/modules/gdscript/gdscript_byte_codegen.cpp @@ -853,6 +853,20 @@ void GDScriptByteCodeGenerator::write_get_member(const Address &p_target, const append(p_name); } +void GDScriptByteCodeGenerator::write_set_static_variable(const Address &p_value, const Address &p_class, int p_index) { + append_opcode(GDScriptFunction::OPCODE_SET_STATIC_VARIABLE); + append(p_value); + append(p_class); + append(p_index); +} + +void GDScriptByteCodeGenerator::write_get_static_variable(const Address &p_target, const Address &p_class, int p_index) { + append_opcode(GDScriptFunction::OPCODE_GET_STATIC_VARIABLE); + append(p_target); + append(p_class); + append(p_index); +} + void GDScriptByteCodeGenerator::write_assign_with_conversion(const Address &p_target, const Address &p_source) { switch (p_target.type.kind) { case GDScriptDataType::BUILTIN: { |