diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-08-23 10:52:12 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-08-23 10:52:12 +0300 |
commit | a1aa4a259713f26c32a5fac4adbe0751e0479f5b (patch) | |
tree | 0737940d32513ad8e2458760c81ad7c1c61e1ce6 /source/blender/makesrna/intern/rna_boid.c | |
parent | 232049dd9408e15d2082181e60ddd775b375ff19 (diff) |
RNA: Cleanup PointerRNA struct
The old layout of `PointerRNA` was confusing for historic reasons:
```
typedef struct PointerRNA {
struct {
void *data;
} id;
struct StructRNA *type;
void *data;
} PointerRNA;
```
This patch updates it to:
```
typedef struct PointerRNA {
struct ID *owner_id;
struct StructRNA *type;
void *data;
} PointerRNA;
```
Throughout the code base `id.data` was replaced with `owner_id`.
Furthermore, many explicit pointer type casts were added which
were implicit before. Some type casts to `ID *` were removed.
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D5558
Diffstat (limited to 'source/blender/makesrna/intern/rna_boid.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_boid.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 8f30a7e0a98..722b7b12271 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -130,10 +130,10 @@ static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN psys->recalc = ID_RECALC_PSYS_RESET; - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } else { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); } WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); @@ -145,10 +145,10 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *UNUSED(scene), PointerRNA * psys->recalc = ID_RECALC_PSYS_RESET; - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); } else { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY | ID_RECALC_PSYS_RESET); } DEG_relations_tag_update(bmain); @@ -240,7 +240,7 @@ static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int static int particle_id_check(PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; return (GS(id->name) == ID_PA); } @@ -250,7 +250,7 @@ static char *rna_BoidSettings_path(PointerRNA *ptr) BoidSettings *boids = (BoidSettings *)ptr->data; if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings *)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->owner_id; if (part->boids == boids) { return BLI_strdup("boids"); |