diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-06-30 11:28:43 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-06-30 11:28:43 -0300 |
commit | 55b34e05b3d735a84e1af9833e19c0b816c18252 (patch) | |
tree | a2e5e0020bf68a2b3ea66010dfe5f54b83403d7b /modules/gdscript | |
parent | 95047562d743b1c1fdc007432c8a0c145a455c5d (diff) |
-some changes by okam
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_script.cpp | 8 | ||||
-rw-r--r-- | modules/gdscript/gd_script.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 63bb44784d..53ae0c8702 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1977,9 +1977,17 @@ void GDScript::_bind_methods() { ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo("new")); + ObjectTypeDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code); + } +Vector<uint8_t> GDScript::get_as_byte_code() const { + + GDTokenizerBuffer tokenizer; + return tokenizer.parse_code_string(source); +}; + Error GDScript::load_byte_code(const String& p_path) { diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index 4672f3b8be..1e1279d5f5 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -349,6 +349,8 @@ public: Error load_source_code(const String& p_path); Error load_byte_code(const String& p_path); + Vector<uint8_t> get_as_byte_code() const; + virtual ScriptLanguage *get_language() const; GDScript(); |