Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_icons.c
| Context not available. | |||||
| } | } | ||||
| #endif /* WITH_HEADLESS */ | #endif /* WITH_HEADLESS */ | ||||
| int UI_load_addonsIcon(const char *filePath) | |||||
| { | |||||
| static int i = 0; | |||||
| int index; | |||||
| if (filePath == NULL) | |||||
| return -1; | |||||
| if (BLI_testextensie(filePath, ".png")) | |||||
| { | |||||
| ImBuf *bbuf; | |||||
| bbuf = IMB_loadiffname(filePath, IB_rect, NULL); | |||||
| if (bbuf) | |||||
| { | |||||
| /* bad size*/ | |||||
| if ((bbuf->x != 64) || (bbuf->y != 64)) | |||||
| return -1; | |||||
| /* found a potential icon file, so make an entry for it in the cache list */ | |||||
| index = BIFICONID_LAST + i++; | |||||
| def_internal_icon(bbuf, index, 0, 0, 64, ICON_TYPE_BUFFER); | |||||
| } | |||||
| IMB_freeImBuf(bbuf); | |||||
| } | |||||
| return index; | |||||
| } | |||||
| static void init_iconfile_list(struct ListBase *list) | static void init_iconfile_list(struct ListBase *list) | ||||
| { | { | ||||
| IconFile *ifile; | IconFile *ifile; | ||||
| Context not available. | |||||