25 if (!def || !def->
term()) {
26 Print(
"WARNING: missing BOOL TermDef in '%s'\n", file);
36 Print(
"WARNING: invalid bool %s in '%s'. value = ", def->
name()->
value().
data(), file);
46 if (!def || !def->
term()) {
47 Print(
"WARNING: missing TEXT TermDef in '%s'\n", file);
64 if (!def || !def->
term()) {
65 Print(
"WARNING: missing TEXT TermDef in '%s'\n", file);
71 strcpy(dst, tn->
value());
82 if (!def || !def->
term()) {
83 Print(
"WARNING: missing NUMBER TermDef in '%s'\n", file);
89 dst = (int) tr->
value();
100 if (!def || !def->
term()) {
101 Print(
"WARNING: missing NUMBER TermDef in '%s'\n", file);
107 dst = (DWORD) tr->
value();
118 if (!def || !def->
term()) {
119 Print(
"WARNING: missing NUMBER TermDef in '%s'\n", file);
125 dst = (float) tr->
value();
136 if (!def || !def->
term()) {
137 Print(
"WARNING: missing NUMBER TermDef in '%s'\n", file);
143 dst = (double) tr->
value();
154 if (!def || !def->
term()) {
155 Print(
"WARNING: missing VEC3 TermDef in '%s'\n", file);
162 Print(
"WARNING: malformed vector in '%s'\n", file);
165 dst.
x = (float) (val->
elements()->
at(0)->isNumber()->value());
166 dst.
y = (float) (val->
elements()->
at(1)->isNumber()->value());
167 dst.
z = (float) (val->
elements()->
at(2)->isNumber()->value());
173 Print(
"WARNING: vector expected in '%s'\n", file);
181 if (!def || !def->
term()) {
182 Print(
"WARNING: missing RECT TermDef in '%s'\n", file);
189 Print(
"WARNING: malformed rect in '%s'\n", file);
192 dst.
x = (int) (val->
elements()->
at(0)->isNumber()->value());
193 dst.
y = (int) (val->
elements()->
at(1)->isNumber()->value());
194 dst.
w = (int) (val->
elements()->
at(2)->isNumber()->value());
195 dst.
h = (int) (val->
elements()->
at(3)->isNumber()->value());
201 Print(
"WARNING: rect expected in '%s'\n", file);
209 if (!def || !def->
term()) {
210 Print(
"WARNING: missing Insets TermDef in '%s'\n", file);
217 Print(
"WARNING: malformed Insets in '%s'\n", file);
222 dst.
top = (WORD) (val->
elements()->
at(2)->isNumber()->value());
229 Print(
"WARNING: Insets expected in '%s'\n", file);
237 if (!def || !def->
term()) {
238 Print(
"WARNING: missing COLOR TermDef in '%s'\n", file);
245 Print(
"WARNING: malformed color in '%s'\n", file);
249 double v0 = (val->
elements()->
at(0)->isNumber()->value());
250 double v1 = (val->
elements()->
at(1)->isNumber()->value());
251 double v2 = (val->
elements()->
at(2)->isNumber()->value());
253 if (v0 >= 0 && v0 <= 1 &&
254 v1 >= 0 && v1 <= 1 &&
255 v2 >= 0 && v2 <= 1) {
257 r = (BYTE) (v0 * 255);
258 g = (BYTE) (v1 * 255);
259 b = (BYTE) (v2 * 255);
273 Print(
"WARNING: color expected in '%s'\n", file);
281 if (!def || !def->
term()) {
282 Print(
"WARNING: missing COLOR TermDef in '%s'\n", file);
289 Print(
"WARNING: malformed color in '%s'\n", file);
292 double r = (val->
elements()->
at(0)->isNumber()->value());
293 double g = (val->
elements()->
at(1)->isNumber()->value());
294 double b = (val->
elements()->
at(2)->isNumber()->value());
298 a = (val->
elements()->
at(3)->isNumber()->value());
300 dst.
Set((
float) r, (
float) g, (
float) b, (
float) a);
305 Print(
"WARNING: color expected in '%s'\n", file);
315 if (!def || !def->
term()) {
316 Print(
"WARNING: missing ARRAY TermDef in '%s'\n", file);
327 for (
int i = 0; i < nelem; i++)
328 *dst++ = (
int) (val->
elements()->
at(i)->isNumber()->value());
333 Print(
"WARNING: array expected in '%s'\n", file);
341 if (!def || !def->
term()) {
342 Print(
"WARNING: missing ARRAY TermDef in '%s'\n", file);
353 for (
int i = 0; i < nelem; i++)
354 *dst++ = (
float) (val->
elements()->
at(i)->isNumber()->value());
359 Print(
"WARNING: array expected in '%s'\n", file);
367 if (!def || !def->
term()) {
368 Print(
"WARNING: missing ARRAY TermDef in '%s'\n", file);
379 for (
int i = 0; i < nelem; i++)
380 *dst++ = (
double) (val->
elements()->
at(i)->isNumber()->value());
385 Print(
"WARNING: array expected in '%s'\n", file);
395 if (!def || !def->
term()) {
396 Print(
"WARNING: missing ARRAY TermDef in '%s'\n", file);
406 for (
int i = 0; i < nelem; i++)
407 array.push_back((DWORD) (val->
elements()->
at(i)->isNumber()->value()));
412 Print(
"WARNING: integer array expected in '%s'\n", file);
420 if (!def || !def->
term()) {
421 Print(
"WARNING: missing ARRAY TermDef in '%s'\n", file);
431 for (
int i = 0; i < nelem; i++)
432 array.push_back((
float) (val->
elements()->
at(i)->isNumber()->value()));
437 Print(
"WARNING: float array expected in '%s'\n", file);
447 if (!def || !def->
term()) {
448 Print(
"WARNING: missing TIME TermDef in '%s'\n", file);
461 strcpy_s(buf, tn->
value());
463 if (strchr(buf,
'/'))
464 sscanf_s(buf,
"%d/%d:%d:%d", &d, &h, &m, &s);
466 sscanf_s(buf,
"%d:%d:%d", &h, &m, &s);
468 dst = d * 24 * 60 * 60 +