Article View: comp.sys.sun
Article #11327Re: postscript
From: Thomas Pfenning
Date: Tue, 07 Mar 1989 04:38
Date: Tue, 07 Mar 1989 04:38
38 lines
1873 bytes
1873 bytes
Following the discussion about postscript I picked up the files from a
comp.sources archive and installed the patch provided by steve beaty in
v7i158. With the fix installed all but one of the demo files ran fine on
our 386i. The raygun2 file produced a garbled picture as mentioned in the
Pixrect Reference Manual. The following patch fixes the bitorder problem
with a 8bit color monitor when loading postscript bitmaps. I can't give
you a diff because BITNET corrupts all files, so I list the function with
the lines between #ifdef 386 and #endif added.
struct hardware *HardwareFromString (s, width, height)
unsigned char *s;
int width, height;
{
int words = (width + 15) / 16;
Pixrect *pr = mem_create (width, height, 1);
short *d = mpr_d (pr)->md_image;
int odd = ((width + 7) / 8) & 1;
int i, j;
for (i = 0; i < height; i++) {
for (j = 0; j < words - odd; j++) {
short word = *s++;
*d++ = (word << 8) *s++;
}
if (odd) *d++ = *s++ << 8;
}
#ifdef sun386
mpr_d (pr) -> md_flags &= |MP_I386; /* pixrect is in 68000 style bitorder
*/
pr_flip(pr); /* revert to 80386 */
#endif
return NewHardware (pr, NewDevicePoint (width, height), 0);
}
Hope this helps .
Thomas Pfenning, University of Cologne, Institute for Theoretical Physics
Technical Details
Message-ID:
<8902240155.AA08849@rice.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: a0096@DK0RRZK0.BITNET (Thomas Pfenning) Newsgroups: comp.sys.sun Subject: Re: postscript Keywords: 386i Message-ID: <8902240155.AA08849@rice.edu> Date: 7 Mar 89 04:38:44 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 38 Approved: Sun-Spots@rice.edu Original-Date: Fri, 24 Feb 89 02:02:59 -0100 X-Sun-Spots-Digest: Volume 7, Issue 184, message 2 of 16