ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/mgflib/parser.h
(Generate patch)

Comparing ray/src/cv/mgflib/parser.h (file contents):
Revision 1.1 by greg, Tue Jun 21 14:45:41 1994 UTC vs.
Revision 1.2 by greg, Wed Jun 22 15:33:42 1994 UTC

# Line 60 | Line 60 | extern int     (*mg_ehand[MG_NENTITIES])(int argc, char **
60   #define MG_EINCL        7               /* error in included file */
61   #define MG_EMEM         8               /* out of memory */
62   #define MG_ESEEK        9               /* file seek error */
63 + #define MG_EBADMAT      10              /* bad material specification */
64  
65 < #define MG_NERRS        10
65 > #define MG_NERRS        11
66  
67   extern char     *mg_err[MG_NERRS];
68  
# Line 140 | Line 141 | extern int isflt(char *);              /* non-zero if floating poi
141   *      Definitions for 3-d vector manipulation functions
142   */
143  
144 < typedef double  FVECT[3];
144 > #ifdef SMLFLT
145 > #define FLOAT   float
146 > #else
147 > #define FLOAT   double
148 > #endif
149  
150 + typedef FLOAT  FVECT[3];
151 +
152   #ifdef NOPROTO
153   extern double   normalize();            /* normalize a vector */
154   #else
# Line 154 | Line 161 | extern double  normalize(FVECT);       /* normalize a vector
161   */
162  
163   typedef struct {
164 <        double  cx, cy;         /* XY chromaticity coordinates */
164 >        float   cx, cy;         /* XY chromaticity coordinates */
165   } C_COLOR;              /* color context */
166  
167   typedef struct {
168 <        double  rd;             /* diffuse reflectance */
168 >        char    *name;          /* material name */
169 >        int     clock;          /* incremented each change -- resettable */
170 >        float   rd;             /* diffuse reflectance */
171          C_COLOR rd_c;           /* diffuse reflectance color */
172 <        double  td;             /* diffuse transmittance */
172 >        float   td;             /* diffuse transmittance */
173          C_COLOR td_c;           /* diffuse transmittance color */
174 <        double  ed;             /* diffuse emittance */
174 >        float   ed;             /* diffuse emittance */
175          C_COLOR ed_c;           /* diffuse emittance color */
176 <        double  rs;             /* specular reflectance */
176 >        float   rs;             /* specular reflectance */
177          C_COLOR rs_c;           /* specular reflectance color */
178 <        double  rs_a;           /* specular reflectance roughness */
179 <        double  ts;             /* specular transmittance */
178 >        float   rs_a;           /* specular reflectance roughness */
179 >        float   ts;             /* specular transmittance */
180          C_COLOR ts_c;           /* specular transmittance color */
181 <        double  ts_a;           /* specular transmittance roughness */
181 >        float   ts_a;           /* specular transmittance roughness */
182   } C_MATERIAL;           /* material context */
183  
184   typedef struct {
# Line 177 | Line 186 | typedef struct {
186   } C_VERTEX;             /* vertex context */
187  
188   #define C_DEFCOLOR      {.333,.333}
189 < #define C_DEFMATERIAL   {0.,C_DEFCOLOR,0.,C_DEFCOLOR,0.,C_DEFCOLOR,\
190 <                        0.,C_DEFCOLOR,0.,0.,C_DEFCOLOR,0.}
189 > #define C_DEFMATERIAL   {NULL,1,0.,C_DEFCOLOR,0.,C_DEFCOLOR,0.,C_DEFCOLOR,\
190 >                                        0.,C_DEFCOLOR,0.,0.,C_DEFCOLOR,0.}
191   #define C_DEFVERTEX     {{0.,0.,0.},{0.,0.,0.}}
192  
193   extern C_COLOR          *c_ccolor;      /* the current color */
# Line 208 | Line 217 | extern char    **obj_name;             /* names in hierarchy */
217  
218   #ifdef NOPROTO
219   extern int      obj_handler();                  /* handle an object entity */
220 + extern void     obj_clear();                    /* clear object stack */
221   #else
222   extern int      obj_handler(int, char **);      /* handle an object entity */
223 + extern void     obj_clear(void);                /* clear object stack */
224   #endif
225  
226   /**************************************************************************
227   *      Definitions for hierarchical transformation handler
228   */
229  
230 < typedef double  MAT4[4][4];
230 > typedef FLOAT  MAT4[4][4];
231  
232   #ifdef  BSD
233   #define  copymat4(m4a,m4b)      bcopy((char *)m4b,(char *)m4a,sizeof(MAT4))
# Line 235 | Line 246 | extern MAT4  m4ident;
246                                  /* regular transformation */
247   typedef struct {
248          MAT4  xfm;                              /* transform matrix */
249 <        double  sca;                            /* scalefactor */
249 >        FLOAT  sca;                             /* scalefactor */
250   }  XF;
251  
252   #define identxf(xp)             (void)(setident4((xp)->xfm),(xp)->sca=1.0)
# Line 270 | Line 281 | extern void    xf_xfmpoint();          /* transform point */
281   extern void     xf_xfmvect();           /* transform vector */
282   extern void     xf_rotvect();           /* rotate vector */
283   extern double   xf_scale();             /* scale a value */
284 + extern void     xf_clear();             /* clear xf stack */
285  
286   /* The following are support routines you probably won't call directly */
287  
# Line 280 | Line 292 | extern int     xf();                   /* interpret transform spec. */
292  
293   #else
294  
295 < extern int      xf_handler();           /* handle xf entity */
296 < extern void     xf_xfmpoint();          /* transform point */
297 < extern void     xf_xfmvect();           /* transform vector */
298 < extern void     xf_rotvect();           /* rotate vector */
299 < extern double   xf_scale();             /* scale a value */
295 > extern int      xf_handler(int, char **);       /* handle xf entity */
296 > extern void     xf_xfmpoint(FVECT, FVECT);      /* transform point */
297 > extern void     xf_xfmvect(FVECT, FVECT);       /* transform vector */
298 > extern void     xf_rotvect(FVECT, FVECT);       /* rotate vector */
299 > extern double   xf_scale(double);               /* scale a value */
300 > extern void     xf_clear(void);                 /* clear xf stack */
301  
302   /* The following are support routines you probably won't call directly */
303  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines