aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorvolzhs2015-07-01 15:13:10 +0900
committervolzhs2015-07-01 15:13:10 +0900
commitf6668dc9db34fc4a3ef9e9e309e0fc248c3f51a8 (patch)
tree0c9a6e5cd8b6d3fdfab3cb6aff41458a08841133 /modules/gdscript
parent903e6b37c0ed94cd0b3447dd3ff471abbfaa4460 (diff)
parentb4d5f7e154973e8fb93a9a0af6ffa0b065e2c50c (diff)
downloadgodot-f6668dc9db34fc4a3ef9e9e309e0fc248c3f51a8.tar.gz
godot-f6668dc9db34fc4a3ef9e9e309e0fc248c3f51a8.tar.zst
godot-f6668dc9db34fc4a3ef9e9e309e0fc248c3f51a8.zip
Merge branch 'master' of https://github.com/okamstudio/godot into fix_android_payments
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_script.cpp12
-rw-r--r--modules/gdscript/gd_script.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index b6ad7aa71..53ae0c870 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) {
@@ -2556,9 +2564,9 @@ void GDScriptLanguage::init() {
//populate native classes
- List<String> class_list;
+ List<StringName> class_list;
ObjectTypeDB::get_type_list(&class_list);
- for(List<String>::Element *E=class_list.front();E;E=E->next()) {
+ for(List<StringName>::Element *E=class_list.front();E;E=E->next()) {
StringName n = E->get();
String s = String(n);
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index 4672f3b8b..1e1279d5f 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();