OLD | NEW |
1 /*· | 1 /*· |
2 * $Id$ | 2 * $Id$ |
3 * | 3 * |
4 * ***** BEGIN GPL LICENSE BLOCK ***** | 4 * ***** BEGIN GPL LICENSE BLOCK ***** |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or | 6 * This program is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License | 7 * modify it under the terms of the GNU General Public License |
8 * as published by the Free Software Foundation; either version 2 | 8 * as published by the Free Software Foundation; either version 2 |
9 * of the License, or (at your option) any later version. | 9 * of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (!(brush->icon_imbuf)) { | 128 if (!(brush->icon_imbuf)) { |
129 folder= BLI_get_folder(BLENDER_DATAFILES
, "brushicons"); | 129 folder= BLI_get_folder(BLENDER_DATAFILES
, "brushicons"); |
130 | 130 |
131 path[0]= 0; | 131 path[0]= 0; |
132 | 132 |
133 BLI_make_file_string(G.main->name, path,
folder, brush->icon_filepath); | 133 BLI_make_file_string(G.main->name, path,
folder, brush->icon_filepath); |
134 | 134 |
135 if (path[0]) | 135 if (path[0]) |
136 brush->icon_imbuf= IMB_loadiffna
me(path, flags); | 136 brush->icon_imbuf= IMB_loadiffna
me(path, flags); |
137 } | 137 } |
| 138 |
| 139 if (brush->icon_imbuf) |
| 140 BKE_icon_changed(BKE_icon_getid(&brush->
id)); |
138 } | 141 } |
139 } | 142 } |
140 } | 143 } |
141 | 144 |
142 if (!(brush->icon_imbuf)) | 145 if (!(brush->icon_imbuf)) |
143 brush->id.icon_id = 0; | 146 brush->id.icon_id = 0; |
144 else | |
145 BKE_icon_changed(BKE_icon_getid(&(brush->id))); | |
146 | 147 |
147 return brush->icon_imbuf; | 148 return brush->icon_imbuf; |
148 } | 149 } |
149 | 150 |
150 typedef struct ShaderPreview { | 151 typedef struct ShaderPreview { |
151 /* from wmJob */ | 152 /* from wmJob */ |
152 void *owner; | 153 void *owner; |
153 short *stop, *do_update; | 154 short *stop, *do_update; |
154 ········ | 155 ········ |
155 Scene *scene; | 156 Scene *scene; |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 ················ | 1241 ················ |
1241 icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect); | 1242 icon_copy_rect(ibuf, sp->sizex, sp->sizey, sp->pr_rect); |
1242 | 1243 |
1243 *do_update= 1; | 1244 *do_update= 1; |
1244 } | 1245 } |
1245 else if(idtype == ID_BR) { | 1246 else if(idtype == ID_BR) { |
1246 Brush *br= (Brush*)id; | 1247 Brush *br= (Brush*)id; |
1247 | 1248 |
1248 br->icon_imbuf= get_brush_icon(br); | 1249 br->icon_imbuf= get_brush_icon(br); |
1249 | 1250 |
| 1251 memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigne
d int)); |
| 1252 |
1250 if(!(br->icon_imbuf) || !(br->icon_imbuf->rect)) | 1253 if(!(br->icon_imbuf) || !(br->icon_imbuf->rect)) |
1251 return; | 1254 return; |
1252 | 1255 |
1253 memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigne
d int)); | |
1254 icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect
); | 1256 icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect
); |
1255 | 1257 |
1256 *do_update= 1; | 1258 *do_update= 1; |
1257 } | 1259 } |
1258 else { | 1260 else { |
1259 /* re-use shader job */ | 1261 /* re-use shader job */ |
1260 shader_preview_startjob(customdata, stop, do_update); | 1262 shader_preview_startjob(customdata, stop, do_update); |
1261 | 1263 |
1262 /* world is rendered with alpha=0, so it wasn't displayed· | 1264 /* world is rendered with alpha=0, so it wasn't displayed· |
1263 this could be render option for sky to, for later */ | 1265 this could be render option for sky to, for later */ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 WM_jobs_start(CTX_wm_manager(C), steve); | 1353 WM_jobs_start(CTX_wm_manager(C), steve); |
1352 } | 1354 } |
1353 | 1355 |
1354 void ED_preview_kill_jobs(const struct bContext *C) | 1356 void ED_preview_kill_jobs(const struct bContext *C) |
1355 { | 1357 { |
1356 wmWindowManager *wm= CTX_wm_manager(C); | 1358 wmWindowManager *wm= CTX_wm_manager(C); |
1357 if(wm) | 1359 if(wm) |
1358 WM_jobs_kill(wm, NULL, common_preview_startjob); | 1360 WM_jobs_kill(wm, NULL, common_preview_startjob); |
1359 } | 1361 } |
1360 | 1362 |
OLD | NEW |