Only in ../xhextris: Imake.template
diff -c3 -r ./Imakefile ../xhextris/Imakefile
*** ./Imakefile	Tue Apr  6 22:24:15 1993
--- ../xhextris/Imakefile	Fri Apr 27 10:46:27 1990
***************
*** 1,19 ****
!        ScoreDir = $(LIBDIR)
!       ScoreFile = xhextris-scores
!         DEFINES = -DHIGHSCOREFILE=\"$(ScoreDir)/$(ScoreFile)\" -DHEXFONTDIR=\"$(FONTDIR)/misc\"
!         HEADERS = header.h
!            SRCS = hextris.c xio.c stdsys.c
!            OBJS = hextris.o xio.o stdsys.o
! LOCAL_LIBRARIES = $(XLIB)
!         DEPLIBS = $(DEPXLIB) 
! 
! ComplexProgramTarget(xhextris)
! 
! hex20.pcf: hex20.bdf
! 	bdftopcf < hex20.bdf > hex20.pcf
! 
! install.font: hex20.pcf
! 	install -m 444 hex20.pcf $(FONTDIR)/misc
! 	$(MKFONTDIR) $(FONTDIR)/misc
  
! InstallMultipleFlags($(ScoreFile),$(ScoreDir),-m 666)
--- 1,120 ----
! # 
! #  hextris Copyright 1990 David Markley, dm3e@+andrew.cmu.edu, dam@cs.cmu.edu
! #
! #  Permission to use, copy, modify, and distribute, this software and its
! #  documentation for any purpose is hereby granted without fee, provided that
! #  the above copyright notice appear in all copies and that both that
! #  copyright notice and this permission notice appear in supporting
! #  documentation, and that the name of the copyright holders be used in
! #  advertising or publicity pertaining to distribution of the software with
! #  specific, written prior permission, and that no fee is charged for further
! #  distribution of this software, or any modifications thereof.  The copyright
! #  holder make no representations about the suitability of this software for
! #  any purpose.  It is provided "as is" without express or implied warranty.
! # 
! #  THE COPYRIGHT HOLDER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
! #  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
! #  EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
! #  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
! #  DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
! #  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
! #  PERFORMANCE OF THIS SOFTWARE.
! # 
  
! CC=cc
! #ifdef AFS
! INCLDS=-I/usr/andrew/include -I/usr/local/include
! LIBS= -L/usr/contributed/lib -L/usr/local/lib -L/usr/andrew/lib
! LOGGING = -lloguse
! #ifdef GAMES
! CFLAGS= -DAFS -DLOG -O
! AUTHLIBS+{sun4_40}= /usr/local/lib/afs/libkauth.a \
! 	/usr/local/lib/libr.a /usr/local/lib/liblwp.a \
! 	/usr/local/lib/afs/libsys.a /usr/local/lib/libscrypt.a
! AUTHLIBS+{mac2_51}= /usr/local/lib/afs/libkauth.a \
! 	/usr/local/lib/libr.a /usr/local/lib/liblwp.a \
! 	/usr/local/lib/afs/libsys.a /usr/local/lib/libscrypt.a
! HEXFONTDIR=/afs/andrew/usr0/games/fonts/x11
! HIGHSCOREDIR=/afs/andrew/usr0/games/lib/xhextris
! HIGHSCOREEXT=xhextris.scores
! #else
! CFLAGS= -DLOG -O
! CFLAGS+{sun4_40}= -DLOG -Dsun4_40 -g
! CFLAGS+{mac2_51}= -DLOG -Dmac2_51 -g
! AUTHLIBS=
! HEXFONTDIR=/afs/andrew/usr10/dm3e/.fonts/X11
! HIGHSCOREDIR=/afs/andrew/usr10/dm3e/stuff/games
! HIGHSCOREEXT=xhextris.scores
! BIN=/afs/andrew/usr10/dm3e/bin
! SECURE=${BIN}
! UNPRIV=${BIN}
! #endif
! #else
! CFLAGS= -O
! # Make sure INCLDS has the correct area(s) for the needed #includes
! INCLDS= -I.
! # Make sure LIBS has the correct area(s) for the needed libraries (-lX11).
! LIBS= -L.
! LOGGING=
! 
! # Make sure to change these same three variables in header.h
! 
! # Make this point to where you want the xhextris font placed.
! HEXFONTDIR=./
! # Make this point to where you want the high score file placed.
! # Remember: This directory must be writable be another user, if you
! # plan on keeping a common high score file.
! HIGHSCOREDIR=./
! # Make this the name of the high score file.
! HIGHSCOREEXT=xhextris.scores
! 
! # This is where you want the binaries to be placed.
! # Don't bother with the SECURE and UNPRIV, unless you have a setup where
! # the game has to switch tokens to write the high scores. Send me mail if you
! # do. The games maintainers at CMU have a good setup for this.
! BIN=/tmp
! SECURE=${BIN}
! UNPRIV=${BIN}
! #endif
! DEFS= -DHEXFONTDIR="\"${HEXFONTDIR}/\"" -DHIGHSCOREDIR="\"${HIGHSCOREDIR}/\"" \
! 	-DHIGHSCOREEXT="\"${HIGHSCOREEXT}\""
! .c.o:
! 	${CC} ${CFLAGS} ${DEFS} ${INCLDS} -c $*.c
! 
! all: installx installtop
! 	bdftosnf < hex10.bdf > ${HEXFONTDIR}/xhextris.snf
! 	mkfontdir ${HEXFONTDIR}
! 	echo "foo" > ${HIGHSCOREDIR}/${HIGHSCOREEXT}
! 
! xhextris : stdsys.o xio.o hextris.o header.h
! 	${CC} ${CFLAGS} ${DEFS} -o xhextris stdsys.o xio.o hextris.o \
! 	${INCLDS} ${AUTHLIBS} ${LIBS} -lX11 ${LOGGING}
! 
! # This is only usefull if you use the Andrew Window Manager
! wmhextris: stdsys.o wmio.o hextris.o header.h
! 	${CC} ${CFLAGS} ${DEFS} -o wmhextris stdsys.o wmio.o hextris.o \
! 	${INCLDS} ${AUTHLIBS} ${LIBS} -lwm ${LOGGING}
! 
! tophextris: stdsys.o tophextris.o header.h
! 	${CC} -O ${DEFS} ${INCLDS} -o tophextris stdsys.o tophextris.o \
! 	${AUTHLIBS} ${LIBS}
! 
! installx: xhextris
! 	install -s xhextris ${SECURE}/xhextris
! 
! # This is only usefull if you use the Andrew Window Manager
! installwm: wmhextris
! 	install -s wmhextris ${SECURE}/hextris
! 
! installtop: tophextris
! 	install -s tophextris ${UNPRIV}/tophextris
! 
! clean:
! 	-	rm *.o xhextris wmhextris hextris
! 
! 
! xio.o: header.h
! hextris.o: header.h
! stdsys.o: header.h 
! tophextris.o: header.h
! 
diff -c3 -r ./Makefile ../xhextris/Makefile
*** ./Makefile	Tue Apr  6 22:26:29 1993
--- ../xhextris/Makefile	Fri Apr 27 10:47:28 1990
***************
*** 1,353 ****
  # Makefile generated by imake - do not edit!
! # $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  
- # -------------------------------------------------------------------------
- # Makefile generated from "Imake.tmpl" and <Imakefile>
- # $Header: /home/x_cvs/mit/config/Imake.tmpl,v 1.8 1993/01/08 10:11:36 dawes Exp $
- # $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  #
! # Platform-specific parameters may be set in the appropriate <vendor>.cf
! # configuration files.  Site-specific parameters should be set in the file
! # site.def.  Full rebuilds are recommended if any parameters are changed.
  #
