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.3 by greg, Mon Mar 10 17:26:26 2003 UTC vs.
Revision 3.8 by greg, Tue Sep 23 03:54:57 2003 UTC

# Line 11 | Line 11 | static const char RCSid[] = "$Id";
11  
12   #include "copyright.h"
13  
14 #include "ranimove.h"
14   #include <time.h>
15 < #include <sys/time.h>
15 > #ifndef _WIN32
16 >  #include <sys/time.h>
17 > #endif
18   #include <ctype.h>
19 + #include <string.h>
20  
21 + #include "paths.h"
22 + #include "ranimove.h"
23 +
24   int             NVARS = NV_INIT; /* total number of variables */
25  
26   VARIABLE        vv[] = VV_INIT; /* variable-value pairs */
# Line 92 | Line 97 | char   *argv[];
97                  case 'f':                       /* frame range */
98                          switch (sscanf(argv[++i], "%d,%d", &fbeg, &fend)) {
99                          case 2:
100 <                                if ((fbeg <= 0 | fend < fbeg))
100 >                                if ((fbeg <= 0) | (fend < fbeg))
101                                          goto userr;
102                                  break;
103                          case 1:
# Line 136 | Line 141 | char   *argv[];
141                                                  /* all done */
142          if (lorendoptf[0])
143                  unlink(lorendoptf);
144 <        if (hirendoptf[0])
144 >        if (hirendoptf[0] && strcmp(hirendoptf, lorendoptf))
145                  unlink(hirendoptf);
146          if (objtmpf[0])
147                  unlink(objtmpf);
# Line 242 | Line 247 | setdefaults()                  /* set default values */
247          setrendparams(lorendoptf, vval(LOWQ));
248          ray_save(&lorendparams);
249          curparams = &lorendparams;
250 <        twolevels = bcmp(&lorendparams, &hirendparams, sizeof(RAYPARAMS));
250 >        twolevels = memcmp(&lorendparams, &hirendparams, sizeof(RAYPARAMS));
251   }
252  
253  
# Line 294 | Line 299 | char   *ms;
299                  if (isflt(om->prio_file)) {
300                          om->prio = atof(om->prio_file);
301                          om->prio_file[0] = '\0';
302 <                        haveprio |= (om->prio < 0.95 | om->prio > 1.05);
302 >                        haveprio |= ((om->prio < 0.95) | (om->prio > 1.05));
303                  } else
304                          haveprio = 1;
305          } else
# Line 329 | Line 334 | char           *qval;
334          if (qval != NULL && qval[0] == '-')
335                  ac += wordstring(av+ac, qval);
336  
337 <                                /* start with default parameters */
338 <        ray_defaults(NULL);
337 >                                /* restore default parameters */
338 >        ray_restore(NULL);
339                                  /* set what we have */
340          for (i = 0; i < ac; i++) {
341                  while ((rval = expandarg(&ac, &av, i)) > 0)
# Line 344 | Line 349 | char           *qval;
349                          continue;
350                  }
351                  rval = getrenderopt(ac-i, av+i);
352 <                if (rval >= 0) {
353 <                        i += rval;
354 <                        continue;
352 >                if (rval < 0) {
353 >                        sprintf(errmsg, "bad render option at '%s'", av[i]);
354 >                        error(USER, errmsg);
355                  }
356 <                sprintf(errmsg, "bad render option at '%s'", av[i]);
352 <                error(USER, errmsg);
356 >                i += rval;
357          }
358   }
359  
# Line 383 | Line 387 | char   *rfargs;
387                          pippt = NULL;
388                  }
389          if (pippt != NULL)
390 <                strcpy(pippt, "> /dev/null");   /* nothing to match */
390 >                strcpy(pippt, "> " NULL_DEVICE);        /* nothing to match */
391          else {
392                  strcpy(cp, ")[ \t]*=' > ranimove.var");
393                  cp += 11;               /* point to file name */
# Line 451 | Line 455 | int    n;
455                          fclose(viewfp);
456                          viewfp = NULL;
457                          viewnum = 0;
458 <                        copystruct(&curview, &stdview);
458 >                        curview = stdview;
459                  }
460                  return(NULL);
461          }
# Line 467 | Line 471 | int    n;
471                          perror(vval(VIEWFILE));
472                          quit(1);
473                  }
474 <                copystruct(&curview, &stdview);
474 >                curview = stdview;
475                  viewnum = 0;
476          }
477          if (n < 0) {                            /* get next view */
# Line 567 | Line 571 | char   *s;
571                  return(1.0);
572  
573          expval = atof(s);
574 <        if ((s[0] == '+' | s[0] == '-'))
574 >        if ((s[0] == '+') | (s[0] == '-'))
575                  return(pow(2.0, expval));
576          return(expval);
577   }
# Line 756 | Line 760 | int    n;
760                  om->cprio = om->prio;
761          }
762                                          /* XXX bxfm relies on call order */
763 <        if (framestep)
763 >        if (framestep) {
764                  if (invmat4(om->bxfm, om->cxfm))
765                          multmat4(om->bxfm, om->bxfm, oxf.xfm);
766                  else
767                          setident4(om->bxfm);
768 +        }
769                                          /* all done */
770          return(xfp);
771   }
# Line 786 | Line 791 | OBJECT obj;
791                  objnm = obj_move[i].name;
792                  len = strlen(objnm);
793                  if (!strncmp(onm, objnm, len)) {
794 <                        if ((obj_move[i].parent < 0 & onm[len] == '.'))
794 >                        if ((obj_move[i].parent < 0) & (onm[len] == '.'))
795                                  break;
796                          objnm = getobjname(&obj_move[i]) + len;
797                          len2 = strlen(objnm);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines