diff options
-rw-r--r-- | source/blender/makesdna/DNA_genfile.h | 22 | ||||
-rw-r--r-- | source/blender/makesdna/intern/makesdna.c | 6 |
2 files changed, 21 insertions, 7 deletions
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h index 0448266330c..2858de74776 100644 --- a/source/blender/makesdna/DNA_genfile.h +++ b/source/blender/makesdna/DNA_genfile.h @@ -41,20 +41,28 @@ struct SDNA; extern const unsigned char DNAstr[]; extern const int DNAlen; /* length of DNAstr */ -/* primitive (non-struct, non-pointer/function/array) types--do not change ordering! */ +/** + * Primitive (non-struct, non-pointer/function/array) types, + * \warning Don't change these values! + * Currently changes here here will work on native endianness, + * however #DNA_struct_switch_endian currently checks these + * hard-coded values against those from old files. + */ typedef enum eSDNA_Type { SDNA_TYPE_CHAR = 0, SDNA_TYPE_UCHAR = 1, SDNA_TYPE_SHORT = 2, SDNA_TYPE_USHORT = 3, SDNA_TYPE_INT = 4, - SDNA_TYPE_FLOAT = 5, - SDNA_TYPE_DOUBLE = 6, - /* ,SDNA_TYPE_VOID = 7 */ + /* SDNA_TYPE_LONG = 5, */ /* deprecated (use as int) */ + /* SDNA_TYPE_ULONG = 6, */ /* deprecated (use as int) */ + SDNA_TYPE_FLOAT = 7, + SDNA_TYPE_DOUBLE = 8, + /* ,SDNA_TYPE_VOID = 9 */ /* define so switch statements don't complain */ -#define SDNA_TYPE_VOID 7 - SDNA_TYPE_INT64 = 8, - SDNA_TYPE_UINT64 = 9, +#define SDNA_TYPE_VOID 9 + SDNA_TYPE_INT64 = 10, + SDNA_TYPE_UINT64 = 11 } eSDNA_Type; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 0bdd428bef9..651794da50d 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -994,6 +994,12 @@ static int make_structDNA(const char *baseDirectory, FILE *file) add_type("short", 2); /* SDNA_TYPE_SHORT */ add_type("ushort", 2); /* SDNA_TYPE_USHORT */ add_type("int", 4); /* SDNA_TYPE_INT */ + + /* note, long isn't supported, + * these are place-holders to maintain alignment with eSDNA_Type*/ + add_type("long", 4); /* SDNA_TYPE_LONG */ + add_type("ulong", 4); /* SDNA_TYPE_ULONG */ + add_type("float", 4); /* SDNA_TYPE_FLOAT */ add_type("double", 8); /* SDNA_TYPE_DOUBLE */ add_type("int64_t", 8); /* SDNA_TYPE_INT64 */ |