ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove.c
(Generate patch)

Comparing ray/src/util/ranimove.c (file contents):
Revision 3.5 by schorsch, Mon Jun 30 14:59:13 2003 UTC vs.
Revision 3.9 by schorsch, Tue Oct 21 19:19:29 2003 UTC

# Line 12 | Line 12 | static const char RCSid[] = "$Id";
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>
# Line 97 | Line 99 | char   *argv[];
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:
# Line 141 | Line 143 | char   *argv[];
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);
# Line 299 | Line 301 | char   *ms;
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
# Line 334 | Line 336 | char           *qval;
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)
# Line 349 | Line 351 | char           *qval;
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  
# Line 456 | Line 457 | int    n;
457                          fclose(viewfp);
458                          viewfp = NULL;
459                          viewnum = 0;
460 <                        copystruct(&curview, &stdview);
460 >                        curview = stdview;
461                  }
462                  return(NULL);
463          }
# Line 472 | Line 473 | int    n;
473                          perror(vval(VIEWFILE));
474                          quit(1);
475                  }
476 <                copystruct(&curview, &stdview);
476 >                curview = stdview;
477                  viewnum = 0;
478          }
479          if (n < 0) {                            /* get next view */
# Line 572 | Line 573 | char   *s;
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   }
# Line 761 | Line 762 | int    n;
762                  om->cprio = om->prio;
763          }
764                                          /* XXX bxfm relies on call order */
765 <        if (framestep)
765 >        if (framestep) {
766                  if (invmat4(om->bxfm, om->cxfm))
767                          multmat4(om->bxfm, om->bxfm, oxf.xfm);
768                  else
769                          setident4(om->bxfm);
770 +        }
771                                          /* all done */
772          return(xfp);
773   }
# Line 791 | Line 793 | OBJECT obj;
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines