From 632c953e4211eeddf9932918a26f0d2101c3fc38 Mon Sep 17 00:00:00 2001 From: Karroffel Date: Mon, 6 Mar 2017 08:49:24 +0100 Subject: [PATCH] buuunch of stuff --- .gitignore | 1 + binding_generator/src/main.rs | 393 +++++++++++++----- include/SConstruct | 70 ++-- include/godot_cpp/Godot.h | 267 ------------ include/godot_cpp/core/Array.cpp | 4 +- include/godot_cpp/core/{Array.h => Array.hpp} | 2 +- include/godot_cpp/core/Basis.cpp | 10 +- include/godot_cpp/core/{Basis.h => Basis.hpp} | 4 +- include/godot_cpp/core/Color.cpp | 4 +- include/godot_cpp/core/{Color.h => Color.hpp} | 2 +- include/godot_cpp/core/CoreTypes.h | 27 -- include/godot_cpp/core/CoreTypes.hpp | 27 ++ include/godot_cpp/core/{Defs.h => Defs.hpp} | 0 include/godot_cpp/core/Dictionary.cpp | 6 +- .../core/{Dictionary.h => Dictionary.hpp} | 4 +- include/godot_cpp/core/Image.cpp | 14 +- include/godot_cpp/core/{Image.h => Image.hpp} | 10 +- include/godot_cpp/core/InputEvent.cpp | 8 +- .../core/{InputEvent.h => InputEvent.hpp} | 2 +- include/godot_cpp/core/NodePath.cpp | 4 +- .../core/{NodePath.h => NodePath.hpp} | 2 +- include/godot_cpp/core/Plane.cpp | 4 +- include/godot_cpp/core/{Plane.h => Plane.hpp} | 2 +- include/godot_cpp/core/PoolArrays.cpp | 12 +- .../core/{PoolArrays.h => PoolArrays.hpp} | 10 +- include/godot_cpp/core/Quat.cpp | 8 +- include/godot_cpp/core/{Quat.h => Quat.hpp} | 2 +- include/godot_cpp/core/RID.cpp | 2 +- include/godot_cpp/core/{RID.h => RID.hpp} | 2 + include/godot_cpp/core/Rect2.cpp | 8 +- include/godot_cpp/core/{Rect2.h => Rect2.hpp} | 2 +- include/godot_cpp/core/Rect3.cpp | 6 +- include/godot_cpp/core/{Rect3.h => Rect3.hpp} | 4 +- include/godot_cpp/core/String.cpp | 2 +- .../godot_cpp/core/{String.h => String.hpp} | 0 include/godot_cpp/core/Transform.cpp | 10 +- .../core/{Transform.h => Transform.hpp} | 6 +- include/godot_cpp/core/Transform2D.cpp | 8 +- .../core/{Transform2D.h => Transform2D.hp} | 2 +- include/godot_cpp/core/Variant.cpp | 6 +- .../godot_cpp/core/{Variant.h => Variant.hpp} | 34 +- include/godot_cpp/core/Vector2.cpp | 4 +- .../godot_cpp/core/{Vector2.h => Vector2.hpp} | 2 +- include/godot_cpp/core/Vector3.cpp | 6 +- .../godot_cpp/core/{Vector3.h => Vector3.hpp} | 4 +- 45 files changed, 474 insertions(+), 533 deletions(-) delete mode 100644 include/godot_cpp/Godot.h rename include/godot_cpp/core/{Array.h => Array.hpp} (98%) rename include/godot_cpp/core/{Basis.h => Basis.hpp} (98%) rename include/godot_cpp/core/{Color.h => Color.hpp} (98%) delete mode 100644 include/godot_cpp/core/CoreTypes.h create mode 100644 include/godot_cpp/core/CoreTypes.hpp rename include/godot_cpp/core/{Defs.h => Defs.hpp} (100%) rename include/godot_cpp/core/{Dictionary.h => Dictionary.hpp} (93%) rename include/godot_cpp/core/{Image.h => Image.hpp} (95%) rename include/godot_cpp/core/{InputEvent.h => InputEvent.hpp} (99%) rename include/godot_cpp/core/{NodePath.h => NodePath.hpp} (95%) rename include/godot_cpp/core/{Plane.h => Plane.hpp} (98%) rename include/godot_cpp/core/{PoolArrays.h => PoolArrays.hpp} (97%) rename include/godot_cpp/core/{Quat.h => Quat.hpp} (98%) rename include/godot_cpp/core/{RID.h => RID.hpp} (92%) rename include/godot_cpp/core/{Rect2.h => Rect2.hpp} (99%) rename include/godot_cpp/core/{Rect3.h => Rect3.hpp} (98%) rename include/godot_cpp/core/{String.h => String.hpp} (100%) rename include/godot_cpp/core/{Transform.h => Transform.hpp} (97%) rename include/godot_cpp/core/{Transform2D.h => Transform2D.hp} (99%) rename include/godot_cpp/core/{Variant.h => Variant.hpp} (91%) rename include/godot_cpp/core/{Vector2.h => Vector2.hpp} (99%) rename include/godot_cpp/core/{Vector3.h => Vector3.hpp} (98%) diff --git a/.gitignore b/.gitignore index 26c753f..52f6c7d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ include/godot_cpp/*.hpp include/godot_cpp/impl/ include/godot.h include/godot +*.os diff --git a/binding_generator/src/main.rs b/binding_generator/src/main.rs index 6f02888..ea0c7a2 100644 --- a/binding_generator/src/main.rs +++ b/binding_generator/src/main.rs @@ -68,6 +68,8 @@ fn main() { let json: Vec = serde_json::from_str::>(&file_contents).unwrap(); + let mut icalls: HashSet<(String, Vec)> = HashSet::new(); + for class in json { let used_classes = get_used_classes(&class); @@ -76,8 +78,17 @@ fn main() { header.write_all(generate_class_header(&used_classes, &class).as_bytes()); let mut implementation = File::create((base_dir.to_string() + "impl/" + strip_name(&class.name) + ".cpp").as_str()).unwrap(); - implementation.write_all(generate_class_implementation(&used_classes, &class).as_bytes()); + implementation.write_all(generate_class_implementation(&mut icalls, &used_classes, &class).as_bytes()); } + + // generate icall files + let mut icall_header = File::create((base_dir.to_string() + "__icalls.hpp").as_str()).unwrap(); + + icall_header.write_all(generate_icall_header(&icalls).as_bytes()); + + let mut icall_implmentation = File::create((base_dir.to_string() + "impl/__icalls.cpp").as_str()).unwrap(); + + icall_implmentation.write_all(generate_icall_implementation(&icalls).as_bytes()); } fn get_used_classes(class: &GodotClass) -> HashSet<&String> { @@ -110,12 +121,12 @@ fn generate_class_header(used_classes: &HashSet<&String>, class: &GodotClass) -> contents = contents + "#define "; contents = contents + strip_name(&class.name).to_string().to_uppercase().as_str() + "_H\n\n"; - contents = contents + "\n#include \"core/CoreTypes.h\"\n"; + contents = contents + "\n#include \"core/CoreTypes.hpp\"\n"; contents = contents + "\n#include \n\n\n"; if class.base_class != "" { - contents = contents + "\n#include \"" + strip_name(&class.base_class) + ".h\"\n\n\n"; + contents = contents + "\n#include \"" + strip_name(&class.base_class) + ".hpp\"\n\n\n"; } contents = contents + "namespace godot {\n\n"; @@ -138,10 +149,6 @@ fn generate_class_header(used_classes: &HashSet<&String>, class: &GodotClass) -> name }; - if class.singleton { - contents = contents + "\n\nstatic godot_object *" + core_obj_name.as_str() + ";\n\n"; - } - contents = contents + "class " + strip_name(&class.name); if class.base_class != "" { @@ -178,8 +185,8 @@ fn generate_class_header(used_classes: &HashSet<&String>, class: &GodotClass) -> } if class.instanciable { - contents = contents + "\tstatic " + strip_name(&class.name) + " _new();\n"; - contents = contents + "\tvoid _destroy();\n\n"; + contents = contents + "\tstatic " + strip_name(&class.name) + "& __new();\n"; + contents = contents + "\tvoid __destroy();\n\n"; } for (name, value) in &class.constants { @@ -189,7 +196,7 @@ fn generate_class_header(used_classes: &HashSet<&String>, class: &GodotClass) -> contents += "\n\n"; for method in &class.methods { - contents = contents + "\t" + (if class.singleton { "static " } else if method.is_virtual { "virtual " } else { "" }) + strip_name(&method.return_type) + (if !is_core_type(&method.return_type) && !is_primitive(&method.return_type) { " &" } else { " " }) + method.name.as_str() + "("; + contents = contents + "\t" + (if class.singleton { "static " } else if method.is_virtual { "virtual " } else { "" }) + strip_name(&method.return_type) + (if !is_core_type(&method.return_type) && !is_primitive(&method.return_type) { " &" } else { " " }) + escape_cpp(&method.name) + "("; for (i, argument) in (&method.arguments).iter().enumerate() { if !is_primitive(&argument._type) { @@ -204,11 +211,21 @@ fn generate_class_header(used_classes: &HashSet<&String>, class: &GodotClass) -> } } - contents = contents + ")" + if method.is_const { " const" } else { "" } + ";\n"; + contents = contents + ")" + if method.is_const && !class.singleton { " const" } else { "" } + ";\n"; + // contents = contents + ")" + if method.is_const { " const" } else { "" } + ";\n"; } contents = contents + "};\n\n"; + if class.base_class == "" { + // Object + contents = contents + "\ninline Variant::operator Object() const\n{\n\n"; + + contents = contents + "\treturn Object(godot_variant_as_object(&_godot_variant));\n\n"; + + contents = contents + "\n}\n\n"; + } + contents = contents + "}\n"; contents = contents + "#endif\n"; @@ -217,22 +234,26 @@ fn generate_class_header(used_classes: &HashSet<&String>, class: &GodotClass) -> } -fn generate_class_implementation(used_classes: &HashSet<&String>, class: &GodotClass) -> String { +fn generate_class_implementation(icalls: &mut HashSet<(String, Vec)>, used_classes: &HashSet<&String>, class: &GodotClass) -> String { let mut contents = String::new(); contents = contents + "#include \"" + strip_name(&class.name) + ".hpp" + "\"\n"; - /* contents = contents + "\n#include \"core/CoreTypes.h\"\n"; + contents = contents + "\n#include \"core/CoreTypes.hpp\"\n"; - contents = contents + "\n#include \n\n\n"; - - if class.base_class != "" { - contents = contents + "\n#include \"" + strip_name(&class.base_class) + ".h\"\n\n\n"; + if class.instanciable { + contents = contents + "#include \"ClassDB.hpp\"\n"; } - contents = contents + "namespace godot {\n\n"; + contents = contents + "\n#include \"__icalls.hpp\"\n\n\n"; - // contents += forward_declares; + for used_class in used_classes { + contents = contents + "#include \"" + strip_name(used_class) + ".hpp\"\n"; + } + + contents = contents + "\n\n"; + + contents = contents + "namespace godot {\n\n"; let core_obj_name = { let mut name = String::new(); @@ -244,65 +265,46 @@ fn generate_class_implementation(used_classes: &HashSet<&String>, class: &GodotC name }; - if class.singleton { - contents = contents + "\n\nstatic godot_object *" + core_obj_name.as_str() + ";\n\n"; - } - - contents = contents + "\n\n\nclass " + strip_name(&class.name); - - if class.base_class != "" { - contents = contents + " : public " + strip_name(&class.base_class); - } - - contents = contents + " {\n"; - - if class.base_class == "" { - contents = contents + "protected:\n\tgodot_object *__core_object = 0;\n\n"; - } + contents = contents + "\n\n\n"; if class.singleton { - contents = contents + "private:\n"; - contents = contents + "\tstatic void ___singleton_init() { " - + core_obj_name.as_str() + " = godot_global_get_singleton(\"" + strip_name(&class.name) + "\"); }\n\n"; + contents = contents + "static godot_object *" + core_obj_name.as_str() + ";\n\n\n\n\n"; + } + + + if class.singleton { + contents = contents + "void " + strip_name(&class.name) + "::___singleton_init()\n{\n\t" + + core_obj_name.as_str() + " = godot_global_get_singleton(\"" + strip_name(&class.name) + "\");\n}\n\n"; } - contents = contents + "public:\n\n"; // default constructor { - contents = contents + "\t" + strip_name(&class.name) + "() {\n"; - contents = contents + "\t\t\n"; - contents = contents + "\t}\n\n"; + contents = contents + "" + strip_name(&class.name) + "::" + strip_name(&class.name) + "()\n{\n"; + contents = contents + "\t\n"; + contents = contents + "}\n\n"; } // pointer constructor { - contents = contents + "\t" + strip_name(&class.name) + "(godot_object *ptr) {\n"; - contents = contents + "\t\t__core_object = ptr;\n"; - contents = contents + "\t}\n\n\n"; + contents = contents + "" + strip_name(&class.name) + "::" + strip_name(&class.name) + "(godot_object *ptr)\n{\n"; + contents = contents + "\t__core_object = ptr;\n"; + contents = contents + "}\n\n\n"; } if class.base_class != "" { - contents = contents + "\tvoid _init() {\n"; - contents = contents + "\t\t\n"; - contents = contents + "\t}\n\n"; + contents = contents + "void " + strip_name(&class.name) + "::" + "_init()\n{\n"; + contents = contents + "\t\n"; + contents = contents + "}\n\n"; } - if class.instanciable { - contents = contents + "\tstatic " + strip_name(&class.name) + "& _new();\n"; - contents = contents + "\tvoid _destroy();\n\n"; - } - - for (name, value) in &class.constants { - contents = contents + "\tconst static int " + name.as_str() + " = " + value.as_i64().unwrap().to_string().as_str() + ";\n"; - } contents += "\n\n"; for method in &class.methods { - contents = contents + "\t" + (if class.singleton { "static " } else { "" }) + strip_name(&method.return_type) + (if !is_core_type(&method.return_type) && !is_primitive(&method.return_type) { " &" } else { " " }) + method.name.as_str() + "("; + contents = contents + strip_name(&method.return_type) + (if !is_core_type(&method.return_type) && !is_primitive(&method.return_type) { " &" } else { " " }) + strip_name(&class.name) + "::" + escape_cpp(&method.name) + "("; for (i, argument) in (&method.arguments).iter().enumerate() { if !is_primitive(&argument._type) { @@ -317,94 +319,269 @@ fn generate_class_implementation(used_classes: &HashSet<&String>, class: &GodotC } } - contents = contents + ") {\n"; + contents = contents + ")" + if method.is_const && !class.singleton { " const" } else { "" } + "\n{\n"; + if class.singleton { - contents = contents + "\t\tif (" + core_obj_name.as_str() + " == 0) {\n"; - contents = contents + "\t\t\t___singleton_init();\n"; - contents = contents + "\t\t}\n\n"; + contents = contents + "\tif (" + core_obj_name.as_str() + " == 0) {\n"; + contents = contents + "\t\t___singleton_init();\n"; + contents = contents + "\t}\n\n"; } - contents = contents + "\t\tstatic godot_method_bind *mb = NULL;\n" - + "\t\tif (mb == NULL) {\n" - + "\t\t\tmb = godot_method_bind_get_method(\"" + class.name.as_str() + "\", \"" + method.name.as_str() + "\");\n" - + "\t\t}\n"; + contents = contents + "\tstatic godot_method_bind *mb = NULL;\n" + + "\tif (mb == NULL) {\n" + + "\t\tmb = godot_method_bind_get_method(\"" + class.name.as_str() + "\", \"" + method.name.as_str() + "\");\n" + + "\t}\n\t"; + if method.return_type != "void" { - // contents = contents + "\t\t" + strip_name(&method.return_type) + (if !is_core_type(&method.return_type) && !is_primitive(&method.return_type) { "*" } else { "" }) + " ret;" + "\n"; - contents = contents + "\t\t" + if !is_core_type(&method.return_type) && !is_primitive(&method.return_type) { "godot_object*" } else { strip_name(&method.return_type) } + " ret;\n"; - } - - contents = contents + "\t\tconst void *args[] = {\n"; - - for argument in &method.arguments { - contents = contents + "\t\t\t"; - if is_primitive(&argument._type) { - contents = contents + "&" + argument.name.as_str(); - } else if is_core_type(&argument._type) { - contents = contents + "(void *) &" + escape_cpp(&argument.name); - } else { - contents = contents + "(void *) &" + escape_cpp(&argument.name); + contents = contents + "return "; + if !is_primitive(&method.return_type) && !is_core_type(&method.return_type) { + contents = contents + "reinterpret_cast<" + strip_name(&method.return_type) + "&>("; } - contents = contents + ",\n"; } - contents = contents + "\t\t};\n"; + let mut args = Vec::new(); - contents = contents + "\t\tgodot_method_bind_ptrcall(mb, " + core_obj_name.as_str() + ", args, " + if method.return_type == "void" { "NULL" } else { "&ret" } + ");\n"; + fn get_icall_type_name(t: &String) -> String { + if is_core_type(t) || is_primitive(t) { + t.clone() + } else { + "Object".to_string() + } + } + + for arg in &method.arguments { + args.push(get_icall_type_name(&arg._type)); + } + + let icallsig = (get_icall_type_name(&method.return_type), args); + + let name = get_icall_name(&icallsig); + + icalls.insert(icallsig); + + + + contents = contents + name.as_str() + "(mb, " + core_obj_name.as_str(); + + for arg in &method.arguments { + contents = contents + ", " + escape_cpp(&arg.name); + } if !is_primitive(&method.return_type) && !is_core_type(&method.return_type) { - contents = contents + "\t\treturn reinterpret_cast<" + strip_name(&method.return_type) + "&>(ret);\n"; - } else if method.return_type != "void" { - contents = contents + "\t\treturn ret;\n"; + contents = contents + ")"; } + contents = contents + ");\n"; - contents = contents + "\t}\n\n"; + contents = contents + "}\n\n"; } - contents = contents + "};\n\n"; - - contents = contents + "}\n"; - - - if class.instanciable { - contents = contents + "#include \"ClassDB.h\"\n"; - - contents = contents + "namespace godot {\n\n"; - - contents = contents + "" + strip_name(&class.name) + "& " + strip_name(&class.name) + "::_new() {\n"; + contents = contents + strip_name(&class.name) + "& " + strip_name(&class.name) + "::__new() {\n"; contents = contents + "\tObject ptr = ClassDB::instance(\"" + class.name.as_str() + "\");\n"; - contents = contents + "\treturn reinterpret_cast<" + strip_name(&class.name) + "&>(ptr);"; + contents = contents + "\treturn reinterpret_cast<" + strip_name(&class.name) + "&>(ptr);\n"; contents = contents + "}\n\n"; - contents = contents + "void " + strip_name(&class.name) + "::_destroy() {\n"; + contents = contents + "void " + strip_name(&class.name) + "::__destroy() {\n"; contents = contents + "\tgodot_object_destroy(__core_object);\n"; contents = contents + "}\n\n\n"; - if class.base_class == "" { + /* if class.base_class == "" { // Object contents = contents + "Variant::operator Object()const {\n\n"; contents = contents + "\treturn Object(godot_variant_as_object(&_godot_variant));\n\n"; contents = contents + "}\n\n"; - } + } */ + } - contents = contents + "}\n"; + contents = contents + "}\n"; + + contents +} + +fn get_icall_name(sig: &(String, Vec)) -> String { + + let &(ref ret, ref args) = sig; + + let mut name = String::new(); + + name = name + "___godot_icall_"; + + name = name + strip_name(&ret); + + for arg in args { + name = name + "_" + strip_name(&arg); + } + + name +} + +fn get_icall_name_ref(sig: (&String, &Vec)) -> String { + + let (ref ret, args) = sig; + + let mut name = String::new(); + + name = name + "___godot_icall_"; + + name = name + strip_name(&ret); + + for arg in args { + name = name + "_" + strip_name(&arg); + } + + name +} + +fn generate_icall_header(icalls: &HashSet<(String, Vec)>) -> String { + + fn return_type(t: &String) -> &str { + if is_primitive(t) || is_core_type(t) { + t.as_str() + } else { + "Object& " + } } + let mut contents = String::new(); + + contents = contents + "#ifndef __ICALLS_H\n"; + contents = contents + "#define __ICALLS_H\n\n\n"; + + contents = contents + "#include \n\n\n"; + + contents = contents + "#include \"core/CoreTypes.hpp\"\n"; + contents = contents + "#include \"Object.hpp\"\n\n\n"; + + contents = contents + "using namespace godot;\n\n\n"; + + for &(ref ret, ref args) in icalls { + 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) { + contents = contents + "const " + arg.as_str() + "&"; + } else { + contents = contents + "const " + arg.as_str() + ""; + } + } + contents = contents + ");\n"; + } + + contents = contents + "#endif"; + + contents +} + +fn generate_icall_implementation(icalls: &HashSet<(String, Vec)>) -> String { + + fn return_type(t: &String) -> &str { + if is_primitive(t) || is_core_type(t) { + t.as_str() + } else { + "Object& " + } + } + + let mut contents = String::new(); + + contents = contents + "#include \"__icalls.hpp\"\n"; + + contents = contents + "#include \n\n\n"; + + contents = contents + "#include \"core/CoreTypes.hpp\"\n"; + contents = contents + "#include \"Object.hpp\"\n\n\n"; + + contents = contents + "using namespace godot;\n\n\n"; + + for &(ref ret, ref args) in icalls { + contents = contents + return_type(ret) + " " + get_icall_name_ref((ret, args)).as_str() + "(godot_method_bind *mb, godot_object *inst"; + let mut i = 0; + for arg in args { + contents = contents + ", "; + if !is_primitive(&arg) { + contents = contents + "const " + arg.as_str() + "&"; + } else { + contents = contents + "const " + arg.as_str() + ""; + } + contents = contents + " arg" + i.to_string().as_str(); + i = i + 1; + } + contents = contents + ")\n"; + + contents = contents + "{\n"; + + if ret != "void" { + contents = contents + "\t" + if !is_core_type(ret) && !is_primitive(ret) { "godot_object*" } else { strip_name(ret) } + " ret;\n"; + } + + contents = contents + "\tconst void *args[] = {\n"; + + let mut j = 0; + for arg in args { + contents = contents + "\t\t"; + if is_primitive(arg) { + contents = contents + "&arg" + j.to_string().as_str(); + } else if is_core_type(arg) { + contents = contents + "(void *) &arg" + j.to_string().as_str(); + } else { + contents = contents + "(void *) &arg" + j.to_string().as_str(); + } + contents = contents + ",\n"; + j = j + 1; + } + + contents = contents + "\t};\n"; + + contents = contents + "\tgodot_method_bind_ptrcall(mb, inst, args, " + if ret == "void" { "NULL" } else { "&ret" } + ");\n"; + + if !is_primitive(ret) && !is_core_type(ret) { + contents = contents + "\treturn reinterpret_cast(ret);\n"; + } else if ret != "void" { + contents = contents + "\treturn ret;\n"; + } + + contents = contents + "}\n\n"; + } + + // contents = contents + "#endif"; - contents = contents + "#endif\n"; - */ contents } fn is_core_type(name: &String) -> bool { - let core_types = vec!["Array", "PoolStringArray", "Vector2", "Vector3", "String", "Variant"]; + let core_types = vec!["Array", + "Basis", + "Color", + "Dictionary", + "Error", + "Image", + "InputEvent", + "NodePath", + "Plane", + "PoolByteArray", + "PoolIntArray", + "PoolRealArray", + "PoolStringArray", + "PoolVector2Array", + "PoolVector3Array", + "PoolColorArray", + "Quat", + "Rect2", + "Rect3", + "RID", + "String", + "Transform", + "Transform2D", + "Variant", + "Vector2", + "Vector3"]; core_types.contains(&name.as_str()) } @@ -418,6 +595,14 @@ fn escape_cpp(name: &String) -> &str { "class" => "_class", "char" => "_char", "short" => "_short", + "bool" => "_bool", + "int" => "_int", + "default" => "_default", + "case" => "_case", + "switch" => "_switch", + "export" => "_export", + "template" => "_template", + "new" => "new_", x => x } } \ No newline at end of file diff --git a/include/SConstruct b/include/SConstruct index 63d9cc4..2287e94 100644 --- a/include/SConstruct +++ b/include/SConstruct @@ -1,31 +1,51 @@ #!python +import os + env = Environment() env["CXX"] = "clang++" -env.Append(CCFLAGS = ['-g','-O3', '-std=c++14']) -env.Append(CPPPATH=['.', './godot']) -sources = [ - 'godot_cpp/core/Array.cpp', - 'godot_cpp/core/Basis.cpp', - 'godot_cpp/core/Color.cpp', - 'godot_cpp/core/Dictionary.cpp', - 'godot_cpp/core/Image.cpp', - 'godot_cpp/core/InputEvent.cpp', - 'godot_cpp/core/NodePath.cpp', - 'godot_cpp/core/Plane.cpp', - 'godot_cpp/core/PoolArrays.cpp', - 'godot_cpp/core/Quat.cpp', - 'godot_cpp/core/Rect2.cpp', - 'godot_cpp/core/Rect3.cpp', - 'godot_cpp/core/RID.cpp', - 'godot_cpp/core/String.cpp', - 'godot_cpp/core/Transform.cpp', - 'godot_cpp/core/Transform2D.cpp', - 'godot_cpp/core/Variant.cpp', - 'godot_cpp/core/Vector2.cpp', - 'godot_cpp/core/Vector3.cpp' -] +target = ARGUMENTS.get("target", "core") -library = env.SharedLibrary(target='godot_cpp_core', source=sources) -Default(library) +if (target == "core"): + env.Append(CCFLAGS = ['-g','-O3', '-std=c++14']) + env.Append(CPPPATH=['.', './godot']) + + sources = [ + 'godot_cpp/core/Array.cpp', + 'godot_cpp/core/Basis.cpp', + 'godot_cpp/core/Color.cpp', + 'godot_cpp/core/Dictionary.cpp', + 'godot_cpp/core/Image.cpp', + 'godot_cpp/core/InputEvent.cpp', + 'godot_cpp/core/NodePath.cpp', + 'godot_cpp/core/Plane.cpp', + 'godot_cpp/core/PoolArrays.cpp', + 'godot_cpp/core/Quat.cpp', + 'godot_cpp/core/Rect2.cpp', + 'godot_cpp/core/Rect3.cpp', + 'godot_cpp/core/RID.cpp', + 'godot_cpp/core/String.cpp', + 'godot_cpp/core/Transform.cpp', + 'godot_cpp/core/Transform2D.cpp', + 'godot_cpp/core/Variant.cpp', + 'godot_cpp/core/Vector2.cpp', + 'godot_cpp/core/Vector3.cpp' + ] + + library = env.SharedLibrary(target='godot_cpp_core', source=sources) + Default(library) + +elif target == "binding": + env.Append(CCFLAGS = ['-Wno-writable-strings']) + env.Append(CCFLAGS = ['-g','-O3', '-std=c++14']) + env.Append(CPPPATH=['.', './godot', './godot_cpp']) + + env.Append(RPATH=['.']) + env.Append(LINKFLAGS=['-Rgodot_cpp_core']) + + + sources = [os.path.join("godot_cpp/impl/", f) for f in os.listdir("godot_cpp/impl/") if f.endswith('.cpp')] + + library = env.SharedLibrary(target='godot_cpp_bindings', source=sources) + Default(library) diff --git a/include/godot_cpp/Godot.h b/include/godot_cpp/Godot.h deleted file mode 100644 index 337b096..0000000 --- a/include/godot_cpp/Godot.h +++ /dev/null @@ -1,267 +0,0 @@ -#ifndef GODOT_H -#define GODOT_H - -#include - -#include - - -#include -#include - -namespace godot { - - -#define GODOT_CLASS(Name, Base) \ - public: static char *___get_type_name() { return (char *) #Name; } \ - static char *___get_base_type_name() { return (char *) #Base; } \ - Name(godot_object *o) { __core_object = o; } \ - private: - - - -template -A object_cast(B b) -{ - A *a = (A*) &b; - return *a; -} - - - - - -// instance and destroy funcs - -template -void *_godot_class_instance_func(godot_object *p) -{ - T *d = new T(p); - d->_init(); - return d; -} - -template -void _godot_class_destroy_func(godot_object *p, void *data) -{ - T *d = (T *) data; - delete d; -} - - - -template -void register_class() -{ - godot_script_register(T::___get_type_name(), T::___get_base_type_name(), _godot_class_instance_func, _godot_class_destroy_func); - T::_register_methods(); -} - - - - - - -// wrapped methods - -template -struct WrappedMethod5 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - godot::Variant *v = (godot::Variant *) &_variant; - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - *v = (obj->*p)(*arg[0], *arg[1], *arg[2], *arg[3], *arg[4]); - return _variant; - } -}; - -template -struct WrappedMethod5 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - (obj->*p)(*arg[0], *arg[1], *arg[2], *arg[3], *arg[4]); - return _variant; - } -}; - -template -struct WrappedMethod4 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - godot::Variant *v = (godot::Variant *) &_variant; - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - *v = (obj->*p)(*arg[0], *arg[1], *arg[2], *arg[3]); - return _variant; - } -}; - -template -struct WrappedMethod4 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - (obj->*p)(*arg[0], *arg[1], *arg[2], *arg[3]); - return _variant; - } -}; - - -template -struct WrappedMethod3 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - godot::Variant *v = (godot::Variant *) &_variant; - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - *v = (obj->*p)(*arg[0], *arg[1], *arg[2]); - return _variant; - } -}; - -template -struct WrappedMethod3 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - (obj->*p)(*arg[0], *arg[1], *arg[2]); - return _variant; - } -}; - -template -struct WrappedMethod2 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - godot::Variant *v = (godot::Variant *) &_variant; - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - *v = (obj->*p)(*arg[0], *arg[1]); - return _variant; - } -}; - -template -struct WrappedMethod2 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - (obj->*p)(*arg[0], *arg[1]); - return _variant; - } -}; - -template -struct WrappedMethod1 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - godot::Variant *v = (godot::Variant *) &_variant; - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - *v = (obj->*p)(*arg[0]); - return _variant; - } -}; - -template -struct WrappedMethod1 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - T *obj = (T *) data; - godot::Variant **arg = (godot::Variant **) args; - (obj->*p)(*arg[0]); - return _variant; - } -}; - - - -template -struct WrappedMethod0 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - godot::Variant *v = (godot::Variant *) &_variant; - T *obj = (T *) data; - *v = (obj->*p)(); - return _variant; - } -}; - -template -struct WrappedMethod0 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) - { - godot_variant _variant; - godot_variant_new_nil(&_variant); - T *obj = (T *) data; - (obj->*p)(); - return _variant; - } -}; - -// method registering - - -template -void register_method(char *name, godot_method_attributes attr = {}) { - godot_script_add_method(T::___get_type_name(), name, &attr, &WrappedMethod0::wrapped_method); -} - -template -void register_method(char *name, godot_method_attributes attr = {}) { - godot_script_add_method(T::___get_type_name(), name, &attr, &WrappedMethod1::wrapped_method); -} - -template -void register_method(char *name, godot_method_attributes attr = {}) { - godot_script_add_method(T::___get_type_name(), name, &attr, &WrappedMethod2::wrapped_method); -} - -template -void register_method(char *name, godot_method_attributes attr = {}) { - godot_script_add_method(T::___get_type_name(), name, &attr, &WrappedMethod3::wrapped_method); -} - -template -void register_method(char *name, godot_method_attributes attr = {}) { - godot_script_add_method(T::___get_type_name(), name, &attr, &WrappedMethod4::wrapped_method); -} - - -template -void register_method(char *name, godot_method_attributes attr = {}) { - godot_script_add_method(T::___get_type_name(), name, &attr, &WrappedMethod5::wrapped_method); -} - - -} - -#endif // GODOT_H diff --git a/include/godot_cpp/core/Array.cpp b/include/godot_cpp/core/Array.cpp index 2d66eb7..e610e1b 100644 --- a/include/godot_cpp/core/Array.cpp +++ b/include/godot_cpp/core/Array.cpp @@ -1,10 +1,10 @@ -#include "Array.h" +#include "Array.hpp" #include #include -#include "Variant.h" +#include "Variant.hpp" namespace godot { diff --git a/include/godot_cpp/core/Array.h b/include/godot_cpp/core/Array.hpp similarity index 98% rename from include/godot_cpp/core/Array.h rename to include/godot_cpp/core/Array.hpp index 4f7a2b5..1b60788 100644 --- a/include/godot_cpp/core/Array.h +++ b/include/godot_cpp/core/Array.hpp @@ -3,7 +3,7 @@ #include -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/Basis.cpp b/include/godot_cpp/core/Basis.cpp index 06a1937..691edaa 100644 --- a/include/godot_cpp/core/Basis.cpp +++ b/include/godot_cpp/core/Basis.cpp @@ -1,11 +1,11 @@ -#include "Basis.h" +#include "Basis.hpp" -#include "Defs.h" +#include "Defs.hpp" -#include "Vector3.h" +#include "Vector3.hpp" -#include "Quat.h" +#include "Quat.hpp" #include @@ -597,7 +597,7 @@ Basis::Basis(const Vector3& p_euler) { } -#include "Quat.h" +#include "Quat.hpp" namespace godot { diff --git a/include/godot_cpp/core/Basis.h b/include/godot_cpp/core/Basis.hpp similarity index 98% rename from include/godot_cpp/core/Basis.h rename to include/godot_cpp/core/Basis.hpp index cb23874..018896a 100644 --- a/include/godot_cpp/core/Basis.h +++ b/include/godot_cpp/core/Basis.hpp @@ -1,9 +1,9 @@ #ifndef BASIS_H #define BASIS_H -#include "Defs.h" +#include "Defs.hpp" -#include "Vector3.h" +#include "Vector3.hpp" namespace godot { diff --git a/include/godot_cpp/core/Color.cpp b/include/godot_cpp/core/Color.cpp index 382575b..6d89cb8 100644 --- a/include/godot_cpp/core/Color.cpp +++ b/include/godot_cpp/core/Color.cpp @@ -1,10 +1,10 @@ -#include "Color.h" +#include "Color.hpp" #include #include -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/Color.h b/include/godot_cpp/core/Color.hpp similarity index 98% rename from include/godot_cpp/core/Color.h rename to include/godot_cpp/core/Color.hpp index abad150..d0f834d 100644 --- a/include/godot_cpp/core/Color.h +++ b/include/godot_cpp/core/Color.hpp @@ -5,7 +5,7 @@ #include -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/CoreTypes.h b/include/godot_cpp/core/CoreTypes.h deleted file mode 100644 index b268310..0000000 --- a/include/godot_cpp/core/CoreTypes.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef CORETYPES_H -#define CORETYPES_H - -#include "Defs.h" - -#include "Array.h" -#include "Basis.h" -#include "Color.h" -#include "Dictionary.h" -#include "Image.h" -#include "InputEvent.h" -#include "NodePath.h" -#include "Plane.h" -#include "PoolArrays.h" -#include "Quat.h" -#include "Rect2.h" -#include "Rect3.h" -#include "RID.h" -#include "String.h" -#include "Transform.h" -#include "Transform2D.h" -#include "Variant.h" -#include "Vector2.h" -#include "Vector3.h" - - -#endif // CORETYPES_H diff --git a/include/godot_cpp/core/CoreTypes.hpp b/include/godot_cpp/core/CoreTypes.hpp new file mode 100644 index 0000000..5142b4f --- /dev/null +++ b/include/godot_cpp/core/CoreTypes.hpp @@ -0,0 +1,27 @@ +#ifndef CORETYPES_H +#define CORETYPES_H + +#include "Defs.hpp" + +#include "Array.hpp" +#include "Basis.hpp" +#include "Color.hpp" +#include "Dictionary.hpp" +#include "Image.hpp" +#include "InputEvent.hpp" +#include "NodePath.hpp" +#include "Plane.hpp" +#include "PoolArrays.hpp" +#include "Quat.hpp" +#include "Rect2.hpp" +#include "Rect3.hpp" +#include "RID.hpp" +#include "String.hpp" +#include "Transform.hpp" +#include "Transform2D.hp" +#include "Variant.hpp" +#include "Vector2.hpp" +#include "Vector3.hpp" + + +#endif // CORETYPES_H diff --git a/include/godot_cpp/core/Defs.h b/include/godot_cpp/core/Defs.hpp similarity index 100% rename from include/godot_cpp/core/Defs.h rename to include/godot_cpp/core/Defs.hpp diff --git a/include/godot_cpp/core/Dictionary.cpp b/include/godot_cpp/core/Dictionary.cpp index c2d828a..7ac6312 100644 --- a/include/godot_cpp/core/Dictionary.cpp +++ b/include/godot_cpp/core/Dictionary.cpp @@ -1,8 +1,8 @@ -#include "Dictionary.h" +#include "Dictionary.hpp" -#include "Variant.h" +#include "Variant.hpp" -#include "Array.h" +#include "Array.hpp" #include diff --git a/include/godot_cpp/core/Dictionary.h b/include/godot_cpp/core/Dictionary.hpp similarity index 93% rename from include/godot_cpp/core/Dictionary.h rename to include/godot_cpp/core/Dictionary.hpp index d481e17..73a7966 100644 --- a/include/godot_cpp/core/Dictionary.h +++ b/include/godot_cpp/core/Dictionary.hpp @@ -1,9 +1,9 @@ #ifndef DICTIONARY_H #define DICTIONARY_H -#include "Variant.h" +#include "Variant.hpp" -#include "Array.h" +#include "Array.hpp" #include diff --git a/include/godot_cpp/core/Image.cpp b/include/godot_cpp/core/Image.cpp index be5c623..4206115 100644 --- a/include/godot_cpp/core/Image.cpp +++ b/include/godot_cpp/core/Image.cpp @@ -1,13 +1,13 @@ -#include "Image.h" +#include "Image.hpp" -#include "Defs.h" +#include "Defs.hpp" -#include "Vector2.h" -#include "Rect2.h" -#include "Color.h" -#include "String.h" +#include "Vector2.hpp" +#include "Rect2.hpp" +#include "Color.hpp" +#include "String.hpp" -#include "PoolArrays.h" +#include "PoolArrays.hpp" #include diff --git a/include/godot_cpp/core/Image.h b/include/godot_cpp/core/Image.hpp similarity index 95% rename from include/godot_cpp/core/Image.h rename to include/godot_cpp/core/Image.hpp index 1530910..5b1322e 100644 --- a/include/godot_cpp/core/Image.h +++ b/include/godot_cpp/core/Image.hpp @@ -1,12 +1,12 @@ #ifndef IMAGE_H #define IMAGE_H -#include "Defs.h" +#include "Defs.hpp" -#include "Vector2.h" -#include "Rect2.h" -#include "Color.h" -#include "String.h" +#include "Vector2.hpp" +#include "Rect2.hpp" +#include "Color.hpp" +#include "String.hpp" #include diff --git a/include/godot_cpp/core/InputEvent.cpp b/include/godot_cpp/core/InputEvent.cpp index 9b2e7cb..35906bb 100644 --- a/include/godot_cpp/core/InputEvent.cpp +++ b/include/godot_cpp/core/InputEvent.cpp @@ -1,14 +1,14 @@ -#include "InputEvent.h" +#include "InputEvent.hpp" #include #include -#include "Vector2.h" -#include "Transform2D.h" +#include "Vector2.hpp" +#include "Transform2D.hp" #include -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/InputEvent.h b/include/godot_cpp/core/InputEvent.hpp similarity index 99% rename from include/godot_cpp/core/InputEvent.h rename to include/godot_cpp/core/InputEvent.hpp index c701f19..ef67817 100644 --- a/include/godot_cpp/core/InputEvent.h +++ b/include/godot_cpp/core/InputEvent.hpp @@ -4,7 +4,7 @@ #include #include -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/NodePath.cpp b/include/godot_cpp/core/NodePath.cpp index 5a30b2b..3dbfd4a 100644 --- a/include/godot_cpp/core/NodePath.cpp +++ b/include/godot_cpp/core/NodePath.cpp @@ -1,6 +1,6 @@ -#include "NodePath.h" +#include "NodePath.hpp" -#include "String.h" +#include "String.hpp" #include diff --git a/include/godot_cpp/core/NodePath.h b/include/godot_cpp/core/NodePath.hpp similarity index 95% rename from include/godot_cpp/core/NodePath.h rename to include/godot_cpp/core/NodePath.hpp index 856e2eb..180b8a1 100644 --- a/include/godot_cpp/core/NodePath.h +++ b/include/godot_cpp/core/NodePath.hpp @@ -1,7 +1,7 @@ #ifndef NODEPATH_H #define NODEPATH_H -#include "String.h" +#include "String.hpp" #include diff --git a/include/godot_cpp/core/Plane.cpp b/include/godot_cpp/core/Plane.cpp index a755a1c..40e0ef6 100644 --- a/include/godot_cpp/core/Plane.cpp +++ b/include/godot_cpp/core/Plane.cpp @@ -1,6 +1,6 @@ -#include "Plane.h" +#include "Plane.hpp" -#include "Vector3.h" +#include "Vector3.hpp" #include diff --git a/include/godot_cpp/core/Plane.h b/include/godot_cpp/core/Plane.hpp similarity index 98% rename from include/godot_cpp/core/Plane.h rename to include/godot_cpp/core/Plane.hpp index edcddaf..5ad5fcd 100644 --- a/include/godot_cpp/core/Plane.h +++ b/include/godot_cpp/core/Plane.hpp @@ -1,7 +1,7 @@ #ifndef PLANE_H #define PLANE_H -#include "Vector3.h" +#include "Vector3.hpp" #include diff --git a/include/godot_cpp/core/PoolArrays.cpp b/include/godot_cpp/core/PoolArrays.cpp index 083d303..27c4a58 100644 --- a/include/godot_cpp/core/PoolArrays.cpp +++ b/include/godot_cpp/core/PoolArrays.cpp @@ -1,11 +1,11 @@ -#include "PoolArrays.h" +#include "PoolArrays.hpp" -#include "Defs.h" +#include "Defs.hpp" -#include "String.h" -#include "Color.h" -#include "Vector2.h" -#include "Vector3.h" +#include "String.hpp" +#include "Color.hpp" +#include "Vector2.hpp" +#include "Vector3.hpp" #include diff --git a/include/godot_cpp/core/PoolArrays.h b/include/godot_cpp/core/PoolArrays.hpp similarity index 97% rename from include/godot_cpp/core/PoolArrays.h rename to include/godot_cpp/core/PoolArrays.hpp index 7a07f86..e2a51f1 100644 --- a/include/godot_cpp/core/PoolArrays.h +++ b/include/godot_cpp/core/PoolArrays.hpp @@ -1,12 +1,12 @@ #ifndef POOLARRAYS_H #define POOLARRAYS_H -#include "Defs.h" +#include "Defs.hpp" -#include "String.h" -#include "Color.h" -#include "Vector2.h" -#include "Vector3.h" +#include "String.hpp" +#include "Color.hpp" +#include "Vector2.hpp" +#include "Vector3.hpp" #include diff --git a/include/godot_cpp/core/Quat.cpp b/include/godot_cpp/core/Quat.cpp index 11ec5a6..866de2b 100644 --- a/include/godot_cpp/core/Quat.cpp +++ b/include/godot_cpp/core/Quat.cpp @@ -1,13 +1,13 @@ -#include "Quat.h" +#include "Quat.hpp" #include -#include "Defs.h" +#include "Defs.hpp" -#include "Vector3.h" +#include "Vector3.hpp" -#include "Basis.h" +#include "Basis.hpp" namespace godot { diff --git a/include/godot_cpp/core/Quat.h b/include/godot_cpp/core/Quat.hpp similarity index 98% rename from include/godot_cpp/core/Quat.h rename to include/godot_cpp/core/Quat.hpp index 8021039..927d4a3 100644 --- a/include/godot_cpp/core/Quat.h +++ b/include/godot_cpp/core/Quat.hpp @@ -3,7 +3,7 @@ #include -#include "Vector3.h" +#include "Vector3.hpp" // #include "Basis.h" diff --git a/include/godot_cpp/core/RID.cpp b/include/godot_cpp/core/RID.cpp index 7444e55..2343475 100644 --- a/include/godot_cpp/core/RID.cpp +++ b/include/godot_cpp/core/RID.cpp @@ -1,4 +1,4 @@ -#include "RID.h" +#include "RID.hpp" #include diff --git a/include/godot_cpp/core/RID.h b/include/godot_cpp/core/RID.hpp similarity index 92% rename from include/godot_cpp/core/RID.h rename to include/godot_cpp/core/RID.hpp index 83eecc7..7584581 100644 --- a/include/godot_cpp/core/RID.h +++ b/include/godot_cpp/core/RID.hpp @@ -11,6 +11,8 @@ class RID { godot_rid _godot_rid; public: + inline RID() {} + RID(Object *p); int32_t get_rid() const; diff --git a/include/godot_cpp/core/Rect2.cpp b/include/godot_cpp/core/Rect2.cpp index faa188f..2b32506 100644 --- a/include/godot_cpp/core/Rect2.cpp +++ b/include/godot_cpp/core/Rect2.cpp @@ -1,12 +1,12 @@ -#include "Rect2.h" +#include "Rect2.hpp" -#include "Vector2.h" +#include "Vector2.hpp" -#include "String.h" +#include "String.hpp" #include -#include "Transform2D.h" +#include "Transform2D.hp" namespace godot { diff --git a/include/godot_cpp/core/Rect2.h b/include/godot_cpp/core/Rect2.hpp similarity index 99% rename from include/godot_cpp/core/Rect2.h rename to include/godot_cpp/core/Rect2.hpp index 482df02..792972d 100644 --- a/include/godot_cpp/core/Rect2.h +++ b/include/godot_cpp/core/Rect2.hpp @@ -1,7 +1,7 @@ #ifndef RECT2_H #define RECT2_H -#include "Vector2.h" +#include "Vector2.hpp" #include diff --git a/include/godot_cpp/core/Rect3.cpp b/include/godot_cpp/core/Rect3.cpp index 19a8c6f..be3cf8f 100644 --- a/include/godot_cpp/core/Rect3.cpp +++ b/include/godot_cpp/core/Rect3.cpp @@ -1,8 +1,8 @@ -#include "Rect3.h" +#include "Rect3.hpp" -#include "Vector3.h" +#include "Vector3.hpp" -#include "Plane.h" +#include "Plane.hpp" #include diff --git a/include/godot_cpp/core/Rect3.h b/include/godot_cpp/core/Rect3.hpp similarity index 98% rename from include/godot_cpp/core/Rect3.h rename to include/godot_cpp/core/Rect3.hpp index cdcb301..acd674f 100644 --- a/include/godot_cpp/core/Rect3.h +++ b/include/godot_cpp/core/Rect3.hpp @@ -1,9 +1,9 @@ #ifndef RECT3_H #define RECT3_H -#include "Vector3.h" +#include "Vector3.hpp" -#include "Plane.h" +#include "Plane.hpp" #include diff --git a/include/godot_cpp/core/String.cpp b/include/godot_cpp/core/String.cpp index 22f80f3..83b1f90 100644 --- a/include/godot_cpp/core/String.cpp +++ b/include/godot_cpp/core/String.cpp @@ -1,4 +1,4 @@ -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/String.h b/include/godot_cpp/core/String.hpp similarity index 100% rename from include/godot_cpp/core/String.h rename to include/godot_cpp/core/String.hpp diff --git a/include/godot_cpp/core/Transform.cpp b/include/godot_cpp/core/Transform.cpp index 337a49c..b8a05df 100644 --- a/include/godot_cpp/core/Transform.cpp +++ b/include/godot_cpp/core/Transform.cpp @@ -1,11 +1,11 @@ -#include "Transform.h" +#include "Transform.hpp" -#include "Basis.h" +#include "Basis.hpp" -#include "Plane.h" -#include "Rect3.h" +#include "Plane.hpp" +#include "Rect3.hpp" -#include "Quat.h" +#include "Quat.hpp" namespace godot { diff --git a/include/godot_cpp/core/Transform.h b/include/godot_cpp/core/Transform.hpp similarity index 97% rename from include/godot_cpp/core/Transform.h rename to include/godot_cpp/core/Transform.hpp index 56ece9d..bb47693 100644 --- a/include/godot_cpp/core/Transform.h +++ b/include/godot_cpp/core/Transform.hpp @@ -1,10 +1,10 @@ #ifndef TRANSFORM_H #define TRANSFORM_H -#include "Basis.h" +#include "Basis.hpp" -#include "Plane.h" -#include "Rect3.h" +#include "Plane.hpp" +#include "Rect3.hpp" namespace godot { diff --git a/include/godot_cpp/core/Transform2D.cpp b/include/godot_cpp/core/Transform2D.cpp index a57ea89..9dfbb22 100644 --- a/include/godot_cpp/core/Transform2D.cpp +++ b/include/godot_cpp/core/Transform2D.cpp @@ -1,10 +1,10 @@ -#include "Transform2D.h" +#include "Transform2D.hp" -#include "Vector2.h" +#include "Vector2.hpp" -#include "String.h" +#include "String.hpp" -#include "Rect2.h" +#include "Rect2.hpp" #include diff --git a/include/godot_cpp/core/Transform2D.h b/include/godot_cpp/core/Transform2D.hp similarity index 99% rename from include/godot_cpp/core/Transform2D.h rename to include/godot_cpp/core/Transform2D.hp index d7942b0..f3bc5fb 100644 --- a/include/godot_cpp/core/Transform2D.h +++ b/include/godot_cpp/core/Transform2D.hp @@ -1,7 +1,7 @@ #ifndef TRANSFORM2D_H #define TRANSFORM2D_H -#include "Vector2.h" +#include "Vector2.hpp" namespace godot { diff --git a/include/godot_cpp/core/Variant.cpp b/include/godot_cpp/core/Variant.cpp index f6fc0ac..edb7672 100644 --- a/include/godot_cpp/core/Variant.cpp +++ b/include/godot_cpp/core/Variant.cpp @@ -1,10 +1,10 @@ -#include "Variant.h" +#include "Variant.hpp" #include -#include "Defs.h" +#include "Defs.hpp" -#include "CoreTypes.h" +#include "CoreTypes.hpp" #include diff --git a/include/godot_cpp/core/Variant.h b/include/godot_cpp/core/Variant.hpp similarity index 91% rename from include/godot_cpp/core/Variant.h rename to include/godot_cpp/core/Variant.hpp index b9efd64..2fe0fed 100644 --- a/include/godot_cpp/core/Variant.h +++ b/include/godot_cpp/core/Variant.hpp @@ -3,24 +3,24 @@ #include -#include "Defs.h" +#include "Defs.hpp" -#include "Basis.h" -#include "Color.h" -#include "Image.h" -#include "InputEvent.h" -#include "NodePath.h" -#include "Plane.h" -#include "PoolArrays.h" -#include "Quat.h" -#include "Rect2.h" -#include "Rect3.h" -#include "RID.h" -#include "String.h" -#include "Transform.h" -#include "Transform2D.h" -#include "Vector2.h" -#include "Vector3.h" +#include "Basis.hpp" +#include "Color.hpp" +#include "Image.hpp" +#include "InputEvent.hpp" +#include "NodePath.hpp" +#include "Plane.hpp" +#include "PoolArrays.hpp" +#include "Quat.hpp" +#include "Rect2.hpp" +#include "Rect3.hpp" +#include "RID.hpp" +#include "String.hpp" +#include "Transform.hpp" +#include "Transform2D.hp" +#include "Vector2.hpp" +#include "Vector3.hpp" #include diff --git a/include/godot_cpp/core/Vector2.cpp b/include/godot_cpp/core/Vector2.cpp index cc5beb3..d17f828 100644 --- a/include/godot_cpp/core/Vector2.cpp +++ b/include/godot_cpp/core/Vector2.cpp @@ -1,10 +1,10 @@ -#include "Vector2.h" +#include "Vector2.hpp" #include #include -#include "String.h" +#include "String.hpp" namespace godot { diff --git a/include/godot_cpp/core/Vector2.h b/include/godot_cpp/core/Vector2.hpp similarity index 99% rename from include/godot_cpp/core/Vector2.h rename to include/godot_cpp/core/Vector2.hpp index 461570c..b62ddfd 100644 --- a/include/godot_cpp/core/Vector2.h +++ b/include/godot_cpp/core/Vector2.hpp @@ -4,7 +4,7 @@ #include -#include "Defs.h" +#include "Defs.hpp" namespace godot { diff --git a/include/godot_cpp/core/Vector3.cpp b/include/godot_cpp/core/Vector3.cpp index 64043f6..b73362d 100644 --- a/include/godot_cpp/core/Vector3.cpp +++ b/include/godot_cpp/core/Vector3.cpp @@ -1,13 +1,13 @@ -#include "Vector3.h" +#include "Vector3.hpp" -#include "String.h" +#include "String.hpp" #include #include -#include "Basis.h" +#include "Basis.hpp" namespace godot { diff --git a/include/godot_cpp/core/Vector3.h b/include/godot_cpp/core/Vector3.hpp similarity index 98% rename from include/godot_cpp/core/Vector3.h rename to include/godot_cpp/core/Vector3.hpp index 9f97172..d1db4e1 100644 --- a/include/godot_cpp/core/Vector3.h +++ b/include/godot_cpp/core/Vector3.hpp @@ -1,9 +1,9 @@ #ifndef VECTOR3_H #define VECTOR3_H -#include "Defs.h" +#include "Defs.hpp" -#include "String.h" +#include "String.hpp" namespace godot {