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

Comparing ray/src/gen/xform.c (file contents):
Revision 1.12 by greg, Sat Dec 15 14:58:03 1990 UTC vs.
Revision 1.13 by greg, Mon Feb 18 13:45:09 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 27 | Line 27 | int  reverse;                          /* boolean true if scene inverted */
27  
28   int  expand = 0;                        /* boolean true to expand commands */
29  
30 + char  *newmod = NULL;                   /* new modifier for surfaces */
31 +
32   char  *idprefix = NULL;                 /* prefix for object identifiers */
33  
34   #define  ALIAS          NUMOTYPE        /* put alias at end of array */
# Line 44 | Line 46 | typedef struct {
46          double  *farg;                  /* float arguments */
47   }  FUNARGS;
48  
49 < #define  MAXSTR         512             /* maximum string length */
49 > #define  MAXSTR         128             /* maximum string length */
50  
51   FUNARGS  *getfargs();
52   char  *malloc();
# Line 69 | Line 71 | char  *argv[];
71          for (a = 1; a < argc; a++) {
72                  if (argv[a][0] == '-')
73                          switch (argv[a][1]) {
74 +                        case 'm':
75 +                                if (argv[a][2] || a+1 >= argc)
76 +                                        break;
77 +                                newmod = argv[++a];
78 +                                continue;
79                          case 'n':
80                                  if (argv[a][2] || a+1 >= argc)
81                                          break;
# Line 228 | Line 235 | xfobject(fname, fin)                           /* transform an object */
235   char  *fname;
236   FILE  *fin;
237   {
238 <        char  stmp[MAXSTR];
238 >        char  typ[16], nam[MAXSTR];
239          int  fn;
240 <        
241 <        fscanf(fin, "%s", stmp);        /* modifier */
242 <        printf("\n%s ", stmp);
236 <        fscanf(fin, "%s", stmp);        /* object type */
237 <        if ((fn = otype(stmp)) < 0) {
240 >                                                /* modifier and type */
241 >        fscanf(fin, "%s %s", nam, typ);
242 >        if ((fn = otype(typ)) < 0) {
243                  fprintf(stderr, "%s: (%s): unknown object type \"%s\"\n",
244 <                                progname, fname, stmp);
244 >                                progname, fname, typ);
245                  exit(1);
246          }
247 <        printf("%s ", stmp);
248 <        fscanf(fin, "%s", stmp);        /* object name */
247 >        printf("\n%s %s ", newmod!=NULL && issurface(fn) ? newmod : nam, typ);
248 >                                                /* object name */
249 >        fscanf(fin, "%s", nam);
250          if (idprefix != NULL && issurface(fn))
251 <                printf("%s.%s\n", idprefix, stmp);
251 >                printf("%s.%s\n", idprefix, nam);
252          else
253 <                printf("%s\n", stmp);
254 <                                        /* transform arguments */
253 >                printf("%s\n", nam);
254 >                                                /* transform arguments */
255          if ((*ofun[fn].funp)(fin) < 0) {
256                  fprintf(stderr, "%s: (%s): bad %s \"%s\"\n",
257 <                                progname, fname, ofun[fn].funame, stmp);
257 >                                progname, fname, ofun[fn].funame, nam);
258                  exit(1);
259          }
260   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines