10 |
|
* |
11 |
|
*/ |
12 |
|
|
13 |
+ |
#define _USE_MATH_DEFINES |
14 |
|
#include <stdio.h> |
15 |
|
#include <stdlib.h> |
16 |
+ |
#include <string.h> |
17 |
|
#include <math.h> |
18 |
+ |
#include <ctype.h> |
19 |
|
#include "ezxml.h" |
20 |
|
#include "hilbert.h" |
21 |
|
#include "bsdf.h" |
109 |
|
if ((geom = ezxml_child(wdb, "Geometry")) == NULL || |
110 |
|
(mgfstr = ezxml_txt(geom)) == NULL) |
111 |
|
return SDEnone; |
112 |
+ |
while (isspace(*mgfstr)) |
113 |
+ |
++mgfstr; |
114 |
+ |
if (!*mgfstr) |
115 |
+ |
return SDEnone; |
116 |
|
if ((fmt = ezxml_attr(geom, "format")) != NULL && |
117 |
|
strcasecmp(fmt, "MGF")) { |
118 |
|
sprintf(SDerrorDetail, |
176 |
|
/* try loading variable resolution data */ |
177 |
|
lastErr = SDloadTre(sd, wtl); |
178 |
|
/* check our result */ |
179 |
< |
switch (lastErr) { |
173 |
< |
case SDEformat: |
174 |
< |
case SDEdata: |
175 |
< |
case SDEsupport: /* possibly we just tried the wrong format */ |
179 |
> |
if (lastErr == SDEsupport) /* try matrix BSDF if not tree data */ |
180 |
|
lastErr = SDloadMtx(sd, wtl); |
181 |
< |
break; |
178 |
< |
default: /* variable res. OK else serious error */ |
179 |
< |
break; |
180 |
< |
} |
181 |
> |
|
182 |
|
/* done with XML file */ |
183 |
|
ezxml_free(fl); |
184 |
|
|
814 |
|
|
815 |
|
#include "standard.h" |
816 |
|
#include "paths.h" |
816 |
– |
#include <ctype.h> |
817 |
|
|
818 |
|
#define MAXLATS 46 /* maximum number of latitudes */ |
819 |
|
|