! # If your C preprocessor does not define any unique symbols, you will need
! # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
! # "make World" the first time).
  #
! 
! # -------------------------------------------------------------------------
! # site-specific configuration parameters that need to come before
! # the platform-specific parameters - edit site.def to change
! 
! # $Header: /home/x_cvs/mit/config/site.def,v 1.52 1993/02/08 22:11:12 dawes Exp $
! # site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
! 
! # -------------------------------------------------------------------------
! # platform-specific configuration parameters - edit x386.cf to change
! 
! # $Header: /home/x_cvs/mit/config/x386.cf,v 1.59 1993/02/08 22:11:15 dawes Exp $
! # platform:  $XConsortium: x386.cf,v 1.7 91/08/16 19:30:10 gildea Exp $
! 
! # operating system:  		Linux 	(Usenet)
! 
! # -------------------------------------------------------------------------
! # site-specific configuration parameters that go after
! # the platform-specific parameters - edit site.def to change
! 
! # $Header: /home/x_cvs/mit/config/site.def,v 1.52 1993/02/08 22:11:12 dawes Exp $
! # site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
! 
!             SHELL = 	/bin/sh
! 
!               TOP = .
!       CURRENT_DIR = .
! 
!                AR = ar clq
!   BOOTSTRAPCFLAGS =
!                CC = 		gcc -fwritable-strings -fomit-frame-pointer
!                AS = as
! 
!               LEX = 		flex
! 
!              YACC = 		bison -y
! 
!          COMPRESS = compress
!               CPP = 		/lib/cpp $(STD_CPP_DEFINES)
!     PREPROCESSCMD = 	/lib/cpp $(STD_CPP_DEFINES)
!           INSTALL = 	install
!                LD = ld
!              LINT = lint
!       LINTLIBFLAG = -C
!          LINTOPTS = -axz
!                LN = ln -s
!              MAKE = make
!                MV = mv
!                CP = cp
! 
!            RANLIB = ranlib
!   RANLIBINSTFLAGS =
! 
!                RM = rm -f
!             TROFF = psroff
!          MSMACROS = -ms
!               TBL = tbl
!               EQN = eqn
!      STD_INCLUDES =
!   STD_CPP_DEFINES = -traditional 		-D_POSIX_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE 	-Dlinux
!       STD_DEFINES = 		-D_POSIX_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE 	-Dlinux
!  EXTRA_LOAD_FLAGS =
!   EXTRA_LIBRARIES =
!              TAGS = ctags
! 
!     PROTO_DEFINES = -DFUNCPROTO=11 -DNARROWPROTO
! 
!      INSTPGMFLAGS = -s
! 
!      INSTBINFLAGS = -m 0755
!      INSTUIDFLAGS = -m 4755
!      INSTLIBFLAGS = -m 0644
!      INSTINCFLAGS = -m 0444
!      INSTMANFLAGS = -m 0444
!      INSTDATFLAGS = -m 0444
!     INSTKMEMFLAGS = -m 4755
! 
!       PROJECTROOT = 	/usr/X386
! 
!      TOP_INCLUDES = -I$(INCROOT)
! 
!       CDEBUGFLAGS = -O2
!         CCOPTIONS = -m486 -DNO_ASM
!     ANSICCOPTIONS =
! 
!       ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
!        ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
!            CFLAGS = $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
!         LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
! 
!            LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
! 
!         LDOPTIONS = $(ANSICCOPTIONS) $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR) -L/usr/lib
! 
!    LDCOMBINEFLAGS = 	-r
!       DEPENDFLAGS =
! 
!         MACROFILE = x386.cf
!            RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
! 
!     IMAKE_DEFINES =
! 
!          IRULESRC = $(CONFIGDIR)
!         IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
! 
!      ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules 			$(IRULESRC)/Project.tmpl $(IRULESRC)/site.def 			$(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
! 
! # -------------------------------------------------------------------------
! # $Header: /home/x_cvs/mit/config/Project.tmpl,v 1.10 1993/02/06 05:14:49 dawes Exp $
! # X Window System Build Parameters
! # $XConsortium: Project.tmpl,v 1.138.1.1 92/11/11 09:49:19 rws Exp $
! 
! # -------------------------------------------------------------------------
! # X Window System make variables; this need to be coordinated with rules
! 
!           PATHSEP = /
!         USRLIBDIR = 	/usr/X386/lib
!            BINDIR = 	/usr/X386/bin
!           INCROOT = 	/usr/X386/include
!      BUILDINCROOT = $(TOP)
!       BUILDINCDIR = $(BUILDINCROOT)/X11
!       BUILDINCTOP = ..
!            INCDIR = $(INCROOT)/X11
!            ADMDIR = /usr/adm
!            LIBDIR = $(USRLIBDIR)/X11
!         CONFIGDIR = $(LIBDIR)/config
!        LINTLIBDIR = $(USRLIBDIR)/lint
! 
!           FONTDIR = $(LIBDIR)/fonts
!          XINITDIR = $(LIBDIR)/xinit
!            XDMDIR = $(LIBDIR)/xdm
!            TWMDIR = $(LIBDIR)/twm
!           MANPATH = 	/usr/X386/man
!     MANSOURCEPATH = $(MANPATH)/man
!         MANSUFFIX = 1x
!      LIBMANSUFFIX = 3x
!            MANDIR = 	$(MANSOURCEPATH)1
!         LIBMANDIR = $(MANSOURCEPATH)3
!            NLSDIR = $(LIBDIR)/nls
!         PEXAPIDIR = $(LIBDIR)/PEX
!       XAPPLOADDIR = $(LIBDIR)/app-defaults
!        FONTCFLAGS = -t
!        LINKKITDIR = 	$(USRLIBDIR)/Server
! 
!      INSTAPPFLAGS = $(INSTDATFLAGS)
! 
!             IMAKE = imake
!            DEPEND = makedepend
!               RGB = rgb
! 
!             FONTC = bdftopcf
! 
!         MKFONTDIR = mkfontdir
!         MKDIRHIER = 	/bin/sh $(BINDIR)/mkdirhier
! 
!         CONFIGSRC = $(TOP)/config
!        DOCUTILSRC = $(TOP)/doc/util
!         CLIENTSRC = $(TOP)/clients
!           DEMOSRC = $(TOP)/demos
!            LIBSRC = $(TOP)/lib
!           FONTSRC = $(TOP)/fonts
!        INCLUDESRC = $(TOP)/X11
!         SERVERSRC = $(TOP)/server
!           UTILSRC = $(TOP)/util
!         SCRIPTSRC = $(UTILSRC)/scripts
!        EXAMPLESRC = $(TOP)/examples
!        CONTRIBSRC = $(TOP)/../contrib
!            DOCSRC = $(TOP)/doc
!            RGBSRC = $(TOP)/rgb
!         DEPENDSRC = $(SCRIPTSRC)
!          IMAKESRC = $(CONFIGSRC)
!          XAUTHSRC = $(LIBSRC)/Xau
!           XLIBSRC = $(LIBSRC)/X
!            XMUSRC = $(LIBSRC)/Xmu
!        TOOLKITSRC = $(LIBSRC)/Xt
!        AWIDGETSRC = $(LIBSRC)/Xaw
!        OLDXLIBSRC = $(LIBSRC)/oldX
!       XDMCPLIBSRC = $(LIBSRC)/Xdmcp
!       BDFTOSNFSRC = $(FONTSRC)/bdftosnf
!       BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
!       BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
!      MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
!          FSLIBSRC = $(FONTSRC)/lib/fs
!     FONTSERVERSRC = $(FONTSRC)/server
!      EXTENSIONSRC = $(TOP)/extensions
!          XILIBSRC = $(EXTENSIONSRC)/lib/xinput
!         PEXLIBSRC = $(EXTENSIONSRC)/lib/PEXlib
!       PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
! 
!   DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
!      EXTENSIONLIB = 			 -lXext
! 
!           DEPXLIB = $(DEPEXTENSIONLIB) $(USRLIBDIR)/libX11.a
!              XLIB = $(EXTENSIONLIB) 			 -lX11
! 
!       DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
!          XAUTHLIB = 			 -lXau
!       DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
!          XDMCPLIB = 			 -lXdmcp
! 
!         DEPXMULIB = $(USRLIBDIR)/libXmu.a
!            XMULIB = 			 -lXmu
! 
!        DEPOLDXLIB = $(USRLIBDIR)/liboldX.a
!           OLDXLIB = 			 -loldX
! 
!       DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
!          XTOOLLIB = 			 -lXt
! 
!         DEPXAWLIB = $(USRLIBDIR)/libXaw.a
!            XAWLIB = 			 -lXaw
! 
!         DEPXILIB = $(USRLIBDIR)/libXi.a
!            XILIB = 			 -lXi
! 
!        DEPPEXLIB = $(USRLIBDIR)/libPEX5.a
!           PEXLIB = 			 -lPEX5
! 
!         DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
!            PHIGSLIB = 			 -lphigs
! 
!        DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
!           XBSDLIB = 			 -lXbsd
! 
!  LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
!          LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
!           LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
!         LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
!           LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
!            LINTXI = $(LINTLIBDIR)/llib-lXi.ln
!           LINTPEX = $(LINTLIBDIR)/llib-lPEX5.ln
!         LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
! 
!           DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
! 
!          DEPLIBS1 = $(DEPLIBS)
!          DEPLIBS2 = $(DEPLIBS)
!          DEPLIBS3 = $(DEPLIBS)
! 
! # -------------------------------------------------------------------------
! # Imake rules for building libraries, programs, scripts, and data files
! # $Header: /home/x_cvs/mit/config/Imake.rules,v 1.8 1993/02/03 13:01:58 dawes Exp $
! # rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
! 
! # -------------------------------------------------------------------------
! # start of Imakefile
! 
!        ScoreDir = $(LIBDIR)
!       ScoreFile = xhextris-scores
!         DEFINES = -DHIGHSCOREFILE=\"$(ScoreDir)/$(ScoreFile)\" -DHEXFONTDIR=\"$(FONTDIR)/misc\"
!         HEADERS = header.h
!            SRCS = hextris.c xio.c stdsys.c
!            OBJS = hextris.o xio.o stdsys.o
! LOCAL_LIBRARIES = $(XLIB)
!         DEPLIBS = $(DEPXLIB)
! 
!  PROGRAM = xhextris
! 
! all:: xhextris
! 
! xhextris: $(OBJS) $(DEPLIBS)
! 	$(RM) $@
! 	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
! 
! install:: xhextris
! 	@if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
! 	else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
! 	$(INSTALL) -c $(INSTPGMFLAGS)  xhextris $(DESTDIR)$(BINDIR)
! 
! install.man:: xhextris.man
! 	@if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
! 	else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
! 	$(INSTALL) -c $(INSTMANFLAGS) xhextris.man $(DESTDIR)$(MANDIR)/xhextris.$(MANSUFFIX)
! 
! depend::
! 	$(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
! 
! lint:
! 	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
! lint1:
! 	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
! 
! clean::
! 	$(RM) $(PROGRAM)
! 
! hex20.pcf: hex20.bdf
! 	bdftopcf < hex20.bdf > hex20.pcf
! 
! install.font: hex20.pcf
! 	install -m 444 hex20.pcf $(FONTDIR)/misc
! 	$(MKFONTDIR) $(FONTDIR)/misc
! 
! install:: $(ScoreFile)
! 	@if [ -d $(DESTDIR)$(ScoreDir) ]; then set +x; \
! 	else (set -x; $(MKDIRHIER) $(DESTDIR)$(ScoreDir)); fi
! 	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
! 	for i in $(ScoreFile); do \
! 	(set -x; $(INSTALL) -c -m 666 $$i $(DESTDIR)$(ScoreDir)); \
! 	done
! 
! # -------------------------------------------------------------------------
! # common rules for all Makefiles - do not edit
! 
! emptyrule::
! 
! clean::
! 	$(RM_CMD) "#"*
! 
! Makefile::
! 	-@if [ -f Makefile ]; then set -x; \
! 	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
! 	else exit 0; fi
! 	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
! 
! tags::
! 	$(TAGS) -w *.[ch]
! 	$(TAGS) -xw *.[ch] > TAGS
! 
! # -------------------------------------------------------------------------
! # empty rules for directories that do not have SUBDIRS - do not edit
! 
! install::
! 	@echo "install in $(CURRENT_DIR) done"
! 
! install.man::
! 	@echo "install.man in $(CURRENT_DIR) done"
! 
! install.linkkit::
! 	@echo "install.linkkit in $(CURRENT_DIR) done"
! 
! Makefiles::
  
! includes::
  
! # -------------------------------------------------------------------------
! # dependencies generated by makedepend
  
--- 1,95 ----
  # Makefile generated by imake - do not edit!
! # $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
  
  #
! #  hextris Copyright 1990 David Markley, dm3e@+andrew.cmu.edu, dam@cs.cmu.edu
  #
! #  Permission to use, copy, modify, and distribute, this software and its
! #  documentation for any purpose is hereby granted without fee, provided that
! #  the above copyright notice appear in all copies and that both that
! #  copyright notice and this permission notice appear in supporting
! #  documentation, and that the name of the copyright holders be used in
! #  advertising or publicity pertaining to distribution of the software with
! #  specific, written prior permission, and that no fee is charged for further
! #  distribution of this software, or any modifications thereof.  The copyright
! #  holder make no representations about the suitability of this software for
! #  any purpose.  It is provided "as is" without express or implied warranty.
  #
! #  THE COPYRIGHT HOLDER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
! #  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
! #  EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
! #  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
! #  DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
! #  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
! #  PERFORMANCE OF THIS SOFTWARE.
! #
  
! CC=cc
  
! CFLAGS= -O
! # Make sure INCLDS has the correct area(s) for the needed #includes
! INCLDS= -I.
! # Make sure LIBS has the correct area(s) for the needed libraries (-lX11).
! LIBS= -L.
! LOGGING=
! 
! # Make sure to change these same three variables in header.h
! 
! # Make this point to where you want the xhextris font placed.
! HEXFONTDIR=./
! # Make this point to where you want the high score file placed.
! # Remember: This directory must be writable be another user, if you
! # plan on keeping a common high score file.
! HIGHSCOREDIR=./
! # Make this the name of the high score file.
! HIGHSCOREEXT=xhextris.scores
! 
! # This is where you want the binaries to be placed.
! # Don't bother with the SECURE and UNPRIV, unless you have a setup where
! # the game has to switch tokens to write the high scores. Send me mail if you
! # do. The games maintainers at CMU have a good setup for this.
! BIN=/tmp
! SECURE=${BIN}
! UNPRIV=${BIN}
! 
! DEFS= -DHEXFONTDIR="\"${HEXFONTDIR}/\"" -DHIGHSCOREDIR="\"${HIGHSCOREDIR}/\"" \
! 	-DHIGHSCOREEXT="\"${HIGHSCOREEXT}\""
! .c.o:
! 	${CC} ${CFLAGS} ${DEFS} ${INCLDS} -c $*.c
! 
! all: installx installtop
! 	bdftosnf < hex10.bdf > ${HEXFONTDIR}/xhextris.snf
! 	mkfontdir ${HEXFONTDIR}
! 	echo "foo" > ${HIGHSCOREDIR}/${HIGHSCOREEXT}
! 
! xhextris : stdsys.o xio.o hextris.o header.h
! 	${CC} ${CFLAGS} ${DEFS} -o xhextris stdsys.o xio.o hextris.o \
! 	${INCLDS} ${AUTHLIBS} ${LIBS} -lX11 ${LOGGING}
! 
! # This is only usefull if you use the Andrew Window Manager
! wmhextris: stdsys.o wmio.o hextris.o header.h
! 	${CC} ${CFLAGS} ${DEFS} -o wmhextris stdsys.o wmio.o hextris.o \
! 	${INCLDS} ${AUTHLIBS} ${LIBS} -lwm ${LOGGING}
! 
! tophextris: stdsys.o tophextris.o header.h
! 	${CC} -O ${DEFS} ${INCLDS} -o tophextris stdsys.o tophextris.o \
! 	${AUTHLIBS} ${LIBS}
! 
! installx: xhextris
! 	install -s xhextris ${SECURE}/xhextris
! 
! # This is only usefull if you use the Andrew Window Manager
! installwm: wmhextris
! 	install -s wmhextris ${SECURE}/hextris
! 
! installtop: tophextris
! 	install -s tophextris ${UNPRIV}/tophextris
! 
! clean:
! 	-	rm *.o xhextris wmhextris hextris
! 
! xio.o: header.h
! hextris.o: header.h
! stdsys.o: header.h
! tophextris.o: header.h
  
Only in .: README.Linux
Only in .: README.Linux~
diff -c3 -r ./header.h ../xhextris/header.h
*** ./header.h	Tue Apr  6 21:43:45 1993
--- ../xhextris/header.h	Fri Apr 27 10:46:28 1990
***************
*** 38,44 ****
  #define MAXNAMELENGTH 40
  /* The maximum length of the users id.
   */
! #define MAXUSERIDLENGTH 40
  /* The maximum nuber of high scores a user can have in the high score file.
   */
  #define MAXUSERHIGHS 3
--- 38,44 ----
  #define MAXNAMELENGTH 40
  /* The maximum length of the users id.
   */
! #define MAXUSERIDLENGTH 5
  /* The maximum nuber of high scores a user can have in the high score file.
   */
  #define MAXUSERHIGHS 3
***************
*** 47,59 ****
  #define NUMBEROFPIECES 10
  /* The name of the xhextris font. DON'T CHANGE!!!
   */
! #define HEXFONTNAME "hex20"
  /* The directory where the text font is.
   */
  #define FONTDIR "/usr/lib/X11/fonts/misc/"
  /* The text font being used.
   */
! #define FONTNAME "-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1" /*8x13B"*/
  /* The name on the window.
   */
  #define WINDOWNAME "xhextris"
--- 47,59 ----
  #define NUMBEROFPIECES 10
  /* The name of the xhextris font. DON'T CHANGE!!!
   */
! #define HEXFONTNAME "xhextris"
  /* The directory where the text font is.
   */
  #define FONTDIR "/usr/lib/X11/fonts/misc/"
  /* The text font being used.
   */
! #define FONTNAME "8x13bold"
  /* The name on the window.
   */
  #define WINDOWNAME "xhextris"
***************
*** 61,66 ****
--- 61,78 ----
   */
  #define ICONNAME "xhextris"
  
+ /* Don't worry about this stuff, it's Andrew specific.
+  */
+ #ifdef sun4_40
+ #define FONTDIR "/afs/andrew.cmu.edu/usr10/dm3e/.fonts/.X11/sun4_40/"
+ #define HIGHSCOREDIR "/afs/andrew.cmu.edu/usr10/dm3e/.logs/"
+ #endif
+ 
+ #ifdef mac2_51
+ #define FONTDIR "/afs/andrew.cmu.edu/usr10/dm3e/.fonts/.X11/mac2_51/"
+ #define HIGHSCOREDIR "/afs/andrew.cmu.edu/usr10/dm3e/.logs/"
+ #endif
+ 
  /* This is the type definition for a piece.
   */
  typedef struct piece_s
***************
*** 166,169 ****
  char log_message[80];
  #endif
  
- extern int score_cardinal;
--- 178,180 ----
Only in .: hex.diff
Only in ../xhextris: hex10.bdf
Only in .: hex20.bdf
Only in .: hex20.pcf
diff -c3 -r ./hextris.c ../xhextris/hextris.c
*** ./hextris.c	Mon Apr  5 19:55:55 1993
--- ../xhextris/hextris.c	Fri Apr 27 10:46:29 1990
***************
*** 33,62 ****
  /* This places the piece on the board in its starting position. All the
   * hexes in the piece are displayed.
   */
! init_piece(piece, upos)
! piece_t *piece; int upos;
  {
      int base, form, i;
      base = (piece->column % 2) ? 0 : 8;
      form = piece->type * 6 + piece->rotation;
  
!     if (upos)
!       redraw_position();
!     for (i = 0; i < 7; i += 2) {
        draw_hex(piece->row+shape[form][base+i],
  		 piece->column+shape[form][base+1+i],1,piece->type);
-       if (upos)
- 	draw_pos(piece->column+shape[form][base+1+i],1,piece->type);
-     }
- }
- 
- redraw_position()
- {
-   int i;
- 
-   for (i = 0; i < MAXCOLUMN; i++)
-     draw_hex(MAXROW + 2, i, 0, 10);
- 
  }
  
  /* This places the piece in its new position. This is done by comparing
--- 33,48 ----
  /* This places the piece on the board in its starting position. All the
   * hexes in the piece are displayed.
   */
! init_piece(piece)
! piece_t *piece;
  {
      int base, form, i;
      base = (piece->column % 2) ? 0 : 8;
      form = piece->type * 6 + piece->rotation;
  
!     for (i = 0; i < 7; i += 2)
        draw_hex(piece->row+shape[form][base+i],
  		 piece->column+shape[form][base+1+i],1,piece->type);
  }
  
  /* This places the piece in its new position. This is done by comparing
***************
*** 65,86 ****
   * any hexes that will be covered. In this way, any piece that is already
   * covered, and will be covered, is not redrawn.
   */
! place_piece(piece,tpiece,upos)
! piece_t *piece, *tpiece; int upos;
  {
      int base, form, tbase, tform, i, j, diff;
-     int pos[MAXCOLUMN];
      base = (piece->column % 2) ? 0 : 8;
      form = piece->type * 6 + piece->rotation;
      tbase = (tpiece->column % 2) ? 0 : 8;
      tform = tpiece->type * 6 + tpiece->rotation;
! 
!     if (upos) {
!       for (i = 0; i < MAXCOLUMN; i++)
! 	pos[i] = 0;
!       redraw_position();
!     }
! 
      for (i = 0; i < 7; i += 2) {
  	for (j = 0; j < 7; j += 2) {
  	    diff = 1;
--- 51,65 ----
   * any hexes that will be covered. In this way, any piece that is already
   * covered, and will be covered, is not redrawn.
   */
! place_piece(piece,tpiece)
! piece_t *piece, *tpiece;
  {
      int base, form, tbase, tform, i, j, diff;
      base = (piece->column % 2) ? 0 : 8;
      form = piece->type * 6 + piece->rotation;
      tbase = (tpiece->column % 2) ? 0 : 8;
      tform = tpiece->type * 6 + tpiece->rotation;
!     
      for (i = 0; i < 7; i += 2) {
  	for (j = 0; j < 7; j += 2) {
  	    diff = 1;
***************
*** 95,106 ****
  	if (diff)
  	  draw_hex(tpiece->row+shape[tform][tbase+i],
  		     tpiece->column+shape[tform][tbase+1+i],1,tpiece->type);
- 	if (upos) {
- 	  if (!pos[i]) {
- 	    draw_pos(tpiece->column+shape[tform][tbase+1+i],1,tpiece->type);
- 	    pos[i] = 1;
- 	  }
- 	}
      }
  
      for (i = 0; i < 7; i += 2) {
--- 74,79 ----
***************
*** 309,321 ****
      case 0:
  	tpiece.column--;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece, 1);
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
  	} else {
  	    tpiece.row -= (1-((piece->column & 1)*2));
  	    if (! check_piece(&tpiece,grid)) {
! 		place_piece(piece,&tpiece, 1);
  		piece->column = tpiece.column;
  		piece->row = tpiece.row;
  	    }
--- 282,294 ----
      case 0:
  	tpiece.column--;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece);
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
  	} else {
  	    tpiece.row -= (1-((piece->column & 1)*2));
  	    if (! check_piece(&tpiece,grid)) {
! 		place_piece(piece,&tpiece);
  		piece->column = tpiece.column;
  		piece->row = tpiece.row;
  	    }
***************
*** 324,336 ****
      case 1:
  	tpiece.column++;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece, 1);
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
  	} else {
  	    tpiece.row -= (1-((piece->column & 1)*2));
  	    if (! check_piece(&tpiece,grid)) {
! 		place_piece(piece,&tpiece, 1);
  		piece->column = tpiece.column;
  		piece->row = tpiece.row;
  	    }
--- 297,309 ----
      case 1:
  	tpiece.column++;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece);
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
  	} else {
  	    tpiece.row -= (1-((piece->column & 1)*2));
  	    if (! check_piece(&tpiece,grid)) {
! 		place_piece(piece,&tpiece);
  		piece->column = tpiece.column;
  		piece->row = tpiece.row;
  	    }
***************
*** 340,346 ****
  	tpiece.rotation++;
  	tpiece.rotation = (tpiece.rotation > 5) ? 0 : tpiece.rotation;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece, 1);
  	    piece->rotation = tpiece.rotation;
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
--- 313,319 ----
  	tpiece.rotation++;
  	tpiece.rotation = (tpiece.rotation > 5) ? 0 : tpiece.rotation;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece);
  	    piece->rotation = tpiece.rotation;
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
***************
*** 350,356 ****
  	tpiece.rotation--;
  	tpiece.rotation = (tpiece.rotation < 0) ? 5 : tpiece.rotation;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece, 1);
  	    piece->rotation = tpiece.rotation;
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
--- 323,329 ----
  	tpiece.rotation--;
  	tpiece.rotation = (tpiece.rotation < 0) ? 5 : tpiece.rotation;
  	if (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece);
  	    piece->rotation = tpiece.rotation;
  	    piece->column = tpiece.column;
  	    piece->row = tpiece.row;
***************
*** 359,365 ****
      case 4:
  	tpiece.row++;
  	while (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece,0);
  	    piece->row++;
  	    tpiece.row++;
  	    *score += 10;
--- 332,338 ----
      case 4:
  	tpiece.row++;
  	while (! check_piece(&tpiece,grid)) {
! 	    place_piece(piece,&tpiece);
  	    piece->row++;
  	    tpiece.row++;
  	    *score += 10;
***************
*** 399,410 ****
  	display_scores(score,rows);
  	game_over =  (piece->row < 2) ? 1 : 0;
  	new_piece(npiece,piece);
! 	init_piece(piece, 1);
  	show_next_piece(npiece);
      } else {
  	tpiece.row--;
  	piece->row++;
! 	place_piece(&tpiece,piece, 0);
  	game_over = 0;
      }
      return game_over;
--- 372,383 ----
  	display_scores(score,rows);
  	game_over =  (piece->row < 2) ? 1 : 0;
  	new_piece(npiece,piece);
! 	init_piece(piece);
  	show_next_piece(npiece);
      } else {
  	tpiece.row--;
  	piece->row++;
! 	place_piece(&tpiece,piece);
  	game_over = 0;
      }
      return game_over;
