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.3 by greg, Tue Oct 13 17:42:22 1992 UTC vs.
Revision 2.6 by greg, Fri Jun 4 14:49:08 1993 UTC

# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10  
11   #include  <stdio.h>
12  
13 + #include  <math.h>
14 +
15   #include  <graph.h>
16  
17   #include  "driver.h"
# Line 38 | Line 40 | struct driver *
40   vga_init(name, id)                      /* open VGA */
41   char  *name, *id;
42   {
43 <        static short  mode_pref[] = {_XRES256COLOR, _SVRES256COLOR,
43 >        static short  mode_pref[] = {_MRES256COLOR, -1};
44 >        static short  smode_pref[] = {_XRES256COLOR, _SVRES256COLOR,
45                                          _VRES256COLOR, _MRES256COLOR, -1};
46          char  *ep;
47 <        register int  i;
47 >        register short  *mp;
48  
49 <        for (i = 0; mode_pref[i] != -1; i++)
50 <                if (_setvideomode(mode_pref[i]))
49 >        mp = !strcmp(name, "vga") ? mode_pref : smode_pref;
50 >        for ( ; *mp != -1; mp++)
51 >                if (_setvideomode(*mp))
52                          break;
53 <        if (mode_pref[i] == -1) {
53 >        if (*mp == -1) {
54                  _setvideomode(_DEFAULTMODE);
55                  stderr_v(name);
56                  stderr_v(": card not present or insufficient VGA memory\n");
# Line 85 | Line 89 | char  *name, *id;
89   static
90   vga_close()                                     /* close VGA */
91   {
92 +        ms_gcdone(&vga_driver);
93          _setvideomode(_DEFAULTMODE);
94          errvec = stderr_v;                      /* reset error vectors */
95          cmdvec = NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines