diff options
Diffstat (limited to 'source/blender/editors/render/render_preview.c')
-rw-r--r-- | source/blender/editors/render/render_preview.c | 86 |
1 files changed, 4 insertions, 82 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 2342d73768e..4bb1f630dad 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -104,83 +104,13 @@ static int qtest() {return 0;} ImBuf* get_brush_icon(Brush *brush) { - void *icon_data[]= { - 0, - - &datatoc_blob_png, - &datatoc_clay_png, - &datatoc_crease_png, - &datatoc_draw_png, - &datatoc_fill_png, - &datatoc_flatten_png, - &datatoc_grab_png, - &datatoc_inflate_png, - &datatoc_layer_png, - &datatoc_nudge_png, - &datatoc_pinch_png, - &datatoc_scrape_png, - &datatoc_smooth_png, - &datatoc_snake_hook_png, - &datatoc_thumb_png, - &datatoc_twist_png, - - &datatoc_add_png, - &datatoc_blur_png, - &datatoc_clone_png, - &datatoc_darken_png, - &datatoc_lighten_png, - &datatoc_mix_png, - &datatoc_multiply_png, - &datatoc_smear_png, - &datatoc_soften_png, - &datatoc_subtract_png, - &datatoc_texdraw_png, - &datatoc_vertexdraw_png, - }; - - size_t icon_size[]= { - 0, - - datatoc_blob_png_size, - datatoc_clay_png_size, - datatoc_crease_png_size, - datatoc_draw_png_size, - datatoc_fill_png_size, - datatoc_flatten_png_size, - datatoc_grab_png_size, - datatoc_inflate_png_size, - datatoc_layer_png_size, - datatoc_nudge_png_size, - datatoc_pinch_png_size, - datatoc_scrape_png_size, - datatoc_smooth_png_size, - datatoc_snake_hook_png_size, - datatoc_thumb_png_size, - datatoc_twist_png_size, - - datatoc_add_png_size, - datatoc_blur_png_size, - datatoc_clone_png_size, - datatoc_darken_png_size, - datatoc_lighten_png_size, - datatoc_mix_png_size, - datatoc_multiply_png_size, - datatoc_smear_png_size, - datatoc_soften_png_size, - datatoc_subtract_png_size, - datatoc_texdraw_png_size, - datatoc_vertexdraw_png_size, - }; - static const int flags = IB_rect|IB_multilayer|IB_metadata; - static const int default_icon = BRUSH_ICON_SCULPTDRAW; - char path[240]; char *folder; if (!(brush->icon_imbuf)) { - if (brush->icon==BRUSH_ICON_FILE) { + if (brush->flag & BRUSH_CUSTOM_ICON) { if (brush->icon_filepath[0]) { // first use the path directly to try and load the file @@ -202,21 +132,13 @@ ImBuf* get_brush_icon(Brush *brush) brush->icon_imbuf= IMB_loadiffname(path, flags); } } - - // if all else fails use a default image - if (!(brush->icon_imbuf)) - brush->icon_imbuf= IMB_ibImageFromMemory(icon_data[default_icon], icon_size[default_icon], flags); - } - else { - if (!(brush->icon_imbuf)) - brush->icon_imbuf= IMB_ibImageFromMemory(icon_data[brush->icon], icon_size[brush->icon], flags); } - - BKE_icon_changed(BKE_icon_getid(&(brush->id))); } if (!(brush->icon_imbuf)) - printf("get_brush_icon: unable to resolve brush icon imbuf\n"); + brush->id.icon_id = 0; + else + BKE_icon_changed(BKE_icon_getid(&(brush->id))); return brush->icon_imbuf; } |