***************
*** 427,433 ****
      new_piece(npiece,piece);
      *score = 0;
      *rows = 0;
!     init_piece(piece, 1);
      show_next_piece(npiece);
  }
  
--- 400,406 ----
      new_piece(npiece,piece);
      *score = 0;
      *rows = 0;
!     init_piece(piece);
      show_next_piece(npiece);
  }
  
***************
*** 472,479 ****
  		high_scores[j].score = high_scores[j+1].score;
  		high_scores[j].rows = high_scores[j+1].rows;
  	    }
! 	    strcpy(high_scores[MAXHIGHSCORES-1].name, "nobody");
! 	    strcpy(high_scores[MAXHIGHSCORES-1].userid, "NON");
  	    high_scores[MAXHIGHSCORES-1].score = 0;
  	    high_scores[MAXHIGHSCORES-1].rows = 0;
  	    i--;
--- 445,452 ----
  		high_scores[j].score = high_scores[j+1].score;
  		high_scores[j].rows = high_scores[j+1].rows;
  	    }
! 	    strcpy(high_scores[MAXHIGHSCORES-1].name, "David Markley");
! 	    strcpy(high_scores[MAXHIGHSCORES-1].userid, "CMU");
  	    high_scores[MAXHIGHSCORES-1].score = 0;
  	    high_scores[MAXHIGHSCORES-1].rows = 0;
  	    i--;
