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

Comparing ray/src/rt/x10.c (file contents):
Revision 1.26 by greg, Fri Feb 23 08:55:18 1990 UTC vs.
Revision 2.4 by greg, Fri Sep 9 15:10:25 1994 UTC

# Line 11 | Line 11 | static char SCCSid[] = "$SunId$ LBL";
11   */
12  
13   #include  <stdio.h>
14 + #include  <math.h>
15  
15 #include  <sys/ioctl.h>
16
16   #include  <X/Xlib.h>
17   #include  <X/cursors/bcross.cursor>
18   #include  <X/cursors/bcross_mask.cursor>
# Line 61 | Line 60 | extern char  *malloc(), *getcombuf();
60  
61   extern char  *progname;
62  
63 < int  x_close(), x_clear(), x_paintr(), x_errout(),
63 > static int  x_close(), x_clear(), x_paintr(), x_errout(),
64                  x_getcur(), x_comout(), x_comin(), x_flush();
65  
66   static struct driver  x_driver = {
# Line 74 | Line 73 | struct driver *
73   x_init(name, id)                /* initialize driver */
74   char  *name, *id;
75   {
76 +        extern char  *getenv();
77 +        char  *gv;
78          char  defgeom[32];
79          OpaqueFrame  mainframe;
80  
# Line 86 | Line 87 | char  *name, *id;
87                  stderr_v("not enough colors\n");
88                  return(NULL);
89          }
90 <        make_gmap(GAMMA);                       /* make color map */
90 >                                /* make color map */
91 >        if ((gv = getenv("GAMMA")) != NULL)
92 >                make_gmap(atof(gv));
93 >        else
94 >                make_gmap(GAMMA);
95  
96          pickcursor = XCreateCursor(bcross_width, bcross_height,
97                          bcross_bits, bcross_mask_bits,
# Line 146 | Line 151 | x_clear(xres, yres)                    /* clear our display */
151   int  xres, yres;
152   {
153          if (xres != gwidth || yres != gheight) {        /* new window */
149                if (comline != NULL)
150                        xt_close(comline);
154                  XChangeWindow(gwind, xres, yres+COMHEIGHT);
152                comline = xt_open(gwind, 0, yres, xres, COMHEIGHT, 0, COMFN);
153                if (comline == NULL) {
154                        stderr_v("Cannot open command line window\n");
155                        quit(1);
156                }
155                  gwidth = xres;
156                  gheight = yres;
157          } else                                          /* just clear */
# Line 163 | Line 161 | int  xres, yres;
161                  stderr_v("cannot allocate colors\n");
162          else
163                  new_ctab(ncolors);
164 <
164 >                                                /* open new command line */
165 >        if (comline != NULL)
166 >                xt_close(comline);
167 >        comline = xt_open(gwind, 0, yres, xres, COMHEIGHT, 0, COMFN);
168 >        if (comline == NULL) {
169 >                stderr_v("Cannot open command line window\n");
170 >                quit(1);
171 >        }
172          XMapWindow(gwind);                      /* make sure it's mapped */
173          XSync(1);                               /* discard input */
174          return;
# Line 199 | Line 204 | static
204   x_comin(inp, prompt)            /* read in a command line */
205   char  *inp, *prompt;
206   {
207 <        int  x_getc(), x_comout();
207 >        extern int  x_getc();
208  
209          if (prompt != NULL)
210                  if (fromcombuf(inp, &x_driver))
# Line 216 | Line 221 | static
221   x_comout(out)                   /* output a string to command line */
222   char  *out;
223   {
224 <        if (comline != NULL)
225 <                xt_puts(out, comline);
226 <        XFlush();
224 >        if (comline == NULL)
225 >                return;
226 >        xt_puts(out, comline);
227 >        if (out[strlen(out)-1] == '\n')
228 >                XFlush();
229   }
230  
231  
# Line 226 | Line 233 | static
233   x_errout(msg)                   /* output an error message */
234   char  *msg;
235   {
229        x_comout(msg);
236          stderr_v(msg);          /* send to stderr also! */
237 +        x_comout(msg);
238   }
239  
240  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines