Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-04-13 10:39:05 +0300
committerJacques Lucke <jacques@blender.org>2021-04-13 10:39:20 +0300
commit9b15c552cc125ff7b41ba81220c2072db6a46848 (patch)
treecce1c30e362471920edc2e66ff3e59d0c415c057 /source/blender/makesdna/intern/dna_genfile.c
parent7b9d94e07360cb3d80457cbd73d72ecc5529505b (diff)
DNA: support int8_t type in DNA structs
Differential Revision: https://developer.blender.org/D8908
Diffstat (limited to 'source/blender/makesdna/intern/dna_genfile.c')
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index d199638710d..6c88d5f7230 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -792,6 +792,9 @@ static void cast_primitive_type(const eSDNA_Type old_type,
old_value_i = *((uint64_t *)old_data);
old_value_f = (double)old_value_i;
break;
+ case SDNA_TYPE_INT8:
+ old_value_i = (uint64_t) * ((int8_t *)old_data);
+ old_value_f = (double)old_value_i;
}
switch (new_type) {
@@ -828,6 +831,9 @@ static void cast_primitive_type(const eSDNA_Type old_type,
case SDNA_TYPE_UINT64:
*((uint64_t *)new_data) = old_value_i;
break;
+ case SDNA_TYPE_INT8:
+ *((int8_t *)new_data) = (int8_t)old_value_i;
+ break;
}
old_data += oldlen;
@@ -1655,6 +1661,7 @@ int DNA_elem_type_size(const eSDNA_Type elem_nr)
switch (elem_nr) {
case SDNA_TYPE_CHAR:
case SDNA_TYPE_UCHAR:
+ case SDNA_TYPE_INT8:
return 1;
case SDNA_TYPE_SHORT:
case SDNA_TYPE_USHORT: