home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xboing / part20 < prev    next >
Encoding:
Text File  |  1993-09-03  |  54.5 KB  |  1,569 lines

  1. Newsgroups: comp.sources.x
  2. From: jck@kimba.catt.citri.edu.au (Justin Kibell)
  3. Subject: v20i127:  xboing - a simple blockout type game, Part20/26
  4. Message-ID: <1993Sep3.123527.8324@sparky.sterling.com>
  5. X-Md4-Signature: e2f2151bbe34c7ac2355c8b856df41aa
  6. Sender: chris@sparky.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Fri, 3 Sep 1993 12:35:27 GMT
  9. Approved: chris@sterling.com
  10.  
  11. Submitted-by: jck@kimba.catt.citri.edu.au (Justin Kibell)
  12. Posting-number: Volume 20, Issue 127
  13. Archive-name: xboing/part20
  14. Environment: X11, xpm, color
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  Imakefile audio/NCDaudio.c bitmaps/titleN.xpm
  21. #   bitmaps/titleO.xpm bitmaps/titleX.xpm inst.c misc.c score.c
  22. #   sounds/ammo.au.uue
  23. # Wrapped by chris@sparky on Fri Sep  3 07:14:48 1993
  24. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  25. echo If this archive is complete, you will see the following message:
  26. echo '          "shar: End of archive 20 (of 26)."'
  27. if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'Imakefile'\"
  29. else
  30.   echo shar: Extracting \"'Imakefile'\" \(4222 characters\)
  31.   sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
  32. X#*****************************************************************************
  33. X# 
  34. X#          (c) Copyright 1993, Justin C. Kibell, All Rights Reserved
  35. X#                           email: jck@citri.edu.au
  36. X#
  37. X#  Permission to use, copy, modify, and distribute this software and its
  38. X#  documentation without written agreement is hereby granted. You cannot sell 
  39. X#  this software without written permission from the author. This entire 
  40. X#  copyright notice must appear in all copies of this software.
  41. X#
  42. X#  IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 
  43. X#  SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF 
  44. X#  THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED 
  45. X#  OF THE POSSIBILITY OF SUCH DAMAGE.
  46. X#
  47. X#  THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 
  48. X#  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  49. X#  PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE 
  50. X#  AUTHOR HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 
  51. X#  ENHANCEMENTS, OR MODIFICATIONS.
  52. X#
  53. X#*****************************************************************************
  54. X
  55. X# Imakefile for xboing version 1.6 - 6th August 1993
  56. X
  57. X# This is the directory where the highscore and level data will be placed.
  58. XXBOING_DIR            = .
  59. X
  60. XCC                    = cc 
  61. XCCOPTIONS            = -Bstatic 
  62. X
  63. X#CC                    = gcc 
  64. X#CCOPTIONS            = -static -DFUNCPROTO -Wall 
  65. X
  66. XXPMLIB                = -L/usr/lib -lXpm
  67. XXPMINCLUDE            = -I/usr/include/X11
  68. XLEVEL_INSTALL_DIR     = $(XBOING_DIR)/levels
  69. XSOUNDS_DIR             = $(XBOING_DIR)/sounds
  70. XHIGH_SCORE_FILE     = $(XBOING_DIR)/xboing.scores
  71. XAUDIO_AVAILABLE        = False
  72. X
  73. X#ifdef HPArchitecture
  74. XCCOPTIONS        = -Aa -D_HPUX_SOURCE
  75. XAUDIO_AVAILABLE    = True
  76. X#endif /* HPArchitecture */
  77. X
  78. X#ifdef MultimaxArchitecture
  79. XCCOPTIONS        = -q -nosb -q ext=parallel
  80. X#endif /* MultimaxArchitecture */
  81. X
  82. X#ifdef i860Architecture
  83. XSYS_LIBRARIES     = -lnsl
  84. X#endif /* i860Architecture */
  85. X
  86. X#ifdef SGIArchitecture
  87. XSYS_LIBRARIES     = -lbsd -lsun
  88. XCCOPTIONS        = -ansi
  89. X#endif /* SGIArchitecture */
  90. X
  91. X#ifdef SparcArchitecture
  92. XAUDIO_AVAILABLE    = True
  93. X#if (OSMajorVersion==4)
  94. XAUDIO_INCLUDE = -I/usr/demo/SOUND/multimedia
  95. XAUDIO_LIB     = -L/usr/demo/SOUND -laudio
  96. X#endif
  97. X#if (OSMajorVersion==5)
  98. XAUDIO_INCLUDE = -I/usr/demo/SOUND/include/multimedia
  99. XAUDIO_LIB     = -L/usr/demo/SOUND/lib -laudio
  100. X#endif
  101. X#endif /* SparcArchitecture */
  102. X
  103. XEXTRA_INCLS = $(XPMINCLUDE) $(AUDIO_INCLUDE)
  104. X
  105. XDEFINES    = $(EXTRA_INCLS) \
  106. X    -DHIGH_SCORE_FILE=\"$(HIGH_SCORE_FILE)\" \
  107. X    -DLEVEL_INSTALL_DIR=\"$(LEVEL_INSTALL_DIR)\" \
  108. X    -DAUDIO_AVAILABLE=\"$(AUDIO_AVAILABLE)\" \
  109. X    -DSOUNDS_DIR=\"$(SOUNDS_DIR)\" 
  110. X
  111. XLOCAL_LIBRARIES = $(AUDIO_LIB) $(XPMLIB) $(XLIB) -lm
  112. X
  113. XDEPLIBS = $(DEPXLIB)
  114. X
  115. XSRCS1=    version.c main.c score.c error.c ball.c blocks.c init.c \
  116. X        stage.c level.c paddle.c mess.c intro.c bonus.c sfx.c \
  117. X        highscore.c misc.c inst.c gun.c keys.c audio.c special.c \
  118. X        presents.c 
  119. X
  120. XOBJS1=    version.o main.o score.o error.o ball.o blocks.o init.o \
  121. X        stage.o level.o paddle.o mess.o intro.o bonus.o sfx.o  \
  122. X        highscore.o misc.o inst.o gun.o keys.o audio.o special.o \
  123. X        presents.o
  124. X
  125. XPROGRAMS = xboing
  126. X
  127. Xall::    $(PROGRAMS) 
  128. X        @$(RM) version.c
  129. X        @echo "xboing built successfully."
  130. X
  131. Xversion.c:
  132. X        @./version.sh $(PROGRAMS)
  133. X
  134. XComplexProgramTarget_1($(PROGRAMS), $(LOCAL_LIBRARIES), ) 
  135. X
  136. Xinstall:: $(PROGRAMS)
  137. X    @echo "XBoing directory is " $(XBOING_DIR)
  138. X
  139. X    @echo "Creating directory " $(XBOING_DIR)
  140. X    @if [ ! -d $(XBOING_DIR) ]; then mkdir $(XBOING_DIR); fi
  141. X
  142. X    @echo "Creating directory " $(LEVEL_INSTALL_DIR)
  143. X    @if [ ! -d $(LEVEL_INSTALL_DIR) ]; then mkdir $(LEVEL_INSTALL_DIR); fi
  144. X
  145. X    @echo "Copying level data into directory " $(LEVEL_INSTALL_DIR)
  146. X    @cd ./levels; set -x; for file in *.data; do                    \
  147. X        $(INSTALL) -c $(INSTDATFLAGS) $$file $(LEVEL_INSTALL_DIR);    \
  148. X    done
  149. X
  150. X    if [ $(AUDIO_AVAILABLE) ]
  151. X        @echo "Creating directory " $(SOUNDS_DIR)
  152. X        @if [ ! -d $(SOUNDS_DIR) ]; then mkdir $(SOUNDS_DIR); fi
  153. X
  154. X        @echo "Copying sound files into directory " $(SOUNDS_DIR)
  155. X        @cd ./sounds; set -x; for file in *.au; do                        \
  156. X            $(INSTALL) -c $(INSTDATFLAGS) $$file $(SOUNDS_DIR);            \
  157. X        done
  158. X    fi
  159. X
  160. X    @echo "Creating a highscore file " $(HIGH_SCORE_FILE)
  161. X    @touch $(HIGH_SCORE_FILE);
  162. X    @chmod a+rw $(HIGH_SCORE_FILE);
  163. X
  164. X# End of the XBoing Imakefile :-)
  165. END_OF_FILE
  166.   if test 4222 -ne `wc -c <'Imakefile'`; then
  167.     echo shar: \"'Imakefile'\" unpacked with wrong size!
  168.   fi
  169.   chmod +x 'Imakefile'
  170.   # end of 'Imakefile'
  171. fi
  172. if test -f 'audio/NCDaudio.c' -a "${1}" != "-c" ; then 
  173.   echo shar: Will not clobber existing file \"'audio/NCDaudio.c'\"
  174. else
  175.   echo shar: Extracting \"'audio/NCDaudio.c'\" \(4654 characters\)
  176.   sed "s/^X//" >'audio/NCDaudio.c' <<'END_OF_FILE'
  177. X#include "copyright.h"
  178. X
  179. X/* NCD Audio format - original code by Dave Lemke <lemke@verbosa.ncd.com> */
  180. X
  181. X/*
  182. X *  Include file dependencies:
  183. X */
  184. X
  185. X#include <stdio.h>
  186. X#include <audio/audiolib.h>
  187. X#include <audio/soundlib.h>
  188. X
  189. X#include "audio.h"
  190. X
  191. X/*
  192. X *  Internal variable declarations:
  193. X */
  194. X
  195. X#define    MAX_SOUNDS    64
  196. X
  197. XAuServer   *aud = NULL;
  198. XAuDeviceID  device;
  199. Xstatic int    audio_on = False;
  200. Xstatic int  num_sounds = 0;
  201. Xstatic char    errorString[255];
  202. X
  203. Xstatic struct 
  204. X{
  205. X    char       *name;
  206. X    char       *filename;
  207. X    void       *private;
  208. X} sound_table[MAX_SOUNDS];
  209. X
  210. Xtypedef struct 
  211. X{
  212. X    int        playing;
  213. X    AuBucketID  bucket;
  214. X} audioRec, *audioPtr;
  215. X
  216. X#if NeedFunctionPrototypes
  217. Xint SetUpAudioSystem(Display *display)
  218. X#else
  219. Xint SetUpAudioSystem(display)
  220. X    Display    *display;
  221. X#endif
  222. X{
  223. X    int         i;
  224. X    char       *displayname = XDisplayString(display);
  225. X
  226. X    if (audio_on)
  227. X        return True;
  228. X
  229. X    /* try and connect to the NCD audio server */
  230. X    if (!(aud = AuOpenServer(displayname, 0, NULL, 0, NULL, NULL)))
  231. X    {
  232. X        ErrorMessage("Error: Cannot connect to NCD audio server.");
  233. X        return False;
  234. X    }
  235. X
  236. X    /* Look for an audio device that we can use */
  237. X    for (i = 0; i < AuServerNumDevices(aud); i++)
  238. X    {
  239. X        if ((AuDeviceKind(AuServerDevice(aud, i)) == 
  240. X            AuComponentKindPhysicalOutput) && 
  241. X            AuDeviceNumTracks(AuServerDevice(aud, i)) == 1) 
  242. X        {
  243. X            device = AuDeviceIdentifier(AuServerDevice(aud, i));
  244. X            break;
  245. X        }
  246. X    }
  247. X
  248. X    /* Well we didn't get a device - all busy? */
  249. X    if (!device) 
  250. X    {
  251. X        ErrorMessage("Error: Cannot obtain NCD audio device.");
  252. X        AuCloseServer(aud);
  253. X        return False;
  254. X    }
  255. X
  256. X#if defined(SOUNDLIB_VERSION) && SOUNDLIB_VERSION >= 2
  257. X    AuSoundRestartHardwarePauses = AuFalse;
  258. X#endif        
  259. X
  260. X    /* Success - we have an audio device */
  261. X    audio_on = True;
  262. X    return True;
  263. X}
  264. X
  265. X#if NeedFunctionPrototypes
  266. Xvoid FreeAudioSystem(void)
  267. X#else
  268. Xvoid FreeAudioSystem()
  269. X#endif
  270. X{
  271. X    /* truly turning it off gets ugly, with old events being lost */
  272. X    audio_on = False;
  273. X}
  274. X
  275. X#if NeedFunctionPrototypes
  276. Xvoid setNewVolume(unsigned int Volume)
  277. X#else
  278. Xvoid setNewVolume(Volume)
  279. X    unsigned int Volume;
  280. X#endif
  281. X{
  282. X    /* Do nothing here as we don't need too */
  283. X}
  284. X
  285. X#if NeedFunctionPrototypes
  286. Xstatic void doneCB(AuServer *aud, AuEventHandlerRec *handler, AuEvent *event,        audioPtr info)
  287. X#else
  288. Xstatic void doneCB(aud, handler, event, info)
  289. X    AuServer               *aud;
  290. X    AuEventHandlerRec     *handler;
  291. X    AuEvent                *event;
  292. X    audioPtr            info;
  293. X#endif
  294. X{
  295. X    info->playing = False;
  296. X}
  297. X
  298. X#if NeedFunctionPrototypes
  299. Xvoid audioDevicePlay(char *filename, int volume, void **private)
  300. X#else
  301. Xvoid audioDevicePlay(filename, volume, private)
  302. X    char    *filename;
  303. X    int     volume;
  304. X    void    **private;
  305. X#endif
  306. X{
  307. X    audioPtr   *info = (audioPtr *) private;
  308. X
  309. X    if (!*info) 
  310. X    {
  311. X        if (!(*info = (audioPtr) malloc(sizeof(audioRec))))
  312. X        {
  313. X            sprintf(errorString, 
  314. X                "Warning: Cannot malloc memory for sound file %s.", filename);
  315. X            ErrorMessage(errorString);
  316. X            return;
  317. X        }
  318. X
  319. X        (*info)->playing = 0;
  320. X        (*info)->bucket = AuSoundCreateBucketFromFile(aud, filename, 
  321. X            AuAccessAllMasks, NULL, NULL);
  322. X    }
  323. X
  324. X    if ((*info)->bucket && (!(*info)->playing)) 
  325. X    {
  326. X        (*info)->playing = 1;
  327. X        AuSoundPlayFromBucket(aud, (*info)->bucket, device,
  328. X            AuFixedPointFromFraction(volume, 100),
  329. X            (void (*)) doneCB, (AuPointer) * info, 1, NULL, NULL, NULL, NULL);
  330. X    
  331. X        /* Flush sound */
  332. X        AuFlush(aud);
  333. X    }
  334. X}
  335. X
  336. X#if NeedFunctionPrototypes
  337. Xvoid audioDeviceEvents(void)
  338. X#else
  339. Xvoid audioDeviceEvents()
  340. X#endif
  341. X{
  342. X    if (aud) AuHandleEvents(aud);
  343. X}
  344. X
  345. X#if NeedFunctionPrototypes
  346. Xvoid playSoundFile(char *filename, int volume)
  347. X#else
  348. Xvoid playSoundFile(filename, volume)
  349. X    char       *filename;
  350. X    int         volume;
  351. X#endif
  352. X{
  353. X    int         i;
  354. X    char        fbuf[1024];
  355. X    char        *str;
  356. X
  357. X    /* Loop through the sound table looking for sound */
  358. X    for (i = 0; i < num_sounds; i++) 
  359. X    {
  360. X        if (!strcmp(sound_table[i].name, filename)) 
  361. X        {
  362. X            /* Yeah - already in sound table */
  363. X            break;
  364. X        }
  365. X    }
  366. X
  367. X    /* Ok - not found so add it to the sound table */
  368. X    if (i == num_sounds) 
  369. X    {    
  370. X        /* new one - so add it to the table */
  371. X        sound_table[num_sounds].name = strdup(filename);
  372. X
  373. X        /* Use the environment variable if it exists */
  374. X        if ((str = getenv("XBOING_SOUND_DIR")) != NULL)
  375. X            sprintf(fbuf, "%s/%s.au", str, filename);
  376. X        else            
  377. X            sprintf(fbuf, "%s/%s.au", SOUNDS_DIR, filename);
  378. X
  379. X        sound_table[num_sounds].filename = strdup(fbuf);
  380. X        num_sounds++;
  381. X    }
  382. X
  383. X    audioDevicePlay(sound_table[i].filename, volume, &sound_table[i].private);
  384. X}
  385. X
  386. X#if NeedFunctionPrototypes
  387. Xvoid SetMaximumVolume(int Volume)
  388. X#else
  389. Xvoid SetMaximumVolume(Volume)
  390. X    int Volume;
  391. X#endif
  392. X{
  393. X}
  394. END_OF_FILE
  395.   if test 4654 -ne `wc -c <'audio/NCDaudio.c'`; then
  396.     echo shar: \"'audio/NCDaudio.c'\" unpacked with wrong size!
  397.   fi
  398.   # end of 'audio/NCDaudio.c'
  399. fi
  400. if test -f 'bitmaps/titleN.xpm' -a "${1}" != "-c" ; then 
  401.   echo shar: Will not clobber existing file \"'bitmaps/titleN.xpm'\"
  402. else
  403.   echo shar: Extracting \"'bitmaps/titleN.xpm'\" \(6834 characters\)
  404.   sed "s/^X//" >'bitmaps/titleN.xpm' <<'END_OF_FILE'
  405. X/* XPM */
  406. Xstatic char * titleN_xpm[] = {
  407. X/* width height ncolors chars_per_pixel */
  408. X"85 74 8 1",
  409. X/* colors */
  410. X"     s None    c None",
  411. X".    c #802F00",
  412. X"X    c #A06000",
  413. X"o    c #903F10",
  414. X"O    c #F0D040",
  415. X"+    c #D09E20",
  416. X"@    c #F0C030",
  417. X"#    c #C07F10",
  418. X/* pixels */
  419. X"                                                                                     ",
  420. X".Xoooooooooooooooooooooooooo                          .Xoooooooooooooooooooooooooooo ",
  421. X"XOO+++++++++++++++++++++++++X                         XOO+++++++++++++++++++++++++++X",
  422. X"XOO@+++++++++++++++++++++@@@+X                        XOO@+++++++++++++++++++++++++# ",
  423. X"XOOO@+++++++++++++++++++@OOOOO#                       XOOO@+++++++++++++++++++++++#X.",
  424. X"XOOOO++++++++++++++@@@@@@OOOOO+X                      XOOOO++++++++++++++++++++++#XX ",
  425. X"XOOOOO@+++++++++++@OOOOOOOOOOOOO#                     XOOOOO@+++++++++++++++++++#XXX.",
  426. X"XOOOOO+XXXXXXXXX++OOOOOOOOOOOOOO+X                    XOOOOO+XXXXXXX##+@#XXXXX##XXXX ",
  427. X"XOOOOO#.........#OOOOOOOOOOOOOOOOO#                   XOOOOO#.......oX+O#.....oXXXXXX",
  428. X"XOOO+#oo....o###+O+#+OOOOOOOOOOOOO+X                  XOOO+#oo...oo..X#O+#Xoo...XXXX ",
  429. X"XOOO#.......#OOOOO#.#OOOOOOOOOOOOOOO#                 XOOO#......ooXXo#OOO+Xo....XXX.",
  430. X"XO+#oo..o###+OOOOO#.o#+OOOOOOOOOOOOO+X                XO+#oo....ooX.oo#@@O++X..oo.XX.",
  431. X"XO#.o...#OOOOOO@OO#...#OOOOOOOOOOOOOOO#               XO#.o....XXXXooo#@@@OO+XX....X ",
  432. X" #     . #+OOO@@@O#...o#+OOOOOOOOOOOOO+X               #     . .X.oooo#@@OOO# . . .. ",
  433. X"          XOO@@O@O#...o.#OOOOOOOOOOOOOOO#                        Xoooo#@@+OOX        ",
  434. X"          XO@@@@OO#.....o#+OOOOOOOOOOOOO+X                      .oooXo#O@@@OX        ",
  435. X"          X@@O@@OO#o......#OOOOOOOOOOOOOOO#                     .ooXXX+@@@@Oo        ",
  436. X"          X@@O@OOO#oo.....o#+OOOOOOOOOOOOO+X                     XoXXX#@@@@@X        ",
  437. X"          X@OOOOOO+Xo.....o.#OOOOOOOOOOOOOOO#                   oXooXX+@@@@@X        ",
  438. X"          X@OOOOOO+Xo.......o#+OOOOOOOOO@+@O+X                  ..XoXo#@@@@OX        ",
  439. X"          X@@OOOOO+o.o.ooo..o.#OOOOOOOOO+#+OOO#                 .ooXXo#@@@@OX        ",
  440. X"          XOOOOOOO+Xo.oooo....o#+O@+@OOO@+++@O#o                 XXXXo#O@@@OX        ",
  441. X"          XOOOOOOO+X.o.ooo...oo.#O+#+OOOOO+#+O+#o               .XXXXX+O@@OOX        ",
  442. X"          XOOOOOOO+Xoo...o......o#++OOOO@+++OO@++X              .XXXXX+@OO@OX        ",
  443. X"          XOOOO@OO+X.o..........o.#OOOOO+#+OOOOOOO#             .XXXXX#@OOOOX        ",
  444. X"          XOOOOOO@+XXooo..........X#++@O+#+OOOOOOO+X            .XXX#X+@@OOOX        ",
  445. X"          XOOOOOOO+XXXXo......ooooooX#+O+#+OOOOOOOOO#           .XX###+@OOOOX        ",
  446. X"          XOOOOOOO+oXXo......o.ooooooX+O@+OO@+@O@+++#X          .XX###+O@OOOX        ",
  447. X"          XOOOOOOO+XXXo.....oo...ooooo#OOOOO+#+O+###+O#         .XX###+OOOOOX        ",
  448. X"          XO@+@OOO+XXXo ....ooooooooooX#++@O@++++++#+++X        .X####+OOOOOX        ",
  449. X"          XO+#+OOO+oXX. .oooooooooooooo.o#+OOO+#+O+###+O#       .#####+OOOOOX        ",
  450. X"          o+++OOOO+XXX.  ..ooooooooooooooX+O@++#+++#++++#X      .#####+O@+@OX        ",
  451. X"          o#+OOOOO+XXX     ooooooooooooooo#O+#######+O+#+O#     .#####+O+#+OX        ",
  452. X"          o#++OOOO+XX#o   . ooooooooooooooX#####++++++++@+#o    .####+@++#+OX        ",
  453. X"          .###+OOO+###.     .ooooooooooXXoooX###+OOO@#+O+###o   .###+O+###+OX        ",
  454. X"          .###++@O+###.      ..oooooooXXoXoooX#+@++++#+O+###Xo  .#++OO+###+OX        ",
  455. X"          .#####+O+###.        ooooooooXXXoooo#O+#####+O+#####o .#+OOO+###+OX        ",
  456. X"          .#####+O+#++o        ..oooooXXXoooooX#####++@++++###Xo#+++OO+###++o        ",
  457. X"          .+####+O+#+OX         .XoooooXooooooooX###+O+#@O+#####+O+#+O+#####o        ",
  458. X"          .XXX#X+O@#+OX          .oooXXXXoooooooX###+O+#+O@++++#+OO+OO+#####o        ",
  459. X"          .XXXXX+O+#+OX           .ooXXXoooooXXooXX#+O@#+OOOOO+#+OOOOO+#####.        ",
  460. X"          .XXXXX+O@+++X            ..XXoXoXoXXoooXX##++#++@O@++#+OOOOO+#####.        ",
  461. X"          .XXXXX+OOO@#o             .XooXXXXXXooXXXX######+O+###+@OOOO+#####.        ",
  462. X"          .XXXXo+O@+##o              ..ooXXXXXooooXXX#####+++###+O@OOO+#####.        ",
  463. X"          .#XXXX+O+###o               .ooXXXXXXooooXXo##########+OOOOO+XX###.        ",
  464. X"          .#XXXX+O@+++o                ..XXXXXXooXXXXXX#########++@O@O+X###X.        ",
  465. X"          .XXXXX+OOOOOX                 .XXXXXXXXXXXXXXo##########+@OO+###XX.        ",
  466. X"          .XXXXX+OOOOOX                  .oXXXXXXXXXXXXXX#########+@@@+#X##X.        ",
  467. X"          .XXXXo+OOOOOX                   .XXXXXXXXXXXXXXo########+@@@#X##XX.        ",
  468. X"           X.X.X+OO@OOX                    ..XXXXXXXXXX#XXXX######+@@@+X###X.        ",
  469. X"          .ooooo#OO@@OX                     .XXXXXXXXX##XXXX######+@@@+###XX.        ",
  470. X"           ooooo+O@OOOX                      ..XXXX#XXXX#XXXXX####++@@+X#XXX.        ",
  471. X"          .ooooX+OOOOOX                       o##X##XXXXXXXXXX######+@#XXXXX.        ",
  472. X"          ..oXXX+OOOOOX                        .XoX##XXXX#X#X#X#####+@+XXXXX.        ",
  473. X"          .XXXXX+OOO@Oo                         .XX####XX#####XXX###+@#XXXXX.        ",
  474. X"          .oooXo+O@@@OX                          .X####X#####X#X####+O+oXXXX.        ",
  475. X"           oXooo#OO@@@o                           .#########XXX#####+O#ooXXX.        ",
  476. X"          o+oooo#OO@@OX                            .X####X####X####X+O+oXXXX.        ",
  477. X"          XO+ooo#OO@@@X                             .###XX####XXX#XX+O+XXXXX.        ",
  478. X"  .XooooXX+O+#Xo#OO@@@+XooooooXX                     .X##X#####X###X++#XXoXo.        ",
  479. X"  XOO+++OOOOOO#o+OO@@OOOO++++++OX                     o###############XXXooo         ",
  480. X"  XOO@+++@+@@O+#+OOOOOO++++++@++o                      .X##############Xoooo.        ",
  481. X"  XOOO@+++++@OOOOOOOOO++++++@O+X                        .#############XXoooo         ",
  482. X"  XOOOO++++++@OOOOOOO@+++++@++#X.                        .X#########++#Xoooo.        ",
  483. X"  XOOOOOO++++++OOOOO@+++++@O+XXX                          o#########+O#ooooo.        ",
  484. X"  XOOOOO+XXXXX######XXXXXX#+#XXX.                          .X#######+O#ooooo         ",
  485. X"  XOOOOO#...............o.oXXXXX                            .#######+O#ooooo.        ",
  486. X"  XOOO+#oo..................XXXX.                            .X###++@O+ooooo.        ",
  487. X"  XOOO#......................XXXo                             o###+OOO+Xoooo         ",
  488. X"  XO+#oo....................o.XX                               .X#+O+#XoXooo.        ",
  489. X"  XO#.o.......................oX.                               .#+O#...oXXo.        ",
  490. X"   #      .  .  . . . . . . . ..                                 oX#oo...ooo.        ",
  491. X"                                                                   oo.....oX.        ",
  492. X"                                                                                     "};
  493. END_OF_FILE
  494.   if test 6834 -ne `wc -c <'bitmaps/titleN.xpm'`; then
  495.     echo shar: \"'bitmaps/titleN.xpm'\" unpacked with wrong size!
  496.   fi
  497.   # end of 'bitmaps/titleN.xpm'
  498. fi
  499. if test -f 'bitmaps/titleO.xpm' -a "${1}" != "-c" ; then 
  500.   echo shar: Will not clobber existing file \"'bitmaps/titleO.xpm'\"
  501. else
  502.   echo shar: Extracting \"'bitmaps/titleO.xpm'\" \(6699 characters\)
  503.   sed "s/^X//" >'bitmaps/titleO.xpm' <<'END_OF_FILE'
  504. X/* XPM */
  505. Xstatic char * titleO_xpm[] = {
  506. X/* width height ncolors chars_per_pixel */
  507. X"83 74 9 1",
  508. X/* colors */
  509. X"     s None    c None",
  510. X".    c #A06000",
  511. X"X    c #F0D040",
  512. X"o    c #F0C030",
  513. X"O    c #D09E20",
  514. X"+    c #802F00",
  515. X"@    c #903F10",
  516. X"#    c #C07F10",
  517. X"$    c black",
  518. X/* pixels */
  519. X"                                .XoOOOOOOOOOOOOOoX.                                ",
  520. X"                                .XOOOOOOOOOOOOOOoX.                                ",
  521. X"                        +.@@@@@@OOoOOOOOOOOOOOOOOo#@@@@@..                         ",
  522. X"                        .XXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoX#                        ",
  523. X"                    +@@@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX#@@@                     ",
  524. X"                    @OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.                    ",
  525. X"                +@@@#OOOOOOOOOOOOoOo#.........OoOoOOOOOOOOOOOO#@@@                 ",
  526. X"                @OOOOOOOOOOOOOOOoXXX#+++++@+++#XXXoOOXOOOOOOOOOOOO.                ",
  527. X"            +.@@#OOOOOOOOOOOOo#..###@@++++++++@###..OXoOOOOOOOOOOO#@..             ",
  528. X"            .XXOOOOOOXOOOOOOoX#+@+++++++++++++++++++#XXoOOOOOOOOOOOOoX#            ",
  529. X"          +@OXoOoOOOXooOO#...#@@++++++++++++++++++++@######OOOOOOOOoOo#.           ",
  530. X"          @OOXooooXooooo#.@+@+@+++++++++++++++++++++++++@.#OOXOOOXXOoOOX.          ",
  531. X"        +@#OooooooooOOOO.+@++++++++++++ + + ++++++++++++@@.#OooOOOoooOXX#@         ",
  532. X"        @OooooooooooOO#.++@+++++++++++       ++++++++++++@@.OoOOOOOXooooOO.        ",
  533. X"      +.#OooooooooooO#..+@++++++++$+ +       + ++++++@+++@@@##OOOOOoXooooo#@       ",
  534. X"      .XXoooooooooooO.+@+++++++++++              ++++@@++++@..OooOoooOoXooOO.      ",
  535. X"      @oooooooooooO##+.@@++++++++                +++@@+++@@++@.OOOoooooooooO.      ",
  536. X"      .Xoooooooooo#..@@@@@@@@@@@                  ++@@@@@@++++@.OoooooooXoXo.      ",
  537. X"    +.OoooooooooooO+@@@@@@@@@@+ +                  ++@@@@@@+@+@@#ooooXoooXooO@     ",
  538. X"    .ooooooooooooo#@@@@@@@@@@@+                      @@@@@@@@@++#XXXXXoooXXooX#    ",
  539. X"    .ooXoooooooXO#@@@@@@@@@@+                       + @@@@@.@@@+.#OXXooXooooXO.    ",
  540. X"    .oooooooooXX#@@@@@@@@@@@+                         +..@@.@@@@@@#oooXXooXXXX.    ",
  541. X"  +.OooooooXoOXX#@@@@@@@@@@@+                         +.@@...@@@@@#XoXXXXoooooO@   ",
  542. X"  .oooooooXXoXXX#@@@@@@@@@..+                         +.+@..@@@@@@#XXXXXXXooXXXX#  ",
  543. X"  .XXoXooooXoXO#.@@@@@.@@@++                           ++@@.@.@@@@#OOXXXXXoooXXo@  ",
  544. X"  .XXXXoooOXXX#@@#.......@                              +@@@@.@@@@@.OXXXXXoooXoX.  ",
  545. X"  .XXXXooXXXoXO@@@.....@.@+                              .@@@.@.@.@@OXXXXXXoXXXX.  ",
  546. X"  .XXXXXXXXXXXO..@@....@@.+                             +.@@@@.....@#XXXXXXXXXoX.  ",
  547. X"+.OXXXoOoXXXXXO.@......@..+                             +..@.@.....@OXXXXXXXXXXXO. ",
  548. X".XXXXXO#OXXXXXO...........+                             +.......###.OXXXXXXXXXXXXX#",
  549. X"@OXXoOO#OXoOOO#......#..++                               ++.........#OOOOOOOoXXXXX.",
  550. X"@#OXO###OXO#...##@..##..+                                 +O...........#####OXXXXX.",
  551. X"+#OXO###OOOOO@.##.....#.+                                 +#.....#.#..#OO###OXoOoX.",
  552. X"+#OXO#####OXO.##.......#+                                 +#....####..OXO###OXO#OX.",
  553. X"+OOOO#####OOO.###.#...##+                                 +###.#.####.#OOOO#OOOooX.",
  554. X"+####################..#+                                 +#############oXO###OXXX.",
  555. X"+###########OOO###OO####+                                 +#############OOO###OOOO@",
  556. X"+###########OXO###OXO###+                                 +#######################@",
  557. X"+###########OXO#OOOOO###+                                 +#OO######OOO##########.@",
  558. X"+O.#########OXO#OXO#####+                                 +#OXO#####OXO#########..+",
  559. X"+###....####OOOOXXoOOOOO.                                 +#OOOo##OOOOO######.###.+",
  560. X"+###.....#####OXXXXXXXXX.                                 +###OXO#OXo#######..####+",
  561. X"+#.##..#.#.##OXXXXXXXXoO@                                 @OOooXO#OOOOO######..#.#+",
  562. X"+..#..##....OXXXXXXXXXO#@                                 .XXXXXO###OXO########...+",
  563. X"+.###.#.##.#OXXXXXXXXXoO#.                              +.OOXXXXoOOOXXO.#.#.##....+",
  564. X"+#####...###OXXXXXXXXXXXXX#                             .XO#OXXXXXXXXXO......##...+",
  565. X" +...#.####.OXXoXXXXXoXXXX.                             .XXOoXXXXXXXXXO......#..++ ",
  566. X"  +...####..OXXoXXXXXooXXX.                             .XXXXXXXXXXXXXO.........+  ",
  567. X"  +.........#OOooXXXooooXX.                             .XXXXXXXXXXXO##.........+  ",
  568. X"  +.....@@@...OooXXXXoooXX.                             .ooXXXXXXXXX#@@.........+  ",
  569. X"  +..+.......@#XXXXoXooooXO.                          +.OooXXXXXXooXO@.........@+  ",
  570. X"  +.+@......@@#XXXXooXXooXXX.                         .ooooooooXXooXO.........@@   ",
  571. X"   @+@@@.@...@#OOXoooXoooXoX.                         .oooXOXoooXoO#.@.@.@.@..@+   ",
  572. X"     @@@@@@.@@@.OoooooooooXX.                         .ooooXooXoXXO@@@@@@@@@@.+    ",
  573. X"    +@@.@....@@@#OoooooooooXO@                      +.OooXOoooooOO#@@@@@@.@.@@+    ",
  574. X"    +@@.....@@@@.#OoooooooooXX.                     .oooooXoXooXO#...@@@@....@     ",
  575. X"     ++.@.@.@@@@@.OooooOoOooOo#.                  +.OooXoooooooX#..@@@@@@.@.++     ",
  576. X"      +..@@@@@@@@@#XXooOOOOoOOoX.                 .XXoooooooooXoO@@@@@@@@@@@       ",
  577. X"      ++@@@@@@@@@@.#OooOoOoooOOOO.              +.OXoXOXOOooooO#.@@@@@@@@@@++      ",
  578. X"       @@@@@@@@@@@@@#XXoooooOOOOOX.             .XXoooXooOOooX#@@@@@@@@@@@++       ",
  579. X"      + @@@@@@@+@@@@.#OXoOoOOOOooo#@@@      +.@@OOoOOOOOOOoXO#.@@@@+@@@@@@+ +      ",
  580. X"        +@@@@@+++@@@@+#XoOOOOOOooXOOOO.     .XXOOOOOOOOOOOoX#@@@@@++@@@@@@+        ",
  581. X"         ++@@@@+@@@@@+.#OoOOOOOOoOOOOO#@@@@@OOOOOOOOOOOOOXO#@@@+@++++@+++          ",
  582. X"           @@@@@@@@@@@@@#XoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoX.@@++++++++++++          ",
  583. X"           ++@++++@+@@@@@##.#oOOOOOOOOOOOOOOOOOOOOOOOoO.##@@+++++++++++            ",
  584. X"             @@+++++@@++++++#XoOOOOOOOOOOOOOOOOOOOOOoX#@++@@@@++++++++             ",
  585. X"            + +@+++++@++++++.##.OooOOOOOOOOOOOOoOo#..#@@+++++++++++++ +            ",
  586. X"              +@++++++++++++@@@@#XXXoOOOOOOOOOoXXX#+@+@++++++++++@@+               ",
  587. X"               + ++++++++++++@+@@###...........###@@++++++++++++++ +               ",
  588. X"                   +++++++++++++++++@+++++++++++++++++++++++++++                   ",
  589. X"                   + + ++++++++++++++++++++++++++++++++++++ + +                    ",
  590. X"                         +++++++++++++++++++++++++++++++++                         ",
  591. X"                         + + + +++++++++++++++++++  +   +                          ",
  592. X"                                 @+++++++++++++++++                                "};
  593. END_OF_FILE
  594.   if test 6699 -ne `wc -c <'bitmaps/titleO.xpm'`; then
  595.     echo shar: \"'bitmaps/titleO.xpm'\" unpacked with wrong size!
  596.   fi
  597.   # end of 'bitmaps/titleO.xpm'
  598. fi
  599. if test -f 'bitmaps/titleX.xpm' -a "${1}" != "-c" ; then 
  600.   echo shar: Will not clobber existing file \"'bitmaps/titleX.xpm'\"
  601. else
  602.   echo shar: Extracting \"'bitmaps/titleX.xpm'\" \(5798 characters\)
  603.   sed "s/^X//" >'bitmaps/titleX.xpm' <<'END_OF_FILE'
  604. X/* XPM */
  605. Xstatic char * titleX_xpm[] = {
  606. X/* width height ncolors chars_per_pixel */
  607. X"71 74 8 1",
  608. X/* colors */
  609. X"     s None    c None",
  610. X".    c #A06000",
  611. X"X    c #903F10",
  612. X"o    c #F0D040",
  613. X"O    c #D09E20",
  614. X"+    c #F0C030",
  615. X"@    c #C07F10",
  616. X"#    c #802F00",
  617. X/* pixels */
  618. X"                                                                       ",
  619. X"                                                                       ",
  620. X"..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....XXXXXXXXXXXXXXXXXXXXXXXXXXX ",
  621. X"oooOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+ooo+OOOOOOOOOOOOOOOOOOOOOOOOOOO.",
  622. X"ooo+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+OOOooO+OOOOOOOOOOOOOOOOOOOOOOOO@ ",
  623. X"oooo+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+oO.Oooo+OOOOOOOOOOOOOOOOOOOOOOO@.#",
  624. X"oooo++OOOOOOOOOOOOOOOOOOOOOOOOOOOOO+OO@.OooooOOOOOOOOOOOOOOOOOOOOOO@.. ",
  625. X"oooooo+OOOOOOOOOOOOOOOOOOOOOOOOOOO+oO...Oooooo+OOOOOOOOOOOOOOOOOOO@...#",
  626. X"ooooooO...........OOO.............@O@...OoooooO..................@.... ",
  627. X"oooooo@###########@o@#############X.....Oooooo@#################X......",
  628. X"ooooO@XX####X@@@@.Oo@##X###########X#...OoooO@XX######X@@.@@XX##X#.... ",
  629. X"oooo@#######@ooooo++@XXX############....Oooo@########XOooooo@######...#",
  630. X"ooO@XX##X@@@Oooo+++oO@.XXXXXX#########..OoO@XX####XXXX@o++ooO@@@XXX#..#",
  631. X"oo@#####@oooo+++++ooooO.....XX#######XX.Oo@######X#.XX@++++ooooo@##XX. ",
  632. X"..X # # @ooo+++o+++oooOO@...XXX#XXX## # X.  X###XX..@@Oo++ooooO.X  # # ",
  633. X"        .oo++++oo+ooooooO....XXXX.XX#       #XX..XX.O+++oooooo.        ",
  634. X"         @Oooooo++ooooooOX.@...X.@.X#     # XX..XX.OO+++ooooO.         ",
  635. X"          .oooooo++oooo+@.@@@@@..@@.#     #.@.XXXX@oo+++oooo.          ",
  636. X"          XO+oooOOOO+ooo+O@@@..@@@..X#   ##....#@@Oo+OOO+oO.           ",
  637. X"          X@OoooO@@@OoooooO@..@@@@@@..# #.......OoooO@@@Oo.            ",
  638. X"           X@O+oO@@@OOOO+o+OO.@@@@@@@.@.......@OOooOOOOO@.             ",
  639. X"            X@OoO@@@@@@@OoooO@@@@@@@@@OoO...@@OoooO@Oooo.              ",
  640. X"             X@OO@@@OOO@OOOOOOOOOOOOO@OoO.@OOOOOOO@@OOO.               ",
  641. X"              X@@@@@OoO@@@@@+oooooooO@OoOOOoooOO...@@@X                ",
  642. X"               #..@@@O@@@@@.@Ooooo+OO.OoO@Oo+O@.@.@@XX                 ",
  643. X"                #..@@.@@@@..@@OoooO@..OoO@OoO....@..#                  ",
  644. X"                #...@.@@@.@...Oooo+O@.@OOOOO@.X..@##                   ",
  645. X"                #....@@@......OoooooO.@@+oO...#XX.#                    ",
  646. X"                 ##..........@@OOoo+O..@@O@.X.X.##                     ",
  647. X"                  #.XXXXX....@..O+++@.@@....XX..#                      ",
  648. X"                   ##.XX.X.X.@.X@@OoOOOO@..XXXX#                       ",
  649. X"                    #....XXXX..XX.O+ooooO.XXXX                         ",
  650. X"                    #X...X.X.XXX..O+ooO@@X.X.@X                        ",
  651. X"                     XX.....XXXXX.Oooo@XXXXX@o.                        ",
  652. X"                     ##..X.X.XXXX.@oooO@@@@@O+@.                       ",
  653. X"                      #.XXXXXXXXXX@oooo++++++o+o.                      ",
  654. X"                       ##X.@@@@@@@@@@@O+++++++++O.                     ",
  655. X"                        #X@o++++oo@#XX@+++++o++++o.                    ",
  656. X"                        X@O+++++O@.#XXOoo+o++++o++O.                   ",
  657. X"                        .oo++o++@XX#X.Ooooooo+++++oo@                  ",
  658. X"                      #.Ooo+++O@.XX#X.@@Oooo+++o+o+o.                  ",
  659. X"                      .oooo+++@XX@X#X.XX@oooo++oooo+X                  ",
  660. X"                    #.Ooo+o+O@.XXXXX.XX..@+ooo+O+oooO.                 ",
  661. X"                    .oooo+++@XXXXX..XX..XX@oooO@Oooooo@                ",
  662. X"                  #.OO+oo+oo@XXXXXX@..X..X@@OOOOOO+o+O.X               ",
  663. X"                  .oO@OoooooO.XXXX.@......XX.@Oo+@OoO@@@X              ",
  664. X"                 X@OOOooooOO@...XXX@........@O+OOOoo+OO@@.             ",
  665. X"                #@@@OoooooO....@.#X.......@@OoO@OoooooO@Oo@            ",
  666. X"               #.@@@OO+o+O@...@.X .....@...@OO@@Oo+OOOO@Oo@X           ",
  667. X"              #@O@@@@@OoO@...@..X #@@..@..@@..@@OoO@@@@@OoO@X          ",
  668. X"             X.@@@@.@@@O@@@.@..#   #.OO@@.@@@O@@OOO@@@@@OOO..X         ",
  669. X"            #..@@@...O...@@@..X     .oO@@@@@OoO@@@@@@@@@@@...@X        ",
  670. X"           #....@.@.OO@.@@@@.       .OO@OOO@OOO@OO@@@@@@@@...@#        ",
  671. X"          #O@@@....@OoOO@@@@X       X@@@OoO@@@@@OoO..@@@@@@...#        ",
  672. X"         #.@.@....@@OOO@@@XX         X.@OOOOO@@@OO@.@....@.@..##       ",
  673. X"        #@O@.......@@@@@@@X           X@@@OoO@@@@@@X..XXX..@....#      ",
  674. X"       X........@OOOO@@@XX             #@O+o+OOOOOOO.X.X...@....##     ",
  675. X"      #...XXX...OoooO@@@#               .oooooo+oo++@XXXX.......#X#    ",
  676. X"    #....#....@OOO+oO@X#                 .Ooooo++o++O@@X..X.X.X..XX.   ",
  677. X"    .oO.XXX...OoO@OoO@#                   .ooo++++++ooO...XXXX..XXOo@  ",
  678. X"XX..OoOO.XX.@OOo+Ooo+O@.X.          #..XXX@+Oo++o+o+ooOO@X.XXX.OO@OoO.X",
  679. X"OO+oooooOXXX@ooooooooo+OOO.         .o+OOOOOOOOooooo++oo@XXXXX@oooooooo",
  680. X"OOO+Oo+oO@.X@ooooo++OoOOO@X         .oo+OOOOOOO++Oooo+oo@XXX.@+o++OoO+O",
  681. X"OOOOOOOooo@X@ooooo+OOOOO@.          .ooo+OOOOOOOOO+ooo++@XXX@ooo+OOOOOO",
  682. X"+OOOOOO+++O@Ooo+O+OOOO@@..#         .ooooOOOOOOOOOO++OooO@@@O+O+OOOOOOO",
  683. X"oooOOOOOOOOoooOOOOOOOO@...X         .ooooooOOOOOOOOOOO+ooooo+OOOOOOOOO+",
  684. X"ooOX......@@@@@..@..@@....          .oooooO...........@@@@@@..........@",
  685. X"oo@XX###############X.....#         .ooooo@###################X##X####X",
  686. X"@@X#################XX....#         .oooO@XX##########################X",
  687. X"######################X...#         .ooo@##############################",
  688. X"#######################XX.#         .oO@XX#############################",
  689. X"########################X.#         .o@#X##############################",
  690. X" # # # # # # # # # # # # #           @      #  # # # # # # # # # # # # ",
  691. X"                                                                       "};
  692. END_OF_FILE
  693.   if test 5798 -ne `wc -c <'bitmaps/titleX.xpm'`; then
  694.     echo shar: \"'bitmaps/titleX.xpm'\" unpacked with wrong size!
  695.   fi
  696.   # end of 'bitmaps/titleX.xpm'
  697. fi
  698. if test -f 'inst.c' -a "${1}" != "-c" ; then 
  699.   echo shar: Will not clobber existing file \"'inst.c'\"
  700. else
  701.   echo shar: Extracting \"'inst.c'\" \(6857 characters\)
  702.   sed "s/^X//" >'inst.c' <<'END_OF_FILE'
  703. X#include "copyright.h"
  704. X
  705. X/*
  706. X *  Include file dependencies:
  707. X */
  708. X
  709. X#include <stdio.h>
  710. X#include <stdlib.h>
  711. X#include <stddef.h>
  712. X#include <math.h>
  713. X#include <X11/Xlib.h>
  714. X#include <X11/Xutil.h>
  715. X#include <X11/Xos.h>
  716. X#include <xpm.h>
  717. X
  718. X#include "error.h"
  719. X#include "highscore.h"
  720. X#include "misc.h"
  721. X#include "main.h"
  722. X#include "init.h"
  723. X#include "stage.h"
  724. X#include "bonus.h"
  725. X#include "special.h"
  726. X#include "blocks.h"
  727. X#include "ball.h"
  728. X#include "score.h"
  729. X#include "paddle.h"
  730. X#include "level.h"
  731. X#include "mess.h"
  732. X#include "version.h"
  733. X#include "intro.h"
  734. X#include "audio.h"
  735. X#include "keys.h"
  736. X
  737. X#include "inst.h"
  738. X
  739. X/*
  740. X *  Internal macro definitions:
  741. X */
  742. X
  743. X#define GAP         12
  744. X
  745. X/*
  746. X *  Internal type declarations:
  747. X */
  748. X
  749. X#if NeedFunctionPrototypes
  750. Xvoid SetInstructWait(int newMode, int waitFrame);
  751. Xstatic void DoSparkle(Display *display, Window window);
  752. Xvoid DoInstructWait(void);
  753. X#else
  754. Xstatic void DoSparkle();
  755. Xvoid SetInstructWait();
  756. Xvoid DoInstructWait();
  757. X#endif
  758. X
  759. X/*
  760. X *  Internal variable declarations:
  761. X */
  762. X
  763. Xstatic int endFrame = 0;
  764. Xstatic int nextFrame = 0;
  765. Xenum InstructStates InstructState;
  766. Xstatic int waitingFrame, waitMode;
  767. X
  768. X#if NeedFunctionPrototypes
  769. Xvoid SetUpInstructions(Display *display, Window window, Colormap colormap)
  770. X#else
  771. Xvoid SetUpInstructions(display, window, colormap)
  772. X    Display *display;
  773. X    Window window;
  774. X    Colormap colormap;
  775. X#endif
  776. X{
  777. X    /* Umm. Reset the instructions to default state */
  778. X    ResetInstructions();
  779. X}
  780. X
  781. X#if NeedFunctionPrototypes
  782. Xstatic void DoText(Display *display, Window window)
  783. X#else
  784. Xstatic void DoText(display, window)
  785. X    Display *display;
  786. X    Window window;
  787. X#endif
  788. X{
  789. X    char string[80];
  790. X    int y;
  791. X
  792. X    SetCurrentMessage(display, messWindow, "UNIX Power!", False);
  793. X
  794. X    DrawShadowCentredText(display, window, titleFont, 
  795. X        "- Instructions -", 140, red, PLAY_WIDTH);
  796. X
  797. X    y = 190;
  798. X
  799. X    DrawLine(display, window, 32, y+2, PLAY_WIDTH - 28, y+2, black, 3);
  800. X    DrawLine(display, window, 30, y, PLAY_WIDTH - 30, y, white, 3);
  801. X    y += textFont->ascent + GAP/3;
  802. X
  803. X    strcpy(string, 
  804. X        "XBoing is a blockout type game where you must use");
  805. X    DrawShadowCentredText(display, window, textFont, 
  806. X        string, y, yellow, PLAY_WIDTH);
  807. X    y += textFont->ascent + GAP;
  808. X
  809. X    strcpy(string, 
  810. X        "the paddle to bounce the ball around the play field and");
  811. X    DrawShadowCentredText(display, window, textFont, 
  812. X        string, y, yellow, PLAY_WIDTH);
  813. X    y += textFont->ascent + GAP;
  814. X
  815. X    strcpy(string, 
  816. X        "destroy the blocks. The Boing Master will rule the world.");
  817. X    DrawShadowCentredText(display, window, textFont, 
  818. X        string, y, yellow, PLAY_WIDTH);
  819. X    y += textFont->ascent + GAP;
  820. X    y += textFont->ascent + GAP / 2;
  821. X
  822. X    strcpy(string, "You can collect bullets and use them to shoot out");
  823. X    DrawShadowCentredText(display, window, textFont, 
  824. X        string, y, green, PLAY_WIDTH);
  825. X    y += textFont->ascent + GAP;
  826. X
  827. X    strcpy(string, "blocks or bonus coins. You have a limited supply of");
  828. X    DrawShadowCentredText(display, window, textFont, 
  829. X        string, y, green, PLAY_WIDTH);
  830. X    y += textFont->ascent + GAP;
  831. X
  832. X    strcpy(string, 
  833. X        "bullets which can be replenished by hitting an");
  834. X    DrawShadowCentredText(display, window, textFont, 
  835. X        string, y, green, PLAY_WIDTH);
  836. X    y += textFont->ascent + GAP;
  837. X
  838. X    strcpy(string, 
  839. X        "ammunition block. You can shoot your ball. Beware.");
  840. X    DrawShadowCentredText(display, window, textFont, 
  841. X        string, y, green, PLAY_WIDTH);
  842. X    y += textFont->ascent + GAP;
  843. X    y += textFont->ascent + GAP / 2;
  844. X
  845. X    strcpy(string, "If you collect more than 10 bonus coins on a level,");
  846. X    DrawShadowCentredText(display, window, textFont, 
  847. X        string, y, tann, PLAY_WIDTH);
  848. X    y += textFont->ascent + GAP;
  849. X
  850. X    strcpy(string, "you will be rewarded with a super bonus of 50,000.");
  851. X    DrawShadowCentredText(display, window, textFont, 
  852. X        string, y, tann, PLAY_WIDTH);
  853. X    y += textFont->ascent + GAP;
  854. X
  855. X    DrawLine(display, window, 32, y+2, PLAY_WIDTH - 28, y+2, black, 3);
  856. X    DrawLine(display, window, 30, y, PLAY_WIDTH - 30, y, white, 3);
  857. X
  858. X    strcpy(string, "Press <Space> to start game");
  859. X    DrawShadowCentredText(display, window, textFont, string, 
  860. X        PLAY_HEIGHT - 40, tann, PLAY_WIDTH);
  861. X}
  862. X
  863. X#if NeedFunctionPrototypes
  864. Xstatic void DoSparkle(Display *display, Window window)
  865. X#else
  866. Xstatic void DoSparkle(display, window)
  867. X    Display *display;
  868. X    Window window;
  869. X#endif
  870. X{
  871. X    static Pixmap store;
  872. X    static int x = 100;
  873. X    static int y = 20;
  874. X    static int in = 0;
  875. X
  876. X    if (frame >= endFrame)
  877. X        InstructState = INSTRUCT_FINISH;
  878. X
  879. X    if (!store)
  880. X    {
  881. X        store = XCreatePixmap(display, window, 20, 20,
  882. X            DefaultDepth(display, XDefaultScreen(display)));
  883. X    }
  884. X
  885. X    if (in == 0)
  886. X        XCopyArea(display, window, store, gc, x, y, 20, 20, 0, 0);
  887. X
  888. X    if (frame == nextFrame)
  889. X    {
  890. X        RenderShape(display, window, stars[in], starsM[in],
  891. X            x, y, 20, 20, False);
  892. X
  893. X        in++;
  894. X        nextFrame = frame + 15;
  895. X
  896. X        if (in == 11)
  897. X        {
  898. X            XCopyArea(display, store, window, gc, 0, 0, 20, 20, x, y);
  899. X            in = 0;
  900. X            nextFrame = frame + 500;
  901. X            x = (rand() % 474) + 5;
  902. X            y = (rand() % 74) + 5;
  903. X        }
  904. X    }
  905. X}
  906. X
  907. X#if NeedFunctionPrototypes
  908. Xstatic void DoFinish(Display *display, Window window)
  909. X#else
  910. Xstatic void DoFinish(display, window)
  911. X    Display *display;
  912. X    Window window;
  913. X#endif
  914. X{
  915. X    ResetKeys();
  916. X    mode = MODE_KEYS;
  917. X
  918. X    if (noSound == False)
  919. X        playSoundFile("weeek", 100);
  920. X}
  921. X
  922. X
  923. X#if NeedFunctionPrototypes
  924. Xvoid Instructions(Display *display, Window window)
  925. X#else
  926. Xvoid Instructions(display, window)
  927. X    Display *display;
  928. X    Window window;
  929. X#endif
  930. X{
  931. X    switch (InstructState)
  932. X    {
  933. X        case INSTRUCT_TITLE:
  934. X            DoIntroTitle(display, window);
  935. X            InstructState = INSTRUCT_TEXT;
  936. X            break;
  937. X
  938. X        case INSTRUCT_TEXT:
  939. X            DoText(display, window);
  940. X            InstructState = INSTRUCT_SPARKLE;
  941. X            break;
  942. X
  943. X        case INSTRUCT_SPARKLE:
  944. X            DoSparkle(display, window);
  945. X            if ((frame % FLASH) == 0)
  946. X                RandomDrawSpecials(display);
  947. X            break;
  948. X
  949. X        case INSTRUCT_FINISH:
  950. X            DoFinish(display, window);
  951. X            break;
  952. X
  953. X        case INSTRUCT_WAIT:
  954. X            DoInstructWait();
  955. X            break;
  956. X
  957. X        default:
  958. X            break;
  959. X    }
  960. X}
  961. X
  962. X#if NeedFunctionPrototypes
  963. Xvoid RedrawInstructions(Display *display, Window window)
  964. X#else
  965. Xvoid RedrawInstructions(display, window)
  966. X    Display *display; 
  967. X    Window window;
  968. X#endif
  969. X{
  970. X    DoIntroTitle(display, window);
  971. X    DoText(display, window);
  972. X}
  973. X
  974. X#if NeedFunctionPrototypes
  975. Xvoid FreeInstructions(Display *display)
  976. X#else
  977. Xvoid FreeInstructions(display)
  978. X    Display *display;
  979. X#endif
  980. X{
  981. X}
  982. X
  983. X#if NeedFunctionPrototypes
  984. Xvoid ResetInstructions(void)
  985. X#else
  986. Xvoid ResetInstructions()
  987. X#endif
  988. X{
  989. X    InstructState = INSTRUCT_TITLE;
  990. X    nextFrame     = frame + 100;
  991. X    endFrame     = frame + 4000;
  992. X}
  993. X
  994. X#if NeedFunctionPrototypes
  995. Xvoid SetInstructWait(int newMode, int waitFrame)
  996. X#else
  997. Xvoid SetInstructWait(newMode, waitFrame)
  998. X    int newMode;
  999. X    int waitFrame;
  1000. X#endif
  1001. X{
  1002. X    waitingFrame     = waitFrame;
  1003. X    waitMode         = newMode;
  1004. X    InstructState     = INSTRUCT_WAIT;
  1005. X}
  1006. X
  1007. X#if NeedFunctionPrototypes
  1008. Xvoid DoInstructWait(void)
  1009. X#else
  1010. Xvoid DoInstructWait()
  1011. X#endif
  1012. X{
  1013. X    if (frame == waitingFrame)
  1014. X        InstructState = waitMode;
  1015. X}
  1016. END_OF_FILE
  1017.   if test 6857 -ne `wc -c <'inst.c'`; then
  1018.     echo shar: \"'inst.c'\" unpacked with wrong size!
  1019.   fi
  1020.   # end of 'inst.c'
  1021. fi
  1022. if test -f 'misc.c' -a "${1}" != "-c" ; then 
  1023.   echo shar: Will not clobber existing file \"'misc.c'\"
  1024. else
  1025.   echo shar: Extracting \"'misc.c'\" \(5689 characters\)
  1026.   sed "s/^X//" >'misc.c' <<'END_OF_FILE'
  1027. X#include "copyright.h"
  1028. X
  1029. X/*
  1030. X *  Include file dependencies:
  1031. X */
  1032. X
  1033. X#include <stdio.h>
  1034. X#include "init.h"
  1035. X#include "stage.h"
  1036. X
  1037. X#include "misc.h"
  1038. X
  1039. X/*
  1040. X *  Internal macro definitions:
  1041. X */
  1042. X
  1043. X/*
  1044. X *  Internal type declarations:
  1045. X */
  1046. X
  1047. X/*
  1048. X *  Internal variable declarations:
  1049. X */
  1050. X
  1051. Xstatic Pixmap backStore = (Pixmap) NULL;
  1052. X
  1053. X#if NeedFunctionPrototypes
  1054. Xvoid DrawLine(Display *display, Window window, int x, int y, int x2, int y2, 
  1055. X    int colour, int width)
  1056. X#else
  1057. Xvoid DrawLine(display, window, x, y, x2, y2, colour, width)
  1058. X    Display *display;
  1059. X    Window window;
  1060. X    int x;
  1061. X    int y;
  1062. X    int x2;
  1063. X    int y2; 
  1064. X    int colour;
  1065. X    int width;
  1066. X#endif
  1067. X{
  1068. X    /* Change the width of the line */
  1069. X    XSetLineAttributes(display, gcxor, width, LineSolid, CapProjecting, 
  1070. X        JoinMiter);
  1071. X    XSetLineAttributes(display, gcand, width, LineSolid, CapProjecting, 
  1072. X        JoinMiter);
  1073. X
  1074. X    /* Set to the desired colours */
  1075. X    XSetBackground(display, gcxor, colour);
  1076. X    XSetForeground(display, gcxor, colour);
  1077. X
  1078. X    /* Now draw the line */
  1079. X    XDrawLine(display, window, gcxor, x, y, x2, y2);
  1080. X    XDrawLine(display, window, gcand, x, y, x2, y2);
  1081. X    XDrawLine(display, window, gcxor, x, y, x2, y2);
  1082. X}
  1083. X
  1084. X#if NeedFunctionPrototypes
  1085. Xvoid DrawShadowCentredText(Display *display, Window window, XFontStruct *font,
  1086. X    char *string, int y, int colour, int width)
  1087. X#else
  1088. Xvoid DrawShadowCentredText(display, window, font, string, y, colour, width)
  1089. X    Display *display;
  1090. X    Window window;
  1091. X    XFontStruct *font;
  1092. X    char *string;
  1093. X    int y;
  1094. X    int colour;
  1095. X    int width;
  1096. X#endif
  1097. X{
  1098. X    int plen, len, x;
  1099. X
  1100. X    /* String length */
  1101. X    len = strlen(string);
  1102. X
  1103. X    /* Length of string in pixels */
  1104. X    plen = XTextWidth(font, string, len);
  1105. X
  1106. X    /* Start drawing so the text is centered */
  1107. X    x = (width / 2) - (plen / 2);
  1108. X
  1109. X    /* Draw the text with a shadow */
  1110. X    DrawText(display, window, x+2, y + 2, font, black, string, -1);
  1111. X    DrawText(display, window, x, y, font, colour, string, -1);
  1112. X}
  1113. X
  1114. X#if NeedFunctionPrototypes
  1115. Xvoid DrawShadowText(Display *display, Window window, XFontStruct *font,
  1116. X    char *string, int x, int y, int colour)
  1117. X#else
  1118. Xvoid DrawShadowText(display, window, font, string, x, y, colour)
  1119. X    Display *display;
  1120. X    Window window;
  1121. X    XFontStruct *font;
  1122. X    char *string;
  1123. X    int x;
  1124. X    int y;
  1125. X    int colour;
  1126. X#endif
  1127. X{
  1128. X    int len;
  1129. X
  1130. X    /* String length */
  1131. X    len = strlen(string);
  1132. X
  1133. X    /* Draw the text with a shadow */
  1134. X    DrawText(display, window, x+2, y + 2, font, black, string, -1);
  1135. X    DrawText(display, window, x, y, font, colour, string, -1);
  1136. X}
  1137. X
  1138. X#if NeedFunctionPrototypes
  1139. Xvoid DrawText(Display *display, Window window, int x, int y, XFontStruct *font, 
  1140. X    int colour, char *text, int numChar)
  1141. X#else
  1142. Xvoid DrawText(display, window, x, y, font, colour, text, numChar)
  1143. X    Display *display;
  1144. X    Window window;
  1145. X    int x;
  1146. X    int y;
  1147. X    XFontStruct *font;
  1148. X    int colour;
  1149. X    char *text;
  1150. X    int numChar;
  1151. X#endif
  1152. X{
  1153. X    int len = strlen(text);
  1154. X
  1155. X    /* If numchar is passed > 0 then only draw numChar characters */
  1156. X    if (numChar > 0) 
  1157. X        len = numChar;
  1158. X
  1159. X    /* Change to the new font */
  1160. X    XSetFont(display, gcxor, font->fid);
  1161. X    XSetFont(display, gcand, font->fid);
  1162. X
  1163. X    /* Change the drawing function */
  1164. X    XSetBackground(display, gcxor, colour);
  1165. X    XSetForeground(display, gcxor, colour);
  1166. X
  1167. X    /* Draw the string into the drawable */
  1168. X    XDrawString(display, window, gcxor, x, y + font->ascent, text, len);
  1169. X    XDrawString(display, window, gcand, x, y + font->ascent, text, len);
  1170. X    XDrawString(display, window, gcxor, x, y + font->ascent, text, len);
  1171. X}
  1172. X
  1173. X#if NeedFunctionPrototypes
  1174. Xvoid RenderShape(Display *display, Window window, Pixmap pixmap, 
  1175. X    Pixmap mask, int x, int y, int w, int h, int clear)
  1176. X#else
  1177. Xvoid RenderShape(display, window, pixmap, mask, x, y, w, h, clear)
  1178. X    Display *display;
  1179. X    Window window;
  1180. X    Pixmap pixmap;
  1181. X    Pixmap mask;
  1182. X    int x;
  1183. X    int y;
  1184. X    int w;
  1185. X    int h;
  1186. X    int clear;
  1187. X#endif
  1188. X{
  1189. X
  1190. X    /* This backing store is used to render into and then we can just copy
  1191. X     * this pixmap onto the drawable like normal - sort of double buffering
  1192. X     * as you would see the object being xored anded etc on screen otherwise.
  1193. X     */
  1194. X    if (backStore == (Pixmap) NULL)
  1195. X    {
  1196. X        if (!(backStore = XCreatePixmap(display, window,
  1197. X            PLAY_WIDTH, PLAY_HEIGHT, 
  1198. X            DefaultDepth(display, XDefaultScreen(display)))))
  1199. X        {
  1200. X            ShutDown(display, 1, "Cannot create pixmap in RenderShape().");
  1201. X        }
  1202. X    }
  1203. X
  1204. X    if (clear)
  1205. X        XClearArea(display, window, x, y, w, h, False);
  1206. X
  1207. X    /* Copy the current window area into the backing store */
  1208. X    XCopyArea(display, window, backStore, gc, x, y, w, h, 0, 0);
  1209. X
  1210. X    /* Draw the pixmap into backing store */
  1211. X    XCopyArea(display, pixmap, backStore, gcxor, 0, 0, w, h, 0, 0);
  1212. X    XCopyPlane(display, mask, backStore, gcand, 0, 0, w, h, 0, 0, 1L);
  1213. X    XCopyArea(display, pixmap, backStore, gcxor, 0, 0, w, h, 0, 0);
  1214. X
  1215. X    /* Write the backing store back to the window */
  1216. X    XCopyArea(display, backStore, window, gc, 0, 0, w, h, x, y);
  1217. X}
  1218. X
  1219. X
  1220. X#if NeedFunctionPrototypes
  1221. Xvoid FreeMisc(Display *display)
  1222. X#else
  1223. Xvoid FreeMisc(display)
  1224. X    Display *display;
  1225. X#endif
  1226. X{
  1227. X    /* Now free the backing store pixmap */
  1228. X    if (backStore) XFreePixmap(display, backStore);
  1229. X}
  1230. X
  1231. X#if NeedFunctionPrototypes
  1232. Xint ColourNameToPixel(Display *display, Colormap colormap, char *colourName)
  1233. X#else
  1234. Xint ColourNameToPixel(display, colormap, colourName)
  1235. X    Display *display;
  1236. X    Colormap colormap;
  1237. X    char *colourName;
  1238. X#endif
  1239. X{
  1240. X    XColor colour;
  1241. X
  1242. X    /* Obtain the exact colour from the colour name */
  1243. X    if (XParseColor(display, DefaultColormap(display,
  1244. X        XDefaultScreen(display)), colourName, &colour) != 0)
  1245. X    {
  1246. X        /* Now allocate the colour */
  1247. X        XAllocColor(display, colormap, &colour);
  1248. X
  1249. X        /* Return the pixel id */
  1250. X        return colour.pixel;
  1251. X    }
  1252. X
  1253. X    /* Obviously a problem so barf */
  1254. X    ShutDown(display, 1, "Error while parsing colours.");
  1255. X
  1256. X    /* Not reached */
  1257. X    return 1;
  1258. X}
  1259. END_OF_FILE
  1260.   if test 5689 -ne `wc -c <'misc.c'`; then
  1261.     echo shar: \"'misc.c'\" unpacked with wrong size!
  1262.   fi
  1263.   # end of 'misc.c'
  1264. fi
  1265. if test -f 'score.c' -a "${1}" != "-c" ; then 
  1266.   echo shar: Will not clobber existing file \"'score.c'\"
  1267. else
  1268.   echo shar: Extracting \"'score.c'\" \(5321 characters\)
  1269.   sed "s/^X//" >'score.c' <<'END_OF_FILE'
  1270. X#include "copyright.h"
  1271. X
  1272. X/*
  1273. X *  Include file dependencies:
  1274. X */
  1275. X
  1276. X#include <stdio.h>
  1277. X#include <stdlib.h>
  1278. X#include <stddef.h>
  1279. X#include <X11/Xlib.h>
  1280. X#include <X11/Xutil.h>
  1281. X#include <X11/Xos.h>
  1282. X#include <xpm.h>
  1283. X
  1284. X#include "bitmaps/digit0.xpm"
  1285. X#include "bitmaps/digit1.xpm"
  1286. X#include "bitmaps/digit2.xpm"
  1287. X#include "bitmaps/digit3.xpm"
  1288. X#include "bitmaps/digit4.xpm"
  1289. X#include "bitmaps/digit5.xpm"
  1290. X#include "bitmaps/digit6.xpm"
  1291. X#include "bitmaps/digit7.xpm"
  1292. X#include "bitmaps/digit8.xpm"
  1293. X#include "bitmaps/digit9.xpm"
  1294. X
  1295. X#include "error.h"
  1296. X#include "init.h"
  1297. X#include "special.h"
  1298. X#include "misc.h"
  1299. X
  1300. X#include "score.h"
  1301. X
  1302. X/*
  1303. X *  Internal macro definitions:
  1304. X */
  1305. X
  1306. X#define NUM_DIGITS    10
  1307. X
  1308. X/*
  1309. X *  Internal type declarations:
  1310. X */
  1311. X
  1312. X/*
  1313. X *  Internal variable declarations:
  1314. X */
  1315. X
  1316. XPixmap    digitPixmaps[NUM_DIGITS];
  1317. XPixmap    digitPixmapsM[NUM_DIGITS];
  1318. X
  1319. Xu_long score = 0L;
  1320. X
  1321. X
  1322. X#if NeedFunctionPrototypes
  1323. Xvoid InitialiseScoreDigits(Display *display, Window window, Colormap colormap)
  1324. X#else
  1325. Xvoid InitialiseScoreDigits(display, window, colormap)
  1326. X    Display *display;
  1327. X    Window window;
  1328. X    Colormap colormap;
  1329. X#endif
  1330. X{
  1331. X    XpmAttributes   attributes;
  1332. X    int             XpmErrorStatus;
  1333. X
  1334. X    attributes.valuemask = XpmColormap;
  1335. X    attributes.colormap = colormap;
  1336. X
  1337. X    /* Create all xpm pixmap digits from the files */
  1338. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit0_xpm, 
  1339. X        &digitPixmaps[0], &digitPixmapsM[0], &attributes);
  1340. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1341. X
  1342. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit1_xpm, 
  1343. X        &digitPixmaps[1], &digitPixmapsM[1], &attributes);
  1344. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1345. X
  1346. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit2_xpm, 
  1347. X        &digitPixmaps[2], &digitPixmapsM[2], &attributes);
  1348. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1349. X
  1350. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit3_xpm, 
  1351. X        &digitPixmaps[3], &digitPixmapsM[3], &attributes);
  1352. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1353. X
  1354. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit4_xpm, 
  1355. X        &digitPixmaps[4], &digitPixmapsM[4], &attributes);
  1356. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1357. X
  1358. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit5_xpm, 
  1359. X        &digitPixmaps[5], &digitPixmapsM[5], &attributes);
  1360. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1361. X
  1362. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit6_xpm, 
  1363. X        &digitPixmaps[6], &digitPixmapsM[6], &attributes);
  1364. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1365. X
  1366. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit7_xpm, 
  1367. X        &digitPixmaps[7], &digitPixmapsM[7], &attributes);
  1368. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1369. X
  1370. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit8_xpm, 
  1371. X        &digitPixmaps[8], &digitPixmapsM[8], &attributes);
  1372. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1373. X
  1374. X    XpmErrorStatus = XpmCreatePixmapFromData(display, window, digit9_xpm, 
  1375. X        &digitPixmaps[9], &digitPixmapsM[9], &attributes);
  1376. X    HandleXPMError(display, XpmErrorStatus, "InitialiseScoreDigits()");
  1377. X
  1378. X    /* Free the xpm pixmap attributes */
  1379. X    XpmFreeAttributes(&attributes);
  1380. X}
  1381. X
  1382. X#if NeedFunctionPrototypes
  1383. Xstatic void DrawDigit(Display *display, Window window, int digit, int x, int y)
  1384. X#else
  1385. Xstatic void DrawDigit(display, window, digit, x, y)
  1386. X    Display *display;
  1387. X    Window window;
  1388. X    int digit;
  1389. X    int x;
  1390. X    int y;
  1391. X#endif
  1392. X{
  1393. X    /* Draw the digit in the window */
  1394. X    RenderShape(display, window, 
  1395. X        digitPixmaps[digit], digitPixmapsM[digit], x, y, 30, 40, True);
  1396. X}
  1397. X
  1398. X#if NeedFunctionPrototypes
  1399. Xvoid DrawOutNumber(Display *display, Window window, u_long score, int x, int y)
  1400. X#else
  1401. Xvoid DrawOutNumber(display, window, score, x, y)
  1402. X    Display *display;
  1403. X    Window window;
  1404. X    u_long score;
  1405. X    int x;
  1406. X    int y;
  1407. X#endif
  1408. X{
  1409. X    int digit;
  1410. X
  1411. X    /* Get the digit that we want from the score */
  1412. X    if (score / 10)
  1413. X        DrawOutNumber(display, window, (score / 10), x - 32, y);
  1414. X
  1415. X    /* Work out the digit needed to draw */
  1416. X    digit = (score % 10);
  1417. X
  1418. X    DrawDigit(display, window, digit, x - 32, y);
  1419. X}
  1420. X
  1421. X#if NeedFunctionPrototypes
  1422. Xvoid AddToScore(u_long inc)
  1423. X#else
  1424. Xvoid AddToScore(inc)
  1425. X    u_long inc;
  1426. X#endif
  1427. X{
  1428. X    /* Take into account any score bonuses */
  1429. X    if (x2Bonus == True)
  1430. X        inc *= 2;
  1431. X    else if (x4Bonus == True)
  1432. X        inc *= 4;
  1433. X
  1434. X    /* Increment the score */
  1435. X    score += inc;
  1436. X}
  1437. X
  1438. X#if NeedFunctionPrototypes
  1439. Xvoid DisplayScore(Display *display, Window window, u_long score)
  1440. X#else
  1441. Xvoid DisplayScore(display, window, score)
  1442. X    Display *display;
  1443. X    Window window;
  1444. X    u_long score;
  1445. X#endif
  1446. X{
  1447. X    /* Erase the old score in the window */
  1448. X    XClearWindow(display, window);
  1449. X
  1450. X    /* Draw a zero if no score */
  1451. X    if (score == 0L)
  1452. X        RenderShape(display, window, 
  1453. X            digitPixmaps[0], digitPixmapsM[0], 192, 0, 30, 40, True);
  1454. X    else
  1455. X        /* Draw the score digits rescursively */
  1456. X        DrawOutNumber(display, window, score, 224, 0);
  1457. X}
  1458. X
  1459. X#if NeedFunctionPrototypes
  1460. Xvoid FreeScoreDigits(Display *display)
  1461. X#else
  1462. Xvoid FreeScoreDigits(display)
  1463. X    Display *display;
  1464. X#endif
  1465. X{
  1466. X    int i;
  1467. X
  1468. X    /* Free the memory associated with the digit pixmaps */
  1469. X    for (i = 0; i < NUM_DIGITS; i++)
  1470. X    {
  1471. X        /* Free the digits pixmap and mask */
  1472. X        if (digitPixmaps[i])    XFreePixmap(display, digitPixmaps[i]);
  1473. X        if (digitPixmapsM[i])    XFreePixmap(display, digitPixmapsM[i]);
  1474. X    }
  1475. X}
  1476. X
  1477. END_OF_FILE
  1478.   if test 5321 -ne `wc -c <'score.c'`; then
  1479.     echo shar: \"'score.c'\" unpacked with wrong size!
  1480.   fi
  1481.   # end of 'score.c'
  1482. fi
  1483. if test -f 'sounds/ammo.au.uue' -a "${1}" != "-c" ; then 
  1484.   echo shar: Will not clobber existing file \"'sounds/ammo.au.uue'\"
  1485. else
  1486.   echo shar: Extracting \"'sounds/ammo.au.uue'\" \(2634 characters\)
  1487.   sed "s/^X//" >'sounds/ammo.au.uue' <<'END_OF_FILE'
  1488. Xbegin 664 ammo.au
  1489. XM+G-N9    "#_____     0  'T     !          "UM34U-34U-;6UM;6U
  1490. XMM34U-34U-;6UM;6UM34U-34U-;6UM;6UM34U-34U-4VUM;6UM;4U-34U-36U
  1491. XMM;6UM;4U-34U-36UM;6UM;4U-34V-C:VMK:VMK99-C8V-C:VMK:VMK8V-C8V
  1492. XM-C9 MK:VMK:V-C8V-C8VMK:VMK:V-C8V-C<WMK:VMK:V.#@X.#@XN+BXN+BX
  1493. XM.3DY.3HZ.KJZNKJZ.SL[.SL[N[N[O+R\O#P\/#P]/;V]O;V]O3X^/CX^/KZ^
  1494. XMOK^_OT! 0$! 0<'!P<'!P4%$1$1$1.O$Q,7%Q<5&1D9&2$C(R,C(R,](2DI*
  1495. XM2DK*RLK,S,Q-34U-34_/S\_/S\]/3T]/3T_/S\_/T=%34U-34U/_T='1T='1
  1496. XM4U=75U=7U]?7V]O;6UM;6UM;V]O;V]O;6UMC8V-CW]_?W]_?8V-C8V-CY^?G
  1497. XMY^?G:VMK:VMK____________M;4U-34U-34U-36UM;6UM;6UM34U-34U-34U
  1498. XM-;6UM;6UM;6U-34U-34U-34UM;6UM;6UM;6U-34U-34U-36UM;6UM;6UM;4U
  1499. XM-34U-34U-36UM;6UM;6UM34U-34U-34U-;6UM;6UM;6UM34U-34V-C8VMK:V
  1500. XMMK:VMK:V-C8V-C8V-C:VMK:VMK:VMK8V-C8V-C8V-C:VMK:VMK:VMC8V-C8V
  1501. XM-C8V-K:VMK:VMK:VMC8V-C8V-S<WMK:VMK:VMK:V.#@X.#@X.#@XN+BXN+BX
  1502. XMN+@Y.3DY.3DZ.CJZNKJZNKJZNCH[.SL[.SL[.[N[N[R\O+R\O#P\/#P\/#T]
  1503. XMO;V]O;V]O;V]/3X^/CX^/CX^OKZ^O[^_O[] 0$! 0$! 04'!P<'!P<'!P<%$
  1504. XM1$1$1$1$1,3$Q,3%Q<7%Q49&1D9&1D9(R,C(R,C(R,C(2$I*2DI*2DI*RLK*
  1505. XMRLS,S,Q-34U-34U-34_/S\_/S\_/ST]/3T]/3T]/3\_/S\_/T='1T5-34U-3
  1506. XM4U-34]'1T='1T='14U-75U=75U=7U]?7U]?;V]M;6UM;6UM;6UO;V]O;V]O;
  1507. XMV]M;6V-C8V-C8]_?W]_?W]_?WV-C8V-C8V-CY^?GY^?GY^?G:VMK:VMK:VMK
  1508. XMM34U-34U-;6UM;6UM34U-34U-;6UM;6UM44U-34U-36UM;6UM;4U-34U-36U
  1509. XMM;6UM;4U-34U-36UM;6UM;4U-34U-36UM;6UM;4U-34V-C:VMK:VMK99-C8V
  1510. XM-C8VMK:VMK:V-C8V-C8VMK:VMK:V-C8V-C8VMK:VMK:V-C8V-C<WMK:VMK:V
  1511. XM.#@X.#@XN+BXN+BX.3DY.3HZ.KJZNKJZNCL[.SL[.[N[O+R\O#P\/#P]/;V]
  1512. XMO;V]O3T^/CX^/KZ^OK^_OT% 0$! 04'!P<'!P4%$1$1$1.O$Q,7%Q<5&1D9&
  1513. XM1DC(R,C(R,A(2DI*2DK*RLK,S,Q-34U-34W/S\_/S\]93T]/3T]5S\_/T='1
  1514. XM4U-34U/_T='1T='14U=75U=7U]?7V]O;6UM;6UM;V]O;V]O;6UMC8V-CW]_?
  1515. XMW]_?=V-C8V-C8^?GY^?GYVMK:VMK:____________________^?W]W=WM;4U
  1516. XM-34U-34U-34U-36YM;6UM;6UM;6UM;4U-34U-34U-34U-37.M;6UM;6UM;6U
  1517. XMM;5'-34U-34U-34U-35+M:^[N[N[N[NOKZ^O.SLO+R\O+R\[.SMOKZ^[N[N[
  1518. XMN[NOKZ_$.SLO+R\O+R\S.SL[KZ^ON[N[N[N[KZ^O.SL[+R\O+R\O.SL[KZ^O
  1519. XMN[N[N[N[KZ^O.SL[+R\O,# P/#P\L+"PO+R\O+R\N;"P3#P\/# P,# P,#P\
  1520. XMM["PL+R\O+R[N["P[SP\/# P,# P,#L[P["PL+N[N[N[N[&Q3#L[.S$Q,3$Q
  1521. XM,3HZ8[&QL;&ZNKJZNKJRLCHZ.CHR,C(S,S,[Z[*SL[.ZNKJZNKJSMCL[.SLT
  1522. XM-34U-34X.[6UM;6UN[N[N[NVMCP\/#P[-S<W.#@X/+BXN+BXO+R\O+R[N$8\
  1523. XM/#P\.3DY.3DY/+FYN;FYO;V]O;V]O$@^/CX^/CL[.SP\/,:\O+R\O+Z^OKZ^
  1524. XMOL,_/S\_/ST]/CX^/M6^OKZ^OL# P,# P$M!04%!04! 0$!!04G!P<'!P<'!
  1525. XMP;JZS<TZ/#P\/#P\45%145&\O+S1T=/3T]/3T]E55555555553T^/C[9V=G9
  1526. XMV;Z^OKZ^OKY963\_/S\_/S\_75V_O[^_O[_ X^/CX^-'04%!9V=G9V=G9V]*
  1527. XM[^_O[^_O[^_#P\/O;V]O;V]#0T-#0T-G[\/#P\/#Q,3$Q/=O145%145%____
  1528. XM___CQ,3$]_?W]_?W]_=*___O[^_O[^]'1T=*;V]O;V_'Q\G)R<G)Y^=)24E)
  1529. XM24I*2N?GR<G)R<G)R6MK:VMG2DI*2]_?W]_?W]_?9V=G9V=G9V=GS<W-X^/C
  1530. XMX^-.3T]/3T]/8V/1T='1T='1T=%C5U-34U-55>/CX^/CV]O;VUM;6UM;6UM;
  1531. X"V]M.
  1532. Xend
  1533. END_OF_FILE
  1534.   if test 2634 -ne `wc -c <'sounds/ammo.au.uue'`; then
  1535.     echo shar: \"'sounds/ammo.au.uue'\" unpacked with wrong size!
  1536.   fi
  1537.   # end of 'sounds/ammo.au.uue'
  1538. fi
  1539. echo shar: End of archive 20 \(of 26\).
  1540. cp /dev/null ark20isdone
  1541. MISSING=""
  1542. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ; do
  1543.     if test ! -f ark${I}isdone ; then
  1544.     MISSING="${MISSING} ${I}"
  1545.     fi
  1546. done
  1547. if test "${MISSING}" = "" ; then
  1548.     echo You have unpacked all 26 archives.
  1549.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1550.     echo "merging split files..."
  1551.     cat blocks.c[12] > blocks.c
  1552.     rm blocks.c[12]
  1553.     echo "blocks.c done"
  1554.     cat bitmaps/earth.xpm.Z.u.[ab] > bitmaps/earth.xpm.Z.uue
  1555.     rm bitmaps/earth.xpm.Z.u.[ab]
  1556.     echo "bitmaps/earth.xpm.Z.uue done"
  1557. else
  1558.     echo You still must unpack the following archives:
  1559.     echo "        " ${MISSING}
  1560. fi
  1561. exit 0
  1562. exit 0 # Just in case...
  1563. -- 
  1564.   // chris@Sterling.COM           | Send comp.sources.x submissions to:
  1565. \X/  Amiga - The only way to fly! |    sources-x@sterling.com
  1566.  "It's intuitively obvious to the |
  1567.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1568.