diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-18 04:48:59 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-18 04:48:59 +0400 |
commit | c1ceab1281ccf061f03f8000bf190a082a5385d8 (patch) | |
tree | 01b9a9cfca80432d316bdad6c18c74eb025e9eb0 /source/blender/makesdna/intern | |
parent | 0d9c98c4bbfbc8c70c4772086dd09a51d01921ef (diff) | |
parent | 66a35e089a64d27bfc09c2225a530069eca05875 (diff) |
Merged changes in the trunk up to revision 55357.
Resolved conflicts:
release/datafiles/startup.blend
source/blender/editors/space_nla/nla_buttons.c
Also updated source/blender/blenkernel/intern/linestyle.c as a follow-up of
recent changes for the use of bool.
Diffstat (limited to 'source/blender/makesdna/intern')
-rw-r--r-- | source/blender/makesdna/intern/dna_genfile.c | 16 | ||||
-rw-r--r-- | source/blender/makesdna/intern/makesdna.c | 8 |
2 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 86014c4e80e..1225821102a 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -1314,6 +1314,22 @@ int DNA_elem_offset(SDNA *sdna, const char *stype, const char *vartype, const ch return (int)((intptr_t)cp); } +bool DNA_struct_elem_find(SDNA *sdna, const char *stype, const char *vartype, const char *name) +{ + + const int SDNAnr = DNA_struct_find_nr(sdna, stype); + + if (SDNAnr >= 0) { + const short * const spo = sdna->structs[SDNAnr]; + char * const cp = find_elem(sdna, vartype, name, spo, NULL, NULL); + + if (cp) return true; + return (int)((intptr_t)cp); + } + return false; +} + + /** * Returns the size in bytes of a primitive type. */ diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index dd65ce53b92..acc6597d2c7 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -255,7 +255,9 @@ static int add_type(const char *str, int len) } /* append new type */ - if (nr_types == 0) cp = typedata; + if (nr_types == 0) { + cp = typedata; + } else { cp = types[nr_types - 1] + strlen(types[nr_types - 1]) + 1; } @@ -401,7 +403,9 @@ static int add_name(const char *str) } /* append new type */ - if (nr_names == 0) cp = namedata; + if (nr_names == 0) { + cp = namedata; + } else { cp = names[nr_names - 1] + strlen(names[nr_names - 1]) + 1; } |