23 |
|
#include "x11twind.h" |
24 |
|
#include "x11icon.h" |
25 |
|
|
26 |
< |
#define GAMMA 2.2 /* exponent for color correction */ |
26 |
> |
#define GAMMA 2.2 /* default exponent correction */ |
27 |
|
|
28 |
|
#define MINWIDTH (32*COMCW) /* minimum graphics window width */ |
29 |
|
#define MINHEIGHT MINWIDTH /* minimum graphics window height */ |
82 |
|
x11_init(name, id) /* initialize driver */ |
83 |
|
char *name, *id; |
84 |
|
{ |
85 |
+ |
extern char *getenv(); |
86 |
+ |
char *gv; |
87 |
|
int nplanes; |
88 |
|
XSetWindowAttributes ourwinattr; |
89 |
|
XWMHints ourxwmhints; |
119 |
|
ourblack = BlackPixel(ourdisplay,ourscreen); |
120 |
|
ourwhite = WhitePixel(ourdisplay,ourscreen); |
121 |
|
} |
122 |
< |
make_gmap(GAMMA); |
123 |
< |
/* open window */ |
122 |
> |
/* set gamma */ |
123 |
> |
if ((gv = getenv("GAMMA")) != NULL) |
124 |
> |
make_gmap(atof(gv)); |
125 |
> |
else |
126 |
> |
make_gmap(GAMMA); |
127 |
> |
/* open window */ |
128 |
|
ourwinattr.background_pixel = ourblack; |
129 |
|
ourwinattr.border_pixel = ourblack; |
130 |
|
/* this is stupid */ |
407 |
|
if (ncolors == 0) |
408 |
|
return; |
409 |
|
XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L); |
410 |
+ |
free((char *)pixval); |
411 |
+ |
pixval = NULL; |
412 |
|
ncolors = 0; |
413 |
|
if (ourmap != DefaultColormap(ourdisplay,ourscreen)) |
414 |
|
XFreeColormap(ourdisplay, ourmap); |