home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume19 / xblckbst / patch01 < prev    next >
Encoding:
Text File  |  1993-04-27  |  41.6 KB  |  1,350 lines

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