308 |
|
if (ourras == NULL) |
309 |
|
goto fail; |
310 |
|
getmono(); |
311 |
< |
} else if (XMatchVisualInfo(thedisplay,ourscreen,24,TrueColor,&vinfo)) { |
311 |
> |
} else if (XMatchVisualInfo(thedisplay,ourscreen,24,TrueColor,&vinfo) |
312 |
> |
/* kludge for DirectColor */ |
313 |
> |
|| XMatchVisualInfo(thedisplay,ourscreen,24,DirectColor,&vinfo)) { |
314 |
|
ourdata = (unsigned char *)malloc(xmax*ymax*3); |
315 |
|
if (ourdata == NULL) |
316 |
|
goto fail; |
336 |
|
} |
337 |
|
return; |
338 |
|
fail: |
339 |
< |
quit("could not create raster image"); |
339 |
> |
quiterr("could not create raster image"); |
340 |
|
} |
341 |
|
|
342 |
|
|
445 |
|
XBell(thedisplay, 0); |
446 |
|
return(-1); |
447 |
|
} |
448 |
< |
viewray(rorg, rdir, &ourview, |
448 |
> |
if (viewray(rorg, rdir, &ourview, |
449 |
|
(ekey->x-xoff+.5)/xmax, |
450 |
< |
(ymax-1-ekey->y+yoff+.5)/ymax); |
450 |
> |
(ymax-1-ekey->y+yoff+.5)/ymax) < 0) |
451 |
> |
return(-1); |
452 |
|
printf("%e %e %e ", rorg[0], rorg[1], rorg[2]); |
453 |
|
printf("%e %e %e\n", rdir[0], rdir[1], rdir[2]); |
454 |
|
fflush(stdout); |
609 |
|
|
610 |
|
if ((inl = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL |
611 |
|
|| (cerr = (short *)calloc(xmax,sizeof(short))) == NULL) |
612 |
< |
quit("out of memory in getmono"); |
612 |
> |
quiterr("out of memory in getmono"); |
613 |
|
dp = ourdata - 1; |
614 |
|
for (y = 0; y < ymax; y++) { |
615 |
|
picreadline3(y, inl); |
674 |
|
if (scanpos == NULL || scanpos[y] == -1) |
675 |
|
return(-1); |
676 |
|
if (fseek(fin, scanpos[y], 0) == -1) |
677 |
< |
quit("fseek error"); |
677 |
> |
quiterr("fseek error"); |
678 |
|
cury = y; |
679 |
|
} else if (scanpos != NULL) |
680 |
|
scanpos[y] = ftell(fin); |