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

Comparing ray/src/hd/rhd_geom.c (file contents):
Revision 3.11 by schorsch, Thu Jun 26 00:58:10 2003 UTC vs.
Revision 3.14 by schorsch, Thu Jan 1 11:21:55 2004 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   * Geometry drawing operations for OpenGL driver.
6   */
7  
8 + #include <string.h>
9 +
10 + #include "rtio.h"
11   #include "radogl.h"
12   #include "rhdriver.h"
13 + #include "rhd_odraw.h"
14  
15   #ifndef MAXGEO
16   #define MAXGEO          8               /* maximum geometry list length */
# Line 32 | Line 36 | static struct gmEntry {
36  
37   #define FORALLPORT(pl,i)                for (i=0;i<MAXPORT&&pl[i]!=NULL;i++)
38  
35 extern char     *nextword();
39  
40  
41 < gmNewGeom(file)                 /* add new geometry to next list */
42 < char    *file;
41 >
42 > extern void
43 > gmNewGeom(                      /* add new geometry to next list */
44 >        char    *file
45 > )
46   {
47          register int    i, j;
48                                          /* check if already in next list */
# Line 50 | Line 56 | char   *file;
56                                          /* check if copy in current list */
57          FORALLGEOM(gmCurrent, j)
58                  if (!strcmp(file, gmCurrent[j].gfile)) {
59 <                        copystruct(&gmNext[i], &gmCurrent[j]);
59 >                        gmNext[i] = gmCurrent[j];
60                          return;
61                  }
62                                          /* else load new octree */
# Line 67 | Line 73 | char   *file;
73   }
74  
75  
76 < gmEndGeom()                     /* make next list current */
76 > extern void
77 > gmEndGeom(void)                 /* make next list current */
78   {
79          register int    i, j;
80  
# Line 81 | Line 88 | gmEndGeom()                    /* make next list current */
88                          freestr(gmCurrent[i].gfile);
89                  }
90          }
91 <        bcopy((void *)gmNext, (void *)gmCurrent, sizeof(gmNext));
92 <        bzero((void *)gmNext, sizeof(gmNext));
91 >        memcpy((void *)gmCurrent, (void *)gmNext, sizeof(gmNext));
92 >        memset((void *)gmNext, '\0', sizeof(gmNext));
93   }
94  
95  
96 < int
97 < gmDrawGeom()                    /* draw current list of octrees */
96 > extern int
97 > gmDrawGeom(void)                        /* draw current list of octrees */
98   {
99          register int    n;
100  
# Line 97 | Line 104 | gmDrawGeom()                   /* draw current list of octrees */
104   }
105  
106  
107 < gmDrawPortals(r, g, b, a)       /* draw portals with specific RGBA value */
108 < int     r, g, b, a;
107 > extern void
108 > gmDrawPortals(  /* draw portals with specific RGBA value */
109 >        int     r,
110 >        int     g,
111 >        int     b,
112 >        int     a
113 > )
114   {
115 <        if (!gmPortals || r<0 & g<0 & b<0 & a<0)
115 >        if (!gmPortals || (r<0) & (g<0) & (b<0) & (a<0))
116                  return;
117          glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT|
118                          GL_POLYGON_BIT|GL_LIGHTING_BIT);
# Line 118 | Line 130 | int    r, g, b, a;
130   }
131  
132  
133 < gmDepthLimit(dl, vorg, vdir)    /* compute approximate depth limits for view */
134 < double  dl[2];
135 < FVECT   vorg, vdir;
133 > extern void
134 > gmDepthLimit(   /* compute approximate depth limits for view */
135 >        double  dl[2],
136 >        FVECT   vorg,
137 >        FVECT   vdir
138 > )
139   {
140          FVECT   v;
141          double  dcent;
# Line 140 | Line 155 | FVECT  vorg, vdir;
155   }
156  
157  
158 < gmNewPortal(pflist)             /* add portal file(s) to our new list */
159 < char    *pflist;
158 > extern void
159 > gmNewPortal(            /* add portal file(s) to our new list */
160 >        char    *pflist
161 > )
162   {
163 <        register int    i, j;
163 >        register int    i;
164          char    newfile[128];
165  
166          if (pflist == NULL)
# Line 170 | Line 187 | char   **ss0, **ss1;
187   }
188  
189  
190 < int
191 < gmEndPortal()                   /* close portal list and return GL list */
190 > extern int
191 > gmEndPortal(void)                       /* close portal list and return GL list */
192   {
193          register int    n;
194  
# Line 196 | Line 213 | gmEndPortal()                  /* close portal list and return GL lis
213                  }
214          FORALLPORT(curportlist, n)              /* free old file list */
215                  freestr(curportlist[n]);
216 <        bcopy((void *)newportlist, (void *)curportlist, sizeof(newportlist));
217 <        bzero((void *)newportlist, sizeof(newportlist));
216 >        memcpy((void *)curportlist, (void *)newportlist, sizeof(newportlist));
217 >        memset((void *)newportlist, '\0', sizeof(newportlist));
218          return(gmPortals);                      /* return GL list id */
219   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines