diff options
author | Ray Molenkamp <github@lazydodo.com> | 2020-03-17 22:45:35 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2020-03-17 22:45:35 +0300 |
commit | a7c660fe615030b41128a20e0bd2676ff4c2a196 (patch) | |
tree | 5064f2ed558e23f17b4ad1eaec694ede7e5a54a6 /source/blender/makesrna/intern/makesrna.c | |
parent | e09f0caff32e61095c3349daa394e1a45b18a893 (diff) |
Cleanup: Fix warnings about function signature of register pass
RE_engine_register_pass is sometimes in the headers with type
as an integer parameter, sometimes as eNodeSocketDatatype.
This caused warnings, the root cause was makesrna was not able
to generate the proper type for enums and defaulted to int.
makesrna has been extended with the RNA_def_property_enum_native_type
that allows telling makesrna the native type of an enum, if set it
will be used otherwise it will still fall back to int.
Differential Revision: https://developer.blender.org/D7117
Reviewed By: brecht
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index ae414489f52..0f69adf6298 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -482,8 +482,14 @@ static const char *rna_type_type_name(PropertyRNA *prop) case PROP_BOOLEAN: return "bool"; case PROP_INT: - case PROP_ENUM: return "int"; + case PROP_ENUM: { + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; + if (eprop->native_enum_type) { + return eprop->native_enum_type; + } + return "int"; + } case PROP_FLOAT: return "float"; case PROP_STRING: @@ -4331,6 +4337,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const fprintf(f, "#include \"DNA_ID.h\"\n"); fprintf(f, "#include \"DNA_scene_types.h\"\n"); + fprintf(f, "#include \"DNA_node_types.h\"\n"); fprintf(f, "#include \"BLI_blenlib.h\"\n\n"); fprintf(f, "#include \"BLI_utildefines.h\"\n\n"); @@ -4423,6 +4430,7 @@ static void rna_generate_header(BlenderRNA *UNUSED(brna), FILE *f) " * Do not edit manually, changes will be overwritten. */\n\n"); fprintf(f, "#include \"RNA_types.h\"\n\n"); + fprintf(f, "#include \"DNA_node_types.h\"\n\n"); fprintf(f, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n"); @@ -4857,6 +4865,7 @@ static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f) fprintf(f, "#include \"RNA_blender.h\"\n"); fprintf(f, "#include \"RNA_types.h\"\n"); fprintf(f, "#include \"RNA_access.h\"\n"); + fprintf(f, "#include \"DNA_node_types.h\"\n"); fprintf(f, "%s", cpp_classes); |