diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2010-07-20 17:42:27 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2010-07-20 17:42:27 +0400 |
commit | 886ce5a35101ea8bfef9c02745a94b1ab017f12f (patch) | |
tree | cb3f418bb74daa4411a9267039bcfa6e957bfbdc /source/blender/makesrna/intern/rna_brush.c | |
parent | a1494105657e0cc428b6e9163df500d0fe5b3176 (diff) |
* can use file for brush icon
* fixed memory leaks
* moved some of the brush icon code around
* the update of the icon after a change is more responsive
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index b73b5f22141..bc71a862f4b 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -110,11 +110,12 @@ static void rna_Brush_icon_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Brush *br= (Brush*)ptr->data; - if (br->icon==BRUSH_ICON_FILE && br->icon_imbuf) + if (br->icon_imbuf) { IMB_freeImBuf(br->icon_imbuf); + br->icon_imbuf= NULL; + } - br->icon_imbuf= NULL; - br->icon_imbuf= get_brush_icon(br); + BKE_icon_changed(BKE_icon_getid(&(br->id))); WM_main_add_notifier(NC_BRUSH|NA_EDITED, br); } @@ -260,7 +261,7 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem brush_icon_items[] = { - //{BRUSH_ICON_FILE, "FILE", 0, "File", ""}, + {BRUSH_ICON_FILE, "FILE", 0, "Use Image File", ""}, {BRUSH_ICON_BLOB, "BLOB", 0, "Blob", ""}, {BRUSH_ICON_CREASE, "CREASE", 0, "Crease", ""}, {BRUSH_ICON_CLAY, "CLAY", 0, "Clay", ""}, |