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.1 by greg, Sat Feb 22 02:07:30 2003 UTC vs.
Revision 3.8 by greg, Tue Sep 23 03:54:57 2003 UTC

# Line 1 | Line 1
1   #ifndef lint
2 < static const char       RCSid[] = "$Id$";
2 > static const char RCSid[] = "$Id";
3   #endif
4   /*
5   *  Radiance object animation program
# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   *  See ranimove.h and the ranimove(1) man page for details.
10   */
11  
12 < /* ====================================================================
13 < * The Radiance Software License, Version 1.0
14 < *
15 < * Copyright (c) 1990 - 2002 The Regents of the University of California,
16 < * through Lawrence Berkeley National Laboratory.   All rights reserved.
17 < *
18 < * Redistribution and use in source and binary forms, with or without
19 < * modification, are permitted provided that the following conditions
20 < * are met:
21 < *
22 < * 1. Redistributions of source code must retain the above copyright
23 < *         notice, this list of conditions and the following disclaimer.
24 < *
25 < * 2. Redistributions in binary form must reproduce the above copyright
26 < *       notice, this list of conditions and the following disclaimer in
27 < *       the documentation and/or other materials provided with the
28 < *       distribution.
29 < *
30 < * 3. The end-user documentation included with the redistribution,
31 < *           if any, must include the following acknowledgment:
32 < *             "This product includes Radiance software
33 < *                 (http://radsite.lbl.gov/)
34 < *                 developed by the Lawrence Berkeley National Laboratory
35 < *               (http://www.lbl.gov/)."
36 < *       Alternately, this acknowledgment may appear in the software itself,
37 < *       if and wherever such third-party acknowledgments normally appear.
38 < *
39 < * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
40 < *       and "The Regents of the University of California" must
41 < *       not be used to endorse or promote products derived from this
42 < *       software without prior written permission. For written
43 < *       permission, please contact [email protected].
44 < *
45 < * 5. Products derived from this software may not be called "Radiance",
46 < *       nor may "Radiance" appear in their name, without prior written
47 < *       permission of Lawrence Berkeley National Laboratory.
48 < *
49 < * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
50 < * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
51 < * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
52 < * DISCLAIMED.   IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
53 < * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54 < * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
55 < * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
56 < * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
57 < * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
58 < * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
59 < * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 < * SUCH DAMAGE.
61 < * ====================================================================
62 < *
63 < * This software consists of voluntary contributions made by many
64 < * individuals on behalf of Lawrence Berkeley National Laboratory.   For more
65 < * information on Lawrence Berkeley National Laboratory, please see
66 < * <http://www.lbl.gov/>.
67 < */
12 > #include "copyright.h"
13  
14 < #include "ranimove.h"
15 < #include <sys/time.h>
14 > #include <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 146 | 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 190 | 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 296 | 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 348 | 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 383 | 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 398 | 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]);
406 <                error(USER, errmsg);
356 >                i += rval;
357          }
358   }
359  
# Line 437 | 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 505 | 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 521 | 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 621 | 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 810 | 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 840 | 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