12 |
|
#include "copyright.h" |
13 |
|
|
14 |
|
#include <time.h> |
15 |
< |
#ifndef _WIN32 |
15 |
> |
#ifdef _WIN32 |
16 |
> |
#include <winsock.h> /* struct timeval. XXX find a replacement? */ |
17 |
> |
#else |
18 |
|
#include <sys/time.h> |
19 |
|
#endif |
20 |
|
#include <ctype.h> |
99 |
|
case 'f': /* frame range */ |
100 |
|
switch (sscanf(argv[++i], "%d,%d", &fbeg, &fend)) { |
101 |
|
case 2: |
102 |
< |
if ((fbeg <= 0 | fend < fbeg)) |
102 |
> |
if ((fbeg <= 0) | (fend < fbeg)) |
103 |
|
goto userr; |
104 |
|
break; |
105 |
|
case 1: |
143 |
|
/* all done */ |
144 |
|
if (lorendoptf[0]) |
145 |
|
unlink(lorendoptf); |
146 |
< |
if (hirendoptf[0]) |
146 |
> |
if (hirendoptf[0] && strcmp(hirendoptf, lorendoptf)) |
147 |
|
unlink(hirendoptf); |
148 |
|
if (objtmpf[0]) |
149 |
|
unlink(objtmpf); |
301 |
|
if (isflt(om->prio_file)) { |
302 |
|
om->prio = atof(om->prio_file); |
303 |
|
om->prio_file[0] = '\0'; |
304 |
< |
haveprio |= (om->prio < 0.95 | om->prio > 1.05); |
304 |
> |
haveprio |= ((om->prio < 0.95) | (om->prio > 1.05)); |
305 |
|
} else |
306 |
|
haveprio = 1; |
307 |
|
} else |
336 |
|
if (qval != NULL && qval[0] == '-') |
337 |
|
ac += wordstring(av+ac, qval); |
338 |
|
|
339 |
< |
/* start with default parameters */ |
340 |
< |
ray_defaults(NULL); |
339 |
> |
/* restore default parameters */ |
340 |
> |
ray_restore(NULL); |
341 |
|
/* set what we have */ |
342 |
|
for (i = 0; i < ac; i++) { |
343 |
|
while ((rval = expandarg(&ac, &av, i)) > 0) |
351 |
|
continue; |
352 |
|
} |
353 |
|
rval = getrenderopt(ac-i, av+i); |
354 |
< |
if (rval >= 0) { |
355 |
< |
i += rval; |
356 |
< |
continue; |
354 |
> |
if (rval < 0) { |
355 |
> |
sprintf(errmsg, "bad render option at '%s'", av[i]); |
356 |
> |
error(USER, errmsg); |
357 |
|
} |
358 |
< |
sprintf(errmsg, "bad render option at '%s'", av[i]); |
357 |
< |
error(USER, errmsg); |
358 |
> |
i += rval; |
359 |
|
} |
360 |
|
} |
361 |
|
|
573 |
|
return(1.0); |
574 |
|
|
575 |
|
expval = atof(s); |
576 |
< |
if ((s[0] == '+' | s[0] == '-')) |
576 |
> |
if ((s[0] == '+') | (s[0] == '-')) |
577 |
|
return(pow(2.0, expval)); |
578 |
|
return(expval); |
579 |
|
} |
793 |
|
objnm = obj_move[i].name; |
794 |
|
len = strlen(objnm); |
795 |
|
if (!strncmp(onm, objnm, len)) { |
796 |
< |
if ((obj_move[i].parent < 0 & onm[len] == '.')) |
796 |
> |
if ((obj_move[i].parent < 0) & (onm[len] == '.')) |
797 |
|
break; |
798 |
|
objnm = getobjname(&obj_move[i]) + len; |
799 |
|
len2 = strlen(objnm); |