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

Comparing ray/src/rt/rview.c (file contents):
Revision 2.17 by greg, Wed Apr 17 14:02:16 1996 UTC vs.
Revision 2.19 by greg, Tue Feb 25 02:47:23 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1995 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  rview.c - routines and variables for interactive view generation.
6   *
7 < *     3/24/87
7 > *  External symbols declared in rpaint.h
8   */
9  
10 + #include "copyright.h"
11 +
12   #include  "ray.h"
13  
14   #include  "rpaint.h"
# Line 18 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17  
18   #include  <ctype.h>
19  
20 < VIEW  ourview = STDVIEW;                /* viewing parameters */
21 < int  hresolu, vresolu;                  /* image resolution */
20 > CUBE  thescene;                         /* our scene */
21 > OBJECT  nsceneobjs;                     /* number of objects in our scene */
22  
23   int  dimlist[MAXDIM];                   /* sampling dimensions */
24   int  ndims = 0;                         /* number of sampling dimensions */
25   int  samplendx = 0;                     /* index for this sample */
26  
27 + extern void  ambnotify();
28 + void  (*addobjnotify[])() = {ambnotify, NULL};
29 +
30 + VIEW  ourview = STDVIEW;                /* viewing parameters */
31 + int  hresolu, vresolu;                  /* image resolution */
32 +
33 + void  (*trace)() = NULL;                /* trace call */
34 +
35 + int  do_irrad = 0;                      /* compute irradiance? */
36 +
37   int  psample = 8;                       /* pixel sample size */
38   double  maxdiff = .15;                  /* max. sample difference */
39  
# Line 51 | Line 60 | int  backvis = 1;                      /* back face visibility */
60   int  maxdepth = 4;                      /* maximum recursion depth */
61   double  minweight = 1e-2;               /* minimum ray weight */
62  
63 + char  *ambfile = NULL;                  /* ambient file name */
64   COLOR  ambval = BLKCOLOR;               /* ambient value */
65   int  ambvwt = 0;                        /* initial weight for ambient value */
66   double  ambacc = 0.2;                   /* ambient accuracy */
# Line 62 | Line 72 | char  *amblist[128];                   /* ambient include/exclude list
72   int  ambincl = -1;                      /* include == 1, exclude == 0 */
73  
74   int  greyscale = 0;                     /* map colors to brightness? */
75 < char  *devname = dev_default;           /* output device name */
75 > char  *dvcname = dev_default;           /* output device name */
76  
77   struct driver  *dev = NULL;             /* driver functions */
78  
# Line 81 | Line 91 | static char  *reserve_mem = NULL;      /* pre-allocated res
91   #define  CTRL(c)        ((c)-'@')
92  
93  
94 + void
95   quit(code)                      /* quit program */
96   int  code;
97   {
# Line 93 | Line 104 | int  code;
104   }
105  
106  
107 + void
108   devopen(dname)                          /* open device driver */
109   char  *dname;
110   {
# Line 119 | Line 131 | char  *dname;
131   }
132  
133  
134 + void
135   devclose()                              /* close our device */
136   {
137          if (dev != NULL)
# Line 127 | Line 140 | devclose()                             /* close our device */
140   }
141  
142  
143 + void
144   printdevices()                          /* print list of output devices */
145   {
146          register int  i;
# Line 136 | Line 150 | printdevices()                         /* print list of output devices */
150   }
151  
152  
153 + void
154   rview()                         /* do a view */
155   {
156          char  buf[32];
157  
158 <        devopen(devname);               /* open device */
158 >        devopen(dvcname);               /* open device */
159          newimage();                     /* start image (calls fillreserves) */
160  
161          for ( ; ; ) {                   /* quit in command() */
# Line 168 | Line 183 | rview()                                /* do a view */
183   }
184  
185  
186 + void
187   fillreserves()                  /* fill memory reserves */
188   {
189          if (reserve_mem != NULL)
190                  return;
191 <        reserve_mem = malloc(RESERVE_AMT);
191 >        reserve_mem = (char *)malloc(RESERVE_AMT);
192   }
193  
194  
195 + void
196   freereserves()                  /* free memory reserves */
197   {
198          if (reserve_mem == NULL)
# Line 185 | Line 202 | freereserves()                 /* free memory reserves */
202   }
203  
204  
205 + void
206   command(prompt)                 /* get/execute command */
207   char  *prompt;
208   {
# Line 313 | Line 331 | dostop:
331                  devclose();
332                  kill(0, SIGTSTP);
333                  /* pc stops here */
334 <                devopen(devname);
334 >                devopen(dvcname);
335                  redraw();
336                  break;
337   #endif
# Line 333 | Line 351 | commerr:
351   }
352  
353  
354 + void
355   rsample()                       /* sample the image */
356   {
357          int  xsiz, ysiz, y;
# Line 355 | Line 374 | rsample()                      /* sample the image */
374                  return;
375          pl = (PNODE **)malloc(xsiz*sizeof(PNODE *));
376          if (pl == NULL) {
377 <                free((char *)rl);
377 >                free((void *)rl);
378                  return;
379          }
380          /*
# Line 416 | Line 435 | rsample()                      /* sample the image */
435                  }
436          }
437   escape:
438 <        free((char *)rl);
439 <        free((char *)pl);
438 >        free((void *)rl);
439 >        free((void *)pl);
440   }
441  
442  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines