🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #961

patch for monochrome Suns

#961
From: Mark Linton
Date: Fri, 19 Apr 1991 07:07
46 lines
1971 bytes
Below is the fix for monochrome Suns or anything bw system with whitepixel == 0.

*** /tmp/,RCSt1a07294	Wed Apr 17 17:11:39 1991
--- iv/src/lib/IV-X11/xworld.c	Wed Apr 17 17:11:16 1991
***************
*** 146,157 ****
  	set_shift(visual_->green_mask, green_, green_shift_);
  	set_shift(visual_->blue_mask, blue_, blue_shift_);
  	break;
-     case StaticGray:
- 	rgbtable_ = nil;
- 	white_ = (1 << visual_->bits_per_rgb) - 1;
- 	break;
      default:
  	rgbtable_ = new RGBTable(256);
      }
      ctable_ = new ColorTable(256);
      localmap_ = nil;
--- 146,154 ----
  	set_shift(visual_->green_mask, green_, green_shift_);
  	set_shift(visual_->blue_mask, blue_, blue_shift_);
  	break;
      default:
  	rgbtable_ = new RGBTable(256);
+ 	break;
      }
      ctable_ = new ColorTable(256);
      localmap_ = nil;
***************
*** 395,409 ****
  	xc.red = (unsigned short)rescale(r, red_, 0xffff);
  	xc.green = (unsigned short)rescale(g, green_, 0xffff);
  	xc.blue = (unsigned short)rescale(b, blue_, 0xffff);
- 	break;
-     case StaticGray:
- 	unsigned long gray = rescale(
- 	    (30 * red + 59 * green + 11 * blue) / 100, 0xffff, white_
- 	);
- 	xc.pixel = gray;
- 	xc.red = (unsigned short)rescale(gray, white_, 0xffff);
- 	xc.green = (unsigned short)rescale(gray, white_, 0xffff);
- 	xc.blue = (unsigned short)rescale(gray, white_, 0xffff);
  	break;
      default:
  	unsigned long rg = (red << 16) | green;
--- 392,397 ----
Technical Details
Message-ID: <1991Apr19.070715.5452@odin.corp.sgi.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!marktwain.rad.sgi.com!linton

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!marktwain.rad.sgi.com!linton
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.windows.interviews
Subject: patch for monochrome Suns
Message-ID: <1991Apr19.070715.5452@odin.corp.sgi.com>
Date: 19 Apr 91 07:07:15 GMT
Sender: news@odin.corp.sgi.com (Net News)
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
Organization: sgi
Lines: 46