23 |
|
} lat[MAXLATS+1]; /* latitudes */ |
24 |
|
} ANGLE_BASIS; |
25 |
|
|
26 |
< |
#define MAXABASES 5 /* limit on defined bases */ |
26 |
> |
#define MAXABASES 7 /* limit on defined bases */ |
27 |
|
|
28 |
|
static ANGLE_BASIS abase_list[MAXABASES] = { |
29 |
|
{ |
200 |
|
|
201 |
|
|
202 |
|
static void |
203 |
< |
load_angle_basis( /* load BSDF angle basis */ |
203 |
> |
load_angle_basis( /* load custom BSDF angle basis */ |
204 |
|
ezxml_t wab |
205 |
|
) |
206 |
|
{ |
208 |
|
ezxml_t wbb; |
209 |
|
int i; |
210 |
|
|
211 |
< |
if (abname == NULL || !*abname) |
211 |
> |
if (!abname || !*abname) |
212 |
|
return; |
213 |
|
for (i = nabases; i--; ) |
214 |
|
if (!strcmp(abname, abase_list[i].name)) |
215 |
< |
return; /* XXX assume it's the same */ |
215 |
> |
return; /* assume it's the same */ |
216 |
|
if (nabases >= MAXABASES) |
217 |
|
error(INTERNAL, "too many angle bases"); |
218 |
|
strcpy(abase_list[nabases].name, abname); |
250 |
|
char *sdata; |
251 |
|
int i; |
252 |
|
|
253 |
< |
if ((cbasis == NULL || !*cbasis) | (rbasis == NULL || !*rbasis)) { |
253 |
> |
if ((!cbasis || !*cbasis) | (!rbasis || !*rbasis)) { |
254 |
|
error(WARNING, "missing column/row basis for BSDF"); |
255 |
|
return; |
256 |
|
} |
257 |
– |
/* XXX need to add routines for loading in foreign bases */ |
257 |
|
for (i = nabases; i--; ) |
258 |
|
if (!strcmp(cbasis, abase_list[i].name)) { |
259 |
|
dp->ninc = abase_list[i].nangles; |
264 |
|
break; |
265 |
|
} |
266 |
|
if (i < 0) { |
267 |
< |
sprintf(errmsg, "unsupported ColumnAngleBasis '%s'", cbasis); |
267 |
> |
sprintf(errmsg, "undefined ColumnAngleBasis '%s'", cbasis); |
268 |
|
error(WARNING, errmsg); |
269 |
|
return; |
270 |
|
} |
278 |
|
break; |
279 |
|
} |
280 |
|
if (i < 0) { |
281 |
< |
sprintf(errmsg, "unsupported RowAngleBasis '%s'", cbasis); |
281 |
> |
sprintf(errmsg, "undefined RowAngleBasis '%s'", cbasis); |
282 |
|
error(WARNING, errmsg); |
283 |
|
return; |
284 |
|
} |
285 |
|
/* read BSDF data */ |
286 |
|
sdata = ezxml_txt(ezxml_child(wdb,"ScatteringData")); |
287 |
< |
if (sdata == NULL || !*sdata) { |
287 |
> |
if (!sdata || !*sdata) { |
288 |
|
error(WARNING, "missing BSDF ScatteringData"); |
289 |
|
return; |
290 |
|
} |