***************
*** 505,517 ****
   * I/O handler supplies it.
   */
  do_choice(choice,grid,npiece,piece,score,rows,game_over,game_view,high_scores)
! char *choice;
  position_t grid[MAXROW][MAXCOLUMN];
  piece_t *npiece,*piece;
  int *score, *rows, *game_over, *game_view;
  high_score_t high_scores[MAXHIGHSCORES];
  {
!     switch (choice[0]) {
      case 'j': case 'J': case '4':
  	if (! *game_over)
  	  update(0,grid,npiece,piece,score,rows);
--- 478,490 ----
   * I/O handler supplies it.
   */
  do_choice(choice,grid,npiece,piece,score,rows,game_over,game_view,high_scores)
! char choice;
  position_t grid[MAXROW][MAXCOLUMN];
  piece_t *npiece,*piece;
  int *score, *rows, *game_over, *game_view;
  high_score_t high_scores[MAXHIGHSCORES];
  {
!     switch (choice) {
      case 'j': case 'J': case '4':
  	if (! *game_over)
  	  update(0,grid,npiece,piece,score,rows);
***************
*** 544,550 ****
  	if (! *game_over) {
  	    *game_over = 2;
  	    display_high_scores(high_scores);
! 	    display_help_score();
  	}
  	break;
      case 'u': case 'U':
--- 517,523 ----
  	if (! *game_over) {
  	    *game_over = 2;
  	    display_high_scores(high_scores);
! 	    display_help();
  	}
  	break;
      case 'u': case 'U':
***************
*** 576,599 ****
  #ifdef LOG
  	loguse(LOGHOST,"xhexlog",log_message);
  #endif
-       case '\024':
- 	if (strcmp(choice, "\024[A") == 0) {
- 	  if (! *game_over)
- 	    update(3,grid,npiece,piece,score,rows);
- 	}
- 	else if (strcmp(choice, "\024[B") == 0) {
- 	  if (! *game_over)
- 	    update(0,grid,npiece,piece,score,rows);
- 	}
- 	else if (strcmp(choice, "\024[C") == 0) {
- 	  if (! *game_over)
- 	    update(1,grid,npiece,piece,score,rows);
- 	}
- 	else if (strcmp(choice, "\024[D") == 0) {
- 	  if (! *game_over)
- 	    update(2,grid,npiece,piece,score,rows);
- 	}
- 	break;
      }
  }
  
--- 549,554 ----
***************
*** 608,614 ****
      if (! game_view) {
  	redraw_grid(grid);
  	draw_borders();
! 	init_piece(piece, 1);
  	display_scores(score,rows);
  	display_help();
  	show_next_piece(npiece);
--- 563,569 ----
      if (! game_view) {
  	redraw_grid(grid);
  	draw_borders();
! 	init_piece(piece);
  	display_scores(score,rows);
  	display_help();
  	show_next_piece(npiece);
***************
*** 615,621 ****
      } else {
  	if (read_high_scores(high_scores))
  	  display_high_scores(high_scores);
! 	display_help_score();
! /*	display_scores(score,rows);*/
      }
  }
--- 570,576 ----
      } else {
  	if (read_high_scores(high_scores))
  	  display_high_scores(high_scores);
! 	display_help();
! 	display_scores(score,rows);
      }
  }
