diff --git a/.gitignore b/.gitignore index 6bbb30d..2b8cbf2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ +# Visual Studio +*/.vs + # Compiled binaries bin/ @@ -8,3 +11,6 @@ cpp/.sconsign.dblite cpp/compile_commands.json cpp/src/doc_data.gen.h *.os +# Windows +*.obj +*.obj.import diff --git a/cpp/SConstruct b/cpp/SConstruct index d42d977..66a6d9e 100644 --- a/cpp/SConstruct +++ b/cpp/SConstruct @@ -19,7 +19,7 @@ def main(): env.Tool('compilation_db') cdb = env.CompilationDatabase() x = env.Alias('cdb', cdb) - if "cdb" in COMMAND_LINE_TARGETS: + if "cdb" in COMMAND_LINE_TARGETS and "-fno-gnu-unique" in env._dict["CXXFLAGS"]: env._dict["CXXFLAGS"].remove("-fno-gnu-unique") platform:str = env["platform"] diff --git a/cpp/src/world.cpp b/cpp/src/world.cpp index 7e49497..90c6dbc 100644 --- a/cpp/src/world.cpp +++ b/cpp/src/world.cpp @@ -983,7 +983,7 @@ void GFWorld::init_gd_type_ptr( switch (vari_type) { case(Variant::Type::NIL): if (ecs_has(_raw, type, EcsStruct)) {init_component_ptr(ptr, type, Variant());}; break; case(Variant::Type::BOOL): *static_cast(ptr) = false; break; - case(Variant::Type::INT): *static_cast(ptr) = 0; break; + case(Variant::Type::INT): *static_cast(ptr) = 0; break; case(Variant::Type::FLOAT): *static_cast(ptr) = 0.0; break; case(Variant::Type::STRING): new(ptr) String(); break; case(Variant::Type::VECTOR2): new(ptr) Vector2(); break; diff --git a/unittests/test_events.gd b/unittests/test_events.gd index f77db7d..5114c33 100644 --- a/unittests/test_events.gd +++ b/unittests/test_events.gd @@ -81,7 +81,6 @@ func test_on_add_event_with_objects(): .set_name("WithInts") assert_eq(data.i, 1) assert_eq(e.get_component(Textures).a, null) - assert_eq(e.get_component(Textures).b, null) e.delete() @@ -90,10 +89,9 @@ func test_on_add_event_with_objects(): data.i = 0 var e2:= GFEntity.spawn(world) \ .set_name("WithTextures") - e2.add_component(Textures, [load("res://icon.png"), load("res://icon.svg")]) + e2.add_component(Textures, [load("res://icon.png")]) assert_eq(data.i, 1) assert_eq(e2.get_component(Textures).a, load("res://icon.png")) - assert_eq(e2.get_component(Textures).b, load("res://icon.svg")) e2.delete() @@ -115,12 +113,8 @@ class Ints extends GFComponent: class Textures extends GFComponent: func _build(b:GFComponentBuilder) -> void: b.add_member("a", TYPE_OBJECT) - b.add_member("b", TYPE_OBJECT) var a:Texture2D: get: return getm(&"a") set(v): setm(&"a", v) - var b:Texture2D: - get: return getm(&"b") - set(v): setm(&"b", v) #endregion