Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-02-04 18:22:05 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-02-04 18:22:05 +0400
commit8160829303bf3ba3c14f25cdb68aef5396faa56a (patch)
tree58a1a6b5b87e69ae91f52c4bbcabd673328f9afe /source/blender/makesrna/intern/rna_userdef.c
parent3e3ed974d79432662bfb7c694762c15682e3ca54 (diff)
parentfc0ce537bab8731cc60fda282a6c97d4816011e5 (diff)
Merged changes in the trunk up to revision 43881.
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index d2b71e92e22..e6d04f04fef 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -377,10 +377,18 @@ static EnumPropertyItem *rna_userdef_compute_device_itemf(bContext *UNUSED(C), P
CCLDeviceInfo *devices = CCL_compute_device_list(opencl);
int a;
- for(a = 0; devices[a].name; a++) {
- tmp.value = devices[a].value;
- tmp.identifier = devices[a].identifier;
- tmp.name = devices[a].name;
+ if(devices) {
+ for(a = 0; devices[a].name; a++) {
+ tmp.value = devices[a].value;
+ tmp.identifier = devices[a].identifier;
+ tmp.name = devices[a].name;
+ RNA_enum_item_add(&item, &totitem, &tmp);
+ }
+ }
+ else {
+ tmp.value = 0;
+ tmp.name = "CPU";
+ tmp.identifier = "CPU";
RNA_enum_item_add(&item, &totitem, &tmp);
}
}