[comp.windows.x] Round bubbles and error handeling for X Aquarium...

jonnyg@AARDVARK.UMD.EDU (Jon Greenblatt) (08/12/89)

	This should be the last posting on this (I hope). I fixed the
bubble shapes and error message for mono monitors. Here are the diffs:

*** xfish.c.1	Fri Aug 11 09:44:10 1989
--- xfish.c	Fri Aug 11 16:49:49 1989
***************
*** 50,57 ****
              rreds[],
              rgreens[],
              rblues[];
! extern short xfishRaster[],
!             xbBits[9][8];
  
  
  /* typedefs for bubble and fish structures, also caddr_t (not used in X.h) */
--- 50,57 ----
              rreds[],
              rgreens[],
              rblues[];
! extern short xfishRaster[];
! extern unsigned char xbBits[9][8];
  
  
  /* typedefs for bubble and fish structures, also caddr_t (not used in X.h) */
***************
*** 252,257 ****
--- 252,262 ----
      extern char *malloc();
  
  
+     if (DisplayPlanes(Dpy,screen) < 8) {
+ 	printf("ERROR: Need a color display at least 8 planes deep\n");
+ 	exit(1);
+ 	}
+ 
      j = rwidth * rheight;
      x1 = p = (caddrt) xfishRaster;
      for (i = 0; i < j; i++, p++)
***************
*** 264,270 ****
  	q = x2 + (i + 1) * rwidth - 1;
  	for (j = 0; j < rwidth; j++)
  	    *q-- = *p++;
!     }
      xfish[1] = XCreateImage(Dpy, DefaultVisual(Dpy, screen), 8, ZPixmap,
  	0, x1, rwidth, rheight, 8, rwidth);
      xfish[2] = XCreateImage(Dpy, DefaultVisual(Dpy, screen), 8, ZPixmap, 
--- 269,276 ----
  	q = x2 + (i + 1) * rwidth - 1;
  	for (j = 0; j < rwidth; j++)
  	    *q-- = *p++;
! 	}
! 
      xfish[1] = XCreateImage(Dpy, DefaultVisual(Dpy, screen), 8, ZPixmap,
  	0, x1, rwidth, rheight, 8, rwidth);
      xfish[2] = XCreateImage(Dpy, DefaultVisual(Dpy, screen), 8, ZPixmap, 
***************
*** 271,276 ****
--- 277,283 ----
  	0, x2, rwidth, rheight, 8, rwidth);
  
      i = DisplayPlanes(Dpy, screen);
+ 
      pfish[1] = XCreatePixmap(Dpy, wid, rwidth, rheight, i);
      if (pfish[1])
  	pfish[2] = XCreatePixmap(Dpy, wid, rwidth, rheight, i);
*** xfishy.c.1	Fri Aug 11 09:57:32 1989
--- xfishy.c	Fri Aug 11 16:35:35 1989
***************
*** 2398,2411 ****
  };
  
  
! short xbBits[9][8] = {
!   {0x0000 },
!   {0xffff },
!   {0xffff,0xffff },
!   {0xffff,0xffff,0xffff },
!   {0x0006,0x000b,0x0009,0x0006 },
!   {0x000e,0x0017,0x0013,0x0011,0x000e },
!   {0x001e,0x002d,0x0027,0x0021,0x0021,0x001e },
!   {0x001c,0x002a,0x004d,0x0047,0x0041,0x0022,0x001c },
!   {0x003c,0x004e,0x008b,0x0087,0x0081,0x0081,0x0042,0x003c }
  };
--- 2398,2411 ----
  };
  
  
! unsigned char xbBits[9][8] = {
!   {0x00 },
!   {0xff },
!   {0xff,0xff },
!   {0xff,0xff,0xff },
!   {0x06,0x0b,0x09,0x06 },
!   {0x0e,0x17,0x13,0x11,0x0e },
!   {0x1e,0x2d,0x27,0x21,0x21,0x1e },
!   {0x1c,0x2a,0x4d,0x47,0x41,0x22,0x1c },
!   {0x3c,0x4e,0x8b,0x87,0x81,0x81,0x42,0x3c }
  };

envbvs@epb2.lbl.gov (Brian V. Smith) (08/12/89)

jonnyg@AARDVARK.UMD.EDU (Jon Greenblatt) writes:

< 	This should be the last posting on this (I hope). I fixed the
< bubble shapes and error message for mono monitors. Here are the diffs:

[some diffs]

< +     if (DisplayPlanes(Dpy,screen) < 8) {
< + 	printf("ERROR: Need a color display at least 8 planes deep\n");
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   

Some fix.  Thanks a lot for "accomodating" us 4-plane color and monochrome
users. 8-(

_____________________________________
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
We don't need no signatures!