diff options
author | Karroffel <therzog@mail.de> | 2017-03-18 15:23:28 +0100 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-03-18 15:23:28 +0100 |
commit | 7fa7f7b9c5d5999a5c626a77b1a9b22da6f009b9 (patch) | |
tree | ff6610df8b430d445726f7ee94072e91f80bf5e9 /binding_generator/src/main.rs | |
parent | 80e3e74934426c9fc87906096cbd53efcc316b19 (diff) | |
download | redot-cpp-7fa7f7b9c5d5999a5c626a77b1a9b22da6f009b9.tar.gz |
added operator overload for string
Diffstat (limited to 'binding_generator/src/main.rs')
-rw-r--r-- | binding_generator/src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/binding_generator/src/main.rs b/binding_generator/src/main.rs index 1af7aaa..d426fa8 100644 --- a/binding_generator/src/main.rs +++ b/binding_generator/src/main.rs @@ -504,7 +504,8 @@ fn generate_icall_header(icalls: &HashSet<(String, Vec<String>)>) -> String { contents = contents + return_type(ret) + " " + get_icall_name_ref((ret, args)).as_str() + "(godot_method_bind *mb, godot_object *inst"; for arg in args { contents = contents + ", "; - if !is_primitive(&arg) && is_core_type(&arg) { + // if !is_primitive(&arg) && is_core_type(&arg) { + if !is_primitive(&arg) { contents = contents + "const " + arg.as_str() + "&"; } else { contents = contents + "const " + arg.as_str() + ""; @@ -544,7 +545,8 @@ fn generate_icall_implementation(icalls: &HashSet<(String, Vec<String>)>) -> Str let mut i = 0; for arg in args { contents = contents + ", "; - if !is_primitive(&arg) && is_core_type(&arg) { + // if !is_primitive(&arg) && is_core_type(&arg) { + if !is_primitive(&arg) { contents = contents + "const " + arg.as_str() + "&"; } else { contents = contents + "const " + arg.as_str() + ""; @@ -570,7 +572,7 @@ fn generate_icall_implementation(icalls: &HashSet<(String, Vec<String>)>) -> Str } else if is_core_type(arg) { contents = contents + "(void *) &arg" + j.to_string().as_str(); } else { - contents = contents + "(void *) *(godot_object**) &arg" + j.to_string().as_str(); + contents = contents + "(void *) arg" + j.to_string().as_str() + ".__core_object"; } contents = contents + ",\n"; j = j + 1; |