home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!news.tek.com!news.cna.tek.com!not-for-mail
- From: billr@saab.cna.tek.com (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v18i054: gtetris4 - Generic Tetris for X11, V3.0.1, Part02/03 (REPOST)
- Date: 30 Aug 1993 07:53:23 -0700
- Organization: Tektronix, Inc., Redmond, OR
- Lines: 1716
- Approved: billr@saab.CNA.TEK.COM
- Message-ID: <25t493$f6g@saab.cna.tek.com>
- NNTP-Posting-Host: saab.cna.tek.com
- Xref: uunet comp.sources.games:1854
-
- Submitted-by: "Q. Alex Zhao" <azhao@cc.gatech.edu>
- Posting-number: Volume 18, Issue 54
- Archive-name: gtetris4/part02
- Supersedes: tetris3: Volume 15, Issue 44-45
- 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 <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 3)."
- # Contents: Imakefile Makefile.std Revisions X11/Xfuncproto.h
- # X11/Xos.h X11/Xosdefs.h bm-plain/rop00.xbm bm-plain/rop01.xbm
- # bm-plain/rop02.xbm bm-plain/rop03.xbm bm-plain/rop04.xbm
- # bm-plain/rop05.xbm bm-plain/rop06.xbm bm-plain/rop07.xbm
- # bm-plain/rop08.xbm bm-plain/rop09.xbm bm-plain/rop10.xbm
- # bm-plain/rop11.xbm bm-plain/rop12.xbm bm-plain/rop13.xbm
- # bm-plain/rop14.xbm playing.c tetris.man ticon.xbm
- # Wrapped by billr@saab on Fri Aug 27 12:06:40 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Imakefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Imakefile'\"
- else
- echo shar: Extracting \"'Imakefile'\" \(1564 characters\)
- sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
- X/**/# GENERIC X-WINDOW-BASED TETRIS
- X/**/#
- X/**/# Imakefile
- X/**/#
- X/**/###
- X/**/#
- X/**/# Copyright (C) 1992 - 93 Q. Alex Zhao, azhao@cc.gatech.edu
- 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
- XSCOREFILE = ./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
- XRANDOM = -DHAS_48
- X
- X/**/# Set your C compiler
- X
- XCC = gcc
- X
- X/**/##############################################################
- X
- XDEFINES = -I. -DSCOREFILE=\"${SCOREFILE}\" ${RANDOM}
- XSYS_LIBRARIES = ${XLIB} -lm
- XSRCS = tetris.c playing.c utils.c
- XOBJS = tetris.o playing.o utils.o
- XMYPROGRAM = tetris
- X
- XComplexProgramTarget(${MYPROGRAM})
- X
- Xtetris.o: tetris.c tetris.h
- Xplaying.o: playing.c tetris.h
- Xutils.o: utils.c tetris.h
- X
- Xclean.all:: clean
- X ${RM} Makefile ${SCOREFILE}
- END_OF_FILE
- if test 1564 -ne `wc -c <'Imakefile'`; then
- echo shar: \"'Imakefile'\" unpacked with wrong size!
- fi
- # end of 'Imakefile'
- fi
- if test -f 'Makefile.std' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.std'\"
- else
- echo shar: Extracting \"'Makefile.std'\" \(1640 characters\)
- sed "s/^X//" >'Makefile.std' <<'END_OF_FILE'
- X# GENERIC X-WINDOW-BASED TETRIS
- X#
- X# Makefile.std
- X#
- X###
- X#
- X# Copyright (C) 1992 - 93 Q. Alex Zhao, azhao@cc.gatech.edu
- 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
- XSCOREFILE = ./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
- XRANDOM = -DHAS_48
- X
- X# Set your C compiler
- XCC = cc
- X
- X# X include files
- XXINCLUDEPATH = /usr/local/include
- X
- X# X libraries
- XXLIBPATH = /usr/local/lib
- X
- X##############################################################
- X
- XDEFINES = -I${XINCLUDEPATH} -I. -DSCOREFILE=\"${SCOREFILE}\" ${RANDOM}
- XSYS_LIBRARIES = -lX11 -lm
- XSRCS = tetris.c playing.c utils.c
- XOBJS = tetris.o playing.o utils.o
- XMYPROGRAM = tetris
- X
- XCFLAGS = -O ${DEFINES}
- X
- X${MYPROGRAM}: ${OBJS}
- X ${CC} ${CFLAGS} -o ${MYPROGRAM} ${OBJS} -L${XLIBPATH} ${SYS_LIBRARIES}
- X
- Xtetris.o: tetris.c tetris.h
- Xplaying.o: playing.c tetris.h
- Xutils.o: utils.c tetris.h
- X
- Xclean.all::
- X rm -f Makefile ${SCOREFILE}
- END_OF_FILE
- if test 1640 -ne `wc -c <'Makefile.std'`; then
- echo shar: \"'Makefile.std'\" unpacked with wrong size!
- fi
- # end of 'Makefile.std'
- fi
- if test -f 'Revisions' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Revisions'\"
- else
- echo shar: Extracting \"'Revisions'\" \(4161 characters\)
- sed "s/^X//" >'Revisions' <<'END_OF_FILE'
- X [Aug 24, 93] V3.0.1 --
- X
- X utils.c, checkUp and checkDown for the new bitmap #15.
- X
- X tetris.c, size hints.
- X
- X [Aug 22, 93] V3.0.0 --
- X
- X In general: added a "bonus mode" inspired by an unofficial
- X patch from David Bagley <bagleyd@source.asset.com>.
- X
- X Imakefile, "SYS_LIBRARIES" changed to include "$(XLIB)".
- X Suggested by Dr. Horst Spandl <spandl@uisu00.lfu-bw.de>.
- X
- X tetris.c, correct resource lookup for "startLevel",
- X "preFilledLines", "showNext", and "beep". Suggested by Reuben
- X Worley <reuben@bugs.merit-tech.com>.
- X
- X playing.c, destroying window before closing connection.
- X Suggested by Elwood C. Downey <ecdowney@hwking.cca.cr.rockwell.com>.
- X
- X utils.c, tetris.c, brought back the old "plain" bitmaps.
- X Suggested by David W. Sanderson <dws@ssec.wisc.edu>.
- X
- X utils.c, better rotation (looks more "natural"). Suggested by
- X Alberto Hernandez <alberto@TITAN.tid.es>.
- X
- X Many minor changes...
- X
- X [Feb 27, 93] V2.1.4: HP time structure problem resulting "hanging
- X blocks". By Marcus Leech <mleech@bnr.ca>. New set of
- X bitmaps contributed by Atsuhiko Yamanaka
- X <yamanaka@ecip.tohoku.ac.jp>.
- X
- X [Jan 21, 93] V2.1.3: Two bugs in finding user environment:
- X "endpwent()" by Jari Tavi <jpt@rixrax.enet.dec.com>;
- X "gethostname()" by Johan Vromans <jv@mh.nl>. Added two
- X more arrow keys.
- X
- X [Jan 19, 93] V2.1.2: Improved "paused" mode - so it won't take too
- X much CPU time - suggested by Philip JENNINGS
- X <P.Jennings@frcl.bull.fr>.
- X
- X [Jan 18, 93] V2.1.1: Fixed a resource look-up bug found by Peter
- X Kabal <kabal@inrs-telecom.uquebec.ca>, and Imakefile
- X problem found by Tong Zhou <tzhou@cse.ogi.edu>.
- X
- X [Jan 15, 93] V2.1.0: Fixed a resource look-up bug found by Kiyotaka
- X Sakai <ksakai@mtl.t.u-tokyo.ac.jp>. Added "-u" option.
- X New feature: when a row is deleted, remaining blocks
- X remains rounded -- suggested by Elwood C. Downey
- X <ecdowney@hwking.cca.cr.rockwell.com> and Bill Leue
- X <leue@crd.ge.com>.
- 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 <golde@cs.washington.edu>.
- 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 <ogawa@sm.sony.co.jp>. Included four X11 header files
- X in case some system doesn't have them. Fixed block
- X clearing bug found by Benjamin Kroop
- X <bkroop@sunlab.cit.cornell.edu>.
- 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 [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, <herbison@erlang.enet.dec.com>.
- X Added man-page. Gregg Townsend <gmt@cs.arizona.edu>
- 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 <raet-sh!richard@relay.nluug.nl>
- 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 <raet-sh!richard@relay.nluug.nl>. 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 <sys/select.h> and -lbsd for AIX (by "Daryl
- X Green" <darylg@amex-trs.com>).
- 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 <faustus@cs.berkeley.edu> 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 4161 -ne `wc -c <'Revisions'`; then
- echo shar: \"'Revisions'\" unpacked with wrong size!
- fi
- # end of 'Revisions'
- 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/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 <X11/Xosdefs.h>
- 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 <sys/types.h> /* 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 <sys/types.h>
- X#define _POSIX_SOURCE
- X#else
- X#include <sys/types.h>
- 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 <string.h>
- X#define index strchr
- X#define rindex strrchr
- X#else
- X#ifdef SYSV
- X#include <string.h>
- X#define index strchr
- X#define rindex strrchr
- X#else
- X#include <strings.h>
- 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 <fcntl.h>
- X#ifdef USL
- X#include <unistd.h>
- X#endif /* USL */
- X#ifdef CRAY
- X#include <unistd.h>
- X#endif /* CRAY */
- X#ifdef MOTOROLA
- X#include <unistd.h>
- X#endif /* MOTOROLA */
- X#ifdef SYSV386
- X#include <unistd.h>
- X#endif /* SYSV386 */
- X#include <sys/file.h>
- X#else /* X_NOT_POSIX */
- X#if !defined(_POSIX_SOURCE) && defined(macII)
- X#define _POSIX_SOURCE
- X#include <fcntl.h>
- X#undef _POSIX_SOURCE
- X#else
- X#include <fcntl.h>
- X#endif
- X#include <unistd.h>
- X#endif /* X_NOT_POSIX else */
- X
- X/*
- X * Get struct timeval
- X */
- X
- X#ifdef SYSV
- X
- X#ifndef USL
- X#include <sys/time.h>
- X#endif
- X#include <time.h>
- 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 <sys/time.h>
- X#define _POSIX_SOURCE
- X#else
- X#include <sys/time.h>
- 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 <sys/bsdtypes.h>
- 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 'bm-plain/rop00.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop00.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop00.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop00.xbm' <<'END_OF_FILE'
- X#define rop00_width 30
- X#define rop00_height 30
- Xstatic char rop00_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 <'bm-plain/rop00.xbm'`; then
- echo shar: \"'bm-plain/rop00.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop00.xbm'
- fi
- if test -f 'bm-plain/rop01.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop01.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop01.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop01.xbm' <<'END_OF_FILE'
- X#define rop01_width 30
- X#define rop01_height 30
- Xstatic char rop01_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 <'bm-plain/rop01.xbm'`; then
- echo shar: \"'bm-plain/rop01.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop01.xbm'
- fi
- if test -f 'bm-plain/rop02.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop02.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop02.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop02.xbm' <<'END_OF_FILE'
- X#define rop02_width 30
- X#define rop02_height 30
- Xstatic char rop02_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 <'bm-plain/rop02.xbm'`; then
- echo shar: \"'bm-plain/rop02.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop02.xbm'
- fi
- if test -f 'bm-plain/rop03.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop03.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop03.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop03.xbm' <<'END_OF_FILE'
- X#define rop03_width 30
- X#define rop03_height 30
- Xstatic char rop03_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 <'bm-plain/rop03.xbm'`; then
- echo shar: \"'bm-plain/rop03.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop03.xbm'
- fi
- if test -f 'bm-plain/rop04.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop04.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop04.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop04.xbm' <<'END_OF_FILE'
- X#define rop04_width 30
- X#define rop04_height 30
- Xstatic char rop04_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 <'bm-plain/rop04.xbm'`; then
- echo shar: \"'bm-plain/rop04.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop04.xbm'
- fi
- if test -f 'bm-plain/rop05.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop05.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop05.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop05.xbm' <<'END_OF_FILE'
- X#define rop05_width 30
- X#define rop05_height 30
- Xstatic char rop05_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 <'bm-plain/rop05.xbm'`; then
- echo shar: \"'bm-plain/rop05.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop05.xbm'
- fi
- if test -f 'bm-plain/rop06.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop06.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop06.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop06.xbm' <<'END_OF_FILE'
- X#define rop06_width 30
- X#define rop06_height 30
- Xstatic char rop06_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 <'bm-plain/rop06.xbm'`; then
- echo shar: \"'bm-plain/rop06.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop06.xbm'
- fi
- if test -f 'bm-plain/rop07.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop07.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop07.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop07.xbm' <<'END_OF_FILE'
- X#define rop07_width 30
- X#define rop07_height 30
- Xstatic char rop07_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 <'bm-plain/rop07.xbm'`; then
- echo shar: \"'bm-plain/rop07.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop07.xbm'
- fi
- if test -f 'bm-plain/rop08.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop08.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop08.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop08.xbm' <<'END_OF_FILE'
- X#define rop08_width 30
- X#define rop08_height 30
- Xstatic char rop08_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 <'bm-plain/rop08.xbm'`; then
- echo shar: \"'bm-plain/rop08.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop08.xbm'
- fi
- if test -f 'bm-plain/rop09.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop09.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop09.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop09.xbm' <<'END_OF_FILE'
- X#define rop09_width 30
- X#define rop09_height 30
- Xstatic char rop09_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 <'bm-plain/rop09.xbm'`; then
- echo shar: \"'bm-plain/rop09.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop09.xbm'
- fi
- if test -f 'bm-plain/rop10.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop10.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop10.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop10.xbm' <<'END_OF_FILE'
- X#define rop10_width 30
- X#define rop10_height 30
- Xstatic char rop10_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 <'bm-plain/rop10.xbm'`; then
- echo shar: \"'bm-plain/rop10.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop10.xbm'
- fi
- if test -f 'bm-plain/rop11.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop11.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop11.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop11.xbm' <<'END_OF_FILE'
- X#define rop11_width 30
- X#define rop11_height 30
- Xstatic char rop11_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 <'bm-plain/rop11.xbm'`; then
- echo shar: \"'bm-plain/rop11.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop11.xbm'
- fi
- if test -f 'bm-plain/rop12.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop12.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop12.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop12.xbm' <<'END_OF_FILE'
- X#define rop12_width 30
- X#define rop12_height 30
- Xstatic char rop12_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 <'bm-plain/rop12.xbm'`; then
- echo shar: \"'bm-plain/rop12.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop12.xbm'
- fi
- if test -f 'bm-plain/rop13.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop13.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop13.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop13.xbm' <<'END_OF_FILE'
- X#define rop13_width 30
- X#define rop13_height 30
- Xstatic char rop13_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 <'bm-plain/rop13.xbm'`; then
- echo shar: \"'bm-plain/rop13.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop13.xbm'
- fi
- if test -f 'bm-plain/rop14.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bm-plain/rop14.xbm'\"
- else
- echo shar: Extracting \"'bm-plain/rop14.xbm'\" \(828 characters\)
- sed "s/^X//" >'bm-plain/rop14.xbm' <<'END_OF_FILE'
- X#define rop14_width 30
- X#define rop14_height 30
- Xstatic char rop14_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 <'bm-plain/rop14.xbm'`; then
- echo shar: \"'bm-plain/rop14.xbm'\" unpacked with wrong size!
- fi
- # end of 'bm-plain/rop14.xbm'
- 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'\" \(10788 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 - 93 Q. Alex Zhao, azhao@cc.gatech.edu
- 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;
- Xstatic Bool firstFall = False;
- X
- Xstatic int speeds[NUM_LEVELS] = {
- X100, 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,
- X100, 110, 120, 130, 140, 150, 160, 170, 180};
- X
- Xstatic struct timeval nextFall, now, delay, oldsample;
- Xstatic struct timezone tzone = {0, 0};
- X
- Xstatic Bool moveOne();
- X
- X/* ------------------------------------------------------------------ */
- X
- Xvoid
- Xplaying()
- X{
- X Bool resetTime = True;
- X int conNum = ConnectionNumber(display);
- X int oldscore = 0;
- X
- X drawTitle();
- X drawStatus();
- X drawField();
- X XFlush(display);
- X sleep(1);
- X
- X (void) gettimeofday(&oldsample, &tzone);
- 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 = (unsigned) 1 << conNum;
- 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 (((long) delay.tv_sec > 0) ||
- X (((long) delay.tv_sec == 0) &&
- X ((long) delay.tv_usec > 0))) {
- X /* sleep */
- X (void) select(conNum + 1, (fd_set *) & readfd,
- X (fd_set *) & writefd, (fd_set *) & exceptfd, &delay);
- X }
- X }
- X
- X (void) gettimeofday(&now, &tzone);
- X delay.tv_sec = now.tv_sec - oldsample.tv_sec;
- X delay.tv_usec = now.tv_usec - oldsample.tv_usec - SAMPLERATE;
- X realTime(&delay);
- X
- X if (((long) delay.tv_sec > 0) ||
- X (((long) delay.tv_sec == 0) &&
- X ((long) delay.tv_usec > 0))) {
- X oldsample.tv_sec = now.tv_sec;
- X oldsample.tv_usec = now.tv_usec;
- X if (bonusMode) {
- X if (score - oldscore < BONUSOUT) {
- X bonusMode = False;
- X range = NUM_THINGS;
- X }
- X } else {
- X if (score - oldscore > BONUSIN) {
- X bonusMode = True;
- X range = NUM_THINGS + NUM_BTHINGS;
- X }
- X }
- X oldscore = score;
- X }
- X
- 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 firstFall = 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, flag;
- X char buf[4];
- X
- X if (!paused && falldown)
- X gotNew = moveOne(FALL) || gotNew;
- X
- X while (XPending(display)) {
- X XNextEvent(display, &ev);
- X flag = True;
- X while (flag) {
- 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 bonusMode = False;
- X range = NUM_THINGS;
- 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 if (firstFall) {
- X paused = True;
- X banner(MSG_PAUSED);
- X }
- 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 if (paused) {
- X XNextEvent(display, &ev);
- X flag = True;
- X gotNew = True; /* for reseting time */
- X (void) gettimeofday(&oldsample, &tzone);
- X } else
- X flag = False;
- 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
- Xstatic Bool
- XmoveOne(move)
- X move_t move;
- X{
- X int lines;
- X
- X if ((move == DROP) || ((move == FALL) && atBottom())) {
- X tryMove(move);
- X putBox();
- X lines = checkLines();
- X score += (prefilled + level + lines) * (bonusMode ? 1 : 3);
- X score += (showNext ? 3 : 5) * level * level * lines * lines *
- X (bonusMode ? 1 : 2);
- 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, True); /* discard all events */
- 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 /* 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 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 /*
- X * As we trickle, we add up records owned by me. Once we hit max, we
- X * 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 /* unlock */
- X close(lfd);
- X (void) unlink(lockfile);
- X close(fd);
- X}
- X
- X/* ------------------------------------------------------------------ */
- X
- Xvoid
- XgameOver()
- X{
- X int i, j;
- X
- X banner(MSG_END);
- X XSync(display, True);
- X
- X for (j = 0; j <= ROWS / 2; j ++) {
- X for (i = 0; i < COLS; i ++) {
- X drawBox(blockWin, 0, nrand(NUM_THINGS), i * BOXSIZE, j * BOXSIZE);
- X drawBox(blockWin, 0, nrand(NUM_THINGS), i * BOXSIZE,
- X (ROWS - j - 1) * BOXSIZE);
- X }
- X XSync(display, True);
- X }
- X
- X addScore();
- X showScores(SHOWSCORES);
- X XDestroyWindow(display, mainWin);
- 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 10788 -ne `wc -c <'playing.c'`; then
- echo shar: \"'playing.c'\" unpacked with wrong size!
- fi
- # end of 'playing.c'
- 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'\" \(4142 characters\)
- sed "s/^X//" >'tetris.man' <<'END_OF_FILE'
- X.TH TETRIS 6 "24 Aug 93, V3.0" "Georgia Tech"
- X.SH NAME
- XGENERIC TETRIS \- Yet Another Tetris Game on X
- X.SH SYNOPSIS
- X.B tetris
- X[-s] [-l <start level>] [-p <prefilled lines>] [-showNext] [-beep]
- X[-plain] [-u <name>]
- X[-display <display>] [-geometry <geometry>] [-iconGeometry <geometry>]
- X[-{background | bg} <color>] [-{foreground | fg} <color>] [-bigFont
- X<font>] [-tinyFont <font>] [-xrm <resource specification>]
- 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.
- XPlay \fIfast\fP and see how well you can do in the \fIbonus\fP mode
- X(what is that? ;-).
- X.SH OPTIONS
- X.PP
- X.TP 8
- X.B \-s
- X.br
- XThis option lets the program only list all the recorded scores then exit.
- X.TP 8
- X.B \-l \fIlevel\fP
- X.br
- XThis option starts the program at the specified level (resource name
- X"\fIstartLevel\fP").
- X.TP 8
- X.B \-p \fIlines\fP
- X.br
- 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
- X.br
- XThis option tells the program start in "show next" mode (resource name
- X"\fIshowNext\fP").
- X.TP 8
- X.B \-beep
- X.br
- XThis option turns the sound on (resource name "\fIbeep\fP").
- X.TP 8
- X.B \-plain
- X.br
- XUses the old "plain" bitmaps instead of the default 3D ones (resource
- Xname "\fIplain\fP").
- X.TP 8
- X.B \-u \fIname\fP
- X.br
- XThis option sets an alternative player name (resource name
- X"\fIplayerName\fP").
- X.TP 8
- X.B \-display \fIhost\fP:\fIdpy\fP
- X.br
- XThis option specifies the X server to contact.
- X.TP 8
- X.B \-geometry {+|\-}\fIX\fP{+|\-}\fIY\fP
- X.br
- XThis option sets the initial position of the tetris window (resource
- Xname "\fIgeometry\fP").
- X.TP 8
- X.B \-iconGeometry {+|\-}\fIX\fP{+|\-}\fIY\fP
- X.br
- XThis option sets the position of the icon (resource name "\fIiconGeometry\fP").
- X.TP 8
- X.B \-{background | bg} \fIcolor\fP
- X.br
- XThis option specifies the background of the tetris window (resource name
- X"\fIbackground\fP").
- X.TP 8
- X.B \-{foreground | fg} \fIcolor\fP
- X.br
- XThis option specifies the foreground of the tetris window (resource name
- X"\fIforeground\fP").
- X.TP 8
- X.B \-bigFont \fIfont\fP
- X.br
- 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
- X.br
- XThis option sets the font used in drawing status information
- X(resource name "\fItinyFont\fP").
- X.TP 8
- X.B \-xrm <\fIresource specification\fP>
- X.br
- 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, Q. Alex Zhao, <\fIazhao@cc.gatech.edu\fP>.
- X.SH BUG REPORTS AND PROGRAM UPDATES
- X.LP
- XSend bug reports (or fixes) to the author:
- X.RS
- XQ. Alex Zhao, <\fIazhao@cc.gatech.edu\fP>
- X.br
- XCollege of Computing
- X.br
- XGeorgia Institute of Technology
- X.br
- XAtlanta, GA 30332-0280
- X.RE
- X.LP
- XThe most updated source could be found on \fIftp.x.org\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 4142 -ne `wc -c <'tetris.man'`; then
- echo shar: \"'tetris.man'\" unpacked with wrong size!
- fi
- # end of 'tetris.man'
- fi
- if test -f 'ticon.xbm' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ticon.xbm'\"
- else
- echo shar: Extracting \"'ticon.xbm'\" \(3278 characters\)
- sed "s/^X//" >'ticon.xbm' <<'END_OF_FILE'
- X#define ticon_width 64
- X#define ticon_height 64
- Xstatic char ticon_bits[] = {
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90,
- X 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x3c, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30,
- X 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0xc0, 0x01, 0x00,
- X 0x00, 0x00, 0x00, 0x38, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x7c,
- X 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x83, 0x01, 0x40, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x01, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
- X 0x02, 0x10, 0x01, 0x00, 0x00, 0x00, 0x80, 0x10, 0x02, 0x10, 0x01, 0x00,
- X 0x00, 0x00, 0x80, 0x10, 0x02, 0x10, 0x01, 0x00, 0x00, 0x00, 0x80, 0x10,
- X 0x02, 0x10, 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x02, 0x08, 0x02, 0x00,
- X 0x00, 0x00, 0x00, 0x01, 0x01, 0x48, 0x02, 0x00, 0x00, 0x00, 0x00, 0x83,
- X 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x08, 0x02, 0x00,
- X 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x3c, 0x44,
- X 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x07, 0x44, 0x00, 0x00, 0xc0, 0x00,
- X 0x00, 0xc0, 0x01, 0x44, 0x00, 0x00, 0x80, 0x00, 0x00, 0x70, 0x00, 0x44,
- X 0x00, 0x00, 0x80, 0x00, 0x00, 0x18, 0x00, 0x44, 0x00, 0x00, 0x80, 0x00,
- X 0x00, 0x0c, 0x00, 0x44, 0x7c, 0x3e, 0x9f, 0x00, 0x00, 0x06, 0x00, 0x44,
- X 0x44, 0x22, 0x91, 0x00, 0x00, 0x03, 0x00, 0x44, 0x44, 0x22, 0x91, 0x00,
- X 0x00, 0x81, 0x0f, 0x44, 0x44, 0x22, 0x91, 0x00, 0x00, 0xe1, 0x3f, 0x44,
- X 0x44, 0x22, 0x91, 0x00, 0x00, 0x31, 0x60, 0x44, 0x44, 0x22, 0x91, 0x00,
- X 0x00, 0x19, 0xc0, 0x44, 0x44, 0x22, 0x91, 0x00, 0x00, 0x09, 0x80, 0x44,
- X 0x44, 0x22, 0x91, 0x00, 0x00, 0x89, 0x88, 0x44, 0x44, 0x22, 0x91, 0x00,
- X 0x00, 0xc9, 0x98, 0x44, 0x44, 0x22, 0x91, 0x00, 0x00, 0x09, 0x80, 0x44,
- X 0x44, 0x22, 0x91, 0x00, 0x00, 0x09, 0x80, 0x44, 0x44, 0x22, 0x91, 0x00,
- X 0x00, 0xc9, 0x98, 0x44, 0x44, 0x22, 0x91, 0x00, 0x00, 0x09, 0x80, 0x44,
- X 0x7c, 0x3e, 0x9f, 0x00, 0x00, 0x09, 0x80, 0x44, 0x7c, 0x3e, 0x9f, 0x00,
- X 0x00, 0xc9, 0x98, 0x44, 0x00, 0x00, 0x80, 0x00, 0x00, 0x89, 0x88, 0x44,
- X 0x00, 0x00, 0x80, 0x00, 0x00, 0x09, 0x80, 0x44, 0x00, 0x00, 0x80, 0x00,
- X 0x00, 0x09, 0x80, 0x44, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf9, 0xff, 0x44,
- X 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x44, 0x00, 0x00, 0x80, 0x00,
- X 0x00, 0x01, 0x00, 0x44, 0x00, 0x00, 0x80, 0x00, 0x00, 0xff, 0xff, 0xff,
- X 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- X 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- END_OF_FILE
- if test 3278 -ne `wc -c <'ticon.xbm'`; then
- echo shar: \"'ticon.xbm'\" unpacked with wrong size!
- fi
- # end of 'ticon.xbm'
- fi
- echo shar: End of archive 2 \(of 3\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 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
-