diff -c3 -r ./stdsys.c ../xhextris/stdsys.c
*** ./stdsys.c	Tue Apr  6 22:21:20 1993
--- ../xhextris/stdsys.c	Fri Apr 27 10:46:30 1990
***************
*** 99,105 ****
      char high_score_file_name[512];
      char buffer[40];
  
!     strcpy(high_score_file_name,HIGHSCOREFILE);
      
      if ((high_score_file = fopen(high_score_file_name , "r")) == NULL) {
  	fprintf(stderr,"xhextris: Can't open high score file.\n");
--- 99,106 ----
      char high_score_file_name[512];
      char buffer[40];
  
!     strcpy(high_score_file_name,HIGHSCOREDIR);
!     strcat(high_score_file_name,HIGHSCOREEXT);
      
      if ((high_score_file = fopen(high_score_file_name , "r")) == NULL) {
  	fprintf(stderr,"xhextris: Can't open high score file.\n");
***************
*** 119,126 ****
  	  break;
      }
      for (j = i; j < MAXHIGHSCORES; j++) {
! 	strcpy(high_scores[j].name,"nobody");
! 	strcpy(high_scores[j].userid,"NON");
  	high_scores[j].score = 0;
  	high_scores[j].rows = 0;
      }
--- 120,127 ----
  	  break;
      }
      for (j = i; j < MAXHIGHSCORES; j++) {
! 	strcpy(high_scores[j].name,"David Markley");
! 	strcpy(high_scores[j].userid,"CMU");
  	high_scores[j].score = 0;
  	high_scores[j].rows = 0;
      }
