Category : UNIX Files
Archive   : GTETRIS.ZIP
Filename : GTETRIS.SHR

 
Output of file : GTETRIS.SHR contained in archive : GTETRIS.ZIP
Path: aplcenmp!aplcen.apl.jhu.edu!darwin.sura.net!haven.umd.edu!uunet!news.tek.com!master!saab!billr
From: [email protected] (Bill Randle)
Newsgroups: comp.sources.games
Subject: v15i044: gtetris3 - Generic Tetris for X11, V2.0.1, Part01/02
Message-ID: <[email protected]>
Date: 15 Jan 93 01:32:08 GMT
Sender: [email protected]
Lines: 1951
Approved: [email protected]

Submitted-by: "Qiang Alex Zhao"
Posting-number: Volume 15, Issue 44
Archive-name: gtetris3/Part01
Supersedes: gtetris2: Volume 15, Issue 5-6
Environment: X11R4/5, Xlib

[This is major rewrite of the popular Generic Tetris game for X. -br]

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh # will see the following message at the end:
# "End of archive 1 (of 2)."
# Contents: README MANIFEST X11 bitmaps playing.c tetris.c tetris.h
# utils.c
# Wrapped by billr@saab on Wed Jan 13 19:41:27 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(4720 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X GENERIC TETRIS
X ============== Yet Another Tetris Game on X, V2.0.1
X
X
XWHY ANOTHER?
X
X Because this one is simple, easy to build, and portable -- actually
X the blocks are bigger, more comfortable for your eyes. It only uses
X Xlib -- no "toolkit" kind of thing. People have tested it on the
X following platforms:
X
X DEC 5000 Ultrix 4.2A X11R4
X Iris 4D IRIX 4.0.1 Motif
X Sun4, SPARCstation SunOS 4.1.1 X11R4, X11R5
X Sequent S81 DYNIX 3.2.0 X11R5
X
X If your's is not in this list, please let me know -- thanks. The
X most updated source could be found on export.lcs.mit.edu under
X /contrib.
X
X A System V port (Sequent Dynix/ptx) for earlier versions has been
X added by "Hans-Wolfgang Loidl" ([email protected]). The
X source can be retrieved by anonymous FTP to:
X Host: melmac.risc.uni-linz.ac.at
X File: /pub/misc/gtetris.tar.Z
X
X
XHOW TO BUILD?
X
X Edit the Imakefile for appropriate settings of variable SCOREFILE
X and RANDOM, then do:
X xmkmf
X make
X
X "Tetris" is the game. It only lists the top 15 players at the end,
X each player may has at most three scores. With the option "-s",
X "tetris" will list all the scores.
X
X
XANYTHING SPECIAL IN PLAYING?
X
X Use 'j' to move left; 'l' to move right; 'k' to rotate. Left-handed
X people may want to use 's', 'd', 'f' respectively. Use the space
X bar to drop a block quickly. Do you want to try the arrow keys?
X
X Use CTRL-L key combination to redraw -- in case the program messes
X somthing up.
X
X As usual, '+' and '-' will speed up or lower down the speed. Note
X that you don't need to press the SHIFT key -- '=' and '_' also
X work. The 'b' key can be used to toggle "beep" and 'n' toggles
X "show next".
X
X If you press 'p', the game will be paused, and the window will be
X iconified -- just in case your boss suddenly appears at your door.
X ;o) When the tetris window loses its focus, it also goes to
X "paused" mode except it doesn't iconify itself.
X
X Refer to the man page for detailed command line options.
X
X
XFOUND A BUG?
X
X Send bugs (or their reports, or fixes) to the author:
X
X Qiang Alex Zhao, [email protected]
X Computer Science Department
X University of Arizona
X Tucson, AZ 85721
X
X Refter to the "COPYRIGHT" notice in the "COPYRIGHT" file (yeah, as
X its name implies). And note: my first name is *NOT* spelled as
X "Quiang" nor "Quang".
X
X
XHISTORY -- Oh no, not again: I failed my history course!
XWell ... ACKNOWLEDGEMENTS
X
X Since the days of V1.8, I have got many responses over the net.
X Thanks go to people who helped me in improving the program.
X
X [Jan 12, 93] V2.0.1: added arrow keys. Changed error handling method
X in locking score file, suggested by Hellmut Golde
X .
X
X [Jan 10, 93] V2.0.0: Complete rewrite. Enhanced layout. Added
X resource management and "next piece". Changes made for
X Sony workstations, suggested by Masato Ogawa
X . Included four X11 header files
X in case some system doesn't have them. Fixed block
X clearing bug found by Benjamin Kroop
X .
X
X [Nov 13, 92] Black Friday -- V1.8.1: numerious minor changes. Made
X score listing built in.
X
X [Oct 08, 92] V1.8: Corrected some typos, .
X Added man-page. Gregg Townsend
X provided hints for some problems on HP-UX. Imakefile.
X Richard van Denzel suggest modifications for HP-UX.
X
X [Sep 30, 92] V1.7: Richard van Denzel
X reported bugs on HP-UX 8.0.
X
X [Sep 27, 92] V1.6: Changed speed coefficients. Improved window
X manager hints. Several rows at once worth more points.
X
X [Sep 25, 92] V1.5: HP-UX fixes by "Richard van Denzel"
X . Added 'b' to toggle
X "beep". Rewrote window creation/initialization to fix
X the "losing input focus" problem.
X
X [Sep 24, 92] V1.4: Added and -lbsd for AIX (by "Daryl
X Green" ).
X
X [Sep 23, 92] V1.3: Scoring -- a line in a higher level worth more
X points; "tscores" program. Submitted to
X comp.sources.games (volumn 15, issues 1-2; it has
X nothing to do with GNU, but it was called "gtetris",
X pronounced as "Gee, tetris", by the newsgroup
X moderator).
X
X [Sep ??, 92] First set of versions, 1.0 through 1.2 -- developed and
X tested at the University of Arizona. Put on
X export.lcs.mit.edu.
X
X I studied an old tetris game for X10, wrote by Wayne
X Christopher in 1988; then I
X adopted the ideas in representing those "blocks" and
X rotating them, and added X11 stuff. Also I learned a
X lot from Nathan Sidwell's great game "xmris", e.g. the
X "iconifying pause".
X
END_OF_FILE
if test 4720 -ne `wc -c <'README'`; then
echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'MANIFEST' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(1075 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X File Name Archive # Description
X-----------------------------------------------------------
X COPYRIGHT 2
X Imakefile 2
X MANIFEST 1 This shipping list
X README 1
X X11 1
X X11/Xfuncproto.h 2
X X11/Xfuncs.h 2
X X11/Xos.h 2
X X11/Xosdefs.h 2
X bitmaps 1
X bitmaps/rot00.xbm 2
X bitmaps/rot01.xbm 2
X bitmaps/rot02.xbm 2
X bitmaps/rot03.xbm 2
X bitmaps/rot04.xbm 2
X bitmaps/rot05.xbm 2
X bitmaps/rot06.xbm 2
X bitmaps/rot07.xbm 2
X bitmaps/rot08.xbm 2
X bitmaps/rot09.xbm 2
X bitmaps/rot10.xbm 2
X bitmaps/rot11.xbm 2
X bitmaps/rot12.xbm 2
X bitmaps/rot13.xbm 2
X bitmaps/rot14.xbm 2
X bitmaps/ticon.xbm 2
X playing.c 1
X tetris.c 1
X tetris.h 1
X tetris.man 2
X utils.c 1
END_OF_FILE
if test 1075 -ne `wc -c <'MANIFEST'`; then
echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test ! -d 'X11' ; then
echo shar: Creating directory \"'X11'\"
mkdir 'X11'
fi
if test ! -d 'bitmaps' ; then
echo shar: Creating directory \"'bitmaps'\"
mkdir 'bitmaps'
fi
if test -f 'playing.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'playing.c'\"
else
echo shar: Extracting \"'playing.c'\" \(9187 characters\)
sed "s/^X//" >'playing.c' <<'END_OF_FILE'
X/*
X# GENERIC X-WINDOW-BASED TETRIS
X#
X# playing.c
X#
X###
X#
X# Copyright (C) 1992, 1993 Qiang Alex Zhao, [email protected]
X# Computer Science Dept, University of Arizona
X#
X# All Rights Reserved
X#
X# Permission to use, copy, modify, and distribute this software and
X# its documentation for any purpose and without fee is hereby granted,
X# provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the author not be
X# used in advertising or publicity pertaining to distribution of the
X# software without specific, written prior permission.
X#
X# This program is distributed in the hope that it will be "playable",
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
X#
X*/
X
X#include "tetris.h"
X
Xstatic Bool paused = False;
X
Xstatic int speeds[NUM_LEVELS] = {
X 100, 92, 84, 76, 68, 60, 53, 46, 39, 32, 26, 20, 15, 10, 6, 3, 1, 0};
Xstatic int thresh[NUM_LEVELS] = {
X 10, 20, 30, 40, 50, 60, 70, 80, 90,
X 100, 110, 120, 130, 140, 150, 160, 170, 180};
X
Xstatic struct timeval nextFall, now, delay;
Xstatic struct timezone tzone = {0, 0};
X
X/* ------------------------------------------------------------------ */
X
Xvoid
Xplaying()
X{
X Bool resetTime = True;
X
X score = prefilled * level * 10;
X while (True) {
X if (resetTime) {
X (void) gettimeofday(&nextFall, &tzone);
X nextFall.tv_usec += 10000 * speeds[level];
X realTime(&nextFall);
X } else {
X int writefd = 0, exceptfd = 0;
X int readfd = 1 << ConnectionNumber(display);
X
X (void) gettimeofday(&now, &tzone);
X delay.tv_sec = nextFall.tv_sec - now.tv_sec;
X delay.tv_usec = nextFall.tv_usec - now.tv_usec;
X realTime(&delay);
X if (delay.tv_sec >= 0) { /* sleep */
X (void) select(sizeof(int) * 8, (fd_set *) &readfd,
X (fd_set *) & writefd, (fd_set *) & exceptfd, &delay);
X }
X }
X (void) gettimeofday(&now, &tzone);
X if ((now.tv_sec > nextFall.tv_sec) ||
X ((now.tv_sec == nextFall.tv_sec) &&
X (now.tv_usec > nextFall.tv_usec))) {
X (void) evGotNewThing(True);
X resetTime = True;
X } else {
X resetTime = evGotNewThing(False);
X }
X }
X /* never come to here */
X}
X
X/* ------------------------------------------------------------------ */
X
XBool
XevGotNewThing(falldown)
X Bool falldown;
X{
X XEvent ev;
X Bool gotNew = False;
X char buf[4];
X
X if (!paused && falldown)
X gotNew = moveOne(FALL) || gotNew;
X
X while (XPending(display)) {
X XNextEvent(display, &ev);
X switch (ev.type) {
X case KeyPress:
X if (!XLookupString(&ev.xkey, buf, 4, NULL, NULL))
X break;
X
X switch (buf[0]) {
X case 'j':
X case 's':
X if (!paused)
X gotNew = moveOne(LEFT) || gotNew;
X break;
X
X case 'k':
X case 'd':
X if (!paused)
X gotNew = moveOne(ROTATE) || gotNew;
X break;
X
X case 'l':
X case 'f':
X if (!paused)
X gotNew = moveOne(RIGHT) || gotNew;
X break;
X
X case ' ':
X case '\n':
X if (!paused)
X gotNew = moveOne(DROP) || gotNew;
X break;
X
X case 'q':
X case 'Q':
X gameOver();
X break;
X
X case '+':
X case '=':
X if (!paused)
X if (level < NUM_LEVELS - 1) {
X level++;
X drawStatus();
X }
X break;
X
X case '-':
X case '_':
X if (!paused)
X if (level > 0) {
X level--;
X drawStatus();
X }
X break;
X
X case 'b':
X case 'B':
X beep = !beep;
X if (beep)
X XBell(display, BVOLUME);
X break;
X
X case 'p':
X case 'P':
X if (beep)
X XBell(display, BVOLUME);
X paused = !paused;
X if (paused) {
X /* "... Hi boss, I'm working hard as usual ..." */
X banner(MSG_PAUSED);
X (void) XIconifyWindow(display, mainWin, screen_num);
X } else {
X clearNext();
X if (showNext)
X drawNext();
X }
X XSync(display, False);
X break;
X
X case '\014':
X XClearWindow(display, mainWin);
X XClearWindow(display, blockWin);
X redrawAll();
X if (paused)
X banner(MSG_PAUSED);
X XSync(display, False);
X break;
X
X case 'n':
X case 'N':
X if (!paused) {
X showNext = !showNext;
X if (showNext) {
X drawNext();
X } else {
X clearNext();
X }
X XSync(display, False);
X }
X break;
X
X default:
X XBell(display, 0);
X XSync(display, False);
X break;
X }
X
X break;
X
X case UnmapNotify:
X paused = True;
X break;
X
X case FocusOut:
X paused = True;
X banner(MSG_PAUSED);
X break;
X
X case Expose:
X if (ev.xexpose.count == 0) {
X redrawAll();
X if (paused)
X banner(MSG_PAUSED);
X }
X break;
X
X case ClientMessage:
X if ((Atom) ev.xclient.data.l[0] == delw)
X gameOver();
X break;
X
X case DestroyNotify:
X exit(0);
X break;
X }
X }
X
X XSync(display, False);
X return gotNew;
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XredrawAll()
X{
X drawTitle();
X drawStatus();
X drawField();
X drawThing();
X if (showNext)
X drawNext();
X}
X
X/* ------------------------------------------------------------------ */
X
XBool
XmoveOne(move)
X move_t move;
X{
X XEvent ev;
X int lines;
X
X if ((move == DROP) || ((move == FALL) && atBottom())) {
X tryMove(move);
X putBox();
X lines = checkLines();

X score += prefilled * prefilled + lines + 1;
X score += (showNext ? 3 : 5) * level * level * lines * lines;
X rows += lines;
X if (rows > thresh[level])
X level ++;
X drawStatus();
X newThing();
X if (showNext) {
X clearNext();
X drawNext();
X }
X XSync(display, False);
X while (XPending(display))
X XNextEvent(display, &ev);
X if (overlapping())
X gameOver();
X drawThing();
X return True;
X } else {
X tryMove(move);
X if (rows > thresh[level]) {
X level ++;
X drawStatus();
X }
X return False;
X }
X}
X
X/* ------------------------------------------------------------------ */
X
Xstatic void
XaddScore()
X{
X time_t tloc;
X char buff[2][SCORESIZE];
X char lockfile[FILENAMELEN];
X int fd, lfd;
X int tmp, ptmp, s1;
X int mycount = 0;
X Bool saved = False, trickle = False;
X
X time(&tloc);
X (void) strcpy(myscore.mydate, asctime(localtime(&tloc)));
X (void) sprintf(myscore.score, "%9d", score);
X (void) sprintf(myscore.level, "%3d", level);
X (void) sprintf(myscore.rows, "%4d", rows);
X
X (void) fprintf(stderr, "\n- %s", myscore.mydate);
X (void) fprintf(stderr, "- Your final score is %d,", score);
X (void) fprintf(stderr, " at level %d with %d rows.\n\n", level, rows);
X
X if ((fd = open(SCOREFILE, O_CREAT | O_RDWR, 0644)) < 0) {
X (void) fprintf(stderr, "Cannot write the score-file!\n");
X return;
X }
X
X /* lock */
X (void) strcpy(lockfile, SCOREFILE);
X (void) strcat(lockfile, ".lock");
X while (((lfd = open(lockfile, O_CREAT | O_EXCL, 0644)) < 0) &&
X errno == EEXIST)
X sleep(1);
X
X if (lfd < 0) {
X (void) perror("Error in creating the score-file lock-file");
X (void) fprintf(stderr, "Score not recorded - sorry.\n");
X return;
X }
X
X tmp = 0;
X ptmp = 1;
X bcopy((char *) &myscore, buff[1], SCORESIZE);
X
X while (read(fd, buff[tmp], SCORESIZE) == SCORESIZE) {
X sscanf(((score_t *)buff[tmp])->score, " %d", &s1);
X if (!saved && (s1 <= score)) {
X trickle = True;
X saved = True;
X mycount++;
X }
X if (!strncmp(myscore.myname, ((score_t *) buff[tmp])->myname,
X NAMELEN)) {
X mycount++;
X }
X /* Then check if we should trickle the score */
X if (trickle) {
X lseek(fd, (off_t) -SCORESIZE, SEEK_CUR);
X write(fd, buff[ptmp], SCORESIZE);
X ptmp = tmp;
X tmp = (tmp + 1) % 2;
X }
X /*
X * As we trickle, we add up records owned by me. Once we hit max,
X * we throw it away, and stop trickling.
X */
X if ((mycount > MAXSCORES) || ((mycount == MAXSCORES) && !trickle)) {
X trickle = False;
X break;
X }
X } /* while */
X
X if (trickle) {
X write(fd, buff[ptmp], SCORESIZE);
X }
X if (!saved && (mycount < MAXSCORES)) {
X write(fd, (char *) &myscore, SCORESIZE);
X }
X
X /* unlock */
X close(lfd);
X (void) unlink(lockfile);
X close(fd);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XgameOver()
X{
X banner(MSG_END);
X XFlush(display);
X addScore();
X showScores(SHOWSCORES);
X XCloseDisplay(display);
X exit(0);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XshowScores(num)
X int num;
X{
X int fd, i = 0;
X score_t curs;
X
X if ((fd = open(SCOREFILE, O_RDONLY, 0644)) < 0)
X return;
X
X (void) fprintf(stderr, " GENERIC TETRIS HALL OF FAME\n\n");
X (void) fprintf(stderr,
X " # USER SCORE L R HOST DATE\n");
X
X while (read(fd, (char *) &curs, SCORESIZE) == SCORESIZE) {
X i++;
X if ((num == 0) || (i <= num))
X (void) fprintf(stderr, "%4d %-12s%9s %3s %4s %-12s %-s",
X i, curs.myname, curs.score, curs.level, curs.rows,
X curs.myhost, curs.mydate);
X }
X close(fd);
X (void) fprintf(stderr, "There are %d scores to date.\n", i);
X}
X
X/* ------------------------------------------------------------------ */
END_OF_FILE
if test 9187 -ne `wc -c <'playing.c'`; then
echo shar: \"'playing.c'\" unpacked with wrong size!
fi
# end of 'playing.c'
fi
if test -f 'tetris.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tetris.c'\"
else
echo shar: Extracting \"'tetris.c'\" \(11770 characters\)
sed "s/^X//" >'tetris.c' <<'END_OF_FILE'
X/*
X# GENERIC X-WINDOW-BASED TETRIS
X#
X# tetris.c
X#
X###
X#
X# Copyright (C) 1992, 1993 Qiang Alex Zhao, [email protected]
X# Computer Science Dept, University of Arizona
X#
X# All Rights Reserved
X#
X# Permission to use, copy, modify, and distribute this software and
X# its documentation for any purpose and without fee is hereby granted,
X# provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the author not be
X# used in advertising or publicity pertaining to distribution of the
X# software without specific, written prior permission.
X#
X# This program is distributed in the hope that it will be "playable",
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
X#
X*/
X
X#include "tetris.h"
X
X/*** variables ***/
X
Xchar myDisplayName[256];
XDisplay *display;
Xint screen_num;
XVisual *visual;
XBool useColor = True;
XColormap colormap;
XWindow mainWin, blockWin;
XCursor theCursor;
XXFontStruct *bigFont, *tinyFont;
Xunsigned long fg, bg;
X
XXSizeHints sizehints = {
X PMinSize | PMaxSize | PPosition | PSize | USSize,
X 0, 0, /* x, y */
X 0, 0, /* w, h */
X 0, 0, /* min w, min h */
X 0, 0, /* max w, max h */
X 0, 0, /* inc, not set */
X 0, 0, 0, 0 /* aspect ratio, not set */
X};
XXSizeHints iconsizehints = {
X PPosition | PSize,
X 0, 0, /* x, y */
X 48, 48, /* w, h */
X 0, 0, /* min w, min h */
X 0, 0, /* max w, max h */
X 0, 0, /* inc, not set */
X 0, 0, 0, 0 /* aspect ratio, not set */
X};
XXWMHints wmhints = {
X InputHint | StateHint | IconPixmapHint,
X True, /* input mode */
X NormalState, /* normal */
X 0, /* icon pixmap */
X 0, /* icon window */
X 0, 0, /* icon position */
X 0 /* icon mask pixmap - not used */
X};
X
Xchar myHome[FILENAMELEN];
Xint level = 3, prefilled = 0, score = 0, rows = 0;
XBool showNext = False, beep = False;
Xscore_t myscore;
X
Xstatic int opTableEntries = 15;
Xstatic XrmOptionDescRec opTable[] = {
X {"-s", ".scoresOnly", XrmoptionIsArg, (caddr_t) NULL},
X {"-l", "*startLevel", XrmoptionSepArg, (caddr_t) NULL},
X {"-p", "*preFilledLines", XrmoptionSepArg, (caddr_t) NULL},
X {"-showNext", "*showNext", XrmoptionNoArg, (caddr_t) "on"},
X {"-beep", "*beep", XrmoptionNoArg, (caddr_t) "on"},
X {"-display", ".display", XrmoptionSepArg, (caddr_t) NULL},
X {"-geometry", "*geometry", XrmoptionSepArg, (caddr_t) NULL},
X {"-iconGeometry", "*iconGeometry", XrmoptionSepArg, (caddr_t) NULL},
X {"-background", "*background", XrmoptionSepArg, (caddr_t) NULL},
X {"-bg", "*background", XrmoptionSepArg, (caddr_t) NULL},
X {"-foreground", "*foreground", XrmoptionSepArg, (caddr_t) NULL},
X {"-fg", "*foreground", XrmoptionSepArg, (caddr_t) NULL},
X {"-bigFont", "*bigFont", XrmoptionSepArg, (caddr_t) NULL},
X {"-tinyFont", "*tinyFont", XrmoptionSepArg, (caddr_t) NULL},
X {"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL}
X};
Xstatic XrmDatabase cmmDB = (XrmDatabase) NULL, rDB = (XrmDatabase) NULL;
X
Xstatic void parseOpenDisp();
Xstatic void Usage();
Xstatic void getDefaults();
X
X/* ------------------------------------------------------------------ */
X
Xvoid
Xmain(argc, argv)
X int argc;
X char *argv[];
X{
X (void) fprintf(stderr,
X " GENERIC TETRIS V2.0.1\n");
X (void) fprintf(stderr,
X "Copyright (C) 1992-93 Q. Alex Zhao, [email protected]\n");
X (void) fprintf(stderr,
X " Computer Science Dept, University of Arizona\n\n");
X (void) fprintf(stderr,
X "GENERIC TETRIS comes with ABSOLUTELY NO WARRANTY.\n\n");
X
X parseOpenDisp(&argc, argv);
X getDefaults();
X inits(argc, argv);
X playing();
X /* never come to here */
X}
X
X/* ------------------------------------------------------------------ */
X
Xstatic void
XparseOpenDisp(argc, argv)
X int *argc;
X char *argv[];
X{
X struct passwd *pw;
X XrmValue value;
X char *str_type[20];
X XVisualInfo vtmp, *vinfo;
X int n = 1;
X
X XrmInitialize();
X
X myDisplayName[0] = '\0';
X
X XrmParseCommand(&cmmDB, opTable, opTableEntries, argv[0], argc, argv);
X
X /* check for any arguments left */
X if (*argc != 1) {
X Usage(argv[0]);
X }
X /* only print out the scores? */
X if (XrmGetResource(cmmDB, "tetris.scoresOnly", "Tetris.ScoresOnly",
X str_type, &value) == True) {
X showScores(0);
X exit(0);
X }
X /* get display now */
X if (XrmGetResource(cmmDB, "tetris.display", "Tetris.Display",
X str_type, &value) == True)
X (void) strncpy(myDisplayName, value.addr, (int) value.size);
X
X if (!(display = XOpenDisplay(myDisplayName))) {
X (void) fprintf(stderr, "%s: Can't open display '%s'\n",
X argv[0], XDisplayName(myDisplayName));
X exit(1);
X }
X screen_num = DefaultScreen(display);
X visual = DefaultVisual(display, screen_num);
X colormap = DefaultColormap(display, screen_num);
X vtmp.visualid = XVisualIDFromVisual(visual);
X if ((vinfo = XGetVisualInfo(display, VisualIDMask, &vtmp, &n)) != NULL) {
X if ((vinfo->class == GrayScale) || (vinfo->class == StaticGray)) {
X useColor = False;
X }
X XFree((unsigned char *) vinfo);
X } else {
X useColor = False;
X }
X
X /* setup user information */
X (void) gethostname(myscore.myhost, NAMELEN);
X setpwent();
X pw = getpwuid(getuid());
X endpwent();
X if (pw == NULL) { /* impossible? */
X (void) sprintf(myscore.myname, "%d", getuid());
X myHome[0] = '.';
X myHome[1] = '/';
X myHome[2] = '\0';
X } else {
X (void) strncpy(myscore.myname, pw->pw_name, NAMELEN);
X (void) strncpy(myHome, pw->pw_dir, FILENAMELEN);
X }
X myscore.myname[NAMELEN - 1] = '\0';
X myscore.myhost[NAMELEN - 1] = '\0';
X myHome[FILENAMELEN - 1] = '\0';
X}
X
X/* ------------------------------------------------------------------ */
X
Xstatic void
XUsage(argv0)
X char *argv0;
X{
X (void) fprintf(stderr,
X "Usage: %s [-s] [-l ] [-p ]\n", argv0);
X (void) fprintf(stderr,
X " [-display ] [-geometry ] [-iconGeometry\n");
X (void) fprintf(stderr,
X " ] [-fg ] [-bg ]\n");
X (void) fprintf(stderr,
X " [-bigFont ] [-tinyFont ] [-showNext] [-beep]\n");
X (void) fprintf(stderr,
X " [-xrm ]\n");
X
X exit(1);
X}
X
X/* ------------------------------------------------------------------ */
X
Xstatic void
XgetDefaults()
X{
X XrmDatabase homeDB, serverDB, appDB;
X char filenamebuf[FILENAMELEN];
X char *filename = &filenamebuf[0];
X char *env;
X char *classname = "Tetris";
X char name[255], geoStr[20], icongeoStr[20];
X XrmValue value;
X char *str_type[20];
X int x, y;
X unsigned int w, h;
X long flags;
X
X (void) strcpy(name, "/usr/lib/X11/app-defaults/");
X (void) strcat(name, classname);
X
X /* Get application defaults file, if any */
X appDB = XrmGetFileDatabase(name);
X (void) XrmMergeDatabases(appDB, &rDB);
X
X if (XResourceManagerString(display) != NULL) {
X serverDB = XrmGetStringDatabase(XResourceManagerString(display));
X } else {
X (void) strcpy(filename, myHome);
X (void) strcat(filename, "/.Xdefaults");
X serverDB = XrmGetFileDatabase(filename);
X }
X XrmMergeDatabases(serverDB, &rDB);
X
X if ((env = getenv("XENVIRONMENT")) == NULL) {
X int len;
X
X env = &filenamebuf[0];
X (void) strcpy(env, myHome);
X len = strlen(env);
X (void) gethostname(env + len, FILENAMELEN - len);
X }
X homeDB = XrmGetFileDatabase(env);
X XrmMergeDatabases(homeDB, &rDB);
X
X XrmMergeDatabases(cmmDB, &rDB);
X
X /* starting levels */
X
X if (XrmGetResource(cmmDB, "tetris.startLevel", "Tetris.StartLevel",
X str_type, &value) == True) {
X if ((sscanf(value.addr, "%d", &level) <= 0) ||
X (level < 0) || (level >= NUM_LEVELS)) {
X (void) fprintf(stderr, "Tetris: Invalid level.\n");
X exit(1);
X }

X }
X
X /* prefilled lines */
X
X if (XrmGetResource(cmmDB, "tetris.preFilledLines", "Tetris.PreFilledLines",
X str_type, &value) == True) {
X if ((sscanf(value.addr, "%d", &prefilled) <= 0) ||
X (prefilled < 0) || (prefilled >= ROWS - THINGSIZE)) {
X (void) fprintf(stderr, "Tetris: Invalid prefilled lines.\n");
X exit(1);
X }
X }
X
X /* show next */
X
X if (XrmGetResource(cmmDB, "tetris.showNext", "Tetris.ShowNext",
X str_type, &value) == True) {
X showNext = True;
X }
X
X /* beep */
X
X if (XrmGetResource(cmmDB, "tetris.beep", "Tetris.Beep",
X str_type, &value) == True) {
X beep = True;
X }
X
X /*** get foreground/background colors ***/
X
X if (XrmGetResource(rDB, "tetris.foreground", "Tetris.Foreground",
X str_type, &value) == True) {
X (void) strncpy(name, value.addr, (int) value.size);
X fg = getColor(name);
X } else
X fg = BlackPixel(display, screen_num);
X
X if (XrmGetResource(rDB, "tetris.background", "Tetris.Background",
X str_type, &value) == True) {
X (void) strncpy(name, value.addr, (int) value.size);
X bg = getColor(name);
X } else
X bg = WhitePixel(display, screen_num);
X
X if (bg == fg) {
X bg = WhitePixel(display, screen_num);
X fg = BlackPixel(display, screen_num);
X }
X
X /*** get geometry info ***/
X
X if (XrmGetResource(rDB, "tetris.geometry", "Tetris.Geometry",
X str_type, &value) == True) {
X (void) strncpy(geoStr, value.addr, (int) value.size);
X } else {
X geoStr[0] = '\0';
X }
X
X flags = XParseGeometry(geoStr, &x, &y, &w, &h);
X if ((WidthValue | HeightValue) & flags)
X Usage("tetris");
X
X if (XValue & flags) {
X if (XNegative & flags)
X x = DisplayWidth(display, screen_num) + x - sizehints.width;
X sizehints.x = x;
X }
X if (YValue & flags) {
X if (YNegative & flags)
X y = DisplayHeight(display, screen_num) + y - sizehints.height;
X sizehints.y = y;
X }
X
X /*** get icon geometry info ***/
X
X if (XrmGetResource(rDB, "tetris.iconGeometry", "Tetris.IconGeometry",
X str_type, &value) == True) {
X (void) strncpy(icongeoStr, value.addr, (int) value.size);
X } else {
X icongeoStr[0] = '\0';
X }
X
X flags = XParseGeometry(icongeoStr, &x, &y, &w, &h);
X if ((WidthValue | HeightValue) & flags)
X Usage("tetris");
X
X if (XValue & flags) {
X if (XNegative & flags)
X x = DisplayWidth(display, screen_num) + x - iconsizehints.width;
X wmhints.flags |= IconPositionHint;
X wmhints.icon_x = x;
X iconsizehints.x = x;
X }
X if (YValue & flags) {
X if (YNegative & flags)
X y = DisplayHeight(display, screen_num) + y - iconsizehints.height;
X wmhints.flags |= IconPositionHint;
X wmhints.icon_y = y;
X iconsizehints.y = y;
X }
X
X /*** get fonts ***/
X
X if (XrmGetResource(rDB, "tetris.bigFont", "tetris.BigFont",
X str_type, &value) == True) {
X (void) strncpy(name, value.addr, (int) value.size);
X } else {
X (void) strcpy(name, BIGFONT);
X }
X if ((bigFont = XLoadQueryFont(display, name)) == NULL) {
X (void) fprintf(stderr, "Tetris: can't open font '%s'.\n", name);
X exit(1);
X }
X if (XrmGetResource(rDB, "tetris.tinyFont", "tetris.TinyFont",
X str_type, &value) == True) {
X (void) strncpy(name, value.addr, (int) value.size);
X } else {
X (void) strcpy(name, TINYFONT);
X }
X if ((tinyFont = XLoadQueryFont(display, name)) == NULL) {
X (void) fprintf(stderr, "Tetris: can't open font '%s'.\n", name);
X exit(1);
X }
X
X /*
X * clean up
X */
X XrmDestroyDatabase(rDB);
X}
X
X/* ------------------------------------------------------------------ */
END_OF_FILE
if test 11770 -ne `wc -c <'tetris.c'`; then
echo shar: \"'tetris.c'\" unpacked with wrong size!
fi
# end of 'tetris.c'
fi
if test -f 'tetris.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tetris.h'\"
else
echo shar: Extracting \"'tetris.h'\" \(4561 characters\)
sed "s/^X//" >'tetris.h' <<'END_OF_FILE'
X/*
X# GENERIC X-WINDOW-BASED TETRIS
X#
X# tetris.h
X#
X###
X#
X# Copyright (C) 1992, 1993 Qiang Alex Zhao, [email protected]
X# Computer Science Dept, University of Arizona
X#
X# All Rights Reserved
X#
X# Permission to use, copy, modify, and distribute this software and
X# its documentation for any purpose and without fee is hereby granted,
X# provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the author not be
X# used in advertising or publicity pertaining to distribution of the
X# software without specific, written prior permission.
X#
X# This program is distributed in the hope that it will be "playable",
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
X#
X*/
X
X/*** Common headers ***/
X
X#include

X#include
X#include
X#include
X
X#include
X#include
X#include
X#include
X#include
X#include
X#include
X#include
X
X#ifndef X_NOT_STDC_ENV
X#include
X#else
Xextern char *getenv(
X#if NeedFunctionPrototypes
X char *
X#endif
X);
X#endif
X
X#ifdef X_NOT_POSIX
Xextern int getuid(
X#if NeedFunctionPrototypes
X void
X#endif
X);
Xextern struct passwd *getpwuid(
X#if NeedFunctionPrototypes
X int
X#endif
X);
X#endif
X
X#ifdef _AIX
X#include
X#endif
X
X/*** for lseek ***/
X
X#ifndef SEEK_SET
X#define SEEK_SET L_SET
X#endif
X
X#ifndef SEEK_CUR
X#define SEEK_CUR L_INCR
X#endif
X
X#ifndef SEEK_END
X#define SEEK_END L_XTND
X#endif
X
X/*** random generator ***/
X
X#if defined(HAS_48) /* Use lrand48() and srand48() */
X#define LRAND() lrand48()
X#define SRAND(X) srand48((long) (X))
Xextern long lrand48(
X#if NeedFunctionPrototypes
X void
X#endif
X);
X
X#else
X#if defined(HAS_RANDOM) /* Use random() and srandom() */
X
X#define LRAND() random()
X#define SRAND(X) srandom((unsigned int) (X))
Xextern long random(
X#if NeedFunctionPrototypes
X void
X#endif
X);
X
X#else /* Use rand() and srand() */
X
X#define LRAND() ((long) rand())
X#define SRAND(X) srand(X)
X
X#endif
X#endif
X
X/*** constants ***/
X
X#ifndef SCOREFILE
X#define SCOREFILE "/usr/games/lib/tetris.scores"
X#endif
X
X#define BIGFONT "12x24"
X#define TINYFONT "6x12"
X#define BVOLUME -90
X#define NUM_FLASHES 16
X
X#define MILLION 1000000
X#define MAXSCORES 3
X#define SHOWSCORES 15
X#define NAMELEN 12
X#define FILENAMELEN 1024
X
X#define MSG_PAUSED "PAUSED"
X#define MSG_END "GAME OVER"
X#define MSG_TITLE "TETRIS"
X#define MSG_AUTHOR "by Qiang Alex Zhao"
X
X#define NUM_LEVELS 18
X#define ROWS 20
X#define COLS 10
X
X#define BOXSIZE 30
X#define OFFSET 20
X#define THINGSIZE 4
X#define NUM_THINGS 7
X#define NUM_BITMAPS 15
X
X/*** types ***/
X
Xtypedef enum {FALL, DROP, ROTATE, LEFT, RIGHT} move_t;
X
Xtypedef struct {
X char myname[NAMELEN], myhost[NAMELEN], mydate[27];
X char score[10];
X char level[4];
X char rows[5];
X} score_t;
X#define SCORESIZE sizeof(score_t)
X
Xtypedef struct {
X int map[THINGSIZE][THINGSIZE];
X int xpos, ypos;
X int size, px, py;
X} thing_t;
X
X/*** variables defined in "tetris.c" ***/
X
Xextern Display *display;
Xextern int screen_num;
Xextern Visual *visual;
Xextern Bool useColor;
Xextern Colormap colormap;
Xextern Window mainWin, blockWin;
Xextern Cursor theCursor;
Xextern XFontStruct *bigFont, *tinyFont;
Xextern unsigned long fg, bg;
X
Xextern XSizeHints sizehints, iconsizehints;
Xextern XWMHints wmhints;
X
Xextern char myHome[FILENAMELEN];
Xextern int level, prefilled, score, rows;
Xextern Bool showNext, beep;
Xextern score_t myscore;
X
X/*** variables defined in "utils.c" ***/
X
Xextern Atom delw;
X
X/*** variables defined in "playing.c" ***/
X
X/*** functions ***/
X
Xextern unsigned long getColor();
Xextern void showScores();
Xextern void inits();
Xextern void playing();
Xextern void realTime();
Xextern void newThing();
Xextern Bool evGotNewThing();
Xextern void redrawAll();
Xextern void drawTitle();
Xextern void drawStatus();
Xextern void drawField();
Xextern void drawThing();
Xextern void drawThingDiff();
Xextern void drawNext();
Xextern void gameOver();
Xextern void banner();
Xextern void clearNext();
Xextern void putBox();
Xextern void tryMove();
Xextern Bool atBottom();
Xextern Bool overlapping();
Xextern int checkLines();
X
END_OF_FILE
if test 4561 -ne `wc -c <'tetris.h'`; then
echo shar: \"'tetris.h'\" unpacked with wrong size!
fi
# end of 'tetris.h'
fi
if test -f 'utils.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'utils.c'\"
else
echo shar: Extracting \"'utils.c'\" \(18011 characters\)
sed "s/^X//" >'utils.c' <<'END_OF_FILE'
X/*
X# GENERIC X-WINDOW-BASED TETRIS
X#
X# utils.c
X#
X###
X#
X# Copyright (C) 1992, 1993 Qiang Alex Zhao, [email protected]
X# Computer Science Dept, University of Arizona
X#
X# All Rights Reserved
X#
X# Permission to use, copy, modify, and distribute this software and
X# its documentation for any purpose and without fee is hereby granted,
X# provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the author not be
X# used in advertising or publicity pertaining to distribution of the
X# software without specific, written prior permission.
X#
X# This program is distributed in the hope that it will be "playable",
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
X#
X*/
X
X#include "tetris.h"
X
X#include "bitmaps/ticon.xbm"
X#include "bitmaps/rot00.xbm"
X#include "bitmaps/rot01.xbm"
X#include "bitmaps/rot02.xbm"
X#include "bitmaps/rot03.xbm"
X#include "bitmaps/rot04.xbm"
X#include "bitmaps/rot05.xbm"
X#include "bitmaps/rot06.xbm"
X#include "bitmaps/rot07.xbm"
X#include "bitmaps/rot08.xbm"
X#include "bitmaps/rot09.xbm"
X#include "bitmaps/rot10.xbm"
X#include "bitmaps/rot11.xbm"
X#include "bitmaps/rot12.xbm"
X#include "bitmaps/rot13.xbm"
X#include "bitmaps/rot14.xbm"
X
XAtom delw;
X
Xstatic GC revGC, bigGC, tinyGC, xorGC;
Xstatic GC thingGCs[NUM_THINGS];
X
Xstatic char *winName = "GENERIC TETRIS";
Xstatic char *iconName = "TETRIS";
X
Xstatic int titleLen, titleWidth, authorLen, authorWidth;
Xstatic int titleX, titleY, authorX, authorY;
Xstatic int sX;
Xstatic int sLevelY, sRowsY, sScoreY;
X
Xstatic int topRWidth, topWidth, topHeight, topMidX, topMidY;
Xstatic int frameX, frameY, frameW, frameH;
X
Xstatic char *bitmap_data[NUM_BITMAPS] = {
X rot00_bits, rot01_bits, rot02_bits, rot03_bits, rot04_bits, rot05_bits,
X rot06_bits, rot07_bits, rot08_bits, rot09_bits, rot10_bits, rot11_bits,
X rot12_bits, rot13_bits, rot14_bits
X};
X
Xstatic thing_t possible[][4] = {
X {
X {{{0, 0, 0, 0}, {4, 5, 5, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 4, 0, 0},
X {{{0, 2, 0, 0}, {0, 10, 0, 0}, {0, 10, 0, 0}, {0, 8, 0, 0}}, 0, 0, 4, 0, 1},
X {{{0, 0, 0, 0}, {4, 5, 5, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 4, 0, 2},
X {{{0, 2, 0, 0}, {0, 10, 0, 0}, {0, 10, 0, 0}, {0, 8, 0, 0}}, 0, 0, 4, 0, 3}
X },
X
X {
X {{{0, 2, 0, 0}, {0, 10, 0, 0}, {4, 9, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 1, 0},
X {{{2, 0, 0, 0}, {12, 5, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 1, 1},
X {{{6, 1, 0, 0}, {10, 0, 0, 0}, {8, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 1, 2},
X {{{4, 5, 3, 0}, {0, 0, 8, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 1, 3}
X },
X
X {
X {{{2, 0, 0, 0}, {10, 0, 0, 0}, {12, 1, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 2, 0},
X {{{6, 5, 1, 0}, {8, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 2, 1},
X {{{4, 3, 0, 0}, {0, 10, 0, 0}, {0, 8, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 2, 2},
X {{{0, 0, 2, 0}, {4, 5, 9, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 2, 3}
X },
X
X {
X {{{0, 2, 0, 0}, {4, 11, 0, 0}, {0, 8, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 3, 0},
X {{{0, 2, 0, 0}, {4, 13, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 3, 1},
X {{{2, 0, 0, 0}, {14, 1, 0, 0}, {8, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 3, 2},
X {{{4, 7, 1, 0}, {0, 8, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 3, 3}
X },
X
X {
X {{{2, 0, 0, 0}, {12, 3, 0, 0}, {0, 8, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 4, 0},
X {{{0, 6, 1, 0}, {4, 9, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 4, 1},
X {{{2, 0, 0, 0}, {12, 3, 0, 0}, {0, 8, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 4, 2},
X {{{0, 6, 1, 0}, {4, 9, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 4, 3}
X },
X
X {
X {{{0, 2, 0, 0}, {6, 9, 0, 0}, {8, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 5, 0},
X {{{4, 3, 0, 0}, {0, 12, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 5, 1},
X {{{0, 2, 0, 0}, {6, 9, 0, 0}, {8, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 5, 2},
X {{{4, 3, 0, 0}, {0, 12, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 3, 5, 3}
X },
X
X {
X {{{6, 3, 0, 0}, {12, 9, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 2, 6, 0},
X {{{6, 3, 0, 0}, {12, 9, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 2, 6, 1},
X {{{6, 3, 0, 0}, {12, 9, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 2, 6, 2},
X {{{6, 3, 0, 0}, {12, 9, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, 0, 0, 2, 6, 3}
X }
X};
X
Xstatic char *thingFGs[NUM_THINGS] = {
X "Magenta", "ForestGreen", "Blue", "Red", "DarkTurquoise", "Black", "Brown"
X};
X
Xstatic Pixmap pms[NUM_BITMAPS];
X
Xstatic thing_t curThing, nextThing;
Xstatic struct {
X int pm_num, cid;
X} field[ROWS][COLS];
X
X/* ------------------------------------------------------------------ */
X
Xstatic int
Xnrand(n)
X int n;
X{
X return (int) (LRAND() % n);
X}
X
X/* ------------------------------------------------------------------ */
X
Xunsigned long
XgetColor(name)
X char name[];
X{
X XColor tmp;
X
X if (!useColor) {
X return BlackPixel(display, screen_num);
X }
X if (XParseColor(display, colormap, name, &tmp) == 0) {
X (void) fprintf(stderr, "Tetris: invalid color '%s'.\n", name);
X return BlackPixel(display, screen_num);
X }
X if (XAllocColor(display, colormap, &tmp) == 0) {
X (void) fprintf(stderr, "Tetris: can't allocate color '%s'.\n", name);
X return BlackPixel(display, screen_num);
X }
X return tmp.pixel;
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
Xinits(argc, argv)
X int argc;
X char *argv[];
X{
X XSetWindowAttributes att;
X unsigned int attvm;
X XTextProperty wName, iName;
X XClassHint classhints;
X XEvent ev;
X XGCValues gcv;
X unsigned long gcvm;
X int i, j;
X
X SRAND(time(NULL));
X for (i = 0; i < COLS; i++)
X for (j = 0; j < ROWS; j++)
X if ((j >= ROWS - prefilled) && (nrand(2) == 0)) {
X field[j][i].pm_num = 0;
X field[j][i].cid = nrand(NUM_THINGS);
X } else {
X field[j][i].pm_num = -1;
X field[j][i].cid = 0;
X }
X
X titleLen = strlen(MSG_TITLE);
X titleWidth = XTextWidth(bigFont, MSG_TITLE, titleLen);
X authorLen = strlen(MSG_AUTHOR);
X authorWidth = XTextWidth(tinyFont, MSG_AUTHOR, authorLen);
X
X frameW = BOXSIZE * COLS;
X frameH = BOXSIZE * ROWS;
X topRWidth = BOXSIZE * THINGSIZE + OFFSET * 2;
X topHeight = frameH + OFFSET * 2 + 4;
X if (titleWidth > topRWidth)
X topRWidth = titleWidth;
X if (authorWidth > topRWidth)
X topRWidth = authorWidth;
X topMidX = frameW + OFFSET * 2 + 4;
X topMidY = topHeight / 2 + bigFont->ascent;
X topWidth = topMidX + topRWidth;
X frameX = frameY = OFFSET + 2;
X
X titleX = (topRWidth - titleWidth) / 2 + topMidX;
X titleY = OFFSET + 2 + bigFont->ascent;
X authorX = (topRWidth - authorWidth) / 2 + topMidX;
X authorY = OFFSET + 2 + bigFont->ascent + bigFont->descent + tinyFont->ascent;
X
X sX = topMidX + OFFSET;
X sScoreY = topHeight - OFFSET - 2 - tinyFont->descent;
X sRowsY = sScoreY - tinyFont->descent - tinyFont->ascent - 2;
X sLevelY = sRowsY - tinyFont->descent - tinyFont->ascent - 2;
X
X sizehints.width = (sizehints.min_width =
X (sizehints.max_width = topWidth));
X sizehints.height = (sizehints.min_height =
X (sizehints.max_height = topHeight));
X
X theCursor = XCreateFontCursor(display, XC_exchange);
X
X /* arrow keys */
X XRebindKeysym(display, XK_R10, NULL, 0,

X (unsigned char *) "j", sizeof(unsigned char));
X XRebindKeysym(display, XK_Left, NULL, 0,
X (unsigned char *) "j", sizeof(unsigned char));
X XRebindKeysym(display, XK_R11, NULL, 0,
X (unsigned char *) "k", sizeof(unsigned char));
X XRebindKeysym(display, XK_R12, NULL, 0,
X (unsigned char *) "l", sizeof(unsigned char));
X XRebindKeysym(display, XK_Right, NULL, 0,
X (unsigned char *) "l", sizeof(unsigned char));
X
X /* create windows */
X attvm = CWBackPixel | CWEventMask | CWDontPropagate | CWCursor;
X att.background_pixel = bg;
X att.event_mask = ExposureMask | KeyPressMask |
X StructureNotifyMask | FocusChangeMask;
X att.do_not_propagate_mask = KeyReleaseMask |
X ButtonPressMask | ButtonReleaseMask | PointerMotionMask |
X ButtonMotionMask | Button1MotionMask | Button2MotionMask |
X Button3MotionMask | Button4MotionMask | Button5MotionMask;
X att.cursor = theCursor;
X
X mainWin = XCreateWindow(display, DefaultRootWindow(display),
X sizehints.x, sizehints.y, topWidth, topHeight, 0,
X CopyFromParent, InputOutput, CopyFromParent, attvm, &att);
X
X attvm = CWBackPixel | CWBorderPixel | CWEventMask;
X att.border_pixel = fg;
X att.event_mask = ExposureMask;
X
X blockWin = XCreateWindow(display, mainWin,
X frameX-2, frameY-2, frameW, frameH, 2,
X CopyFromParent, InputOutput, CopyFromParent, attvm, &att);
X
X /* WM hints */
X XStringListToTextProperty(&winName, 1, &wName);
X XStringListToTextProperty(&iconName, 1, &iName);
X
X wmhints.icon_pixmap = XCreateBitmapFromData(display,
X mainWin, ticon_bits, ticon_width, ticon_height);
X classhints.res_name = "tetris";
X classhints.res_class = "Tetris";
X
X XSetWMProperties(display, mainWin, &wName, &iName,
X argv, argc, &sizehints, &wmhints, &classhints);
X
X delw = XInternAtom(display, "WM_DELETE_WINDOW", False);
X XSetWMProtocols(display, mainWin, &delw, 1);
X
X /* GC's */
X
X gcvm = GCForeground | GCBackground | GCFunction |
X GCFont | GCGraphicsExposures;
X
X gcv.function = GXcopy;
X gcv.foreground = fg;
X gcv.background = bg;
X gcv.font = bigFont->fid;
X gcv.graphics_exposures = False;
X bigGC = XCreateGC(display, mainWin, gcvm, &gcv);
X
X gcv.font = tinyFont->fid;
X tinyGC = XCreateGC(display, mainWin, gcvm, &gcv);
X
X gcv.foreground = bg;
X gcv.background = fg;
X revGC = XCreateGC(display, mainWin, gcvm, &gcv);
X
X gcv.background = bg;
X for (i = 0; i < NUM_THINGS; i++) {
X gcv.foreground = getColor(thingFGs[i]);
X if (gcv.foreground == bg)
X gcv.foreground = fg;
X thingGCs[i] = XCreateGC(display, blockWin, gcvm, &gcv);
X }
X
X gcv.foreground = fg;
X gcv.function = GXxor;
X xorGC = XCreateGC(display, blockWin, gcvm, &gcv);
X
X /* pixmaps */
X
X for (i = 0; i < NUM_BITMAPS; i++) {
X pms[i] = (Pixmap) XCreateBitmapFromData(display, blockWin,
X bitmap_data[i], BOXSIZE, BOXSIZE);
X }
X
X /* new things */
X newThing();
X newThing();
X
X /* the last thing is to wait for mapped */
X XMapWindow(display, blockWin);
X XMapRaised(display, mainWin);
X XNextEvent(display, &ev);
X sleep(1);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XnewThing()
X{
X curThing = nextThing;
X nextThing = possible[nrand(NUM_THINGS)][nrand(4)];
X nextThing.xpos = nrand(COLS - nextThing.size + 1);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XdrawTitle()
X{
X XDrawString(display, mainWin, bigGC,
X titleX, titleY, MSG_TITLE, titleLen);
X XDrawString(display, mainWin, tinyGC,
X authorX, authorY, MSG_AUTHOR, authorLen);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XdrawStatus()
X{
X char buf[30];
X
X (void) sprintf(buf, "Score: %d", score);
X XDrawImageString(display, mainWin, tinyGC, sX, sScoreY, buf, strlen(buf));
X
X (void) sprintf(buf, "Level: %d ", level);
X XDrawImageString(display, mainWin, tinyGC, sX, sLevelY, buf, strlen(buf));
X
X (void) sprintf(buf, "Rows: %d", rows);
X XDrawImageString(display, mainWin, tinyGC, sX, sRowsY, buf, strlen(buf));
X}
X
X/* ------------------------------------------------------------------ */
X
Xstatic void
XdrawBox(win, pmid, cid, x, y)
X Window win;
X int pmid, cid, x, y;
X{
X XCopyPlane(display, pms[pmid], win, thingGCs[cid], 0, 0,
X BOXSIZE, BOXSIZE, x, y, (unsigned long) 1);
X}
X
X/* ------------------------------------------------------------------ */
X
Xstatic void
XclearBox(x, y)
X int x, y;
X{
X XFillRectangle(display, blockWin, revGC, x, y, BOXSIZE, BOXSIZE);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XdrawField()
X{
X int i, j;
X
X for (i = 0; i < COLS; i++)
X for (j = 0; j < ROWS; j++)
X if (field[j][i].pm_num >= 0)
X drawBox(blockWin, field[j][i].pm_num, field[j][i].cid,
X i * BOXSIZE, j * BOXSIZE);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XdrawThing()
X{
X int i, j;
X
X for (i = 0; i < curThing.size; i++)
X for (j = 0; j < curThing.size; j++)
X if (curThing.map[j][i])
X drawBox(blockWin, curThing.map[j][i], curThing.px,
X (curThing.xpos + i) * BOXSIZE,
X (curThing.ypos + j) * BOXSIZE);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XdrawThingDiff(old)
X thing_t *old;
X{
X int i, j, ox, oy;
X
X for (i = 0; i < curThing.size; i++)
X for (j = 0; j < curThing.size; j++)
X if (curThing.map[j][i])
X drawBox(blockWin, curThing.map[j][i], curThing.px,
X (curThing.xpos + i) * BOXSIZE,
X (curThing.ypos + j) * BOXSIZE);
X
X for (i = 0; i < curThing.size; i++)
X for (j = 0; j < curThing.size; j++) {
X ox = old->xpos + i - curThing.xpos;
X oy = old->ypos + j - curThing.ypos;
X if (old->map[j][i] &&
X ((ox < 0) || (ox >= curThing.size) ||
X (oy < 0) || (oy >= curThing.size) ||
X !curThing.map[oy][ox]))
X clearBox((old->xpos + i) * BOXSIZE, (old->ypos + j) * BOXSIZE);
X }
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XdrawNext()
X{
X int x, y;
X int i, j;
X
X x = topMidX + (topRWidth - nextThing.size * BOXSIZE) / 2;
X y = topMidY - nextThing.size * BOXSIZE / 2;
X for (i = 0; i < nextThing.size; i++)
X for (j = 0; j < nextThing.size; j++)
X if (nextThing.map[j][i])
X drawBox(mainWin, nextThing.map[j][i], nextThing.px,
X x + i * BOXSIZE, y + j * BOXSIZE);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XclearNext()
X{
X XFillRectangle(display, mainWin, revGC,
X topMidX, topMidY - BOXSIZE * 2, topRWidth, BOXSIZE * 4);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
Xbanner(msg)
X char msg[];
X{
X int mlen = strlen(msg);
X int w = XTextWidth(bigFont, msg, mlen);
X int x = (topRWidth - w)/2 + topMidX;
X
X XFillRectangle(display, mainWin, revGC,
X x - 60, topMidY - bigFont->ascent - 5,
X w + 120, bigFont->ascent + bigFont->descent + 10);
X XDrawString(display, mainWin, bigGC, x, topMidY, msg, mlen);
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XputBox()
X{
X int i, j;
X int x = curThing.xpos, y = curThing.ypos;
X
X for (i = 0; i < curThing.size; i++)
X for (j = 0; j < curThing.size; j++)
X if (curThing.map[j][i]) {
X field[y + j][x + i].pm_num = curThing.map[j][i];
X field[y + j][x + i].cid = curThing.px;
X }
X}
X
X/* ------------------------------------------------------------------ */
X
XBool
Xoverlapping()
X{
X int i, j;
X int x = curThing.xpos, y = curThing.ypos;
X
X for (i = 0; i < curThing.size; i++)
X for (j = 0; j < curThing.size; j++)
X if (curThing.map[j][i]) {
X if ((y + j >= ROWS) || (x + i < 0) || (x + i >= COLS))
X return True;
X if (field[y + j][x + i].pm_num >= 0)
X return True;
X }
X
X return False;
X}
X
X/* ------------------------------------------------------------------ */
X
XBool
XatBottom()
X{
X int i, j;
X int x = curThing.xpos, y = curThing.ypos;
X
X for (i = 0; i < curThing.size; i++)
X for (j = 0; j < curThing.size; j++)
X if (curThing.map[j][i]) {
X if ((y + j >= ROWS - 1) || (x + i < 0) || (x + i >= COLS))
X return True;
X if (field[y + j + 1][x + i].pm_num >= 0)
X return True;
X }
X
X return False;
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XtryMove(move)
X move_t move;
X{
X thing_t old;
X
X old = curThing;
X
X switch (move) {
X case FALL:
X curThing.ypos ++;
X break;
X
X case DROP:
X do {
X curThing.ypos ++;
X score += level + prefilled;
X } while (!overlapping());
X curThing.ypos --;
X break;
X
X case ROTATE:
X curThing = possible[old.px][(old.py + 3) % 4];
X curThing.xpos = old.xpos;
X curThing.ypos = old.ypos;
X break;
X
X case LEFT:
X curThing.xpos --;
X break;
X
X case RIGHT:
X curThing.xpos ++;
X break;
X }
X
X if (!overlapping())
X drawThingDiff(&old);
X else
X curThing = old;
X}
X
X/* ------------------------------------------------------------------ */
X
Xint
XcheckLines()
X{
X int lSet[ROWS], nset = 0;
X int i, j, y;
X
X for (j = 0; j < ROWS; j++) {
X lSet[j] = 0;
X for (i = 0; i < COLS; i++)
X if (field[j][i].pm_num >= 0)
X lSet[j] ++;
X if (lSet[j] == COLS)
X nset ++;
X }
X
X if (nset) {
X for (i = 0; i < ((NUM_FLASHES / nset) % 2) * 2; i ++) {
X for (j = 0; j < ROWS; j++) {
X if (lSet[j] == COLS)
X XFillRectangle(display, blockWin, xorGC,
X 0, j * BOXSIZE, frameW, BOXSIZE);
X }
X XFlush(display);
X }
X
X for (j = ROWS-1; j >= 0; j--) {
X if (lSet[j] == COLS) {
X for (y = j; y > 0; y--)
X for (i = 0; i < COLS; i++)
X field[y][i] = field[y-1][i];
X for (i = 0; i < COLS; i++)
X field[0][i].pm_num = -1;
X
X XCopyArea(display, blockWin, blockWin, tinyGC,
X 0, 0, frameW, j * BOXSIZE, 0, BOXSIZE);
X
X XFillRectangle(display, blockWin, revGC,
X 0, 0, frameW, BOXSIZE);
X
X for (i = j; i > 0; i--)
X lSet[i] = lSet[i-1];
X lSet[0] = 0;
X
X j++;
X XFlush(display);
X }
X }
X
X if (beep) XBell(display, BVOLUME);
X XSync(display, False);
X }
X
X return nset;
X}
X
X/* ------------------------------------------------------------------ */
X
Xvoid
XrealTime(tv)
X struct timeval *tv;
X{
X while (tv->tv_usec < 0) {
X tv->tv_sec --;
X tv->tv_usec += MILLION;
X }
X while (tv->tv_usec >= MILLION) {
X tv->tv_sec ++;
X tv->tv_usec -= MILLION;
X }
X}
X
X/* ------------------------------------------------------------------ */
END_OF_FILE
if test 18011 -ne `wc -c <'utils.c'`; then
echo shar: \"'utils.c'\" unpacked with wrong size!
fi
# end of 'utils.c'
fi
echo shar: End of archive 1 \(of 2\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked both archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0

Path: aplcenmp!aplcen.apl.jhu.edu!darwin.sura.net!haven.umd.edu!uunet!news.tek.com!master!saab!billr
From: [email protected] (Bill Randle)
Newsgroups: comp.sources.games
Subject: v15i045: gtetris3 - Generic Tetris for X11, V2.0.1, Part02/02
Message-ID: <[email protected]>
Date: 15 Jan 93 01:32:38 GMT
Sender: [email protected]
Lines: 1088
Approved: [email protected]

Submitted-by: "Qiang Alex Zhao"
Posting-number: Volume 15, Issue 45
Archive-name: gtetris3/Part02
Supersedes: gtetris2: Volume 15, Issue 5-6
Environment: X11R4/5, Xlib


#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh # will see the following message at the end:
# "End of archive 2 (of 2)."
# Contents: COPYRIGHT Imakefile X11/Xfuncproto.h X11/Xfuncs.h
# X11/Xos.h X11/Xosdefs.h bitmaps/rot00.xbm bitmaps/rot01.xbm
# bitmaps/rot02.xbm bitmaps/rot03.xbm bitmaps/rot04.xbm
# bitmaps/rot05.xbm bitmaps/rot06.xbm bitmaps/rot07.xbm
# bitmaps/rot08.xbm bitmaps/rot09.xbm bitmaps/rot10.xbm
# bitmaps/rot11.xbm bitmaps/rot12.xbm bitmaps/rot13.xbm
# bitmaps/rot14.xbm bitmaps/ticon.xbm tetris.man
# Wrapped by billr@saab on Wed Jan 13 19:41:27 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'COPYRIGHT' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'COPYRIGHT'\"
else
echo shar: Extracting \"'COPYRIGHT'\" \(851 characters\)
sed "s/^X//" >'COPYRIGHT' <<'END_OF_FILE'
X# GENERIC X-WINDOW-BASED TETRIS
X#
X# Copyright (C) 1992, 1993 Qiang Alex Zhao, [email protected]
X# Computer Science Dept, University of Arizona
X#
X# All Rights Reserved
X#
X# Permission to use, copy, modify, and distribute this software and
X# its documentation for any purpose and without fee is hereby granted,
X# provided that the above copyright notice appear in all copies and
X# that both that copyright notice and this permission notice appear in
X# supporting documentation, and that the name of the author not be
X# used in advertising or publicity pertaining to distribution of the
X# software without specific, written prior permission.
X#
X# This program is distributed in the hope that it will be "playable",
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
X#
X
END_OF_FILE
if test 851 -ne `wc -c <'COPYRIGHT'`; then
echo shar: \"'COPYRIGHT'\" unpacked with wrong size!
fi
# end of 'COPYRIGHT'
fi
if test -f 'Imakefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Imakefile'\"
else
echo shar: Extracting \"'Imakefile'\" \(1630 characters\)
sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
X/**/# GENERIC X-WINDOW-BASED TETRIS
X/**/#
X/**/# Imakefile
X/**/#
X/**/###
X/**/#
X/**/# Copyright (C) 1992, 1993 Qiang Alex Zhao, [email protected]
X/**/# Computer Science Dept, University of Arizona
X/**/#
X/**/# All Rights Reserved
X/**/#
X/**/# Permission to use, copy, modify, and distribute this software and
X/**/# its documentation for any purpose and without fee is hereby granted,
X/**/# provided that the above copyright notice appear in all copies and
X/**/# that both that copyright notice and this permission notice appear in
X/**/# supporting documentation, and that the name of the author not be
X/**/# used in advertising or publicity pertaining to distribution of the
X/**/# software without specific, written prior permission.
X/**/#
X/**/# This program is distributed in the hope that it will be "playable",
X/**/# but WITHOUT ANY WARRANTY; without even the implied warranty of
X/**/# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
X/**/#
X
X SCOREFILE = /r/cas/usr/azhao/pub/.tetris.scores
X
X/**/# Set "RANDOM" to:
X/**/# -DHAS_48 if has lrand48() and srand48()
X/**/# -DHAS_RANDOM if has random() and srandom()
X/**/# otherwise, set to empty
X RANDOM = -DHAS_48
X
X/**/##############################################################
X
X DEFINES = -DSCOREFILE=\"$(SCOREFILE)\" $(RANDOM)
X INCLUDES = -I.
XLOCAL_LIBRARIES = $(XLIB)
X SYS_LIBRARIES = -lm
X SRCS = tetris.c playing.c utils.c
X OBJS = tetris.o playing.o utils.o
X PROGRAMS = tetris tscores
X
XComplexProgramTarget(tetris)
X
Xtetris.o: tetris.c tetris.h
Xplaying.o: playing.c tetris.h
Xutils.o: utils.c tetris.h
X
END_OF_FILE
if test 1630 -ne `wc -c <'Imakefile'`; then
echo shar: \"'Imakefile'\" unpacked with wrong size!
fi
# end of 'Imakefile'
fi
if test -f 'X11/Xfuncproto.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'X11/Xfuncproto.h'\"
else
echo shar: Extracting \"'X11/Xfuncproto.h'\" \(2263 characters\)
sed "s/^X//" >'X11/Xfuncproto.h' <<'END_OF_FILE'
X/* $XConsortium: Xfuncproto.h,v 1.7 91/05/13 20:49:21 rws Exp $ */
X/*
X * Copyright 1989, 1991 by the Massachusetts Institute of Technology
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of M.I.T. not be used in advertising
X * or publicity pertaining to distribution of the software without specific,
X * written prior permission. M.I.T. makes no representations about the
X * suitability of this software for any purpose. It is provided "as is"
X * without express or implied warranty.
X *
X */
X
X/* Definitions to make function prototypes manageable */
X
X#ifndef _XFUNCPROTO_H_
X#define _XFUNCPROTO_H_
X
X#ifndef NeedFunctionPrototypes
X#if defined(FUNCPROTO) || __STDC__ || defined(__cplusplus) || defined(c_plusplus)
X#define NeedFunctionPrototypes 1
X#else
X#define NeedFunctionPrototypes 0
X#endif
X#endif /* NeedFunctionPrototypes */
X
X#ifndef NeedVarargsPrototypes
X#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&2)
X#define NeedVarargsPrototypes 1
X#else
X#define NeedVarargsPrototypes 0
X#endif
X#endif /* NeedVarargsPrototypes */
X
X#if NeedFunctionPrototypes
X
X#ifndef NeedNestedPrototypes
X#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&8)
X#define NeedNestedPrototypes 1
X#else
X#define NeedNestedPrototypes 0
X#endif
X#endif /* NeedNestedPrototypes */
X
X#ifndef _Xconst
X#if __STDC__ || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
X#define _Xconst const
X#else
X#define _Xconst
X#endif
X#endif /* _Xconst */
X
X#ifndef NeedWidePrototypes
X#ifdef NARROWPROTO
X#define NeedWidePrototypes 0
X#else
X#define NeedWidePrototypes 1 /* default to make interropt. easier */
X#endif
X#endif /* NeedWidePrototypes */
X
X#endif /* NeedFunctionPrototypes */
X
X#ifndef _XFUNCPROTOBEGIN
X#ifdef __cplusplus /* for C++ V2.0 */
X#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
X#define _XFUNCPROTOEND }
X#else
X#define _XFUNCPROTOBEGIN
X#define _XFUNCPROTOEND
X#endif
X#endif /* _XFUNCPROTOBEGIN */
X
X#endif /* _XFUNCPROTO_H_ */
END_OF_FILE
if test 2263 -ne `wc -c <'X11/Xfuncproto.h'`; then
echo shar: \"'X11/Xfuncproto.h'\" unpacked with wrong size!
fi
# end of 'X11/Xfuncproto.h'
fi
if test -f 'X11/Xfuncs.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'X11/Xfuncs.h'\"
else
echo shar: Extracting \"'X11/Xfuncs.h'\" \(1665 characters\)
sed "s/^X//" >'X11/Xfuncs.h' <<'END_OF_FILE'
X/*
X * $XConsortium: Xfuncs.h,v 1.8 91/04/17 09:27:52 rws Exp $
X *
X * Copyright 1990 by the Massachusetts Institute of Technology
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of M.I.T. not be used in advertising
X * or publicity pertaining to distribution of the software without specific,
X * written prior permission. M.I.T. makes no representations about the
X * suitability of this software for any purpose. It is provided "as is"
X * without express or implied warranty.
X *
X */
X
X#ifndef _XFUNCS_H_
X#define _XFUNCS_H_
X
X#include
X
X#ifdef X_USEBFUNCS
Xvoid bcopy();
Xvoid bzero();
Xint bcmp();
X#else
X#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII)) || defined(SVR4) || defined(hpux) || defined(_IBMR2)
X#include
X#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
X#define bzero(b,len) memset(b, 0, (size_t)(len))
X#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
X#else
X#ifdef sgi
X#include
X#else
X#ifdef SYSV
X#include
X#if defined(_XBCOPYFUNC) && !defined(macII)
X#define bcopy _XBCOPYFUNC
X#define _XNEEDBCOPYFUNC
X#endif
Xvoid bcopy();
X#define bzero(b,len) memset(b, 0, len)
X#define bcmp(b1,b2,len) memcmp(b1, b2, len)
X#else /* bsd */
Xvoid bcopy();
Xvoid bzero();
Xint bcmp();
X#endif /* SYSV */
X#endif /* sgi */
X#endif /* __STDC__ and relatives */
X#endif /* X_USEBFUNCS */
X
X#endif /* _XFUNCS_H_ */
END_OF_FILE
if test 1665 -ne `wc -c <'X11/Xfuncs.h'`; then
echo shar: \"'X11/Xfuncs.h'\" unpacked with wrong size!
fi
# end of 'X11/Xfuncs.h'
fi
if test -f 'X11/Xos.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'X11/Xos.h'\"
else
echo shar: Extracting \"'X11/Xos.h'\" \(3217 characters\)
sed "s/^X//" >'X11/Xos.h' <<'END_OF_FILE'
X/*
X * $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
X *
X * Copyright 1987 by the Massachusetts Institute of Technology
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted, provided
X * that the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of M.I.T. not be used in advertising
X * or publicity pertaining to distribution of the software without specific,
X * written prior permission. M.I.T. makes no representations about the
X * suitability of this software for any purpose. It is provided "as is"
X * without express or implied warranty.
X *
X * The X Window System is a Trademark of MIT.
X *
X */
X
X/* This is a collection of things to try and minimize system dependencies
X * in a "signficant" number of source files.
X */
X
X#ifndef _XOS_H_
X#define _XOS_H_
X
X#include
X
X/*
X * Get major data types (esp. caddr_t)
X */
X
X#ifdef USG
X#ifndef __TYPES__
X#ifdef CRAY
X#define word word_t
X#endif /* CRAY */
X#include /* forgot to protect it... */
X#define __TYPES__
X#endif /* __TYPES__ */
X#else /* USG */
X#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
X#undef _POSIX_SOURCE
X#include
X#define _POSIX_SOURCE
X#else
X#include
X#endif
X#endif /* USG */
X
X
X/*
X * Just about everyone needs the strings routines. We provide both forms here,
X * index/rindex and strchr/strrchr, so any systems that don't provide them all
X * need to have #defines here.
X */
X
X#ifndef X_NOT_STDC_ENV
X#include
X#define index strchr
X#define rindex strrchr
X#else
X#ifdef SYSV
X#include
X#define index strchr
X#define rindex strrchr
X#else
X#include
X#define strchr index
X#define strrchr rindex
X#endif
X#endif
X
X
X/*
X * Get open(2) constants
X */
X#ifdef X_NOT_POSIX
X#include
X#ifdef USL
X#include
X#endif /* USL */
X#ifdef CRAY
X#include
X#endif /* CRAY */
X#ifdef MOTOROLA
X#include
X#endif /* MOTOROLA */
X#ifdef SYSV386
X#include
X#endif /* SYSV386 */
X#include
X#else /* X_NOT_POSIX */
X#if !defined(_POSIX_SOURCE) && defined(macII)
X#define _POSIX_SOURCE
X#include
X#undef _POSIX_SOURCE
X#else
X#include
X#endif
X#include
X#endif /* X_NOT_POSIX else */
X
X/*
X * Get struct timeval
X */
X
X#ifdef SYSV
X
X#ifndef USL
X#include
X#endif
X#include
X#ifdef CRAY
X#undef word
X#endif /* CRAY */
X#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA)
Xstruct timeval {
X long tv_sec;
X long tv_usec;
X};
X#ifndef USL_SHARELIB
Xstruct timezone {
X int tz_minuteswest;
X int tz_dsttime;
X};
X#endif /* USL_SHARELIB */
X#endif /* USG */
X
X#else /* not SYSV */
X
X#if defined(_POSIX_SOURCE) && defined(SVR4)
X/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
X#undef _POSIX_SOURCE
X#include
X#define _POSIX_SOURCE
X#else
X#include
X#endif
X
X#endif /* SYSV */
X
X/* use POSIX name for signal */
X#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
X#define SIGCHLD SIGCLD
X#endif
X
X#ifdef ISC
X#include
X#endif
X
X#endif /* _XOS_H_ */
END_OF_FILE
if test 3217 -ne `wc -c <'X11/Xos.h'`; then
echo shar: \"'X11/Xos.h'\" unpacked with wrong size!
fi
# end of 'X11/Xos.h'
fi
if test -f 'X11/Xosdefs.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'X11/Xosdefs.h'\"
else
echo shar: Extracting \"'X11/Xosdefs.h'\" \(2394 characters\)
sed "s/^X//" >'X11/Xosdefs.h' <<'END_OF_FILE'
X/*
X * O/S-dependent (mis)feature macro definitions
X *
X * $XConsortium: Xosdefs.h,v 1.7 91/07/19 23:22:19 rws Exp $
X *
X * Copyright 1991 Massachusetts Institute of Technology
X *
X * Permission to use, copy, modify, distribute, and sell this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of M.I.T. not be used in advertising or
X * publicity pertaining to distribution of the software without specific,
X * written prior permission. M.I.T. makes no representations about the
X * suitability of this software for any purpose. It is provided "as is"
X * without express or implied warranty.
X *
X * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
X * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
X * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
X * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _XOSDEFS_H_
X#define _XOSDEFS_H_
X
X/*
X * X_NOT_STDC_ENV means does not have ANSI C header files. Lack of this
X * symbol does NOT mean that the system has stdarg.h.
X *
X * X_NOT_POSIX means does not have POSIX header files. Lack of this
X * symbol does NOT mean that the POSIX environment is the default.
X * You may still have to define _POSIX_SOURCE to get it.
X */
X
X#ifdef NOSTDHDRS
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X
X#ifdef sony
X#ifndef SYSTYPE_SYSV
X#define X_NOT_POSIX
X#endif
X#endif
X
X#ifdef UTEK
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X
X#ifdef CRAY
X#define X_NOT_POSIX
X#endif
X
X#ifdef vax
X#ifndef ultrix /* assume vanilla BSD */
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X#endif
X
X#ifdef luna
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X
X#ifdef Mips
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X
X#ifdef USL
X#ifdef SYSV /* (release 3.2) */
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X#endif
X
X#ifdef SYSV386
X#ifdef SYSV
X#define X_NOT_POSIX
X#define X_NOT_STDC_ENV
X#endif
X#endif
X
X#ifdef MOTOROLA
X#ifdef SYSV
X#define X_NOT_STDC_ENV
X#endif
X#endif
X
X#endif /* _XOSDEFS_H_ */
END_OF_FILE
if test 2394 -ne `wc -c <'X11/Xosdefs.h'`; then
echo shar: \"'X11/Xosdefs.h'\" unpacked with wrong size!
fi
# end of 'X11/Xosdefs.h'
fi
if test -f 'bitmaps/rot00.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot00.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot00.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot00.xbm' <<'END_OF_FILE'
X#define rot00_width 30
X#define rot00_height 30
Xstatic char rot00_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0x07,
X 0x5c, 0x55, 0x55, 0x0f, 0xae, 0xaa, 0xaa, 0x1e, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0x6a, 0xaa, 0x1a,
X 0x56, 0x95, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x5e, 0x55, 0x55, 0x1d, 0xbc, 0xaa, 0xaa, 0x0e,
X 0xf8, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot00.xbm'`; then
echo shar: \"'bitmaps/rot00.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot00.xbm'
fi
if test -f 'bitmaps/rot01.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot01.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot01.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot01.xbm' <<'END_OF_FILE'
X#define rot01_width 30
X#define rot01_height 30
Xstatic char rot01_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x07,
X 0x55, 0x55, 0x55, 0x0f, 0xaa, 0xaa, 0xaa, 0x1e, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0x6a, 0xaa, 0x1a,
X 0x55, 0x95, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x0e,
X 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot01.xbm'`; then
echo shar: \"'bitmaps/rot01.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot01.xbm'
fi
if test -f 'bitmaps/rot02.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot02.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot02.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot02.xbm' <<'END_OF_FILE'
X#define rot02_width 30
X#define rot02_height 30
Xstatic char rot02_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff, 0x07,
X 0x5c, 0x55, 0x55, 0x0f, 0xae, 0xaa, 0xaa, 0x1e, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0x6a, 0xaa, 0x1a,
X 0x56, 0x95, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot02.xbm'`; then
echo shar: \"'bitmaps/rot02.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot02.xbm'
fi
if test -f 'bitmaps/rot03.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot03.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot03.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot03.xbm' <<'END_OF_FILE'
X#define rot03_width 30
X#define rot03_height 30
Xstatic char rot03_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x07,
X 0x55, 0x55, 0x55, 0x0f, 0xaa, 0xaa, 0xaa, 0x1e, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0x6a, 0xaa, 0x1a,
X 0x55, 0x95, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x57, 0x55, 0x55, 0x1d, 0xaf, 0xaa, 0xaa, 0x1a, 0x57, 0x55, 0x55, 0x1d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot03.xbm'`; then
echo shar: \"'bitmaps/rot03.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot03.xbm'
fi
if test -f 'bitmaps/rot04.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot04.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot04.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot04.xbm' <<'END_OF_FILE'
X#define rot04_width 30
X#define rot04_height 30
Xstatic char rot04_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x3f,
X 0x5c, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0x6a, 0xaa, 0x2a,
X 0x56, 0x95, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x5e, 0x55, 0x55, 0x15, 0xbc, 0xaa, 0xaa, 0x2a,
X 0xf8, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot04.xbm'`; then
echo shar: \"'bitmaps/rot04.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot04.xbm'
fi
if test -f 'bitmaps/rot05.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot05.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot05.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot05.xbm' <<'END_OF_FILE'
X#define rot05_width 30
X#define rot05_height 30
Xstatic char rot05_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0x6a, 0xaa, 0x2a,
X 0x55, 0x95, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot05.xbm'`; then
echo shar: \"'bitmaps/rot05.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot05.xbm'
fi
if test -f 'bitmaps/rot06.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot06.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot06.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot06.xbm' <<'END_OF_FILE'
X#define rot06_width 30
X#define rot06_height 30
Xstatic char rot06_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x3f,
X 0x5c, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0x6a, 0xaa, 0x2a,
X 0x56, 0x95, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x3d, 0xae, 0xaa, 0xaa, 0x3a, 0x56, 0x55, 0x55, 0x3d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot06.xbm'`; then
echo shar: \"'bitmaps/rot06.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot06.xbm'
fi
if test -f 'bitmaps/rot07.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot07.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot07.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot07.xbm' <<'END_OF_FILE'
X#define rot07_width 30
X#define rot07_height 30
Xstatic char rot07_bits[] = {
X 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0x6a, 0xaa, 0x2a,
X 0x55, 0x95, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x57, 0x55, 0x55, 0x3d, 0xaf, 0xaa, 0xaa, 0x3a, 0x57, 0x55, 0x55, 0x3d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot07.xbm'`; then
echo shar: \"'bitmaps/rot07.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot07.xbm'
fi
if test -f 'bitmaps/rot08.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot08.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot08.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot08.xbm' <<'END_OF_FILE'
X#define rot08_width 30
X#define rot08_height 30
Xstatic char rot08_bits[] = {
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0x6a, 0xaa, 0x1a,
X 0x56, 0x95, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x5e, 0x55, 0x55, 0x1d, 0xbc, 0xaa, 0xaa, 0x0e,
X 0xf8, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot08.xbm'`; then
echo shar: \"'bitmaps/rot08.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot08.xbm'
fi
if test -f 'bitmaps/rot09.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot09.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot09.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot09.xbm' <<'END_OF_FILE'
X#define rot09_width 30
X#define rot09_height 30
Xstatic char rot09_bits[] = {
X 0xaf, 0xaa, 0xaa, 0x1a, 0x57, 0x55, 0x55, 0x1d, 0xaf, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0x6a, 0xaa, 0x1a,
X 0x55, 0x95, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x0e,
X 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot09.xbm'`; then
echo shar: \"'bitmaps/rot09.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot09.xbm'
fi
if test -f 'bitmaps/rot10.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot10.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot10.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot10.xbm' <<'END_OF_FILE'
X#define rot10_width 30
X#define rot10_height 30
Xstatic char rot10_bits[] = {
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0x6a, 0xaa, 0x1a,
X 0x56, 0x95, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d,
X 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a,
X 0x56, 0x55, 0x55, 0x1d, 0xae, 0xaa, 0xaa, 0x1a, 0x56, 0x55, 0x55, 0x1d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot10.xbm'`; then
echo shar: \"'bitmaps/rot10.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot10.xbm'
fi
if test -f 'bitmaps/rot11.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot11.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot11.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot11.xbm' <<'END_OF_FILE'
X#define rot11_width 30
X#define rot11_height 30
Xstatic char rot11_bits[] = {
X 0xaf, 0xaa, 0xaa, 0x1a, 0x57, 0x55, 0x55, 0x1d, 0xaf, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0x6a, 0xaa, 0x1a,
X 0x55, 0x95, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d,
X 0xaa, 0xaa, 0xaa, 0x1a, 0x55, 0x55, 0x55, 0x1d, 0xaa, 0xaa, 0xaa, 0x1a,
X 0x57, 0x55, 0x55, 0x1d, 0xaf, 0xaa, 0xaa, 0x1a, 0x57, 0x55, 0x55, 0x1d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot11.xbm'`; then
echo shar: \"'bitmaps/rot11.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot11.xbm'
fi
if test -f 'bitmaps/rot12.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot12.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot12.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot12.xbm' <<'END_OF_FILE'
X#define rot12_width 30
X#define rot12_height 30
Xstatic char rot12_bits[] = {
X 0xae, 0xaa, 0xaa, 0x3a, 0x56, 0x55, 0x55, 0x3d, 0xae, 0xaa, 0xaa, 0x3a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0x6a, 0xaa, 0x2a,
X 0x56, 0x95, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x5e, 0x55, 0x55, 0x15, 0xbc, 0xaa, 0xaa, 0x2a,
X 0xf8, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00};

X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot12.xbm'`; then
echo shar: \"'bitmaps/rot12.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot12.xbm'
fi
if test -f 'bitmaps/rot13.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot13.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot13.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot13.xbm' <<'END_OF_FILE'
X#define rot13_width 30
X#define rot13_height 30
Xstatic char rot13_bits[] = {
X 0xaf, 0xaa, 0xaa, 0x3a, 0x57, 0x55, 0x55, 0x3d, 0xaf, 0xaa, 0xaa, 0x3a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0x6a, 0xaa, 0x2a,
X 0x55, 0x95, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15,
X 0xaa, 0xaa, 0xaa, 0x2a, 0x55, 0x55, 0x55, 0x15, 0xaa, 0xaa, 0xaa, 0x2a,
X 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot13.xbm'`; then
echo shar: \"'bitmaps/rot13.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot13.xbm'
fi
if test -f 'bitmaps/rot14.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/rot14.xbm'\"
else
echo shar: Extracting \"'bitmaps/rot14.xbm'\" \(828 characters\)
sed "s/^X//" >'bitmaps/rot14.xbm' <<'END_OF_FILE'
X#define rot14_width 30
X#define rot14_height 30
Xstatic char rot14_bits[] = {
X 0xae, 0xaa, 0xaa, 0x3a, 0x56, 0x55, 0x55, 0x3d, 0xae, 0xaa, 0xaa, 0x3a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0x6a, 0xaa, 0x2a,
X 0x56, 0x95, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15,
X 0xae, 0xaa, 0xaa, 0x2a, 0x56, 0x55, 0x55, 0x15, 0xae, 0xaa, 0xaa, 0x2a,
X 0x56, 0x55, 0x55, 0x3d, 0xae, 0xaa, 0xaa, 0x3a, 0x56, 0x55, 0x55, 0x3d};
X
END_OF_FILE
if test 828 -ne `wc -c <'bitmaps/rot14.xbm'`; then
echo shar: \"'bitmaps/rot14.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/rot14.xbm'
fi
if test -f 'bitmaps/ticon.xbm' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitmaps/ticon.xbm'\"
else
echo shar: Extracting \"'bitmaps/ticon.xbm'\" \(1877 characters\)
sed "s/^X//" >'bitmaps/ticon.xbm' <<'END_OF_FILE'
X#define ticon_width 48
X#define ticon_height 48
Xstatic char ticon_bits[] = {
X 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
X 0x00, 0x00, 0x90, 0x07, 0x00, 0x00, 0x00, 0x00, 0x10, 0x3c, 0x00, 0x00,
X 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x40, 0x00,
X 0x00, 0x00, 0x10, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x38, 0x00, 0x40, 0x0e,
X 0x00, 0x00, 0x7c, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x83, 0x01, 0x40, 0x00,
X 0x00, 0x00, 0x01, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x02, 0x10, 0x01,
X 0x00, 0x80, 0x10, 0x02, 0x10, 0x01, 0x00, 0x80, 0x10, 0x02, 0x10, 0x01,
X 0x00, 0x80, 0x10, 0x02, 0x10, 0x01, 0x00, 0x80, 0x00, 0x02, 0x08, 0x02,
X 0x00, 0x00, 0x01, 0x01, 0x48, 0x02, 0x00, 0x00, 0x83, 0x01, 0x08, 0x02,
X 0x00, 0x00, 0x7c, 0x00, 0x08, 0x02, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x1f,
X 0x00, 0x3c, 0x44, 0x00, 0x00, 0x70, 0x00, 0x07, 0x44, 0x00, 0x00, 0xc0,
X 0xc0, 0x01, 0x44, 0x00, 0x00, 0x80, 0x70, 0x00, 0x44, 0x00, 0x00, 0x80,
X 0x18, 0x00, 0x44, 0x00, 0x00, 0x80, 0x0c, 0x00, 0x44, 0x7c, 0x3e, 0x9f,
X 0x06, 0x00, 0x44, 0x44, 0x22, 0x91, 0x03, 0x00, 0x44, 0x44, 0x22, 0x91,
X 0x81, 0x0f, 0x44, 0x44, 0x22, 0x91, 0xe1, 0x3f, 0x44, 0x44, 0x22, 0x91,
X 0x31, 0x60, 0x44, 0x44, 0x22, 0x91, 0x19, 0xc0, 0x44, 0x44, 0x22, 0x91,
X 0x09, 0x80, 0x44, 0x44, 0x22, 0x91, 0x89, 0x88, 0x44, 0x44, 0x22, 0x91,
X 0xc9, 0x98, 0x44, 0x44, 0x22, 0x91, 0x09, 0x80, 0x44, 0x44, 0x22, 0x91,
X 0x09, 0x80, 0x44, 0x44, 0x22, 0x91, 0xc9, 0x98, 0x44, 0x44, 0x22, 0x91,
X 0x09, 0x80, 0x44, 0x7c, 0x3e, 0x9f, 0x09, 0x80, 0x44, 0x7c, 0x3e, 0x9f,
X 0xc9, 0x98, 0x44, 0x00, 0x00, 0x80, 0x89, 0x88, 0x44, 0x00, 0x00, 0x80,
X 0x09, 0x80, 0x44, 0x00, 0x00, 0x80, 0x09, 0x80, 0x44, 0x00, 0x00, 0x80,
X 0xf9, 0xff, 0x44, 0x00, 0x00, 0x80, 0x01, 0x00, 0x44, 0x00, 0x00, 0x80,
X 0x01, 0x00, 0x44, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
END_OF_FILE
if test 1877 -ne `wc -c <'bitmaps/ticon.xbm'`; then
echo shar: \"'bitmaps/ticon.xbm'\" unpacked with wrong size!
fi
# end of 'bitmaps/ticon.xbm'
fi
if test -f 'tetris.man' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'tetris.man'\"
else
echo shar: Extracting \"'tetris.man'\" \(3829 characters\)
sed "s/^X//" >'tetris.man' <<'END_OF_FILE'
X.TH TETRIS 6 "11 Jan 1993, V2.0.1" "Univ of Arizona"
X.SH NAME
XGENERIC TETRIS \- Yet Another Tetris Game on X
X.SH SYNOPSIS
X.B tetris
X[-s] [-l ] [-p ] [-showNext] [-beep]
X[-display ] [-geometry ] [-iconGeometry ]
X[-{background | bg} ] [-{foreground | fg} ] [-bigFont
X] [-tinyFont ] [-xrm ]
X.SH DESCRIPTION
X.LP
XOne of the motivations of this tetris program is simplicity. It does
Xnot have many fancy features but the blocks are big enough so player
Xcan feel comfortable.
X.LP
XThe program lists the top 15 players at the end, each player may has at
Xmost three scores. With the option \fB\-s\fP, it shows all the players
Xand scores.
X.LP
XKey "\fBj\fP" moves the block left, "\fBl\fP" moves right,
X"\fBk\fP" rotates. Left-handed people may want to use "\fBs\fP",
X"\fBd\fP", "\fBf\fP" respectively. Or maybe someone wants to try the
Xarrow keys... The space bar drops a block quickly. Use "\fBCTRL-L\fP"
Xkey combination to redraw \- in case the program messes somthing up.
X.LP
XAs usual, "\fB+\fP" and "\fB\-\fP" speed up or lower down the speed. Note
Xthat you don't need to press the "\fISHIFT\fP" key \- "\fB=\fP" and
X"\fB_\fP" also work. The "\fBb\fP" key toggles "beep", and "\fBn\fP"
Xtoggles "show next".
X.LP
XIf you press "\fBp\fP", the game will be paused, and the window
Xwill be iconified \- just in case your boss suddenly appears at your
Xdoor ;o). When the tetris window loses its focus, it also goes to
X"paused" mode except it doesn't iconify itself.
X.LP
XTo get high scores, don't use "show next" mode, try starting at a
Xhigher level and try to let "tetris" eat more than one line at a time.
X.SH OPTIONS
X.PP
X.TP 8
X.B \-s
XThis option lets the program only list all the recorded scores then exit.
X.TP 8
X.B \-l \fIlevel\fP
XThis option starts the program at the specified level (resource name
X"\fIstartLevel\fP").
X.TP 8
X.B \-p \fIlines\fP
XThis option indicates that the program should start with some of the lines
Xbeing randomly filled (resource name "\fIpreFilledLines\fP").
X.TP 8
X.B \-showNext
XThis option tells the program start in "show next" mode (resource name
X"\fIshowNext\fP").
X.TP 8
X.B \-beep
XThis option turns the sound on (resource name "\fIbeep\fP").
X.TP 8
X.B \-display \fIhost\fP:\fIdpy\fP
XThis option specifies the X server to contact.
X.TP 8
X.B \-geometry {+|\-}\fIX\fP{+|\-}\fIY\fP
XThis option sets the initial position of the tetris window (resource
Xname "\fIgeometry\fP").
X.TP 8
X.B \-iconGeometry {+|\-}\fIX\fP{+|\-}\fIY\fP
XThis option sets the position of the icon (resource name "\fIiconGeometry\fP").
X.TP 8
X.B \-{background | bg} \fIcolor\fP
XThis option specifies the background of the tetris window (resource name
X"\fIbackground\fP").
X.TP 8
X.B \-{foreground | fg} \fIcolor\fP
XThis option specifies the foreground of the tetris window (resource name
X"\fIforeground\fP").
X.TP 8
X.B \-bigFont \fIfont\fP
XThis option sets the font used in drawing titles and important messages
X(resource name "\fIbigFont\fP").
X.TP 8
X.B \-tinyFont \fIfont\fP
XThis option sets the font used in drawing status information
X(resource name "\fItinyFont\fP").
X.TP 8
X.B \-xrm <\fIresource specification\fP>
XAnother method of specifying preferences.
X.PP
X.SH SEE ALSO
X.LP
XX(1), xtetris(1), xmris(1)
X.SH COPYRIGHTS
X.LP
X\*R Copyright 1992-93, Qiang Alex Zhao, University of Arizona.
X.SH BUG REPORTS AND PROGRAM UPDATES
X.LP
XSend bugs (or their reports, or fixes) to the author (note: my first
Xname is NOT spelled as "Quiang"):
X.RS
XQiang Alex Zhao, <\[email protected]\fP>
X.br
XComputer Science Department
X.br
XUniversity of Arizona
X.br
XTucson, AZ 85721
X.RE
X.LP
XThe most updated source could be found on \fIexport.lcs.mit.edu\fP under
X\fI/contrib\fP.
X.SH ACKNOWLEDGEMENTS
X.LP
XThanks go to people who helped me in improving the program.
END_OF_FILE
if test 3829 -ne `wc -c <'tetris.man'`; then
echo shar: \"'tetris.man'\" unpacked with wrong size!
fi
# end of 'tetris.man'
fi
echo shar: End of archive 2 \(of 2\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked both archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0



  3 Responses to “Category : UNIX Files
Archive   : GTETRIS.ZIP
Filename : GTETRIS.SHR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/