diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-09 21:47:10 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-11-09 23:00:53 +0300 |
commit | 865796375bcfa6be4288cca4243dddcb4092f70b (patch) | |
tree | 5264d4b9b0f9d392b6e1b942e0f6fd802de1fff4 /source/blender/blenkernel/intern/texture.c | |
parent | cf959a879eb5ffbdfa573c5f3a00965e69d7a976 (diff) |
Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r-- | source/blender/blenkernel/intern/texture.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 463ca250ad5..d353042b711 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -1009,8 +1009,8 @@ void BKE_texture_make_local(Tex *tex) if (ma->mtex[a] && ma->mtex[a]->tex == tex) { if (ma->id.lib == NULL) { ma->mtex[a]->tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } } @@ -1022,8 +1022,8 @@ void BKE_texture_make_local(Tex *tex) if (la->mtex[a] && la->mtex[a]->tex == tex) { if (la->id.lib == NULL) { la->mtex[a]->tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } } @@ -1035,8 +1035,8 @@ void BKE_texture_make_local(Tex *tex) if (wrld->mtex[a] && wrld->mtex[a]->tex == tex) { if (wrld->id.lib == NULL) { wrld->mtex[a]->tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } } @@ -1047,15 +1047,15 @@ void BKE_texture_make_local(Tex *tex) if (br->mtex.tex == tex) { if (br->id.lib == NULL) { br->mtex.tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } if (br->mask_mtex.tex == tex) { if (br->id.lib == NULL) { br->mask_mtex.tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } br = br->id.next; @@ -1066,8 +1066,8 @@ void BKE_texture_make_local(Tex *tex) if (pa->mtex[a] && pa->mtex[a]->tex == tex) { if (pa->id.lib == NULL) { pa->mtex[a]->tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } } @@ -1079,8 +1079,8 @@ void BKE_texture_make_local(Tex *tex) if (ls->mtex[a] && ls->mtex[a]->tex == tex) { if (ls->id.lib == NULL) { ls->mtex[a]->tex = tex_new; - tex_new->id.us++; - tex->id.us--; + id_us_plus(&tex_new->id); + id_us_min(&tex->id); } } } |