home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume19 / xblockbuster / patch01 / xblockbuster.patch
Encoding:
Text File  |  1993-04-28  |  37.8 KB  |  1,275 lines

  1. diff -cr xblockbuster1.00/patchlevel.h xblockbuster1.01/patchlevel.h
  2. *** xblockbuster1.00/patchlevel.h    Fri Mar 12 23:48:29 1993
  3. --- xblockbuster1.01/patchlevel.h    Thu Mar 18 01:34:39 1993
  4. ***************
  5. *** 1 ****
  6. ! #define VERSION    "XBlockBuster 1.00"
  7. --- 1 ----
  8. ! #define VERSION    "XBlockBuster 1.01"
  9. diff -cr xblockbuster1.00/CHANGES xblockbuster1.01/CHANGES
  10. *** xblockbuster1.00/CHANGES    Wed Mar 10 17:57:12 1993
  11. --- xblockbuster1.01/CHANGES    Sat Mar 20 03:26:53 1993
  12. ***************
  13. *** 1,4 ****
  14. ! XBlockBuster v1.00:
  15.   
  16.    Converted to run under X11 instead of SunView.
  17.   
  18. --- 1,33 ----
  19. ! Changes from v1.00 to v1.01
  20. !   Fixed the Imakefile so StageDir now works properly.
  21. !   PATHLENGTH (in xblockbuster.h) increased from 64 to 512
  22. !   sprintf is no longer assumed to return its first arguement (ANSI C it
  23. !   returns the number of characters transferred.)  Thanks David Sanderson
  24. !   SysV/Ultrix support added (put -DSYSV in the define line in the Makefile/
  25. !   Imakefile). Thanks ykcheu@eos.ncsu.edu
  26. !   Added code so that XBlockBuster will hopefully work better on displays
  27. !   in which BlackPixel == 0 (Xor didn't work at all on those systems.)
  28. !   Moved FONT from the (I)Makefile to xblockbuster.h.   The FONT, as
  29. !   defined, should work fine.  Moved there because if a nice title screen
  30. !   is ever added, a different font will be used there, and I don't really
  31. !   want 2 or 3 font declarations on the compile line.
  32. !   Changed the XmbSetWMProperties to XSetWMProperties in xblockbuster.c.  From
  33. !   the man page, it appears that the former is standard X11R5, but some
  34. !   systems don't have it, and XSetWMProperties does the job fine.
  35. !   Added RAND and SRAND defines to xblockbuster.h.  Some machines don't
  36. !   seem to have the random and srandom functions.  These macros should make
  37. !   it easier for these people to fix that problem.
  38. ! -----------------------------------------------------------------------------
  39. ! Changes from Sunview BlockBuster to XBlockBuster v1.00:
  40.   
  41.    Converted to run under X11 instead of SunView.
  42.   
  43. diff -cr xblockbuster1.00/Imakefile xblockbuster1.01/Imakefile
  44. *** xblockbuster1.00/Imakefile    Sat Mar 13 02:20:09 1993
  45. --- xblockbuster1.01/Imakefile    Mon Mar 22 20:18:02 1993
  46. ***************
  47. *** 1,26 ****
  48.   XCOMM $XConsortium: Imakefile,v 1.9 91/07/16 23:06:01 gildea Exp $
  49. ! /*     BINDIR = /usr/games/
  50.   */
  51. !        FONT    = -DFONT=\"10x20\"
  52. ! /*     MANDIR = /usr/local/man/man6
  53.   */
  54.         MANSUFFIX = 6
  55. ! /*
  56. !        STAGEDIR = /usr/games/lib/xblockbuster
  57. ! */
  58. ! #ifndef STAGEDIR
  59. ! #define STAGEDIR = LIBDIR
  60.   #endif
  61.   
  62. !     DEFINES = $(FONT) -DSTAGEDIR=\"$(STAGEDIR)\"
  63.           DEPLIBS = $(DEPXLIB)
  64.   LOCAL_LIBRARIES = $(XLIB)
  65.             SRCS1 = balls_pallet.c bricks.c deflection.c save.c score.c stage.c \
  66. !             xblockbuster.c
  67.             OBJS1 = balls_pallet.o bricks.o deflection.o save.o score.o stage.o \
  68. !             xblockbuster.o
  69. !       SRCS2 = stagemm.c
  70. !       OBJS2 = stagemm.o
  71.          PROGRAMS = xblockbuster stagemm
  72.   
  73.   ComplexProgramTarget_1(xblockbuster,$(LOCAL_LIBRARIES),-lm)
  74. --- 1,30 ----
  75.   XCOMM $XConsortium: Imakefile,v 1.9 91/07/16 23:06:01 gildea Exp $
  76. ! /*       BINDIR = /usr/games/
  77.   */
  78. ! /*       MANDIR = /usr/local/man/man6
  79.   */
  80.         MANSUFFIX = 6
  81. ! #define StageDir /usr/games/lib/xblockbuster
  82. ! #define InstallLib YES    /* Change to NO if the stages are already installed */
  83. ! #ifndef StageDir
  84. ! #define StageDir $(LIBDIR)/xblockbuster
  85.   #endif
  86.   
  87. ! STAGEDIR = StageDir
  88. ! /* If your on a system V machine, add -DSYSV to DEFINES below */
  89. !         DEFINES = -DSTAGEDIR=\"$(STAGEDIR)\"
  90.           DEPLIBS = $(DEPXLIB)
  91.   LOCAL_LIBRARIES = $(XLIB)
  92.             SRCS1 = balls_pallet.c bricks.c deflection.c save.c score.c stage.c \
  93. !                   xblockbuster.c
  94.             OBJS1 = balls_pallet.o bricks.o deflection.o save.o score.o stage.o \
  95. !                   xblockbuster.o
  96. !           SRCS2 = stagemm.c
  97. !           OBJS2 = stagemm.o
  98.          PROGRAMS = xblockbuster stagemm
  99.   
  100.   ComplexProgramTarget_1(xblockbuster,$(LOCAL_LIBRARIES),-lm)
  101. ***************
  102. *** 33,41 ****
  103.     There must be a better way of doing this install, other than listing
  104.     the 40 or so files and doing a InstallMultiple.
  105.   */
  106.   install::
  107.       MakeDir($(STAGEDIR))
  108.       cp -r STAGES* $(STAGEDIR)
  109.       chmod 666 $(STAGEDIR)/STAGES*/scores
  110.       chmod 777 $(STAGEDIR)/STAGES*/save
  111. --- 37,46 ----
  112.     There must be a better way of doing this install, other than listing
  113.     the 40 or so files and doing a InstallMultiple.
  114.   */
  115. + #if InstallLib
  116.   install::
  117.       MakeDir($(STAGEDIR))
  118.       cp -r STAGES* $(STAGEDIR)
  119.       chmod 666 $(STAGEDIR)/STAGES*/scores
  120.       chmod 777 $(STAGEDIR)/STAGES*/save
  121. ! #endif
  122. Only in xblockbuster1.00: Makefile
  123. diff -cr xblockbuster1.00/Makefile.noIm xblockbuster1.01/Makefile.noIm
  124. *** xblockbuster1.00/Makefile.noIm    Fri Mar 19 01:19:41 1993
  125. --- xblockbuster1.01/Makefile.noIm    Sat Mar 20 03:11:41 1993
  126. ***************
  127. *** 15,26 ****
  128.   MANDIR = /usr/local/man/man6/
  129.   MANEXT = 6
  130.   
  131. - # Font to use for writing text.
  132. - FONT = 10x20
  133.   
  134.   CC = cc
  135. ! # IF you want to change the FONT or LIBDIR, do it above
  136. ! CFLAGS= -O -DFONT=\"${FONT}\"  -DSTAGEDIR=\"${LIBDIR}\"
  137.   LDFLAGS=
  138.   LIBS= -lm -lX11
  139.   
  140. --- 15,27 ----
  141.   MANDIR = /usr/local/man/man6/
  142.   MANEXT = 6
  143.   
  144.   
  145. + # If you want change LIBDIR, do it above
  146. + # If on a System V machine, add -DSYSV to CFLAGS
  147. + DEFINES =  -DSTAGEDIR=\"${LIBDIR}\"
  148.   CC = cc
  149. ! CFLAGS = -O $(DEFINES)
  150.   LDFLAGS=
  151.   LIBS= -lm -lX11
  152.   
  153. ***************
  154. *** 37,42 ****
  155. --- 38,50 ----
  156.       cp -r STAGES* ${LIBDIR}
  157.       chmod 666 ${LIBDIR}/STAGES*/scores
  158.       chmod 777 ${LIBDIR}/STAGES*/save
  159. +     cp XBlockbuster.ad ${LIBDIR}
  160. +     cp xblockbuster ${BINDIR}/xblockbuster
  161. +     cp xblockbuster.man ${MANDIR}/xblockbuster.${MANEXT}
  162. +     cp stagemm ${BINDIR}/stagemm
  163. +     cp stagemm.man ${MANDIR}/stagemm.${MANEXT}
  164. + install.bin:
  165.       cp XBlockbuster.ad ${LIBDIR}
  166.       cp xblockbuster ${BINDIR}/xblockbuster
  167.       cp xblockbuster.man ${MANDIR}/xblockbuster.${MANEXT}
  168. diff -cr xblockbuster1.00/README xblockbuster1.01/README
  169. *** xblockbuster1.00/README    Sat Mar 13 00:15:30 1993
  170. --- xblockbuster1.01/README    Mon Mar 22 20:07:43 1993
  171. ***************
  172. *** 12,43 ****
  173.   
  174.   TO BUILD:
  175.   
  176. !     If you want to use the Imakefile, all that is needed is:
  177.   
  178.       1) xmkmf
  179.       2) make
  180.       3) make install
  181.   
  182.       If you don't want to use the Imakefile, do the following:
  183.       1) cp Makefile.noIm Makefile
  184.       2) Edit the Makefile.  Everything should be fairly well documented.
  185. -            You should make sure that whatever FONT is defined to is available
  186. -        on your system, or the program will not work (use xlsfonts to see
  187. -        what fonts your server provides.)  I believe the default font as
  188. -         distributed (10x20) is part of the X11R5 distribution.
  189.       3) make
  190.       4) make install
  191.   
  192. !     XBlockbuster can use the same playground that Blockbuster (the sunview
  193. ! version) does, if you already have that installed.  Set LIBDIR appropriately
  194. ! to use the same playground.
  195.   
  196. !     I have successfully compiled the source with both cc and gcc on
  197. ! a sun 3/sunos 4.1.1.
  198.   
  199. !     After you have set up the Makefile to your satisfaction, type:
  200.   
  201.   
  202.   FILES (of interest):
  203.   
  204.   CHANGES: changes made from blockbuster to xblockbuster.
  205. --- 12,78 ----
  206.   
  207.   TO BUILD:
  208.   
  209. !     If you are on a System V machine, -DSYSV will need to be added to the
  210. !     DEFINES variable.
  211.   
  212. +     XBlockbuster can use the same playground that Blockbuster (the sunview
  213. +     version) does.  If you want to use the same playground, set 
  214. +     StageDir (Imakefile) or LIBDIR (Makefile.noIm) appropriately.
  215. +   IMAKEFILE directions:
  216. +     If you have already installed the stages file for xblockbuster, and
  217. +     don't want to copy over them, change InstallLib in Imakefile to No.
  218. +     The Imakefile, as distributed, should work fine (unless on System V).  You
  219. +     may still want to edit the Imakefile to change where the files will
  220. +     be installed.  Once you have edited the Imakefile to your satisfaction,
  221. +     all that is needed is:
  222.       1) xmkmf
  223.       2) make
  224.       3) make install
  225.   
  226. +   MAKEFILE directions:
  227.       If you don't want to use the Imakefile, do the following:
  228.       1) cp Makefile.noIm Makefile
  229.       2) Edit the Makefile.  Everything should be fairly well documented.
  230.       3) make
  231. +     If you have already installed the XBlockBuster stages, and don't
  232. +     want to copy over them, do:
  233. +     4) make install.bin
  234. +     If this is your first installation, or you want to copy over the
  235. +     score files, do:
  236.       4) make install
  237.   
  238. !     I have successfully compiled the source with both cc and gcc on
  239. !     a sun 3/sunos 4.1.1.
  240.   
  241. ! IF YOU HAVE PROBLEMS:
  242.   
  243. !     If it can't find the font, change FONT in xblockbuster.h
  244.   
  245. +     If your on system V/Ultrix machine, did you add -DSYSV to to
  246. +     defines?
  247.   
  248. +     If you get link errors of random or srandom not found, change RAND
  249. +     and SRAND in xblockbuster.h to comparable functions for your
  250. +     machine (and please send me mail, so I can make this more automatic
  251. +     in the future.)  Note that RAND and SRAND are only used for
  252. +     determining what the order of the stages are, so they need not
  253. +     be especially good.
  254. +     Check the BUGS/TODO section to see if it is a problem I
  255. +     already know about.  If it is, still send me mail, but maybe
  256. +     by it being a known problem, you won't feel quite so bad.
  257. +     Other problems?  Send me mail. (see below)
  258.   FILES (of interest):
  259.   
  260.   CHANGES: changes made from blockbuster to xblockbuster.
  261. ***************
  262. *** 56,63 ****
  263.       (See the manual page for more information on coloring the bricks and
  264.       alternate bricks.)
  265.   
  266. ! TODO:
  267.   
  268.    A nice opening screen, showing the bricks (with proper coloring, if 
  269.   applicable), along with descriptions of what each brick does.
  270.   
  271. --- 91,106 ----
  272.       (See the manual page for more information on coloring the bricks and
  273.       alternate bricks.)
  274.   
  275. ! BUGS/TODO:
  276.   
  277. +  I have gotten several reports of the pallette not appearing on the
  278. + screen, yet the balls are appearing (both use the gc_xor structure, so
  279. + I don't have any idea what the problem is, and can't reproduce it
  280. + myself.)  This problem seems to be happening more on BW systems.  My
  281. + only thought right now is perhaps the window wasn't made the proper size,
  282. + so the bottom is cut off.  But even then, if the pointer is moved near
  283. + the top of the window, the side crosshairs should still appear.
  284.    A nice opening screen, showing the bricks (with proper coloring, if 
  285.   applicable), along with descriptions of what each brick does.
  286.   
  287. ***************
  288. *** 79,85 ****
  289.   
  290.       I will maintain it and release patches as required. 
  291.   
  292.   Mark Wedel
  293.   master@cats.ucsc.edu
  294. ! March 10, 1993
  295.   
  296. --- 122,132 ----
  297.   
  298.       I will maintain it and release patches as required. 
  299.   
  300. +     If you send me mail, please include a valid mail address as
  301. + part of your signature.  I have gotten at least a few letters where
  302. + the mail address in the header was incorrect.
  303.   Mark Wedel
  304.   master@cats.ucsc.edu
  305. ! March 17, 1993
  306.   
  307. Common subdirectories: xblockbuster1.00/SKELS and xblockbuster1.01/SKELS
  308. Common subdirectories: xblockbuster1.00/STAGES and xblockbuster1.01/STAGES
  309. Common subdirectories: xblockbuster1.00/STAGES.try and xblockbuster1.01/STAGES.try
  310. Common subdirectories: xblockbuster1.00/STAGES.wacko and xblockbuster1.01/STAGES.wacko
  311. diff -cr xblockbuster1.00/balls_pallet.c xblockbuster1.01/balls_pallet.c
  312. *** xblockbuster1.00/balls_pallet.c    Mon Nov 16 23:29:32 1992
  313. --- xblockbuster1.01/balls_pallet.c    Fri Mar 19 02:12:30 1993
  314. ***************
  315. *** 47,86 ****
  316.       ball_pr = XCreateBitmapFromData(display, win, ball_bits, ball_width, ball_height);
  317.   }
  318.   
  319. ! /* Macro to draw a ball */
  320. ! #define draw_ball( ball )      \
  321. !     XCopyPlane(display, ball_pr, win, gc_xor, 0, 0, 16, 16, \
  322.           (int)( (ball)->x ) - 8, (int)( (ball)->y ) - 8, 1)
  323.   
  324.   /* Procedure to draw the pallet */
  325.   void
  326. ! draw_pallet(  )
  327.   {
  328. !     XDrawLine( display, win, gc_xor, pallet_xI - pallet_lengthI + 2, pallet_yI,
  329.              pallet_xI + pallet_lengthI - 2, pallet_yI);
  330. !     XDrawLine( display, win, gc_xor, pallet_xI - pallet_lengthI + 1, pallet_yI + 1,
  331.              pallet_xI + pallet_lengthI - 1, pallet_yI + 1);
  332. !     XDrawLine( display, win, gc_xor, pallet_xI - pallet_lengthI, pallet_yI + 2,
  333.              pallet_xI + pallet_lengthI, pallet_yI + 2);
  334. !     XDrawLine( display, win, gc_xor, pallet_xI - 1, pallet_yI + 3,
  335.              pallet_xI - 1, pallet_yI + 6);
  336. !     XDrawLine( display, win, gc_xor, pallet_xI - 1, pallet_yI + 6,
  337.              pallet_xI + 1, pallet_yI + 6);
  338. !     XDrawLine( display, win, gc_xor, pallet_xI + 1, pallet_yI + 6,
  339.              pallet_xI + 1, pallet_yI + 3);
  340. !     XDrawLine( display, win, gc_xor, 0, mouse_yI - 1,    /* <HC> */
  341.              10, mouse_yI - 1);
  342. !     XDrawLine( display, win, gc_xor, 0, mouse_yI,
  343.              10, mouse_yI);
  344. !     XDrawLine( display, win, gc_xor, 0, mouse_yI + 1,    /* <HC> */
  345.              10, mouse_yI + 1);
  346. !     XDrawLine( display, win, gc_xor, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI - 1,    /* <HC> */
  347.              STAGE_WIDTH_IN_PIXELS - 11, mouse_yI - 1);
  348. !     XDrawLine( display, win, gc_xor, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI,
  349.              STAGE_WIDTH_IN_PIXELS - 11, mouse_yI);
  350. !     XDrawLine( display, win, gc_xor, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI + 1,    /* <HC> */
  351.              STAGE_WIDTH_IN_PIXELS - 11, mouse_yI + 1);
  352.   }
  353.   
  354. --- 47,84 ----
  355.       ball_pr = XCreateBitmapFromData(display, win, ball_bits, ball_width, ball_height);
  356.   }
  357.   
  358. ! #define draw_ball( ball, gc )      \
  359. !     XCopyPlane(display, ball_pr, win, gc, 0, 0, 16, 16, \
  360.           (int)( (ball)->x ) - 8, (int)( (ball)->y ) - 8, 1)
  361.   
  362.   /* Procedure to draw the pallet */
  363.   void
  364. ! draw_pallet( gc )
  365. ! GC gc;
  366.   {
  367. !     XDrawLine( display, win, gc, pallet_xI - pallet_lengthI + 2, pallet_yI,
  368.              pallet_xI + pallet_lengthI - 2, pallet_yI);
  369. !     XDrawLine( display, win, gc, pallet_xI - pallet_lengthI + 1, pallet_yI + 1,
  370.              pallet_xI + pallet_lengthI - 1, pallet_yI + 1);
  371. !     XDrawLine( display, win, gc, pallet_xI - pallet_lengthI, pallet_yI + 2,
  372.              pallet_xI + pallet_lengthI, pallet_yI + 2);
  373. !     XDrawLine( display, win, gc, pallet_xI - 1, pallet_yI + 3,
  374.              pallet_xI - 1, pallet_yI + 6);
  375. !     XDrawLine( display, win, gc, pallet_xI - 1, pallet_yI + 6,
  376.              pallet_xI + 1, pallet_yI + 6);
  377. !     XDrawLine( display, win, gc, pallet_xI + 1, pallet_yI + 6,
  378.              pallet_xI + 1, pallet_yI + 3);
  379. !     XDrawLine( display, win, gc, 0, mouse_yI - 1,    /* <HC> */
  380.              10, mouse_yI - 1);
  381. !     XDrawLine( display, win, gc, 0, mouse_yI,
  382.              10, mouse_yI);
  383. !     XDrawLine( display, win, gc, 0, mouse_yI + 1,    /* <HC> */
  384.              10, mouse_yI + 1);
  385. !     XDrawLine( display, win, gc, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI - 1,    /* <HC> */
  386.              STAGE_WIDTH_IN_PIXELS - 11, mouse_yI - 1);
  387. !     XDrawLine( display, win, gc, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI,
  388.              STAGE_WIDTH_IN_PIXELS - 11, mouse_yI);
  389. !     XDrawLine( display, win, gc, STAGE_WIDTH_IN_PIXELS - 1, mouse_yI + 1,    /* <HC> */
  390.              STAGE_WIDTH_IN_PIXELS - 11, mouse_yI + 1);
  391.   }
  392.   
  393. ***************
  394. *** 145,151 ****
  395.                             /* NW */ : -M_SQRT2_2 );
  396.           ball->y_speed = launch_speed * -M_SQRT2_2;
  397.           /* initial ball image */
  398. !         draw_ball( ball );
  399.           /* show balls left */
  400.           print_balls();
  401.           /* show speeds */
  402. --- 143,149 ----
  403.                             /* NW */ : -M_SQRT2_2 );
  404.           ball->y_speed = launch_speed * -M_SQRT2_2;
  405.           /* initial ball image */
  406. !         draw_ball( ball, gc_xor );
  407.           /* show balls left */
  408.           print_balls();
  409.           /* show speeds */
  410. ***************
  411. *** 240,252 ****
  412.           break;
  413.       case 'C':        /* clipper */
  414.           if ( ++( brick->nhits ) == 2 ) {
  415. !             draw_pallet();
  416.               pallet_lengthI -= pallet_lengthI / 5;
  417.               if ( pallet_lengthI < MIN_PALLET_LENGTH )
  418.                   pallet_lengthI = MIN_PALLET_LENGTH;
  419.               pallet_length = ( double ) pallet_lengthI;
  420.               busted = TRUE;
  421. !             draw_pallet();
  422.           }
  423.           break;
  424.       case 'D':        /* double */
  425. --- 238,250 ----
  426.           break;
  427.       case 'C':        /* clipper */
  428.           if ( ++( brick->nhits ) == 2 ) {
  429. !             draw_pallet(gc_xor);
  430.               pallet_lengthI -= pallet_lengthI / 5;
  431.               if ( pallet_lengthI < MIN_PALLET_LENGTH )
  432.                   pallet_lengthI = MIN_PALLET_LENGTH;
  433.               pallet_length = ( double ) pallet_lengthI;
  434.               busted = TRUE;
  435. !             draw_pallet(gc_xor);
  436.           }
  437.           break;
  438.       case 'D':        /* double */
  439. ***************
  440. *** 425,434 ****
  441.       /* redraw brick (never on the sides) */
  442.       if ( redraw ) {
  443.           if ( pallet_row == ball->row )
  444. !             draw_pallet(  );    /* avoid shadow */
  445.           draw_brick( ball->row, ball->col );
  446.           if ( pallet_row == ball->row )
  447. !             draw_pallet(  );    /* restore */
  448.       }
  449.       /* deflection */
  450.       if ( ball->col <= 0 || ball->col >= MAX_COL ) {
  451. --- 423,432 ----
  452.       /* redraw brick (never on the sides) */
  453.       if ( redraw ) {
  454.           if ( pallet_row == ball->row )
  455. !             draw_pallet(gc_xor );    /* avoid shadow */
  456.           draw_brick( ball->row, ball->col );
  457.           if ( pallet_row == ball->row )
  458. !             draw_pallet(gc_xor  );    /* restore */
  459.       }
  460.       /* deflection */
  461.       if ( ball->col <= 0 || ball->col >= MAX_COL ) {
  462. ***************
  463. *** 462,468 ****
  464.       register int    score_hit = FALSE;    /* boolean */
  465.   
  466.       /* erase ball image */
  467. !     draw_ball( ball );
  468.   
  469.       /* move ball */
  470.       ball->x += ball->x_speed;
  471. --- 460,466 ----
  472.       register int    score_hit = FALSE;    /* boolean */
  473.   
  474.       /* erase ball image */
  475. !     draw_ball( ball, gc_xor );
  476.   
  477.       /* move ball */
  478.       ball->x += ball->x_speed;
  479. ***************
  480. *** 494,500 ****
  481.           pallet_deflection( ball );
  482.       }
  483.       /* redraw ball image */
  484. !     draw_ball( ball );
  485.   
  486.       return ( score_hit );
  487.   }
  488. --- 492,498 ----
  489.           pallet_deflection( ball );
  490.       }
  491.       /* redraw ball image */
  492. !     draw_ball( ball,gc_xor );
  493.   
  494.       return ( score_hit );
  495.   }
  496. ***************
  497. *** 522,535 ****
  498.   }
  499.   
  500.   
  501. ! void draw_balls()
  502.   {
  503. !     if ( ball1.quadrant ) draw_ball(&ball1);
  504. !     if ( ball2.quadrant ) draw_ball(&ball2);
  505. !     if ( ball3.quadrant ) draw_ball(&ball3);
  506.   }
  507.   
  508.   /*** on timeout event ***/
  509.   void move_balls( )
  510.   {
  511. --- 520,533 ----
  512.   }
  513.   
  514.   
  515. ! void draw_all_balls()
  516.   {
  517. !     if (ball1.quadrant) draw_ball(&ball1, gc_xor);
  518. !     if (ball2.quadrant) draw_ball(&ball2, gc_xor);
  519. !     if (ball3.quadrant) draw_ball(&ball3, gc_xor);
  520.   }
  521.   
  522.   /*** on timeout event ***/
  523.   void move_balls( )
  524.   {
  525. ***************
  526. *** 564,580 ****
  527.           if ( ball1.quadrant ) {
  528.               ball1.quadrant = NO_BALL;
  529.               balls_left++;    /* kludge to avoid consuming the ball */
  530. !             draw_ball( &ball1 );
  531.           }
  532.           if ( ball2.quadrant ) {
  533.               ball2.quadrant = NO_BALL;
  534.               balls_left++;    /* kludge to avoid consuming the ball */
  535. !             draw_ball( &ball2 );
  536.           }
  537.           if ( ball3.quadrant ) {
  538.               ball3.quadrant = NO_BALL;
  539.               balls_left++;    /* kludge to avoid consuming the ball */
  540. !             draw_ball( &ball3 );
  541.           }
  542.           /* update score */
  543.           print_score();
  544. --- 562,578 ----
  545.           if ( ball1.quadrant ) {
  546.               ball1.quadrant = NO_BALL;
  547.               balls_left++;    /* kludge to avoid consuming the ball */
  548. !             draw_ball( &ball1, gc_xor );
  549.           }
  550.           if ( ball2.quadrant ) {
  551.               ball2.quadrant = NO_BALL;
  552.               balls_left++;    /* kludge to avoid consuming the ball */
  553. !             draw_ball( &ball2, gc_xor );
  554.           }
  555.           if ( ball3.quadrant ) {
  556.               ball3.quadrant = NO_BALL;
  557.               balls_left++;    /* kludge to avoid consuming the ball */
  558. !             draw_ball( &ball3, gc_xor );
  559.           }
  560.           /* update score */
  561.           print_score();
  562. Common subdirectories: xblockbuster1.00/icons and xblockbuster1.01/icons
  563. diff -cr xblockbuster1.00/save.c xblockbuster1.01/save.c
  564. *** xblockbuster1.00/save.c    Mon Nov 16 23:35:53 1992
  565. --- xblockbuster1.01/save.c    Thu Mar 18 16:22:53 1993
  566. ***************
  567. *** 16,22 ****
  568.       char            sve[SAVEFILE_LENGTH];
  569.       register int    stage_nb_tmp;
  570.   
  571. !     if ((fd = fopen( sprintf( sve, SAVEFILE, playground, login ),"r+" ))) {
  572.           /* restoring save file */
  573.           XDrawImageString(display, win, gc, OFFSET_BALLS,
  574.               font_height, "Restoring...",12);
  575. --- 16,23 ----
  576.       char            sve[SAVEFILE_LENGTH];
  577.       register int    stage_nb_tmp;
  578.   
  579. !     sprintf(sve, SAVEFILE, playground, login );
  580. !     if ((fd = fopen(sve, "r+"))) {
  581.           /* restoring save file */
  582.           XDrawImageString(display, win, gc, OFFSET_BALLS,
  583.               font_height, "Restoring...",12);
  584. ***************
  585. *** 53,60 ****
  586.       char            sve[SAVEFILE_LENGTH];
  587.       register int    stage_nb_tmp = 0;
  588.   
  589. !     if ( !( fd = fopen( sprintf( sve, SAVEFILE, playground, login ),
  590. !                 "w" ) ) ) {
  591.           perror( "Can't open save file" );
  592.           exit( 1 );
  593.       }
  594. --- 54,61 ----
  595.       char            sve[SAVEFILE_LENGTH];
  596.       register int    stage_nb_tmp = 0;
  597.   
  598. !     sprintf( sve, SAVEFILE, playground, login );
  599. !     if ( !( fd = fopen(sve, "w" ))) {
  600.           perror( "Can't open save file" );
  601.           exit( 1 );
  602.       }
  603. diff -cr xblockbuster1.00/score.c xblockbuster1.01/score.c
  604. *** xblockbuster1.00/score.c    Mon Nov 16 23:32:19 1992
  605. --- xblockbuster1.01/score.c    Thu Mar 18 16:49:56 1993
  606. ***************
  607. *** 38,45 ****
  608.   show_score_board(  )
  609.   {
  610.       register int    lows, s, ns,scorenum=0;
  611. !     register int    update = FALSE;
  612. !     register int    made_it = FALSE;
  613.       FILE           *fd;
  614.       char            buf[PATH_LENGTH];
  615.   
  616. --- 38,44 ----
  617.   show_score_board(  )
  618.   {
  619.       register int    lows, s, ns,scorenum=0;
  620. !     int        update = FALSE,made_it = FALSE,width;
  621.       FILE           *fd;
  622.       char            buf[PATH_LENGTH];
  623.   
  624. ***************
  625. *** 53,59 ****
  626.       }
  627.   
  628.       /* read the score file into the array */
  629. !     if ( !( fd = fopen( sprintf( buf, SCOREFILE, playground ), "r+" ) ) ) {
  630.           perror( "No score file" );
  631.           exit( 1 );
  632.       }
  633. --- 52,59 ----
  634.       }
  635.   
  636.       /* read the score file into the array */
  637. !     sprintf( buf, SCOREFILE, playground );
  638. !     if ( !( fd = fopen(buf, "r+" ) ) ) {
  639.           perror( "No score file" );
  640.           exit( 1 );
  641.       }
  642. ***************
  643. *** 115,155 ****
  644.       /* show score board */
  645.       center_text( 0, "Top Scores" );
  646.       for ( s = 0; s < NB_SCORES; s++ ) {
  647. !         if ( score_board[s].balls_left > 99 ) {
  648. !             center_text( s + 2, sprintf( buf, "%7d (%3d)   %8s ",
  649. !                          score_board[s].score,
  650. !                          score_board[s].balls_left,
  651. !                          score_board[s].login ) );
  652. !         } else if ( score_board[s].balls_left > 9 ) {
  653. !             center_text( s + 2, sprintf( buf, "%7d  (%2d)   %8s ",
  654. !                          score_board[s].score,
  655. !                          score_board[s].balls_left,
  656. !                          score_board[s].login ) );
  657. !         } else if ( score_board[s].balls_left > 0 ) {
  658. !             center_text( s + 2, sprintf( buf, "%7d   (%1d)   %8s ",
  659. !                          score_board[s].score,
  660. !                          score_board[s].balls_left,
  661. !                          score_board[s].login ) );
  662. !         } else if ( score_board[s].balls_left < -99 ) {
  663. !             center_text( s + 2, sprintf( buf, "%7d (%3d) + %8s ",
  664. !                          score_board[s].score,
  665. !                          -score_board[s].balls_left,
  666. !                          score_board[s].login ) );
  667. !         } else if ( score_board[s].balls_left < -9 ) {
  668. !             center_text( s + 2, sprintf( buf, "%7d  (%2d) + %8s ",
  669. !                          score_board[s].score,
  670. !                          -score_board[s].balls_left,
  671. !                          score_board[s].login ) );
  672. !         } else if ( score_board[s].balls_left < 0 ) {
  673. !             center_text( s + 2, sprintf( buf, "%7d   (%1d) + %8s ",
  674. !                          score_board[s].score,
  675. !                          -score_board[s].balls_left,
  676. !                          score_board[s].login ) );
  677. !         } else {    /* no balls left */
  678. !             center_text( s + 2, sprintf( buf, "%7d         %8s ",
  679. !                          score_board[s].score,
  680. !                          score_board[s].login ) );
  681.           }
  682.           if ((s==scorenum) && made_it)
  683.               XDrawImageString(display,win,gc,
  684.               (STAGE_WIDTH_IN_PIXELS - strlen(buf)*font_width)/2 
  685. --- 115,136 ----
  686.       /* show score board */
  687.       center_text( 0, "Top Scores" );
  688.       for ( s = 0; s < NB_SCORES; s++ ) {
  689. !         if (score_board[s].balls_left==0)
  690. !             sprintf( buf, "%7d         %8s ",
  691. !                 score_board[s].score, score_board[s].login);
  692. !         else {
  693. !             if (abs(score_board[s].balls_left)>99) width=3;
  694. !             else if (abs(score_board[s].balls_left)>9) width=2;
  695. !             else if (abs(score_board[s].balls_left)>0) width=1;
  696. !         
  697. !             sprintf( buf, "%7d %*.s(%*d) %c %8s ",
  698. !                 score_board[s].score, (3-width),"    ",
  699. !                 width, abs(score_board[s].balls_left),
  700. !                 score_board[s].balls_left>0 ? ' ' : '+',
  701. !                 score_board[s].login);
  702.           }
  703. +         center_text(s+2, buf);
  704.           if ((s==scorenum) && made_it)
  705.               XDrawImageString(display,win,gc,
  706.               (STAGE_WIDTH_IN_PIXELS - strlen(buf)*font_width)/2 
  707. ***************
  708. *** 162,185 ****
  709.   
  710.       /* make sure the current score is on the board */
  711.       if ( !made_it ) {
  712. !         if ( balls_left > 99 ) {
  713. !             center_text( NB_SCORES + 3, sprintf( buf, "%7d (%3d)   %8s ",
  714. !                            score, balls_left, login ) );
  715. !         } else if ( balls_left > 9 ) {
  716. !             center_text( NB_SCORES + 3, sprintf( buf, "%7d  (%2d)   %8s ",
  717. !                            score, balls_left, login ) );
  718. !         } else if ( balls_left ) {
  719. !             center_text( NB_SCORES + 3, sprintf( buf, "%7d   (%1d)   %8s ",
  720. !                            score, balls_left, login ) );
  721. !         } else {    /* no balls left */
  722. !             center_text( NB_SCORES + 3, sprintf( buf, "%7d    <>   %8s ",
  723. !                              score, login ) );
  724.           }
  725.       }
  726.       /* show the current pallet shrinkage */
  727. !     center_text( NB_SCORES + 5, sprintf( buf, "pallet >>> %2d %% <<<",
  728. !                 ( pallet_modif * 100 ) / PALLET_DENOMINATOR ) );
  729.   
  730.       XFlush(display);
  731.   
  732. --- 143,165 ----
  733.   
  734.       /* make sure the current score is on the board */
  735.       if ( !made_it ) {
  736. !         if (balls_left==0) 
  737. !             sprintf( buf, "%7d    <>   %8s ", score, login );
  738. !         else {
  739. !             if (balls_left >99) width=3;
  740. !             else if (balls_left >9) width=2;
  741. !             else if (balls_left >0) width=1;
  742. !         
  743. !             sprintf( buf, "%7d %*.s(%*d)   %8s ",
  744. !                 score, (3-width),"    ",
  745. !                 width, balls_left, login);
  746.           }
  747. +         center_text( NB_SCORES +3, buf);
  748.       }
  749.       /* show the current pallet shrinkage */
  750. !     sprintf( buf, "pallet >>> %2d %% <<<",
  751. !         ( pallet_modif * 100 ) / PALLET_DENOMINATOR );
  752. !     center_text( NB_SCORES + 5, buf);
  753.   
  754.       XFlush(display);
  755.   
  756. diff -cr xblockbuster1.00/stage.c xblockbuster1.01/stage.c
  757. *** xblockbuster1.00/stage.c    Fri Oct 23 00:23:18 1992
  758. --- xblockbuster1.01/stage.c    Sat Mar 20 03:27:18 1993
  759. ***************
  760. *** 22,29 ****
  761.       last_busted_brick = NULL;
  762.   
  763.       /* open next stage file */
  764. !     if ( !( fd = fopen( sprintf( stg, STAGEFILE, playground, stage_nb ),
  765. !                 "r" ) ) ) {
  766.           perror( "Can't open stage" );
  767.           exit( 1 );
  768.       }
  769. --- 22,29 ----
  770.       last_busted_brick = NULL;
  771.   
  772.       /* open next stage file */
  773. !     sprintf( stg, STAGEFILE, playground, stage_nb );
  774. !     if ( !( fd = fopen(stg, "r"))) {
  775.           perror( "Can't open stage" );
  776.           exit( 1 );
  777.       }
  778. ***************
  779. *** 110,116 ****
  780.       /* reset pallet location */
  781.       pallet_y = ( double ) ( pallet_yI = PALLET_MAX_Y + 4 );
  782.       pallet_row = MAX_ROW - 1;
  783. !     draw_pallet(  );
  784.   
  785.       /* ready ? */
  786.       XDrawImageString(display, win, gc, OFFSET_BALLS, font_height*2,
  787. --- 110,116 ----
  788.       /* reset pallet location */
  789.       pallet_y = ( double ) ( pallet_yI = PALLET_MAX_Y + 4 );
  790.       pallet_row = MAX_ROW - 1;
  791. !     if (extra_draw) draw_pallet(gc_xor );
  792.   
  793.       /* ready ? */
  794.       XDrawImageString(display, win, gc, OFFSET_BALLS, font_height*2,
  795. ***************
  796. *** 134,143 ****
  797.       /* determine stage number */
  798.       if ( !nb_stages ) {
  799.           /* read number of available stages */
  800. !         if ( !( fd = fopen( sprintf( buf, NB_STAGESFILE, playground ),
  801. !                     "r" ) ) ) {
  802. !             perror( sprintf( buf2, "Can't open number of stages file <%s>",
  803. !                      buf ) );
  804.               exit( 1 );
  805.           }
  806.           fscanf( fd, "%d", &nb_stages );
  807. --- 134,145 ----
  808.       /* determine stage number */
  809.       if ( !nb_stages ) {
  810.           /* read number of available stages */
  811. !         sprintf( buf, NB_STAGESFILE, playground );
  812. !         if ( !( fd = fopen( buf, "r"))) {
  813. !             sprintf( buf2, "Can't open number of stages file <%s>",
  814. !                      buf );
  815. !             perror(buf2);
  816.               exit( 1 );
  817.           }
  818.           fscanf( fd, "%d", &nb_stages );
  819. ***************
  820. *** 147,153 ****
  821.               stages[stage_nb_tmp++] = FALSE;
  822.       }
  823.       /* search for stage index'th available stage number */
  824. !     stage_index = ( int ) ( random(  ) ) % nb_stages--;
  825.       if ( stage_index < 0 )
  826.           stage_index = -stage_index;
  827.       for ( stage_nb = 0; stages[stage_nb]; )
  828. --- 149,155 ----
  829.               stages[stage_nb_tmp++] = FALSE;
  830.       }
  831.       /* search for stage index'th available stage number */
  832. !     stage_index = ( int ) ( RAND(  ) ) % nb_stages--;
  833.       if ( stage_index < 0 )
  834.           stage_index = -stage_index;
  835.       for ( stage_nb = 0; stages[stage_nb]; )
  836. diff -cr xblockbuster1.00/xblockbuster.c xblockbuster1.01/xblockbuster.c
  837. *** xblockbuster1.00/xblockbuster.c    Fri Mar 12 23:48:19 1993
  838. --- xblockbuster1.01/xblockbuster.c    Mon Mar 22 01:02:53 1993
  839. ***************
  840. *** 41,47 ****
  841.       struct     timezone tzp;
  842.   
  843.       gettimeofday(&oldtp,&tzp);
  844. !     draw_pallet();
  845.       while(1) {
  846.       /* timer function to keep things moving at a constant speed.
  847.       We read time before servicing events so that the amount of time
  848. --- 41,47 ----
  849.       struct     timezone tzp;
  850.   
  851.       gettimeofday(&oldtp,&tzp);
  852. !     draw_pallet(gc_xor);
  853.       while(1) {
  854.       /* timer function to keep things moving at a constant speed.
  855.       We read time before servicing events so that the amount of time
  856. ***************
  857. *** 89,102 ****
  858.                   break;
  859.   
  860.               case Button2:
  861. !                 draw_pallet(); /* erase old */
  862.                   pallet_y = (double) (pallet_yI = PALLET_MAX_Y+4);
  863.                   pallet_row = MAX_ROW - 1;
  864. !                 draw_pallet(); /* draw new */
  865.                   break;
  866.   
  867.               case Button1:
  868. !                 draw_pallet(); /* erase old */
  869.                   if (pallet_yI > PALLET_MIN_Y) {
  870.                       old_pallet_y = pallet_y;
  871.                       pallet_y = (double) (pallet_yI -=16);
  872. --- 89,102 ----
  873.                   break;
  874.   
  875.               case Button2:
  876. !                 draw_pallet(gc_xor); /* erase old */
  877.                   pallet_y = (double) (pallet_yI = PALLET_MAX_Y+4);
  878.                   pallet_row = MAX_ROW - 1;
  879. !                 draw_pallet(gc_xor); /* draw new */
  880.                   break;
  881.   
  882.               case Button1:
  883. !                 draw_pallet(gc_xor); /* erase old */
  884.                   if (pallet_yI > PALLET_MIN_Y) {
  885.                       old_pallet_y = pallet_y;
  886.                       pallet_y = (double) (pallet_yI -=16);
  887. ***************
  888. *** 107,113 ****
  889.                       upwards */
  890.                       check_deflections(old_pallet_y);
  891.                   }
  892. !                 draw_pallet(); /* draw new */
  893.                   break;
  894.               }
  895.           break;
  896. --- 107,113 ----
  897.                       upwards */
  898.                       check_deflections(old_pallet_y);
  899.                   }
  900. !                 draw_pallet(gc_xor); /* draw new */
  901.                   break;
  902.               }
  903.           break;
  904. ***************
  905. *** 132,141 ****
  906.           break;
  907.   
  908.           case MotionNotify:
  909. !             draw_pallet();    /* erase old pallet */
  910.               pallet_x = (double) (pallet_xI =e.xmotion.x);
  911.               mouse_yI = e.xmotion.y;
  912. !             draw_pallet();    /* draw new one */
  913.               break;
  914.   
  915.           case EnterNotify:
  916. --- 132,141 ----
  917.           break;
  918.   
  919.           case MotionNotify:
  920. !             draw_pallet(gc_xor);    /* erase old pallet */
  921.               pallet_x = (double) (pallet_xI =e.xmotion.x);
  922.               mouse_yI = e.xmotion.y;
  923. !             draw_pallet(gc_xor);    /* draw new one */
  924.               break;
  925.   
  926.           case EnterNotify:
  927. ***************
  928. *** 147,152 ****
  929. --- 147,154 ----
  930.               break;
  931.   
  932.           case Expose:
  933. +             if (e.xexpose.count!=0) break;
  934. +             XClearWindow(display,win);
  935.               /* redraw the stage */
  936.   
  937.               for ( row = 0; row <= MAX_ROW; row++ ) {
  938. ***************
  939. *** 155,161 ****
  940.                                   draw_brick( row, col );
  941.                           draw_brick0( row, MAX_COL );
  942.               }
  943. !             draw_pallet();
  944.               break;
  945.   
  946.           default:
  947. --- 157,176 ----
  948.                                   draw_brick( row, col );
  949.                           draw_brick0( row, MAX_COL );
  950.               }
  951. !             draw_pallet(gc_xor);
  952. !             print_balls();
  953. !             print_score();
  954. !             show_speeds();
  955. !             XDrawImageString(display, win, gc,
  956. !                 OFFSET_SPEED, font_height*2, stage_name,
  957. !                 strlen(stage_name));
  958. !             if (score_incr>1) {
  959. !                  sprintf(str,"Bonus x%d",score_incr);
  960. !                 XDrawImageString(display, win, gc,
  961. !                     OFFSET_SCORE, font_height*2, str, 
  962. !                     strlen(str));
  963. !             }
  964. !             draw_all_balls();
  965.               break;
  966.   
  967.           default:
  968. ***************
  969. *** 176,181 ****
  970. --- 191,197 ----
  971.       struct stat    st;
  972.       int        len, found;
  973.   
  974.       /* set default playground directory */
  975.       strcpy( playground, STAGEDIR );
  976.       strcat( playground, "/" );
  977. ***************
  978. *** 239,244 ****
  979. --- 255,262 ----
  980.       XSizeHints    size_hints;
  981.       XWMHints    wm_hints;
  982.       XClassHint    class_hints;
  983. +     XTextProperty    window_name;
  984. +     char *prog_name=VERSION;
  985.   
  986.       /* who am i ? ['cuserid(3S)' is fooled by 'su(1)'] */
  987.       login = getpwuid( getuid(  ) )->pw_name;
  988. ***************
  989. *** 254,260 ****
  990.           0, 0, STAGE_WIDTH_IN_PIXELS, STAGE_HEIGHT_IN_PIXELS,
  991.           0, 2, WhitePixel(display, screen_num));
  992.   
  993.       XSelectInput(display, win, ExposureMask | ButtonPressMask |
  994.           LeaveWindowMask | EnterWindowMask | KeyPressMask |
  995.           PointerMotionMask);
  996. --- 272,277 ----
  997. ***************
  998. *** 270,275 ****
  999. --- 287,294 ----
  1000.   
  1001.       xgcvalues.foreground = BlackPixel(display, screen_num);
  1002.       xgcvalues.background = WhitePixel(display, screen_num);
  1003. +     
  1004.       xgcvalues.graphics_exposures = False;
  1005.       xgcvalues.font = font_info->fid;
  1006.   
  1007. ***************
  1008. *** 287,298 ****
  1009.       gc_erase = XCreateGC(display, win, GCForeground | GCBackground |
  1010.           GCFont | GCGraphicsExposures | GCFunction, &xgcvalues);
  1011.   
  1012. !     xgcvalues.function = GXxor;    /* Exclusive or */
  1013.   
  1014. !     gc_xor = XCreateGC(display, win, GCForeground | GCBackground |
  1015. !         GCFont | GCGraphicsExposures | GCFunction, &xgcvalues);
  1016.       /* Create our icon for when the window is closed */
  1017.   
  1018.       if  (!(icon_image = XCreateBitmapFromData(display, win,
  1019. --- 306,336 ----
  1020.       gc_erase = XCreateGC(display, win, GCForeground | GCBackground |
  1021.           GCFont | GCGraphicsExposures | GCFunction, &xgcvalues);
  1022.   
  1023. !     /* Xor doesn't work very well (at all) if foreground is 0.  So
  1024. !      * a different function is used instead.  This seems to work,
  1025. !      * at least, from my fiddling with the foreground color on my
  1026. !      * machine. 
  1027. !       */
  1028. !     xgcvalues.line_width=0;
  1029.   
  1030. !     if (xgcvalues.foreground==0) {
  1031. !         /* GXnor, GXinvert and GXequiv  all seem to work for the 
  1032. !             function */
  1033. !         xgcvalues.function = GXequiv;
  1034. !         xgcvalues.plane_mask = xgcvalues.background;
  1035. !         gc_xor = XCreateGC(display, win, GCForeground | GCBackground |
  1036. !             GCFont | GCGraphicsExposures | GCFunction | 
  1037. !             GCPlaneMask | GCLineWidth, &xgcvalues);
  1038. !         extra_draw = TRUE;
  1039. !     }
  1040. !     else {
  1041. !         xgcvalues.function = GXxor;    /* Exclusive or */
  1042. !         gc_xor = XCreateGC(display, win, GCForeground | GCBackground |
  1043. !             GCFont | GCGraphicsExposures | GCFunction |
  1044. !             GCLineWidth,
  1045. !              &xgcvalues);
  1046. !         extra_draw = TRUE;
  1047. !     }
  1048.       /* Create our icon for when the window is closed */
  1049.   
  1050.       if  (!(icon_image = XCreateBitmapFromData(display, win,
  1051. ***************
  1052. *** 317,329 ****
  1053.       class_hints.res_name = "XBlockbuster";
  1054.       class_hints.res_class =  "XBlockbuster";
  1055.   
  1056. !     XmbSetWMProperties(display, win, VERSION , VERSION,
  1057.           argv,argc, &size_hints, &wm_hints, &class_hints);
  1058.   
  1059.   
  1060.       XMapWindow(display, win);
  1061. !     /* initialize random (used to determine next stage_nb) */
  1062. !     srandom( time( 0 ) );
  1063.   
  1064.       get_playground( argc, argv );
  1065.   
  1066. --- 355,368 ----
  1067.       class_hints.res_name = "XBlockbuster";
  1068.       class_hints.res_class =  "XBlockbuster";
  1069.   
  1070. !     XStringListToTextProperty(&prog_name, 1, &window_name);
  1071. !     XSetWMProperties(display, win, &window_name, &window_name,
  1072.           argv,argc, &size_hints, &wm_hints, &class_hints);
  1073.   
  1074.   
  1075.       XMapWindow(display, win);
  1076. !     /* initialize random (used to determine next stage) */
  1077. !     SRAND( time( 0 ) );
  1078.   
  1079.       get_playground( argc, argv );
  1080.   
  1081. ***************
  1082. *** 337,339 ****
  1083. --- 376,394 ----
  1084.   
  1085.   
  1086.   }
  1087. + #ifdef SYSV
  1088. + /* Most SysV's don't have a usleep.  Sone of them have select. */
  1089. + usleep( usecs )
  1090. + int usecs;
  1091. +     {
  1092. +     struct timeval timeout;
  1093. +     timeout.tv_sec = usecs / 1000000;
  1094. +     timeout.tv_usec = usecs % 1000000;
  1095. +     select( 0, 0, 0, 0, &timeout );
  1096. +     }
  1097. + #endif /*SYSV*/
  1098. diff -cr xblockbuster1.00/xblockbuster.h xblockbuster1.01/xblockbuster.h
  1099. *** xblockbuster1.00/xblockbuster.h    Fri Mar 12 23:48:43 1993
  1100. --- xblockbuster1.01/xblockbuster.h    Sat Mar 20 03:27:34 1993
  1101. ***************
  1102. *** 10,17 ****
  1103.   
  1104.   #include <stdio.h>
  1105.   #include <pwd.h>
  1106. - /*#include <sys/file.h>
  1107. - #include <ctype.h>*/
  1108.   #include <math.h>
  1109.   #include <X11/Xlib.h>
  1110.   #include <X11/Xutil.h>
  1111. --- 10,15 ----
  1112. ***************
  1113. *** 18,24 ****
  1114. --- 16,40 ----
  1115.   #include <X11/Xos.h>
  1116.   #include <X11/Xatom.h>
  1117.   
  1118. + /*
  1119. +  * SYSTEM DEPENDENT OPTIONS
  1120. +  */
  1121.   
  1122. + /* STAGEDIR should, in general, be defined in the (I)Makefile */
  1123. + #ifndef STAGEDIR
  1124. + #define STAGEDIR    "/usr/games/lib/blockbuster"
  1125. + #endif
  1126. + #define FONT    "10x20"
  1127. + #define RAND() random()
  1128. + #define SRAND(n) srandom(n)
  1129. + /* You may need to uncomment some of these if your system does not have
  1130. +  * them.  If you need to do so, please let me know, so I can put them
  1131. +  * in an #ifdef/#endif clause to make it easier for others.
  1132. +  */
  1133.   /*
  1134.    * #define M_PI                3.14159265358979323846
  1135.    * #define M_PI_2      1.57079632679489661923
  1136. ***************
  1137. *** 28,38 ****
  1138.   #define M_SQRT2_2      0.70710678118654752440
  1139.   #define NEAR_HORIZONTAL        0.7    /* < M_PI_4 */
  1140.   
  1141.   Display        *display;
  1142.   Window        win;
  1143. ! GC        gc, gc_erase, gc_xor,gc_color;
  1144.   XFontStruct    *font_info;
  1145. ! int        screen_num, font_width, font_height;
  1146.   
  1147.   /*** windowing objects ***/
  1148.   
  1149. --- 44,56 ----
  1150.   #define M_SQRT2_2      0.70710678118654752440
  1151.   #define NEAR_HORIZONTAL        0.7    /* < M_PI_4 */
  1152.   
  1153. + /* Nothing below here should need to be changed. */
  1154.   Display        *display;
  1155.   Window        win;
  1156. ! GC        gc, gc_erase, gc_color,gc_xor;
  1157.   XFontStruct    *font_info;
  1158. ! int        screen_num, font_width, font_height,extra_draw;
  1159.   
  1160.   /*** windowing objects ***/
  1161.   
  1162. ***************
  1163. *** 129,134 ****
  1164. --- 147,155 ----
  1165.        */
  1166.   }               ball1, ball2, ball3;
  1167.   
  1168. + /* Macro to draw a ball */
  1169.   int             launch_quadrant;/* enumeration { NE, NW } */
  1170.   int             launch_row, launch_col;
  1171.   double          launch_x, launch_y;
  1172. ***************
  1173. *** 177,190 ****
  1174.   
  1175.   /*** score and stages files ***/
  1176.   
  1177. ! #define PATH_LENGTH    64
  1178.   
  1179.   char    *login;
  1180.   char    playground[PATH_LENGTH];
  1181.   
  1182. - #ifndef STAGEDIR
  1183. - #define STAGEDIR    "/usr/games/lib/blockbuster"
  1184. - #endif
  1185.   
  1186.   #define SCOREFILE      "%s/scores"
  1187.   #define NB_SCORES      12
  1188. --- 198,208 ----
  1189.   
  1190.   /*** score and stages files ***/
  1191.   
  1192. ! #define PATH_LENGTH    512
  1193.   
  1194.   char    *login;
  1195.   char    playground[PATH_LENGTH];
  1196.   
  1197.   
  1198.   #define SCOREFILE      "%s/scores"
  1199.   #define NB_SCORES      12
  1200. Common subdirectories: xblockbuster1.00/STAGES/save and xblockbuster1.01/STAGES/save
  1201. Common subdirectories: xblockbuster1.00/STAGES.try/save and xblockbuster1.01/STAGES.try/save
  1202. Common subdirectories: xblockbuster1.00/STAGES.wacko/save and xblockbuster1.01/STAGES.wacko/save
  1203. *** xblockbuster1.00/xblockbuster.man    Wed Mar 10 18:12:19 1993
  1204. --- xblockbuster1.01/xblockbuster.man    Tue Mar 23 00:32:13 1993
  1205. ***************
  1206. *** 87,92 ****
  1207. --- 87,96 ----
  1208.   find yourself outside the window, halting play.
  1209.   For this reason the horizontal crosshair is shown at the window border,
  1210.   helping you to keep track of the mouse.
  1211. + .LP
  1212. + By design, the pointer is invisible while in the XBlockBuster window.
  1213. + I found that a visible pointer in the window was very distracting
  1214. + during play.
  1215.   .SH "CREATION OF PLAY GROUNDS"
  1216.   A private play ground can be created in any directory.
  1217.   The stages can be defined from the ascii map codes using any text editor
  1218.  
  1219. --------------(END OF FILE)-------------------------------------------------
  1220.  
  1221.