***************
*** 136,150 ****
  {
      int i;
      FILE *high_score_file;
      char high_score_file_name[512];
      char buffer[40];
      
!     strcpy(high_score_file_name,HIGHSCOREFILE);
      
  #ifdef AFS
      beGames();
  #endif
!     if ((high_score_file = fopen(high_score_file_name, "w")) == NULL) {
  	fprintf(stderr,"xhextris: Can't open high score file.\n");
  	return 0;
      }
--- 137,155 ----
  {
      int i;
      FILE *high_score_file;
+     char tmp_high_score_file_name[512];
      char high_score_file_name[512];
      char buffer[40];
      
!     strcpy(tmp_high_score_file_name,HIGHSCOREDIR);
!     strcat(tmp_high_score_file_name,uniqueid);
!     strcpy(high_score_file_name,HIGHSCOREDIR);
!     strcat(high_score_file_name,HIGHSCOREEXT);
      
  #ifdef AFS
      beGames();
  #endif
!     if ((high_score_file = fopen(tmp_high_score_file_name, "w")) == NULL) {
  	fprintf(stderr,"xhextris: Can't open high score file.\n");
  	return 0;
      }
***************
*** 160,166 ****
      }
      fflush(high_score_file);
      fclose(high_score_file);
! /*    rename(tmp_high_score_file_name,high_score_file_name);*/
  #ifdef AFS
      bePlayer();
  #endif
--- 165,171 ----
      }
      fflush(high_score_file);
      fclose(high_score_file);
!     rename(tmp_high_score_file_name,high_score_file_name);
  #ifdef AFS
      bePlayer();
  #endif
Only in ../xhextris: tophextris.c
Only in ../xhextris: wmio.c
Only in .: xhextris-scores
Only in .: xhextris.man
diff -c3 -r ./xio.c ../xhextris/xio.c
*** ./xio.c	Tue Apr  6 22:11:23 1993
--- ../xhextris/xio.c	Fri Apr 27 10:46:31 1990
***************
*** 55,64 ****
  GC gc, hexgc;
  XFontStruct *font_info, *hexfont_info;
  Pixmap black, white;
- XColor Orange1, Red1, Blue1, Green1, Yellow1, Chocolate1, Purple1, 
-   SteelBlue1, Black, White, Plum1, Maroon1, Pink1, Wheat;
- XColor Orange4, Red4, Blue4, Green4, Yellow4, Chocolate4, Purple4, SteelBlue4,
-   Plum4, Maroon4, Pink4, DarkSlateGrey;
  #ifdef AFS
  extern int PlayerUID;
  #endif
--- 55,60 ----
***************
*** 69,75 ****
  int argc;
  char **argv;
  {
!     char buffer[512];
      int width, height, i, bufsize=20, inverse=0, pleasure=0, window_size = 0;
      XSizeHints size_hints;
      XEvent report;
--- 65,71 ----
  int argc;
  char **argv;
  {
!     char buffer[20];
      int width, height, i, bufsize=20, inverse=0, pleasure=0, window_size = 0;
      XSizeHints size_hints;
      XEvent report;
***************
*** 82,88 ****
      struct passwd  *pwent;
  /* The following variables are required by hextris */
      int score = 0, rows = 0, game_over = 1, game_view = 1, oldscore = 0;
- 
      high_score_t high_scores[MAXHIGHSCORES];
      position_t grid[MAXROW][MAXCOLUMN];
      piece_t npiece, piece;
--- 78,83 ----
***************
*** 189,195 ****
  		case KeyPress:
  		    XLookupString(&report, buffer, bufsize, &key, &compose);
  		    oldscore = score;
! 		    do_choice(buffer,grid,&npiece,&piece,&score,&rows,
  			      &game_over, &game_view, high_scores);
  		    if ((score != oldscore) || (! score)) {
  			XSync(display,True);
--- 184,190 ----
  		case KeyPress:
  		    XLookupString(&report, buffer, bufsize, &key, &compose);
  		    oldscore = score;
! 		    do_choice(buffer[0],grid,&npiece,&piece,&score,&rows,
  			      &game_over, &game_view, high_scores);
  		    if ((score != oldscore) || (! score)) {
  			XSync(display,True);
***************
*** 218,282 ****
  	    exit(-1);
  	}
      screen = DefaultScreen(display);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "red4", &Red4, &Red4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "green4", &Green4, &Green4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "black", &Black, &Black);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "white", &White, &White);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Orange4", &Orange4, &Orange4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "blue4", &Blue4, &Blue4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "yellow4", &Yellow4, &Yellow4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "chocolate4", &Chocolate4, &Chocolate4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "purple4", &Purple4, &Purple4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "SteelBlue4", &SteelBlue4, &SteelBlue4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Plum4", &Plum4, &Plum4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Maroon4", &Maroon4, &Maroon4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "pink4", &Pink4, &Pink4);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Wheat", &Wheat, &Wheat);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "darkslategrey", &DarkSlateGrey, &DarkSlateGrey);
