| 96 |
|
char *id; |
| 97 |
|
{ |
| 98 |
|
extern char *getenv(); |
| 99 |
< |
char *gv; |
| 99 |
> |
static RGBPRIMS myprims = STDPRIMS; |
| 100 |
> |
char *ev; |
| 101 |
|
double gamval = GAMMA; |
| 102 |
+ |
RGBPRIMP dpri = stdprims; |
| 103 |
|
int nplanes; |
| 104 |
|
XSetWindowAttributes ourwinattr; |
| 105 |
|
XWMHints ourxwmhints; |
| 132 |
|
ourwhite = WhitePixel(ourdisplay,ourscreen); |
| 133 |
|
} |
| 134 |
|
/* set gamma and tone mapping */ |
| 135 |
< |
if ((gv = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL |
| 136 |
< |
|| (gv = getenv("DISPLAY_GAMMA")) != NULL) |
| 137 |
< |
gamval = atof(gv); |
| 138 |
< |
if (tmInit(mytmflags(), stdprims, gamval) == NULL) |
| 135 |
> |
if ((ev = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL |
| 136 |
> |
|| (ev = getenv("DISPLAY_GAMMA")) != NULL) |
| 137 |
> |
gamval = atof(ev); |
| 138 |
> |
if ((ev = getenv("DISPLAY_PRIMARIES")) != NULL && |
| 139 |
> |
sscanf(ev, "%f %f %f %f %f %f %f %f", |
| 140 |
> |
&myprims[RED][CIEX],&myprims[RED][CIEY], |
| 141 |
> |
&myprims[GRN][CIEX],&myprims[GRN][CIEY], |
| 142 |
> |
&myprims[BLU][CIEX],&myprims[BLU][CIEY], |
| 143 |
> |
&myprims[WHT][CIEX],&myprims[WHT][CIEY]) >= 6) |
| 144 |
> |
dpri = myprims; |
| 145 |
> |
if (tmInit(mytmflags(), dpri, gamval) == NULL) |
| 146 |
|
error(SYSTEM, "not enough memory in dev_open"); |
| 147 |
|
/* open window */ |
| 148 |
|
ourwinattr.background_pixel = ourblack; |
| 183 |
|
dev_input(); /* sets size and view angles */ |
| 184 |
|
/* allocate our leaf pile */ |
| 185 |
|
if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) * |
| 186 |
< |
DisplayHeight(ourdisplay,ourscreen) / |
| 187 |
< |
(qtMinNodesiz*qtMinNodesiz))) |
| 186 |
> |
DisplayHeight(ourdisplay,ourscreen) * 3 / |
| 187 |
> |
(qtMinNodesiz*qtMinNodesiz*2))) |
| 188 |
|
error(SYSTEM, "insufficient memory for leaf storage"); |
| 189 |
|
odev.name = id; |
| 190 |
|
odev.ifd = ConnectionNumber(ourdisplay); |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
|
| 211 |
+ |
|
| 212 |
+ |
dev_clear() /* clear our quadtree */ |
| 213 |
+ |
{ |
| 214 |
+ |
qtCompost(100); |
| 215 |
+ |
if (ncolors > 0) |
| 216 |
+ |
new_ctab(ncolors); |
| 217 |
+ |
rayqleft = 0; /* hold off update */ |
| 218 |
+ |
} |
| 219 |
+ |
|
| 220 |
+ |
|
| 221 |
|
int |
| 222 |
|
dev_view(nv) /* assign new driver view */ |
| 223 |
|
VIEW *nv; |
| 623 |
|
if (ncolors > 0) |
| 624 |
|
new_ctab(ncolors); |
| 625 |
|
inpresflags |= DFL(DC_REDRAW); /* resend values from server */ |
| 626 |
+ |
rayqleft = 0; /* hold off update */ |
| 627 |
|
return; |
| 628 |
|
case 'K': /* kill rtrace process(es) */ |
| 629 |
|
inpresflags |= DFL(DC_KILL); |