]> git.tdb.fi Git - libs/game.git/commitdiff
Prefix C++ types with namespaces in the setup generator
authorMikko Rasa <tdb@tdb.fi>
Sun, 8 Jan 2023 12:55:14 +0000 (14:55 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jan 2023 12:55:14 +0000 (14:55 +0200)
tools/setupgen/setupgen.cpp

index 571396ff0cfad6dfe80a26a6e760327aa8a7acf6..efb93fb81c32e80f0093a5fbd92396996ea0678a 100644 (file)
@@ -208,6 +208,7 @@ void SetupGen::Loader::enum_def(const DataFile::Symbol &n)
        Enum en(n.name);
        load_sub(en);
        Type &type = obj.add_type(n.name, Type::ENUM);
+       type.set_cpp_type(join(mod.name_space, "::", type.get_cpp_type()));
        type.set_enum(*mod.enums.emplace_back(make_unique<Enum>(move(en))));
 }
 
@@ -235,5 +236,6 @@ void SetupGen::Loader::struct_def(Struct::Kind kind, const DataFile::Symbol &n)
        Struct sct(n.name+"Setup", kind);
        load_sub(sct, obj);
        Type &type = obj.add_type(n.name, Type::STRUCT);
+       type.set_cpp_type(join(mod.name_space, "::", type.get_cpp_type()));
        type.set_struct(*mod.structs.emplace_back(make_unique<Struct>(move(sct))));
 }