- 
- 
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "red1", &Red1, &Red1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "green1", &Green1, &Green1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Orange1", &Orange1, &Orange1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "blue1", &Blue1, &Blue1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "yellow1", &Yellow1, &Yellow1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "chocolate1", &Chocolate1, &Chocolate1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "purple1", &Purple1, &Purple1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "SteelBlue1", &SteelBlue1, &SteelBlue1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Plum1", &Plum1, &Plum1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "Maroon1", &Maroon1, &Maroon1);
-     XAllocNamedColor(display, DefaultColormap(display, screen),
- 		     "pink1", &Pink1, &Pink1);
      black = BlackPixel(display, screen);
      white = WhitePixel(display, screen);
! 
      set_font_path(HEXFONTDIR);
! 
  }
  
  /* This sets up the font path to contain the directories that have the
--- 213,227 ----
  	    exit(-1);
  	}
      screen = DefaultScreen(display);
      black = BlackPixel(display, screen);
      white = WhitePixel(display, screen);
!     if (inverse) {
! 	temp = black;
! 	black = white;
! 	white = temp;
!     }
      set_font_path(HEXFONTDIR);
!     set_font_path(FONTDIR);
  }
  
  /* This sets up the font path to contain the directories that have the
***************
*** 314,341 ****
  int argc;
  {
      *width = MAXCOLUMN*40;
!     *height = (MAXROW+4)*20;
!     win = XCreateSimpleWindow(display,RootWindow(display, screen),0,0,
! 			      *width, *height, 4, white, black);
      size_hints->flags = PPosition | PSize | PMinSize;
!     size_hints->x = 0;
!     size_hints->y = 0;
      size_hints->width = *width;
      size_hints->height = *height;
      size_hints->min_width = 300;
      size_hints->min_height = 700;
!     XSetStandardProperties(display, win, WINDOWNAME, ICONNAME, (int) NULL, argv,
  			   argc, size_hints);
      XSelectInput(display, win, ExposureMask | KeyPressMask | ButtonPressMask |
  		 StructureNotifyMask | EnterWindowMask | LeaveWindowMask);
      load_font(&font_info, FONTNAME);
      get_GC(win, &gc, font_info);
-     XSetForeground(display, gc, Wheat.pixel);
-     XSetBackground(display, gc, black);
      load_font(&hexfont_info, HEXFONTNAME);
      get_GC(win, &hexgc, hexfont_info);
-     XSetForeground(display, hexgc, black);
-     XSetBackground(display, hexgc, DarkSlateGrey.pixel);
      XMapWindow(display, win);
      XFlush(display);
  }
--- 259,282 ----
  int argc;
  {
      *width = MAXCOLUMN*40;
!     *height = (MAXROW+4)*26;
!     win = XCreateSimpleWindow(display,RootWindow(display, screen),50,50,
! 			      *width, *height, 4, black, white);
      size_hints->flags = PPosition | PSize | PMinSize;
!     size_hints->x = 50;
!     size_hints->y = 50;
      size_hints->width = *width;
      size_hints->height = *height;
      size_hints->min_width = 300;
      size_hints->min_height = 700;
!     XSetStandardProperties(display, win, WINDOWNAME, ICONNAME, NULL, argv,
  			   argc, size_hints);
      XSelectInput(display, win, ExposureMask | KeyPressMask | ButtonPressMask |
  		 StructureNotifyMask | EnterWindowMask | LeaveWindowMask);
      load_font(&font_info, FONTNAME);
      get_GC(win, &gc, font_info);
      load_font(&hexfont_info, HEXFONTNAME);
      get_GC(win, &hexgc, hexfont_info);
      XMapWindow(display, win);
      XFlush(display);
  }
***************
*** 359,365 ****
  
      *tgc = XCreateGC(display, win, valuemask, &values);
      XSetFont(display, *tgc, tfont_info->fid);
!     XSetForeground(display, *tgc, white);
      XSetLineAttributes(display, *tgc, line_width, line_style, cap_style,
  		   join_style);
      XSetDashes(display, *tgc, dash_offset, dash_list, list_length);
--- 300,306 ----
  
      *tgc = XCreateGC(display, win, valuemask, &values);
      XSetFont(display, *tgc, tfont_info->fid);
!     XSetForeground(display, *tgc, black);
      XSetLineAttributes(display, *tgc, line_width, line_style, cap_style,
  		   join_style);
      XSetDashes(display, *tgc, dash_offset, dash_list, list_length);
***************
*** 411,418 ****
  
      XSetFillStyle(display, gc, FillSolid);
      sprintf(scores,"Score: %6d", *score);
!     y_offset = 160;
!     x_offset = (MAXCOLUMN + 1) * 20;
      XClearArea(display,win,x_offset,y_offset-20,MAXCOLUMN*20, 50, False);
      XDrawString(display, win, gc, x_offset, y_offset, scores,strlen(scores));
      sprintf(scores,"Rows: %3d", *rows);
--- 352,359 ----
  
      XSetFillStyle(display, gc, FillSolid);
      sprintf(scores,"Score: %6d", *score);
!     y_offset = 250;
!     x_offset = (MAXCOLUMN + 5) * 20;
      XClearArea(display,win,x_offset,y_offset-20,MAXCOLUMN*20, 50, False);
      XDrawString(display, win, gc, x_offset, y_offset, scores,strlen(scores));
      sprintf(scores,"Rows: %3d", *rows);
***************
*** 450,457 ****
  
  
      XSetFillStyle(display, gc, FillSolid);
!     y_offset = 200;
!     x_offset = (MAXCOLUMN + 1) * 20;
      for (i = 0; i < 19; i++)
  	XDrawString(display, win, gc, x_offset, y_offset+(i*17), message[i],
  		    strlen(message[i]));
--- 391,398 ----
  
  
      XSetFillStyle(display, gc, FillSolid);
!     y_offset = 315;
!     x_offset = (MAXCOLUMN + 4) * 20;
      for (i = 0; i < 19; i++)
  	XDrawString(display, win, gc, x_offset, y_offset+(i*17), message[i],
  		    strlen(message[i]));
***************
*** 458,480 ****
      XFlush(display);
  }
  
- display_help_score()
- {
-     int y_offset, x_offset, i;
-     static char *message[] = { "Keys:",
- 				 "N,n - new game.",
- 				 "G,g - show game.",
- 				 "Q,q - quit game."};
- 
-     XSetFillStyle(display, gc, FillSolid);
-     y_offset = 200;
-     x_offset = (MAXCOLUMN + 1) * 26;
-     for (i = 0; i < 4; i++)
- 	XDrawString(display, win, gc, x_offset, y_offset+(i*17), message[i],
- 		    strlen(message[i]));
-     XFlush(display);
- }
- 
  /* This is required by hextris!
   *
   * This displays the high score list.
--- 399,404 ----
***************
*** 494,508 ****
        XDrawString(display, win, gc, x_offset[i], y_offset,
  		  header[i],strlen(header[i]));
      y_offset = 60;
!     for (i = 0; i < ((MAXHIGHSCORES > 40) ? 30 : MAXHIGHSCORES); i++) {
  	itoa(i+1,message);
  	XDrawString(display, win, gc, x_offset[0], y_offset+(i*17),
  		    message,strlen(message));
  	XDrawString(display, win, gc, x_offset[1], y_offset+(i*17),
  		    high_scores[i].name,strlen(high_scores[i].name));
- 	strncpy(message, high_scores[i].userid, 5);
  	XDrawString(display, win, gc, x_offset[2], y_offset+(i*17),
! 		    message, strlen(message));
  	itoa(high_scores[i].score,message);
  	XDrawString(display, win, gc, x_offset[3], y_offset+(i*17),
  		    message,strlen(message));
--- 418,431 ----
        XDrawString(display, win, gc, x_offset[i], y_offset,
  		  header[i],strlen(header[i]));
      y_offset = 60;
!     for (i = 0; i < ((MAXHIGHSCORES > 40) ? 40 : MAXHIGHSCORES); i++) {
  	itoa(i+1,message);
  	XDrawString(display, win, gc, x_offset[0], y_offset+(i*17),
  		    message,strlen(message));
  	XDrawString(display, win, gc, x_offset[1], y_offset+(i*17),
  		    high_scores[i].name,strlen(high_scores[i].name));
  	XDrawString(display, win, gc, x_offset[2], y_offset+(i*17),
! 		    high_scores[i].userid,strlen(high_scores[i].userid));
  	itoa(high_scores[i].score,message);
  	XDrawString(display, win, gc, x_offset[3], y_offset+(i*17),
  		    message,strlen(message));
***************
*** 524,533 ****
  
      tpiece.type = npiece->type;
      tpiece.rotation = npiece->rotation;
!     tpiece.row = 1;
      tpiece.column = MAXCOLUMN+6;
!     XClearArea(display,win,(MAXCOLUMN+3)*18,0,150,140, False);
!     init_piece(&tpiece, 0);
      XFlush(display);
  }
  
--- 447,456 ----
  
      tpiece.type = npiece->type;
      tpiece.rotation = npiece->rotation;
!     tpiece.row = 4;
      tpiece.column = MAXCOLUMN+6;
!     XClearArea(display,win,(MAXCOLUMN+3)*20,0,200,230, False);
!     init_piece(&tpiece);
      XFlush(display);
  }
  
***************
*** 541,665 ****
      int y_offset, x_offset;
      char hex[2];
  
!     x_offset = 20 + column * 16;
!     y_offset = 20 + row * 19 + (column & 1) * 9;
!     if (fill) {
!       strcpy(hex, "|");
!       switch (type) {
!       case 0:
! 	XSetForeground(display, hexgc, Orange1.pixel);
! 	XSetBackground(display, hexgc, Orange4.pixel);
! 	break;
!       case 1:
! 	XSetForeground(display, hexgc, Red1.pixel);
! 	XSetBackground(display, hexgc, Red4.pixel);
! 	break;
!       case 2:
! 	XSetForeground(display, hexgc, Blue1.pixel);
! 	XSetBackground(display, hexgc, Blue4.pixel);
! 	break;
!       case 3:
! 	XSetForeground(display, hexgc, Green1.pixel);
! 	XSetBackground(display, hexgc, Green4.pixel);
! 	break;
!       case 4:
! 	XSetForeground(display, hexgc, Yellow1.pixel);
! 	XSetBackground(display, hexgc, Yellow4.pixel);
! 	break;
!       case 5:
! 	XSetForeground(display, hexgc, Chocolate1.pixel);
! 	XSetBackground(display, hexgc, Chocolate4.pixel);
! 	break;
!       case 6:
! 	XSetForeground(display, hexgc, Purple1.pixel);
! 	XSetBackground(display, hexgc, Purple4.pixel);
! 	break;
!       case 7:
! 	XSetForeground(display, hexgc, SteelBlue1.pixel);
! 	XSetBackground(display, hexgc, SteelBlue4.pixel);
! 	break;
!       case 8:
! 	XSetForeground(display, hexgc, Plum1.pixel);
! 	XSetBackground(display, hexgc, Plum4.pixel);
! 	break;
!       case 9:
! 	XSetForeground(display, hexgc, Maroon1.pixel);
! 	XSetBackground(display, hexgc, Maroon4.pixel);
! 	break;
!       case 10:
! 	XSetForeground(display, hexgc, Pink1.pixel);
! 	XSetBackground(display, hexgc, Pink4.pixel);
! 	break;
!       }	
!     } else {
! 	XSetForeground(display,hexgc,DarkSlateGrey.pixel);
! 	XSetBackground(display, hexgc, DarkSlateGrey.pixel);
! 	strcpy(hex,"}");
!     }
!     XDrawString(display, win, hexgc, x_offset, y_offset, hex, strlen(hex));
!     XFlush(display);
! }
! 
! draw_pos(column,fill,type)
! int column,fill,type;
! {
!     int y_offset, x_offset;
!     char hex[2];
! 
!     x_offset = 20 + column * 16;
!     y_offset = 20 + (MAXROW + 2) * 19 + (column & 1) * 9;
      if (fill) {
!       strcpy(hex, "|");
!       switch (type) {
!       case 0:
! 	XSetForeground(display, hexgc, Orange1.pixel);
! 	XSetBackground(display, hexgc, Orange4.pixel);
! 	break;
!       case 1:
! 	XSetForeground(display, hexgc, Red1.pixel);
! 	XSetBackground(display, hexgc, Red4.pixel);
! 	break;
!       case 2:
! 	XSetForeground(display, hexgc, Blue1.pixel);
! 	XSetBackground(display, hexgc, Blue4.pixel);
! 	break;
!       case 3:
! 	XSetForeground(display, hexgc, Green1.pixel);
! 	XSetBackground(display, hexgc, Green4.pixel);
! 	break;
!       case 4:
! 	XSetForeground(display, hexgc, Yellow1.pixel);
! 	XSetBackground(display, hexgc, Yellow4.pixel);
! 	break;
!       case 5:
! 	XSetForeground(display, hexgc, Chocolate1.pixel);
! 	XSetBackground(display, hexgc, Chocolate4.pixel);
! 	break;
!       case 6:
! 	XSetForeground(display, hexgc, Purple1.pixel);
! 	XSetBackground(display, hexgc, Purple4.pixel);
! 	break;
!       case 7:
! 	XSetForeground(display, hexgc, SteelBlue1.pixel);
! 	XSetBackground(display, hexgc, SteelBlue4.pixel);
! 	break;
!       case 8:
! 	XSetForeground(display, hexgc, Plum1.pixel);
! 	XSetBackground(display, hexgc, Plum4.pixel);
! 	break;
!       case 9:
! 	XSetForeground(display, hexgc, Maroon1.pixel);
! 	XSetBackground(display, hexgc, Maroon4.pixel);
! 	break;
!       case 10:
! 	XSetForeground(display, hexgc, Pink1.pixel);
! 	XSetBackground(display, hexgc, Pink4.pixel);
! 	break;
!       }	
      } else {
! 	XSetForeground(display,hexgc,DarkSlateGrey.pixel);
! 	XSetBackground(display, hexgc, DarkSlateGrey.pixel);
! 	strcpy(hex,"}");
      }
      XDrawString(display, win, hexgc, x_offset, y_offset, hex, strlen(hex));
      XFlush(display);
--- 464,478 ----
      int y_offset, x_offset;
      char hex[2];
  
!     x_offset = 20 + column * 20;
!     y_offset = 20 + row * 26 + (column & 1) * 13;
!     hex[0] = 'b' + type;
!     hex[1] = '\0';
      if (fill) {
! 	XSetForeground(display,hexgc,black);
      } else {
! 	XSetForeground(display,hexgc,white);
! 	strcpy(hex,"a");
      }
      XDrawString(display, win, hexgc, x_offset, y_offset, hex, strlen(hex));
      XFlush(display);
