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

Comparing ray/src/common/rglmat.c (file contents):
Revision 3.1 by gwlarson, Tue Jun 9 11:18:35 1998 UTC vs.
Revision 3.3 by greg, Tue Feb 25 02:47:22 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Routines for Radiance -> OpenGL materials.
6   */
7  
8 + #include "copyright.h"
9 +
10   #include "radogl.h"
11  
13 extern int      free(), freemtl();
14
12   int     domats = 1;                     /* are we doing materials? */
13  
14   LUTAB   mtab = LU_SINIT(free,freemtl);
15  
16  
17 + void
18   rgl_matclear()                  /* clean up materials */
19   {
20          lu_done(&mtab);
# Line 38 | Line 36 | char   *nam;
36   }
37  
38  
39 + int
40   o_default(o)                    /* default object is non-material modifier */
41   register OBJREC *o;
42   {
# Line 55 | Line 54 | register OBJREC        *o;
54                          goto memerr;
55                  strcpy(lup->key, o->oname);
56          } else if (lup->data != NULL)
57 <                freemtl(lup->data);
57 >                freemtl((MATREC *)lup->data);
58          if ((lup->data = o->os) != NULL)        /* make material reference */
59                  ((MATREC *)lup->data)->nlinks++;
60          return;
# Line 78 | Line 77 | char   *nam;
77                          goto memerr;
78                  strcpy(lup->key, nam);
79          } else if (lup->data != NULL)
80 <                freemtl(lup->data);
80 >                freemtl((MATREC *)lup->data);
81          lup->data = (char *)malloc(sizeof(MATREC));
82          if (lup->data == NULL)
83                  goto memerr;
# Line 89 | Line 88 | memerr:
88   }
89  
90  
91 + void
92   freemtl(mp)                     /* free a material */
93   register MATREC *mp;
94   {
95          if (!--mp->nlinks)
96 <                free((char *)mp);
96 >                free((void *)mp);
97   }
98  
99  
100 + int
101   m_normal(o)                     /* compute normal material parameters */
102   register OBJREC *o;
103   {
# Line 128 | Line 129 | register OBJREC        *o;
129   }
130  
131  
132 + int
133   m_aniso(o)                      /* anisotropic material */
134   register OBJREC *o;
135   {
# Line 159 | Line 161 | register OBJREC        *o;
161   }
162  
163  
164 + int
165   m_glass(o)                      /* glass material (hopeless) */
166   OBJREC  *o;
167   {
# Line 172 | Line 175 | OBJREC *o;
175   }
176  
177  
178 + int
179   m_brdf(o)                       /* convert functional material */
180   register OBJREC *o;
181   {
# Line 198 | Line 202 | register OBJREC        *o;
202   }
203  
204  
205 + int
206   m_brdf2(o)                      /* convert advanced functional material */
207   register OBJREC *o;
208   {
# Line 217 | Line 222 | register OBJREC        *o;
222   }
223  
224  
225 + int
226   m_light(o)                      /* convert light type */
227   register OBJREC *o;
228   {
# Line 245 | Line 251 | register OBJREC        *o;
251   }
252  
253  
254 + int
255   m_mirror(o)                     /* convert mirror type */
256   register OBJREC *o;
257   {
# Line 261 | Line 268 | register OBJREC        *o;
268   }
269  
270  
271 + int
272   m_prism(o)                      /* convert prism type */
273   register OBJREC *o;
274   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines