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

Comparing ray/src/gen/genbox.c (file contents):
Revision 2.7 by schorsch, Sun Nov 16 10:29:38 2003 UTC vs.
Revision 2.8 by greg, Sat Jul 25 19:18:01 2020 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   *     1/8/86
8   */
9  
10 < #include  <stdio.h>
11 <
12 < #include <stdlib.h>
13 <
10 > #include  "rtio.h"
11 > #include  <stdlib.h>
12   #include  <math.h>
13  
14  
# Line 31 | Line 29 | int  reverse = 0;      /* boolean true for reversed normals
29  
30  
31   static void
32 < vertex(v)
35 < register int  v;
32 > vertex(int v)
33   {
34          register int  i;
35  
# Line 48 | Line 45 | register int  v;
45  
46  
47   static void
48 < side(a, b, c, d)                /* generate a rectangular face */
52 < int  a, b, c, d;
48 > side(int a, int b, int c, int d)                /* generate a rectangular face */
49   {
50          printf("\n%s polygon %s.%c%c%c%c\n", cmtype, cname,
51                          let[a], let[b], let[c], let[d]);
# Line 69 | Line 65 | int  a, b, c, d;
65  
66  
67   static void
68 < corner(a, b, c)                 /* generate a triangular face */
73 < int  a, b, c;
68 > corner(int a, int b, int c)                     /* generate a triangular face */
69   {
70          printf("\n%s polygon %s.%c%c%c\n", cmtype, cname,
71                          let[a], let[b], let[c]);
# Line 88 | Line 83 | int  a, b, c;
83  
84  
85   static void
86 < cylinder(v0, v1)                /* generate a cylinder */
92 < int  v0, v1;
86 > cylinder(int v0, int v1)                /* generate a cylinder */
87   {
88          printf("\n%s cylinder %s.%c%c\n", cmtype, cname, v0+'0', v1+'0');
89          printf("0\n0\n7\n");
# Line 100 | Line 94 | int  v0, v1;
94  
95  
96   static void
97 < sphere(v0)                      /* generate a sphere */
104 < int  v0;
97 > sphere(int v0)                  /* generate a sphere */
98   {
99          printf("\n%s sphere %s.%c\n", cmtype, cname, v0+'0');
100          printf("0\n0\n4\n");
# Line 110 | Line 103 | int  v0;
103   }
104  
105  
113 static void
114 printhead(ac, av)               /* print command header */
115 register int  ac;
116 register char  **av;
117 {
118        putchar('#');
119        while (ac--) {
120                putchar(' ');
121                fputs(*av++, stdout);
122        }
123        putchar('\n');
124 }
125
126
106   int
107 < main(argc, argv)
129 < int  argc;
130 < char  **argv;
107 > main(int argc, char **argv)
108   {
109          int  i;
110          
# Line 158 | Line 135 | char  **argv;
135                  }
136          }
137  
138 <        printhead(argc, argv);
138 >        fputs("# ", stdout);
139 >        printargs(argc, argv, stdout);
140  
141          if (bevel > 0.0) {
142                                          /* minor faces */
# Line 226 | Line 204 | char  **argv;
204                  side(5, 1, 3, 7);
205                  side(6, 4, 5, 7);
206          }
207 <        exit(0);
207 >        return(0);
208   userr:
209          fprintf(stderr, "Usage: %s ", argv[0]);
210          fprintf(stderr, "material name xsize ysize zsize ");
211          fprintf(stderr, "[-i] [-b bevel | -r rounde]\n");
212 <        exit(1);
212 >        return(1);
213   }
214  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines