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

Comparing ray/src/rt/vga.c (file contents):
Revision 2.9 by greg, Tue Feb 25 02:47:23 2003 UTC vs.
Revision 2.10 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7  
8   #include "copyright.h"
9  
10 #include  "standard.h"
11
10   #include  <graph.h>
11  
12 + #include  "standard.h"
13   #include  "driver.h"
15
14   #include  "color.h"
15  
16   #define  GAMMA          2.2             /* exponent for color correction */
17  
18  
19 < int  vga_close(), vga_clear(), vga_paintr(), vga_comout(), vga_errout(),
20 <                vga_comin();
19 > static struct driver * vga_init(char *name, char *id);
20 > static void vga_errout(char *msg);
21 > static dr_newcolrf_t vgacolr;
22  
23 + static dr_closef_t vga_close;
24 + static dr_clearf_t vga_clear;
25 + static dr_paintrf_t vga_paintr;
26 + static dr_comoutf_t vga_comout;
27 + static dr_cominf_t vga_comin;
28 +
29   static struct driver  vga_driver = {
30          vga_close, vga_clear, vga_paintr, NULL,
31          vga_comout, vga_comin, NULL, 1.0
32   };
33  
34   static char  fatalerr[128];
30
35   static struct videoconfig  config;
36  
33 extern char  *getenv();
37  
38  
39 < struct driver *
40 < vga_init(name, id)                      /* open VGA */
41 < char  *name, *id;
39 > static struct driver *
40 > vga_init(                       /* open VGA */
41 >        char  *name,
42 >        char  *id
43 > )
44   {
45          static short  mode_pref[] = {_MRES256COLOR, -1};
46          static short  smode_pref[] = {_XRES256COLOR, _SVRES256COLOR,
# Line 86 | Line 91 | char  *name, *id;
91   }
92  
93  
94 < static
95 < vga_close()                                     /* close VGA */
94 > static void
95 > vga_close(void)                                 /* close VGA */
96   {
97          ms_gcdone(&vga_driver);
98          _setvideomode(_DEFAULTMODE);
# Line 103 | Line 108 | vga_close()                                    /* close VGA */
108   }
109  
110  
111 < static
112 < vga_clear(x, y)                                 /* clear VGA */
113 < int  x, y;
111 > static void
112 > vga_clear(                                      /* clear VGA */
113 >        int  x,
114 >        int  y
115 > )
116   {
117          _clearscreen(_GCLEARSCREEN);
118          new_ctab(config.numcolors-2);           /* init color table */
119   }
120  
121  
122 < static
123 < vga_paintr(col, xmin, ymin, xmax, ymax)         /* paint a rectangle */
124 < COLOR  col;
125 < int  xmin, ymin, xmax, ymax;
122 > static void
123 > vga_paintr(             /* paint a rectangle */
124 >        COLOR  col,
125 >        int  xmin,
126 >        int  ymin,
127 >        int  xmax,
128 >        int  ymax
129 > )
130   {
120        extern int  vgacolr();
121
131          _setcolor(get_pixel(col, vgacolr)+2);
132          _rectangle(_GFILLINTERIOR, xmin, vga_driver.ysiz-ymax,
133                          xmax-1, vga_driver.ysiz-1-ymin);
# Line 126 | Line 135 | int  xmin, ymin, xmax, ymax;
135   }
136  
137  
138 < static
139 < vga_comout(s)                           /* put s to text output */
140 < register char  *s;
138 > static void
139 > vga_comout(                             /* put s to text output */
140 >        register char  *s
141 > )
142   {
143          struct rccoord  tpos;
144          char  buf[128];
# Line 158 | Line 168 | register char  *s;
168   }
169  
170  
171 < static
172 < vga_errout(msg)
173 < register char  *msg;
171 > static void
172 > vga_errout(
173 >        register char  *msg
174 > )
175   {
176          static char  *fep = fatalerr;
177  
# Line 173 | Line 184 | register char  *msg;
184   }
185  
186  
187 < static
188 < vga_comin(buf, prompt)                  /* get input line from console */
189 < char  *buf;
190 < char  *prompt;
187 > static void
188 > vga_comin(                      /* get input line from console */
189 >        char  *buf,
190 >        char  *prompt
191 > )
192   {
193          extern int  getch();
194  
# Line 187 | Line 199 | char  *prompt;
199   }
200  
201  
202 < static
203 < vgacolr(index, r, g, b)                /* enter a color into our table */
204 < int  index;
205 < int  r, g, b;
202 > static void
203 > vgacolr(                       /* enter a color into our table */
204 >        int  index,
205 >        int  r,
206 >        int  g,
207 >        int  b
208 > )
209   {
210          register long  cl;
211  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines