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.8 by greg, Sat Feb 22 02:07:29 2003 UTC vs.
Revision 2.10 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   *  vga.c - driver for VGA graphics adaptor under MS-DOS
6   */
7  
8 < /* ====================================================================
9 < * The Radiance Software License, Version 1.0
10 < *
11 < * Copyright (c) 1990 - 2002 The Regents of the University of California,
12 < * through Lawrence Berkeley National Laboratory.   All rights reserved.
13 < *
14 < * Redistribution and use in source and binary forms, with or without
15 < * modification, are permitted provided that the following conditions
16 < * are met:
17 < *
18 < * 1. Redistributions of source code must retain the above copyright
19 < *         notice, this list of conditions and the following disclaimer.
20 < *
21 < * 2. Redistributions in binary form must reproduce the above copyright
22 < *       notice, this list of conditions and the following disclaimer in
23 < *       the documentation and/or other materials provided with the
24 < *       distribution.
25 < *
26 < * 3. The end-user documentation included with the redistribution,
27 < *           if any, must include the following acknowledgment:
28 < *             "This product includes Radiance software
29 < *                 (http://radsite.lbl.gov/)
30 < *                 developed by the Lawrence Berkeley National Laboratory
31 < *               (http://www.lbl.gov/)."
32 < *       Alternately, this acknowledgment may appear in the software itself,
33 < *       if and wherever such third-party acknowledgments normally appear.
34 < *
35 < * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
36 < *       and "The Regents of the University of California" must
37 < *       not be used to endorse or promote products derived from this
38 < *       software without prior written permission. For written
39 < *       permission, please contact [email protected].
40 < *
41 < * 5. Products derived from this software may not be called "Radiance",
42 < *       nor may "Radiance" appear in their name, without prior written
43 < *       permission of Lawrence Berkeley National Laboratory.
44 < *
45 < * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
46 < * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
47 < * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48 < * DISCLAIMED.   IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
49 < * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50 < * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51 < * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
52 < * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
53 < * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
54 < * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
55 < * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 < * SUCH DAMAGE.
57 < * ====================================================================
58 < *
59 < * This software consists of voluntary contributions made by many
60 < * individuals on behalf of Lawrence Berkeley National Laboratory.   For more
61 < * information on Lawrence Berkeley National Laboratory, please see
62 < * <http://www.lbl.gov/>.
63 < */
8 > #include "copyright.h"
9  
65 #include  "standard.h"
66
10   #include  <graph.h>
11  
12 + #include  "standard.h"
13   #include  "driver.h"
70
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];
85
35   static struct videoconfig  config;
36  
88 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 141 | 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 158 | 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   {
175        extern int  vgacolr();
176
131          _setcolor(get_pixel(col, vgacolr)+2);
132          _rectangle(_GFILLINTERIOR, xmin, vga_driver.ysiz-ymax,
133                          xmax-1, vga_driver.ysiz-1-ymin);
# Line 181 | 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 213 | 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 228 | 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 242 | 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