]> git.hungrycats.org Git - xscreensaver/commitdiff
http://www.ibiblio.org/pub/historic-linux/ftp-archives/sunsite.unc.edu/Nov-06-1994... xlockmore-1.12 github/xlockmore-1.12
authorZygo Blaxell <zblaxell@hungrycats.org>
Fri, 27 Feb 2009 19:41:51 +0000 (14:41 -0500)
committerZygo Blaxell <zblaxell@hungrycats.org>
Fri, 27 Feb 2009 19:41:51 +0000 (14:41 -0500)
-rw-r--r-- 1 zblaxell zblaxell 85988 May 24  2002 xlockmore-1.12.tgz
14251e5ac163bd8f50aeaa0674ad332f5909a332  xlockmore-1.12.tgz

78 files changed:
Imakefile [new file with mode: 0644]
Makefile [new file with mode: 0644]
Makefile.hp [new file with mode: 0644]
Makefile.imake [new file with mode: 0644]
Makefile.std [new file with mode: 0644]
Makefile.sun [new file with mode: 0644]
README [new file with mode: 0644]
README.VMS [new file with mode: 0644]
README2 [new file with mode: 0644]
XLock [new file with mode: 0644]
XLock.ad [new file with mode: 0644]
blank.c [new file with mode: 0644]
blot.c [new file with mode: 0644]
bounce.c [new file with mode: 0644]
bounce0.bit [new file with mode: 0644]
bounce1.bit [new file with mode: 0644]
bounce2.bit [new file with mode: 0644]
bounce3.bit [new file with mode: 0644]
flame.c [new file with mode: 0644]
grav.c [new file with mode: 0644]
helix.c [new file with mode: 0644]
hopalong.c [new file with mode: 0644]
hsbramp.c [new file with mode: 0644]
hyper.c [new file with mode: 0644]
life.c [new file with mode: 0644]
lifeicon.gen [new file with mode: 0644]
lifeicon.hp [new file with mode: 0644]
lifeicon.sun [new file with mode: 0644]
make.com [new file with mode: 0644]
maze.c [new file with mode: 0644]
mazeicon.gen [new file with mode: 0644]
mazeicon.hp [new file with mode: 0644]
mazeicon.sun [new file with mode: 0644]
pyro.c [new file with mode: 0644]
qix.c [new file with mode: 0644]
rect.c [new file with mode: 0644]
resource.c [new file with mode: 0644]
rock.c [new file with mode: 0644]
rotor.c [new file with mode: 0644]
sphere.c [new file with mode: 0644]
spline.c [new file with mode: 0644]
swarm.c [new file with mode: 0644]
usleep.c [new file with mode: 0644]
world.c [new file with mode: 0644]
world/terra-00.xbm [new file with mode: 0644]
world/terra-01.xbm [new file with mode: 0644]
world/terra-02.xbm [new file with mode: 0644]
world/terra-03.xbm [new file with mode: 0644]
world/terra-04.xbm [new file with mode: 0644]
world/terra-05.xbm [new file with mode: 0644]
world/terra-06.xbm [new file with mode: 0644]
world/terra-07.xbm [new file with mode: 0644]
world/terra-08.xbm [new file with mode: 0644]
world/terra-09.xbm [new file with mode: 0644]
world/terra-10.xbm [new file with mode: 0644]
world/terra-11.xbm [new file with mode: 0644]
world/terra-12.xbm [new file with mode: 0644]
world/terra-13.xbm [new file with mode: 0644]
world/terra-14.xbm [new file with mode: 0644]
world/terra-15.xbm [new file with mode: 0644]
world/terra-16.xbm [new file with mode: 0644]
world/terra-17.xbm [new file with mode: 0644]
world/terra-18.xbm [new file with mode: 0644]
world/terra-19.xbm [new file with mode: 0644]
world/terra-20.xbm [new file with mode: 0644]
world/terra-21.xbm [new file with mode: 0644]
world/terra-22.xbm [new file with mode: 0644]
world/terra-23.xbm [new file with mode: 0644]
world/terra-24.xbm [new file with mode: 0644]
world/terra-25.xbm [new file with mode: 0644]
world/terra-26.xbm [new file with mode: 0644]
world/terra-27.xbm [new file with mode: 0644]
world/terra-28.xbm [new file with mode: 0644]
world/terra-29.xbm [new file with mode: 0644]
worm.c [new file with mode: 0644]
xlock.c [new file with mode: 0644]
xlock.h [new file with mode: 0644]
xlock.man [new file with mode: 0644]

diff --git a/Imakefile b/Imakefile
new file mode 100644 (file)
index 0000000..3dba5ac
--- /dev/null
+++ b/Imakefile
@@ -0,0 +1,76 @@
+XCOMM @(#)Imakefile    23.9 91/09/27
+XCOMM Imakefile - xlock
+XCOMM
+
+#ifndef MathLibrary
+#define MathLibrary -lm
+#endif
+
+#ifdef SunArchitecture
+XCOMM read the README
+XCOMM #if HasShadowPasswd
+XCOMM        CCOPTIONS = -DHAS_SHADOW
+XCOMM        CCOPTIONS = -DSOLARIS_SHADOW
+XCOMM #endif
+       ICONTYPE = sun
+#else
+#if HasShadowPasswd
+      CCOPTIONS = -DHAS_SHADOW
+      SHADOWLIB = -lshadow
+#endif
+#ifdef HPArchitecture
+      CCOPTIONS = -Aa -D_HPUX_SOURCE
+EXTRA_LIBRARIES = -lXhp11
+       ICONTYPE = hp
+#else
+       ICONTYPE = gen
+#endif
+#endif
+
+        DEFINES = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" -DSTARSIZE=2
+        DEPLIBS = $(DEPXLIB)
+LOCAL_LIBRARIES = $(XLIB)
+       LINTLIBS = $(LINTXLIB)
+#if HasLibCrypt
+       CRYPTLIB = -lcrypt
+#endif
+  SYS_LIBRARIES = MathLibrary $(CRYPTLIB) $(SHADOWLIB)
+#if defined(i386FreeBsd)
+   INSTPGMFLAGS = -s -m 4751
+#endif
+           HDRS = xlock.h
+           SRCS = xlock.c hsbramp.c resource.c usleep.c\
+               hopalong.c qix.c life.c blank.c\
+               swarm.c rotor.c pyro.c flame.c worm.c\
+               spline.c maze.c sphere.c hyper.c\
+               helix.c rock.c blot.c\
+               grav.c bounce.c world.c rect.c
+           OBJS = xlock.o hsbramp.o resource.o usleep.o\
+               hopalong.o qix.o life.o blank.o\
+               swarm.o rotor.o pyro.o flame.o worm.o\
+               spline.o maze.o sphere.o hyper.o\
+               helix.o rock.o blot.o\
+               grav.o bounce.o world.o rect.o
+
+AllTarget(xlock)
+#if ProjectX > 5
+depend:: mazeicon.bit lifeicon.bit
+#endif
+ComplexProgramTarget(xlock)
+InstallAppDefaults(XLock)
+
+clean::
+       $(RM) mazeicon.bit lifeicon.bit
+
+#if ProjectX < 6
+maze.c: mazeicon.bit
+life.c: lifeicon.bit
+#endif
+
+mazeicon.bit:
+       $(RM) mazeicon.bit
+       $(LN) mazeicon.$(ICONTYPE) mazeicon.bit
+lifeicon.bit:
+       $(RM) lifeicon.bit
+       $(LN) lifeicon.$(ICONTYPE) lifeicon.bit
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..09ef67e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,329 @@
+# Makefile generated by imake - do not edit!
+# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
+#
+# The cpp used on this machine replaces all newlines and multiple tabs and
+# spaces in a macro expansion with a single space.  Imake tries to compensate
+# for this, but is not always successful.
+#
+
+###########################################################################
+# Makefile generated from "Imake.tmpl" and <Imakefile>
+# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
+#
+# Platform-specific parameters may be set in the appropriate .cf
+# configuration files.  Site-wide parameters may be set in the file
+# site.def.  Full rebuilds are recommended if any parameters are changed.
+#
+# If your C preprocessor doesn't define any unique symbols, you'll need
+# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
+# "make Makefile", "make Makefiles", or "make World").
+#
+# If you absolutely can't get imake to work, you'll need to set the
+# variables at the top of each Makefile as well as the dependencies at the
+# bottom (makedepend will do this automatically).
+#
+
+###########################################################################
+# platform-specific configuration parameters - edit sun.cf to change
+
+# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
+# operating system:  SunOS 4.1.1
+
+###########################################################################
+# site-specific configuration parameters - edit site.def to change
+
+# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
+
+            SHELL = /bin/sh
+
+              TOP = .
+      CURRENT_DIR = .
+
+               AR = ar cq
+  BOOTSTRAPCFLAGS =
+               CC = cc
+
+         COMPRESS = compress
+              CPP = /lib/cpp $(STD_CPP_DEFINES)
+    PREPROCESSCMD = cc -E $(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
+     STD_INCLUDES =
+  STD_CPP_DEFINES =
+      STD_DEFINES =
+ EXTRA_LOAD_FLAGS =
+  EXTRA_LIBRARIES =
+             TAGS = ctags
+
+    SHAREDCODEDEF = -DSHAREDCODE
+         SHLIBDEF = -DSUNSHLIB
+
+    PROTO_DEFINES =
+
+     INSTPGMFLAGS =
+
+     INSTBINFLAGS = -m 0755
+     INSTUIDFLAGS = -m 4755
+     INSTLIBFLAGS = -m 0664
+     INSTINCFLAGS = -m 0444
+     INSTMANFLAGS = -m 0444
+     INSTDATFLAGS = -m 0444
+    INSTKMEMFLAGS = -m 4755
+
+          DESTDIR = /usr/add-on/motif
+
+     TOP_INCLUDES = -I$(INCROOT)
+
+      CDEBUGFLAGS = -O
+        CCOPTIONS =
+      COMPATFLAGS =
+
+      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
+       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
+           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
+        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
+           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
+   LDCOMBINEFLAGS = -X -r
+
+        MACROFILE = sun.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)
+
+###########################################################################
+# X Window System Build Parameters
+# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
+
+###########################################################################
+# X Window System make variables; this need to be coordinated with rules
+# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
+
+          PATHSEP = /
+        USRLIBDIR = $(DESTDIR)/usr/lib
+           BINDIR = $(DESTDIR)/usr/bin/X11
+          INCROOT = $(DESTDIR)/usr/include
+     BUILDINCROOT = $(TOP)
+      BUILDINCDIR = $(BUILDINCROOT)/X11
+      BUILDINCTOP = ..
+           INCDIR = $(INCROOT)/X11
+           ADMDIR = $(DESTDIR)/usr/adm
+           LIBDIR = $(USRLIBDIR)/X11
+        CONFIGDIR = $(LIBDIR)/config
+       LINTLIBDIR = $(USRLIBDIR)/lint
+
+          FONTDIR = $(LIBDIR)/fonts
+         XINITDIR = $(LIBDIR)/xinit
+           XDMDIR = $(LIBDIR)/xdm
+           AWMDIR = $(LIBDIR)/awm
+           TWMDIR = $(LIBDIR)/twm
+           GWMDIR = $(LIBDIR)/gwm
+          MANPATH = $(DESTDIR)/usr/man
+    MANSOURCEPATH = $(MANPATH)/man
+           MANDIR = $(MANSOURCEPATH)n
+        LIBMANDIR = $(MANSOURCEPATH)3
+      XAPPLOADDIR = $(LIBDIR)/app-defaults
+
+        SOXLIBREV = 4.2
+          SOXTREV = 4.0
+         SOXAWREV = 4.0
+        SOOLDXREV = 4.0
+         SOXMUREV = 4.0
+        SOXEXTREV = 4.0
+
+       FONTCFLAGS = -t
+
+     INSTAPPFLAGS = $(INSTDATFLAGS)
+
+            IMAKE = imake
+           DEPEND = makedepend
+              RGB = rgb
+            FONTC = bdftosnf
+        MKFONTDIR = mkfontdir
+        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
+
+        CONFIGSRC = $(TOP)/config
+        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 = $(UTILSRC)/makedepend
+         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
+     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
+     EXTENSIONSRC = $(TOP)/extensions
+
+  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
+     EXTENSIONLIB =  -lXext
+
+          DEPXLIB = $(DEPEXTENSIONLIB)
+             XLIB = $(EXTENSIONLIB) -lX11
+
+      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
+         XAUTHLIB =  -lXau
+
+        DEPXMULIB =
+           XMULIB = -lXmu
+
+       DEPOLDXLIB =
+          OLDXLIB = -loldX
+
+      DEPXTOOLLIB =
+         XTOOLLIB = -lXt
+
+        DEPXAWLIB =
+           XAWLIB = -lXaw
+
+ LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
+         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
+          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
+        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
+          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
+
+          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
+
+         DEPLIBS1 = $(DEPLIBS)
+         DEPLIBS2 = $(DEPLIBS)
+         DEPLIBS3 = $(DEPLIBS)
+
+###########################################################################
+# Imake rules for building libraries, programs, scripts, and data files
+# rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
+
+###########################################################################
+# start of Imakefile
+
+       ICONTYPE = sun
+
+        DEFINES = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" -DSTARSIZE=2
+        DEPLIBS = $(DEPXLIB)
+LOCAL_LIBRARIES = $(XLIB)
+       LINTLIBS = $(LINTXLIB)
+
+  SYS_LIBRARIES = -lm $(CRYPTLIB) $(SHADOWLIB)
+
+           HDRS = xlock.h
+           SRCS = xlock.c hsbramp.c resource.c usleep.c\
+               hopalong.c qix.c life.c blank.c\
+               swarm.c rotor.c pyro.c flame.c worm.c\
+               spline.c maze.c sphere.c hyper.c\
+               helix.c rock.c blot.c\
+               grav.c bounce.c world.c rect.c
+           OBJS = xlock.o hsbramp.o resource.o usleep.o\
+               hopalong.o qix.o life.o blank.o\
+               swarm.o rotor.o pyro.o flame.o worm.o\
+               spline.o maze.o sphere.o hyper.o\
+               helix.o rock.o blot.o\
+               grav.o bounce.o world.o rect.o
+
+all:: xlock
+
+ PROGRAM = xlock
+
+all:: xlock
+
+xlock: $(OBJS) $(DEPLIBS)
+       $(RM) $@
+       $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
+
+install:: xlock
+       $(INSTALL) -c $(INSTPGMFLAGS)   xlock $(BINDIR)
+
+install.man:: xlock.man
+       $(INSTALL) -c $(INSTMANFLAGS) xlock.man $(MANDIR)/xlock.n
+
+depend::
+       $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
+
+lint:
+       $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
+lint1:
+       $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
+
+clean::
+       $(RM) $(PROGRAM)
+
+install:: XLock.ad
+       $(INSTALL) -c $(INSTAPPFLAGS) XLock.ad $(XAPPLOADDIR)/XLock
+
+clean::
+       $(RM) mazeicon.bit lifeicon.bit
+
+maze.c: mazeicon.bit
+life.c: lifeicon.bit
+
+mazeicon.bit:
+       $(RM) mazeicon.bit
+       $(LN) mazeicon.$(ICONTYPE) mazeicon.bit
+
+lifeicon.bit:
+       $(RM) lifeicon.bit
+       $(LN) lifeicon.$(ICONTYPE) lifeicon.bit
+
+###########################################################################
+# common rules for all Makefiles - do not edit
+
+emptyrule::
+
+clean::
+       $(RM_CMD) \#*
+
+Makefile::
+       -@if [ -f Makefile ]; then \
+       echo "  $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
+       $(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"
+
+Makefiles::
+
+includes::
+
+###########################################################################
+# dependencies generated by makedepend
+
diff --git a/Makefile.hp b/Makefile.hp
new file mode 100644 (file)
index 0000000..1cedb03
--- /dev/null
@@ -0,0 +1,83 @@
+# @(#)Makefile 1.9 91/09/27 XLOCK
+
+ICONTYPE       = hp
+
+# Set your C compiler
+#CC            = gcc
+CC             = cc
+
+# X include files
+#XINCLUDEPATH  = /usr/local/include
+#XINCLUDEPATH  = /usr/include/X11R4
+XINCLUDEPATH   = /usr/include/X11R5
+#XINCLUDEPATH  = ${OPENWINHOME}/include
+#XINCLUDEPATH  = ${MOTIFHOME}/include
+
+# X libraries
+#XLIBPATH      = /usr/local/lib
+#XLIBPATH      = /usr/lib/X11R4
+XLIBPATH       = /usr/lib/X11R5
+#XLIBPATH      = ${OPENWINHOME}/lib
+#XLIBPATH      = ${MOTIFHOME}/lib
+
+##############################################################
+INCLUDES       = -I${XINCLUDEPATH} -I.
+LIBRARIES      = -L${XLIBPATH}
+DEFINES                = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" -DSTARSIZE=2
+COPT           = -O
+CFLAGS         = ${COPT} ${DEFINES} ${INCLUDES}
+LIBS           = ${LIBRARIES} -lXhp11 -lX11 -lm
+#LIBS          = ${LIBRARIES} -lXhp11 -lX11 -lm -lcrypt
+HDRS           = xlock.h
+SRCS           = xlock.c hsbramp.c usleep.c resource.c\
+       hopalong.c qix.c life.c blank.c\
+       swarm.c rotor.c pyro.c flame.c worm.c\
+       spline.c maze.c sphere.c hyper.c\
+       helix.c rock.c blot.c\
+       grav.c bounce.c world.c rect.c
+OBJS           =${SRCS:.c=.o}
+PROGRAM         = xlock
+VER             = ${PROGRAM}more
+
+
+all:           ${OBJS}
+               ${CC} -o ${PROGRAM} ${OBJS} ${LIBS}
+
+debug: xlock
+debug:=COPT=-g -DDEBUG
+
+#resource.o:=DEFINES=-DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\"
+#pyro.o:=DEFINES=-DSTARSIZE=2
+
+maze.c:        mazeicon.bit
+life.c:        lifeicon.bit
+mazeicon.bit:
+       rm -f mazeicon.bit
+       ln -s mazeicon.$(ICONTYPE) mazeicon.bit
+lifeicon.bit:
+       rm -f lifeicon.bit
+       ln -s lifeicon.$(ICONTYPE) lifeicon.bit
+
+tar:
+       cd .. ; tar cvf ${VER}.tar ${VER}/* ; compress ${VER}.tar
+
+gtar:
+       cd .. ; tar cvf ${VER}.tar ${VER}/* ; gzip ${VER}.tar
+
+man:
+       nroff -man ${PROGRAM}.man | more
+
+read:
+       more README
+
+lint:
+       lint ${SRCS} -I${XINCLUDEPATH} | more
+
+clean:
+       rm -f *.o ${PROGRAM} mazeicon.bit lifeicon.bit core
+
+install:       ${PROGRAM}
+       install ${PROGRAM} /usr/local/bin
diff --git a/Makefile.imake b/Makefile.imake
new file mode 100644 (file)
index 0000000..fe1f617
--- /dev/null
@@ -0,0 +1,14 @@
+            TOP = ./../..
+             MV = mv
+             RM = rm -f
+        UTILSRC = $(TOP)/util
+       IMAKESRC = $(UTILSRC)/imake
+       IRULESRC = $(UTILSRC)/imake.includes
+          IMAKE = $(IMAKESRC)/imake
+      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl \
+                        -I$(NEWTOP)$(IRULESRC) \
+                        -s Makefile
+
+Makefile:: Imakefile
+        -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak
+        $(IMAKE_CMD) -DTOPDIR=$(TOP)
diff --git a/Makefile.std b/Makefile.std
new file mode 100644 (file)
index 0000000..09070ed
--- /dev/null
@@ -0,0 +1,87 @@
+# @(#)Makefile 1.9 91/09/27 XLOCK
+
+ICONTYPE       = gen
+
+# Set your C compiler
+#CC            = gcc
+CC             = cc
+
+# X include files
+XINCLUDEPATH   = /usr/local/include
+#XINCLUDEPATH  = /usr/include/X11R4
+#XINCLUDEPATH  = /usr/include/X11R5
+#XINCLUDEPATH  = ${OPENWINHOME}/include
+#XINCLUDEPATH  = ${MOTIFHOME}/include
+
+# X libraries
+XLIBPATH       = /usr/local/lib
+#XLIBPATH      = /usr/lib/X11R4
+#XLIBPATH      = /usr/lib/X11R5
+#XLIBPATH      = ${OPENWINHOME}/lib
+#XLIBPATH      = ${MOTIFHOME}/lib
+
+##############################################################
+INCLUDES       = -I${XINCLUDEPATH} -I.
+LIBRARIES      = -L${XLIBPATH}
+# If you do not have shadow passwords remove the backslash and -DHAS_SHADOW
+DEFINES                = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" -DSTARSIZE=2\
+       -DHAS_SHADOW
+#DEFINES       = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" -DSTARSIZE=2
+COPT           = -O
+CFLAGS         = ${COPT} ${DEFINES} ${INCLUDES}
+LIBS           = ${LIBRARIES} -lX11 -lm
+#LIBS          = ${LIBRARIES} -lXhp11 -lX11 -lm
+#LIBS          = ${LIBRARIES} -lX11 -lm -lcrypt
+HDRS           = xlock.h
+SRCS           = xlock.c hsbramp.c usleep.c resource.c\
+       hopalong.c qix.c life.c blank.c\
+       swarm.c rotor.c pyro.c flame.c worm.c\
+       spline.c maze.c sphere.c hyper.c\
+       helix.c rock.c blot.c\
+       grav.c bounce.c world.c rect.c
+OBJS           =${SRCS:.c=.o}
+PROGRAM         = xlock
+VER             = ${PROGRAM}more
+
+
+all:           ${OBJS}
+               ${CC} -o ${PROGRAM} ${OBJS} ${LIBS}
+
+debug: xlock
+debug:=COPT=-g -DDEBUG
+
+resource.o:=DEFINES=-DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\"
+pyro.o:=DEFINES=-DSTARSIZE=2
+
+maze.c:        mazeicon.bit
+life.c:        lifeicon.bit
+mazeicon.bit:
+       rm -f mazeicon.bit
+       ln -s mazeicon.$(ICONTYPE) mazeicon.bit
+lifeicon.bit:
+       rm -f lifeicon.bit
+       ln -s lifeicon.$(ICONTYPE) lifeicon.bit
+
+tar:
+       cd .. ; tar cvf ${VER}.tar ${VER}/* ; compress ${VER}.tar
+
+gtar:
+       cd .. ; tar cvf ${VER}.tar ${VER}/* ; gzip ${VER}.tar
+
+man:
+       nroff -man ${PROGRAM}.man | more
+
+read:
+       more README
+
+lint:
+       lint ${SRCS} -I${XINCLUDEPATH} | more
+
+clean:
+       rm -f *.o ${PROGRAM} mazeicon.bit lifeicon.bit core
+
+install:       ${PROGRAM}
+       install ${PROGRAM} /usr/local/bin
diff --git a/Makefile.sun b/Makefile.sun
new file mode 100644 (file)
index 0000000..a155e1a
--- /dev/null
@@ -0,0 +1,83 @@
+# @(#)Makefile 1.9 91/09/27 XLOCK
+
+ICONTYPE       = sun
+
+# Set your C compiler
+#CC            = gcc
+CC             = cc
+
+# X include files
+#XINCLUDEPATH  = /usr/local/include
+#XINCLUDEPATH  = /usr/include/X11R4
+#XINCLUDEPATH  = /usr/include/X11R5
+XINCLUDEPATH   = ${OPENWINHOME}/include
+#XINCLUDEPATH  = ${MOTIFHOME}/include
+
+# X libraries
+#XLIBPATH      = /usr/local/lib
+#XLIBPATH      = /usr/lib/X11R4
+#XLIBPATH      = /usr/lib/X11R5
+XLIBPATH       = ${OPENWINHOME}/lib
+#XLIBPATH      = ${MOTIFHOME}/lib
+
+##############################################################
+INCLUDES       = -I${XINCLUDEPATH} -I.
+LIBRARIES      = -L${XLIBPATH}
+#DEFINES       = -DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\" -DSTARSIZE=2
+COPT           = -O
+CFLAGS         = ${COPT} ${DEFINES} ${INCLUDES}
+LIBS           = ${LIBRARIES} -lX11 -lm
+#LIBS          = ${LIBRARIES} -lX11 -lm -lcrypt
+HDRS           = xlock.h
+SRCS           = xlock.c hsbramp.c usleep.c resource.c\
+       hopalong.c qix.c life.c blank.c\
+       swarm.c rotor.c pyro.c flame.c worm.c\
+       spline.c maze.c sphere.c hyper.c\
+       helix.c rock.c blot.c\
+       grav.c bounce.c world.c rect.c
+OBJS           =${SRCS:.c=.o}
+PROGRAM         = xlock
+VER             = ${PROGRAM}more
+
+
+all:           ${OBJS}
+               ${CC} -o ${PROGRAM} ${OBJS} ${LIBS}
+
+debug: xlock
+debug:=COPT=-g -DDEBUG
+
+resource.o:=DEFINES=-DDEF_FILESEARCHPATH=\"$(LIBDIR)/%T/%N%S\"
+pyro.o:=DEFINES=-DSTARSIZE=2
+
+maze.c:        mazeicon.bit
+life.c:        lifeicon.bit
+mazeicon.bit:
+       rm -f mazeicon.bit
+       ln -s mazeicon.$(ICONTYPE) mazeicon.bit
+lifeicon.bit:
+       rm -f lifeicon.bit
+       ln -s lifeicon.$(ICONTYPE) lifeicon.bit
+
+tar:
+       cd .. ; tar cvf ${VER}.tar ${VER}/* ; compress ${VER}.tar
+
+gtar:
+       cd .. ; tar cvf ${VER}.tar ${VER}/* ; gzip ${VER}.tar
+
+man:
+       nroff -man ${PROGRAM}.man | more
+
+read:
+       more README
+
+lint:
+       lint ${SRCS} -I${XINCLUDEPATH} | more
+
+clean:
+       rm -f *.o ${PROGRAM} mazeicon.bit lifeicon.bit core
+
+install:       ${PROGRAM}
+       install ${PROGRAM} /usr/local/bin
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..f7d8850
--- /dev/null
+++ b/README
@@ -0,0 +1,264 @@
+xlockmore-1.12 as of 2 September 1994, the  UNofficial version of xlock
+David A. Bagley <bagleyd@source.asset.com>
+
+
+How to build?
+
+  Check below to see if your machine is one mentioned that causes
+  problems, otherwise it should be easy.
+
+    Only if your using X11R6 then:
+        xmkmf
+       make depend
+        make
+       ./xlock -mode spline
+
+    If your using X11R5 then:
+        xmkmf
+        make
+       ./xlock -mode spline
+
+    If your using X11R4 then:
+        mv Imakefile Imakefile.r5
+        sed 's/^XCOMM/\/\*\*\/#/' > Imakefile < Imakefile.r5
+        xmkmf
+        make
+        ./xlock -mode spline
+    Note: if you don't have 'xmkmf' or the "Makefile" it generates
+    doesn't work well, edit Makefile.std for appropriate settings for
+    XINCLUDEPATH and XLIBPATH, then try:
+       make -f Makefile.std
+        ./xlock -mode spline
+
+
+Likely problems:
+
+  Solaris2.x users:
+    You have a choice of
+      (1) Not using the -DSOLARIS_SHADOW switch, then NIS passwords will
+          work, but local and root passwords will not work (default).
+      (2) Using the -DSOLARIS_SHADOW switch, then local and root passwords
+          will work, but NIS passwords will not work.
+      (3) Figuring out how you can have local and NIS passwords at the
+          same time. Mail me the patches.
+    Other Solaris problems:
+      With Gnu's gcc, get rid of the "-ansi" during compilation.
+      With Sun's unbundled cc, compile with a "-DSVR4" and link with
+      "-lnsl -lsocket".
+
+  XFree86 users:
+    Control-Alt-Backspace will defeat locking mechanism and return your
+    console back unless you put "dontzap" in your Xconfig file.
+    Control-Alt-F1 (among others) will defeat locking mechanism with
+    virtual terminals. This ain't too good, right?  If your using Linux,
+    try vlock on tsx-11.mit.edu /pub/linux/sources/usr.bin.  I hear that
+    XFree86 3.2 when it comes out MAY have a server extension for catching
+    or disabling VT switching. Any ideas in the meanwhile?
+
+  Linux users:
+    If you are using shadow passwords make sure you:
+        chown root.shadow xlock
+        chmod 2755 xlock
+    Also check that the following was done:
+        chown root.shadow /etc/shadow
+        chmod 440 /etc/shadow
+    So far, Slackware does NOT come with shadow passwords standard.
+    If you want to install shadow passwords (be careful, it can be tricky)
+    it's on sunsite.unc.edu /pub/Linux/system/Admin.
+
+  FreeBSD users:
+    One may have to make xlock setuid root (are there any objections?).
+
+  SGI users:
+    Out of luck. I hear it does not work, probably something to how with
+    how random is defined. If you get it working, mail me the patches.
+
+  HP users:
+    Shift-Control-Break is caught.
+
+  X-Terminals users (my heart bleeds for you):
+    To get xlock to run, run with -remote option or set XLock.remote on
+    in XLock.ad.
+  
+  If all that does not work you may need to adjust xlock.h or usleep.c
+  (and possibly xlock.c and resource.c) since these files are highly
+  implementation dependent.  If you have to make this kind of change to
+  get it working, let me know.
+
+  You may want to change the 1st line of XLock.ad "blank" to "random",
+  "life", or whatever your favorite is.
+
+
+Acknowledgements:
+
+  I did not write the original algorithms in any of the lockscreens,
+  although I did convert the new ones to run with xlock. I tried to follow
+  the original style of Patrick Naughton. Updates will just overwrite the
+  old file at ftp.x.org in directory /contrib/applications.
+  Most of the additions were "borrowed" from xscreensaver (Jamie Zawinski
+  jwz@lucid.com). At the time, I had trouble with getting it to compile so
+  I moved the "interesting" algorithms to xlock. Many of the others were
+  "borrowed" from old demos from Sun.  My favorite of this new bunch is
+  "spline", "borrowed" from Jef Poskanzer (jef@netcom.com ||
+  jef@well.sf.ca.us).
+
+  I will consider putting new ones in if (1) they are more or less public
+  domain, (2) they are neat (I am biased towards mathematically based
+  programs), and (3) I have the time.
+
+
+Recent Improvements:
+
+1.12
+  Shadow passwords now work on Linux.  Special thanks to H. J. Dihu
+    <macgyver@mcs.com>
+  Reorganized the Imakefile yet again.
+
+1.11
+  Shadow passwords and DES encryption are now detected by the Imakefile.
+    Victor Langeveld <vic@mbfys.kun.nl> reorganized the Imakefile for 
+    shadow passwords and crypt.  Now should compile "right out of the
+    box" (although there are still problems on Solaris 2.3).
+  Patch to fix sudden rotation changes in rock from Yoshiaki Kasahara
+    <kasahara@csce.kyushu-u.ac.jp>.
+  Slowed down rock and rotor a little.
+
+1.10
+  R.K.Lloyd@csc.liv.ac.uk reorganized the Imakefile yet again.
+  Fixed a bug in rect.c.
+  Ditched bzero and bcopy since both are more generally available as
+    memset and memcpy.  Also removed some lint warnings.
+
+1.9
+  "rect" mode was added from xscreensaver's greynetic.
+  "helix" bug fixed.  It is now more interesting.
+  bounce.c divide by zero fixed and grav.c improvements.  Thanks to Greg
+    Bowering <greg@cs.adelaide.edu.au>.
+  grav.c, rock.c, world.c fixed so no black objects.
+
+1.8
+  Imakefile did not work with R6.  Also Solaris2.3 may use SVR4
+    instead of SYSV.  Thanks to Chris P. Ross <cross@eng.umd.edu>
+  "grav" mode was added.  Its a simplistic gravitational simulation,
+    with (currently a constant 16) solid spheres (non-renderd) of equal
+    size and mass orbiting a fixed central mass.  The sphere's orbit in
+    3 dimensions, their position and size being projected with simple
+    perspective.  Thanks to Greg Bowering <greg@cs.adelaide.edu.au>.
+  "inwindow" option was added.  Allows you to do what xlock already
+    did when DEBUG was defined.  It no longer locks your screen, but
+    allows you to run xlock as a (somewhat distracting) decoration.
+    Thanks to Greg Bowering <greg@cs.adelaide.edu.au>.
+  "bounce" mode (football) is back.
+  "world" mode was added.  Thanks to Matthew Moyle-Croft
+    <mmc@cs.adelaide.edu.au>
+  "image" mode was removed. It was very similar to world anyway.
+
+1.7
+  Added a GENeric icon (its supposed to be 2 tetrahedrons superimposed or
+    a stellated octahedron).
+  cuserid() is needed by Solaris2.3 with shadow passwords in xlock.c.
+    Thanks to Bill <benedett@gentire.com>.
+
+1.6
+  R.K.Lloyd@csc.liv.ac.uk pointed out again that gray_bits in maze.c needs
+    a type cast.
+  xlock.c defaults to "blank" to minimize cpu usage on a network.
+
+1.5
+  xlock works again on VMS (see README.VMS) thanks to Anthony Clarke
+    <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>.
+  memcpy and memset definitions for SYSV. Also there now is a switch
+    for shadow passwords thanks to <reggers@julian.uwo.ca>.
+
+1.4
+  Now works on BSD. Thanks to Victor Langeveld <vic@mbfys.kun.nl>
+  Both Victor and Alexandre Miguel <miguel@natacha.ens-cachan.fr>
+    suggested taking out the cuserid() call in xlock.c.  It seems to be
+    fine on Linux 1.0, FreeBSD, SunOS 4.1.3, and HP-UX 9.0.  For FreeBSD
+    its a necessity and the old way is is a security hole in SunOS.
+
+1.3
+  Linux port from Darren Senn's (sinster@scintilla.capitola.ca.us) xlock.
+  Fixed drand to random in helix.c
+  Fixed a memory leak in rock.c.
+
+1.2
+  SHIFT - CONTROL - BREAK on the HP is trapped. Thanks to
+  R.K.Lloyd@csc.liv.ac.uk who pointed out that this was done in xscreensaver.
+  AIXV3 and HP bugs fixed, again due to R. K. Lloyd. (My fault as usual).
+
+1.1 & 1.0
+  cp mazeicon.hp mazeicon.bit  if you prefer the hp icon for "maze".
+  cp lifeicon.hp lifeicon.bit   if you prefer the hp icon for "life"
+  took out "rint" from "worm.c" since HP's have trouble with it
+  added spline, maze, sphere, hyper, helix, rock, & blot modes.
+  fixed "xlock.h" and "usleep" for the HP.
+  got some lint warnings out of "flame".
+  changed border so it varies with size of screen on "swarm" so the
+    wasp would not be stuck in a corner when the password is entered.
+
+
+Some open problems:  (Suggestions for this would be nice)
+
+  Penrose tiling lockscreen needed.  Anyone have an algorithm out there?
+
+  Sometimes xlock runs out of colors (for example, it might happen if you
+    run xfishtank and run xlock at the same time).  A possible solution
+    seems to be to have a private colormap for each screen, then xlock
+    will not have any problem allocating new colors. Unfortunately, it
+    appears that window manager still uses the default colormap,
+    although the window uses another colormap.
+
+  For "bounce" see bounce.c
+
+  "maze" and "helix" are a bit of a kludge, they need better interrupt
+    mechanisms.  Essentially you can't stop them until they are done
+    drawing. Fortunately this is not (usually) a long time.
+
+  "sphere" is too slow (but its neat if you let it run for a while).
+
+-------------------------------------------------------------------------------
+
+Patrick J. Naughton
+
+This was the latest version of xlock (sccs version 23.21) patchlevel = 2.3
+CHANGES:
+    o added worm mode.
+    o old -name and .name changed to -username and .username.
+    o lint cast.
+    o change color allocation to allow "#ffaabb" style color names.
+    o portability bug in flame mode fixed plus some other nits.
+    o white on black on monochrome screens fixed.
+    o added -name to allow different resource files to be used.
+    o added -usefirst to allow first keystroke to be used in password.
+    o made changes to life mode to allow wraparound.
+    o made old life cells stay blue.
+    o added -resources to get default resource file.
+    o added random mode
+    o added pyro mode
+    o added flame mode.
+    o made passwords a little more secure.
+    o use effective uid to find current user.
+    o make main window managed by the wm in debug mode.
+    o some more SVR4 portability changes.
+    o resource code now looks at XUSERFILESEARCHPATH and XAPPLRESDIR.
+    o removed verbose copyright info from each file.
+
+ Copyright (c) 1988-91 by Patrick J. Naughton.
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+ supporting documentation.
+
+ This file is provided AS IS with no warranties of any kind.  The author
+ shall have no liability with respect to the infringement of copyrights,
+ trade secrets or any patents by this file or any part thereof.  In no
+ event will the author be liable for any lost revenue or profits or
+ other special, indirect and consequential damages.
+
+    ______________________________________________________________________
+    Patrick J. Naughton                                   email: naughton@sun.com
+    Sun Microsystems Laboratories, Inc.                   voice: (415) 336 - 1080
diff --git a/README.VMS b/README.VMS
new file mode 100644 (file)
index 0000000..d9e602d
--- /dev/null
@@ -0,0 +1,16 @@
+All you should need to do to build the executable is type @make
+
+To run xlock a symbol needs to be defined, for example:
+XLOCK:==$H268SYSEXE:XLOCK
+where H268SYSEXE is a logical name pointing to the directory where XLOCK.EXE
+resides. The '$' after == means this is a foreign command and VMS makes the
+command line available to the program.
+
+worm may look a bit strange, since the scaling is wrong.
+
+-allowroot only works if you have SYSPRV enabled which is a bit limiting.
+
+The XLock file normally in /usr/lib/X11/app-defaults needs to be in the
+directory DECW$SYSTEM_DEFAULTS on VMS systems and be called 'DECW$XLOCK.DAT'.
diff --git a/README2 b/README2
new file mode 100644 (file)
index 0000000..db24b1b
--- /dev/null
+++ b/README2
@@ -0,0 +1,103 @@
+I got this great blurb from the Linux version, it has been slightly edited.
+------------------------------------------------------------------------------
+Installation:
+
+Move xlock into /usr/bin/X11 (or wherever your X binaries are).
+Move XLock.ad into /usr/lib/X11/app-defaults (or wherever your application
+       defaults files are) and rename to XLock. (without the dot)
+You might want to edit the XLock application defaults file to suit your
+       personal preferences.
+Move xlock.man to /usr/man/mann/xlock.n
+
+Operation:
+
+Under X, run xlock.  The screen will clear, and some pretty animated picture
+(exactly which depends on which module is active) will appear on the screen.
+If you hit a key, then the screen will clear, and (unless you've changed
+the application defaults file that I packaged with this) you'll get a
+white screen with some graphics in the top center.  These graphics
+consist of a reduced size image of the module you were viewing, the
+name of the user who executed xlock, and password prompt field, and
+some short instructions.
+
+At this point, you can either click on the graphic to return to xlock,
+or you can type a password.  If the password is verifiable as the
+root password, or the password of the user listed above, then xlock
+will terminate.  THIS IS THE ONLY WAY TO STOP XLOCK WITHOUT SHUTTING
+DOWN THE X SERVER.  That's what makes it a lock.
+
+XLock is by no means a passive program...  It uses quite a bit of
+CPU, so don't expect to be able to do a compile in the background.
+XLock is able to nice itself to relieve this problem a bit, but it
+can only help so much.
+
+Resources:
+
+There are two sets of resources for XLock.  The first set are (what I call)
+global XLock resources, while the second set consists of module-specific
+resources.  I'll get more into modules a little further below.
+
+The global resources are:
+       XLock.mode: This sets the module.  More about this later.
+       XLock.font: This is the font used on the password entry screen.
+       XLock.background: The background color for the password entry screen.
+       XLock.foreground: The foreground color for the password entry screen.
+       XLock.username: The label for the field indicating the user name.
+       XLock.password: The label for the password prompt.
+       XLock.info: The "short instructions" to print.
+       XLock.validate: A message to display while checking the password
+       XLock.invalid: A message to display if the password is incorrect
+       XLock.nice: How much XLock should nice itself.
+       XLock.timeout: How long to wait idle at the password prompt.
+       XLock.mono: Monochrome mode (yes or no)
+       XLock.nolock: disable the lock mechanism (yes or no)
+       XLock.remote: allow remote locking (meaningless under linux)
+       XLock.allowroot: allow the root password to unlock (yes or no)
+       XLock.enablesaver: allow the system screensaver to work (yes or no)
+       XLock.allowaccess: allow other clients to connect while active
+               (meaningless under linux)
+       XLock.echokeys: Echo "?" for each password keypress (yes or no)
+       XLock.usefirst: Ignore the first character typed (yes or no)
+       XLock.verbose: Verbose mode. (yes or no)
+
+Xlock has a number of modules which it can display.  Currently, the
+modules are: hop (hopalong fractals), QIX (as in the arcade game),
+world (spining Earths), life (Conway's game of life), swarm (a wasp
+tries to escape some bees), rotor (truly strange), pyro (fireworks),
+flame (cosmic flame fractals -- my favorite), worm (crawling multi-colored
+worms), blank (just a screen blanker).  Each module has the following
+resources defined:
+
+       XLock.<module>.delay: How long to wait between draws (usec)
+       XLock.<module>.batchcount: How many draws between initializations
+       XLock.<module>.saturation: Saturation (as in HSV) of colors to use.
+
+It turns out that each module is characterized by a number of inializations,
+separated by a number of "draws".  It's a little hard to describe exactly
+what these are without showing you the source code, but let me give you
+a concrete example:
+
+       The life module initializes by clearing the screen and initializing
+       the playing field.  It then draws the playing field on the screen.
+       In each draw phase, one generation is calculated, and then drawn
+       on the screen.  After a certain number of generations, the current
+       game is thrown away, and a fresh one is started.
+
+Do-it-Yourselfers:
+
+If you want to build your own xlock, you've got two choices.
+       a) Link xlock.a against libX11.a and libm.a:
+               gcc -o xlock xlock.a -lX11 -lm
+          This will give you a good xlock whenever you change your
+          compiler or libraries.
+       b) Get the sources and compile them yourself.  You should use
+          the sources that I've uploaded, because the original sources
+          can't compiler under Linux.
+To build your own xlock.a, just make the object files, then run:
+       ar c xlock.a xlock.o hsbramp.o usleep.o resource.o hopalong.o \
+               qix.o life.o image.o blank.o swarm.o rotor.o pyro.o \
+               flame.o worm.o
+
+                                       Darren Senn
+                                       sinster@scintilla.capitola.ca.us
+                                       5/12/92
diff --git a/XLock b/XLock
new file mode 100644 (file)
index 0000000..c35eb69
--- /dev/null
+++ b/XLock
@@ -0,0 +1,81 @@
+XLock.mode: blank
+XLock.font: -b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1
+XLock.background: White
+XLock.foreground: Black
+XLock.username: Name: 
+XLock.password: Password: 
+XLock.info: Enter password to unlock; select icon to lock.
+XLock.validate: Validating login...
+XLock.invalid: Invalid login.
+XLock.nice: 10
+XLock.timeout: 30
+XLock.mono: off
+XLock.nolock: off
+XLock.remote: off
+XLock.allowroot: off
+XLock.enablesaver: off
+XLock.allowaccess: off
+XLock.echokeys: off
+XLock.usefirst: off
+XLock.verbose: off
+XLock.inwindow: off
+XLock.hop.delay: 10000
+XLock.hop.batchcount: 1000
+XLock.hop.saturation: 1
+XLock.qix.delay: 30000
+XLock.qix.batchcount: 64
+XLock.qix.saturation: 1
+XLock.life.delay: 1000000
+XLock.life.batchcount: 100
+XLock.life.saturation: 1
+XLock.swarm.delay: 10000
+XLock.swarm.batchcount: 100
+XLock.swarm.saturation: 1
+XLock.rotor.delay: 100000
+XLock.rotor.batchcount: 4
+XLock.rotor.saturation: 0.4
+XLock.pyro.delay: 15000
+XLock.pyro.batchcount: 100
+XLock.pyro.saturation: 1
+XLock.flame.delay: 10000
+XLock.flame.batchcount: 20
+XLock.flame.saturation: 1
+XLock.worm.delay: 10000
+XLock.worm.batchcount: 20
+XLock.worm.saturation: 1
+XLock.spline.delay: 30000
+XLock.spline.batchcount: 6 
+XLock.spline.saturation: 0.4
+XLock.maze.delay: 10000
+XLock.maze.batchcount: 40
+XLock.maze.saturation: 1
+XLock.sphere.delay: 1000
+XLock.sphere.batchcount: 1
+XLock.sphere.saturation: 1
+XLock.hyper.delay: 5000
+XLock.hyper.batchcount: 1
+XLock.hyper.saturation: 1
+XLock.helix.delay: 10000
+XLock.helix.batchcount: 1
+XLock.helix.saturation: 1
+XLock.rock.delay: 30000
+XLock.rock.batchcount: 100
+XLock.rock.saturation: 1
+XLock.blot.delay: 10000
+XLock.blot.batchcount: 6
+XLock.blot.saturation: 0.4
+XLock.grav.delay: 10000
+XLock.grav.batchcount: 10
+XLock.grav.saturation: 1
+XLock.bounce.delay: 5000
+XLock.bounce.batchcount: 10
+XLock.bounce.saturation: 1
+XLock.world.delay: 100000
+XLock.world.batchcount: 8
+XLock.world.saturation: 0.3
+XLock.rect.delay: 10000
+XLock.rect.batchcount: 100
+XLock.rect.saturation: 1
+XLock.blank.delay: 5000000
+XLock.blank.batchcount: 1
+XLock.blank.saturation: 1
diff --git a/XLock.ad b/XLock.ad
new file mode 100644 (file)
index 0000000..adf4155
--- /dev/null
+++ b/XLock.ad
@@ -0,0 +1,81 @@
+XLock.mode: blank
+XLock.font: -b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1
+XLock.background: White
+XLock.foreground: Black
+XLock.username: Name: 
+XLock.password: Password: 
+XLock.info: Enter password to unlock; select icon to lock.
+XLock.validate: Validating login...
+XLock.invalid: Invalid login.
+XLock.nice: 10
+XLock.timeout: 30
+XLock.mono: off
+XLock.nolock: off
+XLock.remote: off
+XLock.allowroot: off
+XLock.enablesaver: off
+XLock.allowaccess: off
+XLock.echokeys: off
+XLock.usefirst: off
+XLock.verbose: off
+XLock.inwindow: off
+XLock.hop.delay: 10000
+XLock.hop.batchcount: 1000
+XLock.hop.saturation: 1
+XLock.qix.delay: 30000
+XLock.qix.batchcount: 64
+XLock.qix.saturation: 1
+XLock.life.delay: 1000000
+XLock.life.batchcount: 100
+XLock.life.saturation: 1
+XLock.swarm.delay: 10000
+XLock.swarm.batchcount: 100
+XLock.swarm.saturation: 1
+XLock.rotor.delay: 100000
+XLock.rotor.batchcount: 4
+XLock.rotor.saturation: 0.4
+XLock.pyro.delay: 15000
+XLock.pyro.batchcount: 100
+XLock.pyro.saturation: 1
+XLock.flame.delay: 10000
+XLock.flame.batchcount: 20
+XLock.flame.saturation: 1
+XLock.worm.delay: 10000
+XLock.worm.batchcount: 20
+XLock.worm.saturation: 1
+XLock.spline.delay: 30000
+XLock.spline.batchcount: 6 
+XLock.spline.saturation: 0.4
+XLock.maze.delay: 10000
+XLock.maze.batchcount: 40
+XLock.maze.saturation: 1
+XLock.sphere.delay: 1000
+XLock.sphere.batchcount: 1
+XLock.sphere.saturation: 1
+XLock.hyper.delay: 10000
+XLock.hyper.batchcount: 1
+XLock.hyper.saturation: 1
+XLock.helix.delay: 10000
+XLock.helix.batchcount: 1
+XLock.helix.saturation: 1
+XLock.rock.delay: 30000
+XLock.rock.batchcount: 100
+XLock.rock.saturation: 1
+XLock.blot.delay: 10000
+XLock.blot.batchcount: 6
+XLock.blot.saturation: 0.4
+XLock.grav.delay: 10000
+XLock.grav.batchcount: 10
+XLock.grav.saturation: 1
+XLock.bounce.delay: 5000
+XLock.bounce.batchcount: 10
+XLock.bounce.saturation: 1
+XLock.world.delay: 100000
+XLock.world.batchcount: 8
+XLock.world.saturation: 0.3
+XLock.rect.delay: 10000
+XLock.rect.batchcount: 100
+XLock.rect.saturation: 1
+XLock.blank.delay: 5000000
+XLock.blank.batchcount: 1
+XLock.blank.saturation: 1
diff --git a/blank.c b/blank.c
new file mode 100644 (file)
index 0000000..8ae0b07
--- /dev/null
+++ b/blank.c
@@ -0,0 +1,29 @@
+#ifndef lint
+static char sccsid[] = "@(#)blank.c    1.5 91/05/24 XLOCK";
+#endif
+/*-
+ * blank.c - blank screen for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 31-Aug-90: Written.
+ */
+
+#include "xlock.h"
+
+/*ARGSUSED*/
+void
+drawblank(win)
+    Window      win;
+{
+}
+
+void
+initblank(win)
+    Window      win;
+{
+    XClearWindow(dsp, win);
+}
diff --git a/blot.c b/blot.c
new file mode 100644 (file)
index 0000000..a6a4b39
--- /dev/null
+++ b/blot.c
@@ -0,0 +1,126 @@
+#ifndef lint
+static char sccsid[] = "@(#)blot.c 1.3 92/01/01 XLOCK";
+#endif
+/*
+ * Rorschach's ink blot test
+ *
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1992:     xscreensaver version (Jamie Zawinski jwz@lucid.com)
+ */
+
+/* original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, distribute, and sell 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#include "xlock.h"
+
+typedef struct {
+    int width;
+    int height;
+    int xmid, ymid;
+    int offset;
+    int xsym, ysym;
+    int size;
+    int pix;
+    long startTime;
+} blotstruct;
+
+static blotstruct blots[MAXSCREENS];
+static XPoint *pointBuffer = 0; /* pointer for XDrawPoints */
+
+#define TIMEOUT 30
+
+void
+initblot(win)
+     Window win;
+{
+    XWindowAttributes xgwa;
+    blotstruct *bp = &blots[screen];
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    bp->width = xgwa.width;
+    bp->height = xgwa.height;
+    bp->xmid = bp->width / 2;
+    bp->ymid = bp->height / 2;
+
+    bp->offset = 4;
+    bp->xsym = True;
+    bp->ysym = False;
+    bp->pix = 0;
+    if (bp->offset <= 0) bp->offset = 3;
+    if (batchcount >= 100 || batchcount < 1)
+      batchcount = 6;
+    /* Fudge the size so it takes up the whole screen */
+    bp->size = batchcount * bp->width * bp->height / 1024;
+
+    if (!pointBuffer)
+        pointBuffer = (XPoint *) malloc(bp->size * sizeof(XPoint));
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, bp->width, bp->height);
+    XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+    bp->startTime = seconds();
+}
+
+void
+drawblot(win)
+     Window win;
+{
+  int x, y;
+  int         k;
+  XPoint     *xp = pointBuffer;
+  blotstruct *bp = &blots[screen];
+
+  if (!mono && Scr[screen].npixels > 2) {
+         XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[bp->pix]);
+         if (++bp->pix >= Scr[screen].npixels)
+             bp->pix = 0;
+  }
+
+  x = bp->xmid;
+  y = bp->ymid;
+  k = bp->size;
+  while (k >= 4) {
+      x += ((random () % (1 + (bp->offset << 1))) - bp->offset);
+      y += ((random () % (1 + (bp->offset << 1))) - bp->offset);
+      k--;
+      xp->x = x;
+      xp->y = y;
+      xp++;
+      if (bp->xsym)
+       {
+          k--;
+         xp->x = bp->width - x;
+         xp->y = y;
+         xp++;
+       }
+      if (bp->ysym)
+       {
+          k--;
+         xp->x = x;
+         xp->y = bp->height - y;
+         xp++;
+       }
+      if (bp->xsym && bp->ysym)
+       {
+          k--;
+         xp->x = bp->width - x;
+         xp->y = bp->height - y;
+         xp++;
+       }
+    }
+      XDrawPoints (dsp, win, Scr[screen].gc,
+         pointBuffer, bp->size - k, CoordModeOrigin);
+    if (seconds() - bp->startTime > TIMEOUT)
+        initblot(win);
+}
diff --git a/bounce.c b/bounce.c
new file mode 100644 (file)
index 0000000..eea5e3f
--- /dev/null
+++ b/bounce.c
@@ -0,0 +1,389 @@
+#ifndef lint
+static  char sccsid[] = "@(#)bounce.c 1.3 88/02/26 XLOCK";
+#endif
+
+/*-
+ * bounce.c - A bouncing ball for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 15-Jul-94: cleaned up in time for the final match.
+ * 4-Apr-94: spinning multiple ball version
+ *             (I got a lot of help from with the physics of ball to ball
+ *             collision looking at the source of xpool from Ismail ARIT
+ *             iarit@tara.mines.colorado.edu).
+ * 22-Mar-94: got rid of flashing problem by only erasing parts of the image
+ *             that will not be in the next image.
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1986: Sun Microsystems
+ */
+
+/* original copyright
+ ******************************************************************************
+ Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+
+ All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ 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 names of Sun or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+ software without specific prior written permission. Sun and M.I.T.
+ make no representations about the suitability of this software for
+ any purpose. It is provided "as is" without any express or implied warranty.
+
+ SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. IN NO EVENT SHALL SUN BE LIABLE FOR ANY SPECIAL, INDIRECT
+ OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, 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.
+ *****************************************************************************/
+
+/*
+   Open for improvement:
+     o include different balls (size and mass)  (... how about be real crazy
+         and put in an American/Australian football?).
+     o mask out the corners of ball.
+     o should only have 1 bitmap for ball, the others should be generated
+         as 90 degree rotations.
+     o there should be a shearing spin created with ball to ball collisions
+*/
+
+#include "xlock.h"
+#include <math.h>
+#include "bounce0.bit"
+#include "bounce1.bit"
+#include "bounce2.bit"
+#include "bounce3.bit"
+
+#define MAX_STRENGTH 24
+#define FRICTION 24
+#define PENETRATION 0.3
+#define SLIPAGE 4
+#define TIME 32
+
+#define ORIENTS 4
+#define ORIENTCYCLE 16
+#define CCW 1
+#define CW (ORIENTS-1) 
+#define DIR(x) (((x)>=0)?CCW:CW)
+#define SIGN(x)        (((x)>=0)?1:-1)
+#define ABS(x) (((x)>=0)?x:-(x))
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define TRUE 1
+#define FALSE 0
+
+static XImage logo[ORIENTS] = {
+  {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+  {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+  {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1},
+  {0, 0, 0, XYBitmap, 0, LSBFirst, 8, LSBFirst, 8, 1}
+}; 
+
+typedef struct {
+    int x, y, xlast, ylast;
+    int spincount, spindelay, spindir, orient;
+    int vx, vy, vang;
+    int mass, size;
+    unsigned long color;
+} ballstruct;
+
+typedef struct {
+    int width, height;
+    int nballs;
+    ballstruct *balls;
+    GC draw_GC, erase_GC;
+} bouncestruct;
+
+static bouncestruct bounces[MAXSCREENS];
+
+static void checkCollision();
+static void drawball();
+static void moveball();
+static void spinball();
+static int collide();
+static void XEraseImage();
+
+void
+initbounce(win)
+    Window win;
+{
+    XWindowAttributes xgwa;
+    XGCValues gcv;
+    Screen *scr;
+    bouncestruct *bp = &bounces[screen];
+    int i;
+
+    logo[0].data = (char *) bounceicon0_bits;
+    logo[0].width = bounceicon0_width;
+    logo[0].height = bounceicon0_height;
+    logo[0].bytes_per_line = (bounceicon0_width + 7) / 8;
+    logo[1].data = (char *) bounceicon1_bits;
+    logo[1].width = bounceicon1_width;
+    logo[1].height = bounceicon1_height;
+    logo[1].bytes_per_line = (bounceicon1_width + 7) / 8;
+    logo[2].data = (char *) bounceicon2_bits;
+    logo[2].width = bounceicon2_width;
+    logo[2].height = bounceicon2_height;
+    logo[2].bytes_per_line = (bounceicon2_width + 7) / 8;
+    logo[3].data = (char *) bounceicon3_bits;
+    logo[3].width = bounceicon3_width;
+    logo[3].height = bounceicon3_height;
+    logo[3].bytes_per_line = (bounceicon3_width + 7) / 8;
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    scr = ScreenOfDisplay(dsp, screen);
+    bp->width = xgwa.width;
+    bp->height = xgwa.height;
+
+    gcv.background = BlackPixelOfScreen(scr);
+    bp->draw_GC = XCreateGC(dsp, win, GCForeground|GCBackground, &gcv);
+    bp->erase_GC = XCreateGC(dsp, win, GCForeground|GCBackground, &gcv);
+    if (batchcount < 1)
+      batchcount = 1;
+    bp->nballs = batchcount; 
+    if (!bp->balls)
+      bp->balls = (ballstruct *) malloc(batchcount * sizeof(ballstruct));
+    i = 0;
+    while (i < bp->nballs) {
+      if (logo[0].width > bp->width / 2 || logo[0].height > bp->height / 2)
+        bp->balls[i].size = 5;
+      else
+        bp->balls[i].size = MIN(logo[0].width, logo[0].height);
+      bp->balls[i].vx = ((random() % 2) ? -1 : 1) *
+        (random() % MAX_STRENGTH + 1);
+      bp->balls[i].x = (bp->balls[i].vx >= 0) ?
+        0 : bp->width - bp->balls[i].size;
+      bp->balls[i].y = random() % (bp->height / 2);
+      if (i == collide(i)) {
+        if (!mono && Scr[screen].npixels > 2) {
+          bp->balls[i].color = random() % Scr[screen].npixels;
+          if (bp->balls[i].color == BlackPixel(dsp, screen))
+            bp->balls[i].color = WhitePixel(dsp, screen);
+        } else
+          bp->balls[i].color = WhitePixel(dsp, screen);
+        bp->balls[i].xlast = -1;
+        bp->balls[i].ylast = 0;
+        bp->balls[i].spincount = 1;
+        bp->balls[i].spindelay = 1;
+        bp->balls[i].vy = ((random() % 2) ? -1 : 1) * (random() % MAX_STRENGTH);
+        bp->balls[i].spindir = 0;
+        bp->balls[i].vang = 0;
+        bp->balls[i].orient = random() % ORIENTS;
+        i++;
+      } else
+        bp->nballs--;
+    }
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, bp->width, bp->height);
+    XSetForeground(dsp, bp->erase_GC, BlackPixel(dsp, screen));
+}
+
+static void checkCollision(aball)
+        int aball;
+{
+        bouncestruct *bp = &bounces[screen];
+        int i, amount, spin, d, size;
+        double x, y;
+
+        for (i = 0; i < bp->nballs; i++) {
+          if (i != aball) {
+            x = (double) (bp->balls[i].x - bp->balls[aball].x);
+            y = (double) (bp->balls[i].y - bp->balls[aball].y);
+            d = (int) sqrt(x * x + y * y);
+            size = (bp->balls[i].size + bp->balls[aball].size) / 2;
+            if (d > 0 && d < size) {
+              amount = size - d;
+              if (amount > PENETRATION * size)
+                amount = PENETRATION * size;
+              bp->balls[i].vx += amount * x / d;
+              bp->balls[i].vy += amount * y / d;
+              bp->balls[i].vx -= bp->balls[i].vx / FRICTION;
+              bp->balls[i].vy -= bp->balls[i].vy / FRICTION;
+              bp->balls[aball].vx -= amount * x / d;
+              bp->balls[aball].vy -= amount * y / d;
+              bp->balls[aball].vx -= bp->balls[aball].vx / FRICTION;
+              bp->balls[aball].vy -= bp->balls[aball].vy / FRICTION;
+              spin = (bp->balls[i].vang - bp->balls[aball].vang) /
+                (2 * size * SLIPAGE);
+              bp->balls[i].vang -= spin;
+              bp->balls[aball].vang += spin;
+              bp->balls[i].spindir = DIR(bp->balls[i].vang);
+              bp->balls[aball].spindir = DIR(bp->balls[aball].vang);
+              if (!bp->balls[i].vang) {
+                bp->balls[i].spindelay = 1;
+                bp->balls[i].spindir = 0;
+              } else
+                bp->balls[i].spindelay = M_PI * bp->balls[i].size /
+                  (ABS(bp->balls[i].vang)) + 1;
+              if (!bp->balls[aball].vang) {
+                bp->balls[aball].spindelay = 1;
+                bp->balls[aball].spindir = 0;
+              } else
+                bp->balls[aball].spindelay = M_PI * bp->balls[aball].size /
+                  (ABS(bp->balls[aball].vang)) + 1;
+              return;
+            }
+          }
+        }
+}
+
+void
+drawbounce(win)
+    Window win;
+{
+       bouncestruct *bp = &bounces[screen];
+       int i;
+       static restartnum = TIME;
+
+       for (i = 0; i < bp->nballs; i++) {
+         drawball(win, &bp->balls[i]);
+         moveball(&bp->balls[i]);
+       }
+       for (i = 0; i < bp->nballs; i++)
+         checkCollision(i);
+       if (!(random() % TIME)) /* Put some randomness into the time */
+         restartnum--;
+       if (!restartnum) {
+        initbounce(win);
+         restartnum = TIME;
+       }
+
+}
+
+static void
+drawball(win, ball)
+    Window win;
+    ballstruct *ball;
+{        
+        bouncestruct *bp = &bounces[screen];
+
+        XSetForeground(dsp, bp->draw_GC, ball->color);
+        if (ball->size <= 5) {
+         if (ball->xlast != -1)
+            XFillRectangle(dsp, win, bp->erase_GC,
+             ball->xlast, ball->ylast, ball->size, ball->size);
+         XFillRectangle(dsp, win, bp->draw_GC, 
+           ball->x, ball->y, ball->size, ball->size);
+        } else {
+          XPutImage(dsp, win, bp->draw_GC, &logo[ball->orient],
+            0, 0, ball->x, ball->y, ball->size, ball->size);
+         if (ball->xlast != -1)
+            XEraseImage(dsp, win, bp->erase_GC,
+              ball->x, ball->y,
+              ball->xlast, ball->ylast, ball->size, ball->size);
+        }
+}
+
+static void
+moveball(ball)
+    ballstruct *ball;
+{        
+        bouncestruct *bp = &bounces[screen];
+
+        ball->xlast = ball->x;
+        ball->ylast = ball->y;
+        ball->x += ball->vx;
+        if (ball->x > (bp->width - ball->size)) {
+          /* Bounce off the right edge */
+          ball->x = 2 * (bp->width - ball->size) - ball->x;
+          ball->vx = -ball->vx + ball->vx / FRICTION;
+          spinball(ball, 1, &ball->vy);
+        } else if (ball->x < 0) {
+          /* Bounce off the left edge */
+          ball->x = -ball->x;
+          ball->vx = -ball->vx + ball->vx / FRICTION;
+          spinball(ball, -1, &ball->vy);
+        }
+        ball->vy++;
+        ball->y += ball->vy;
+        if (ball->y >= (bp->height - ball->size)) {
+          /* Bounce off the bottom edge */
+          ball->y = (bp->height - ball->size);
+          ball->vy = -ball->vy + ball->vy / FRICTION;
+          spinball(ball, -1, &ball->vx);
+        } else if (ball->y < 0) {
+          /* Bounce off the top edge */
+         ball->y = -ball->y;
+          ball->vy = -ball->vy + ball->vy / FRICTION;
+          spinball(ball, 1, &ball->vx);
+        }
+        if (ball->spindir) {
+          ball->spincount--;
+          if (!ball->spincount) {
+            ball->orient = (ball->spindir + ball->orient) % ORIENTS;
+            ball->spincount = ball->spindelay;
+          }
+        }
+}
+
+static void
+spinball(ball, dir, vel)
+    ballstruct *ball;
+    int dir;
+    int *vel;
+{
+        *vel -= (*vel + SIGN(*vel * dir) * ball->spindelay * ORIENTCYCLE /
+           (M_PI * ball->size)) / SLIPAGE;
+        if (*vel) {
+          ball->spindir = DIR(*vel * dir);
+          ball->vang = *vel * ORIENTCYCLE;
+          ball->spindelay = M_PI * ball->size / (ABS(ball->vang)) + 1;
+        } else
+          ball->spindir = 0;
+}
+
+static int collide(aball)
+        int aball;
+{
+        bouncestruct *bp = &bounces[screen];
+        int i, d, x, y;
+
+        for (i = 0; i < aball; i++) {
+          x = (bp->balls[i].x - bp->balls[aball].x);
+          y = (bp->balls[i].y - bp->balls[aball].y);
+          d = (int) sqrt((double) (x * x + y * y));
+          if (d < (bp->balls[i].size + bp->balls[aball].size) / 2)
+            return i;
+        }
+        return i;
+}
+
+/* This stops some flashing, could be more efficient */
+static void
+XEraseImage(display, win, gc, x, y, xlast, ylast, xsize, ysize)
+Display *display;
+Window win;
+GC gc;
+int x, y, xlast, ylast, xsize, ysize;
+{
+  if (ylast < y) {
+    if (y < ylast + ysize)
+      XFillRectangle(display, win, gc, xlast, ylast, xsize, y - ylast);
+    else
+      XFillRectangle(display, win, gc, xlast, ylast, xsize, ysize);
+  } else if (ylast > y) {
+    if (y > ylast - ysize)
+      XFillRectangle(display, win, gc, xlast, y + ysize, xsize, ylast - y);
+    else
+      XFillRectangle(display, win, gc, xlast, ylast, xsize, ysize);
+  }
+  if (xlast < x) {
+    if (x < xlast + xsize)
+      XFillRectangle(display, win, gc, xlast, ylast, x - xlast, ysize);
+    else
+      XFillRectangle(display, win, gc, xlast, ylast, xsize, ysize);
+  } else if (xlast > x) {
+    if (x > xlast - xsize)
+      XFillRectangle(display, win, gc, x + xsize, ylast, xlast - x, ysize);
+    else
+      XFillRectangle(display, win, gc, xlast, ylast, xsize, ysize);
+  }
+}
diff --git a/bounce0.bit b/bounce0.bit
new file mode 100644 (file)
index 0000000..edb62b9
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounceicon0_width 64
+#define bounceicon0_height 64
+static char bounceicon0_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x78, 0x1e, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0x7f, 0xfe, 0x31, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x7f,
+   0xfe, 0xcf, 0x00, 0x00, 0x00, 0x80, 0xfc, 0x7f, 0xfe, 0x3f, 0x01, 0x00,
+   0x00, 0x60, 0xff, 0x3f, 0xfc, 0xff, 0x06, 0x00, 0x00, 0x90, 0xff, 0x1f,
+   0xf8, 0xff, 0x09, 0x00, 0x00, 0xc8, 0xff, 0x07, 0xe0, 0xff, 0x13, 0x00,
+   0x00, 0xe4, 0xff, 0x03, 0xc0, 0xff, 0x27, 0x00, 0x00, 0xf2, 0xff, 0x01,
+   0x80, 0xff, 0x4f, 0x00, 0x00, 0xe1, 0x7f, 0x00, 0x00, 0xfe, 0x87, 0x00,
+   0x80, 0xc0, 0x1f, 0x00, 0x00, 0xf8, 0x03, 0x01, 0x40, 0x80, 0x01, 0x00,
+   0x00, 0x80, 0x01, 0x02, 0x40, 0x00, 0x78, 0x00, 0x00, 0x1e, 0x00, 0x02,
+   0x20, 0x80, 0x7f, 0x00, 0x00, 0xfe, 0x01, 0x04, 0x10, 0xc0, 0xff, 0x00,
+   0x00, 0xff, 0x03, 0x08, 0x10, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x07, 0x08,
+   0x08, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x07, 0x10, 0x08, 0xf0, 0xff, 0x01,
+   0x80, 0xff, 0x0f, 0x10, 0x04, 0xf0, 0xff, 0x01, 0x80, 0xff, 0x0f, 0x20,
+   0x04, 0xf8, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x20, 0x04, 0xf8, 0xff, 0x03,
+   0xc0, 0xff, 0x1f, 0x20, 0x02, 0xfc, 0xff, 0xf9, 0x9f, 0xff, 0x3f, 0x40,
+   0x02, 0xfc, 0xff, 0xfc, 0x3f, 0xff, 0x3f, 0x40, 0xfa, 0xfc, 0xff, 0xfe,
+   0x7f, 0xff, 0x3f, 0x5f, 0xfa, 0xfc, 0x7f, 0xfe, 0x7f, 0xfe, 0x3f, 0x5f,
+   0xfd, 0xfd, 0x7f, 0xff, 0xff, 0xfe, 0xbf, 0xbf, 0xfd, 0xf9, 0x3f, 0xff,
+   0xff, 0xfc, 0x9f, 0xbf, 0xfd, 0xf9, 0xbf, 0xff, 0xff, 0xfd, 0x9f, 0xbf,
+   0xfd, 0xfb, 0x9f, 0xff, 0xff, 0xf9, 0xdf, 0xbf, 0xfd, 0xfb, 0x9f, 0xff,
+   0xff, 0xf9, 0xdf, 0xbf, 0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf,
+   0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf, 0xfd, 0x03, 0xc0, 0xff,
+   0xff, 0x03, 0xc0, 0xbf, 0xfd, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xbf,
+   0xfd, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xbf, 0xfa, 0x03, 0x80, 0xff,
+   0xff, 0x01, 0xc0, 0x5f, 0xfa, 0x03, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x5f,
+   0xfa, 0x03, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x5f, 0xfa, 0x03, 0x00, 0xfe,
+   0x7f, 0x00, 0xc0, 0x5f, 0xf4, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x80, 0x2f,
+   0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0xf4, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x2f, 0xe8, 0x01, 0x00, 0xfc, 0x3f, 0x00, 0x80, 0x17,
+   0xe8, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x80, 0x17, 0xd0, 0x00, 0x00, 0xff,
+   0xff, 0x00, 0x00, 0x0b, 0x10, 0x3e, 0x80, 0xff, 0xff, 0x01, 0x7c, 0x08,
+   0x20, 0xff, 0x81, 0xff, 0xff, 0x81, 0xff, 0x04, 0x40, 0xff, 0xcf, 0xff,
+   0xff, 0xf3, 0xff, 0x02, 0x40, 0xfe, 0xcf, 0xff, 0xff, 0xf3, 0x7f, 0x02,
+   0x80, 0xfe, 0x9f, 0xff, 0xff, 0xf9, 0x7f, 0x01, 0x00, 0xfd, 0x3f, 0xff,
+   0xff, 0xfc, 0xbf, 0x00, 0x00, 0xfa, 0x7f, 0xfe, 0x7f, 0xfe, 0x5f, 0x00,
+   0x00, 0xf4, 0x7f, 0xfe, 0x7f, 0xfe, 0x2f, 0x00, 0x00, 0xc8, 0xff, 0xfc,
+   0x3f, 0xff, 0x13, 0x00, 0x00, 0x90, 0xff, 0x01, 0x80, 0xff, 0x09, 0x00,
+   0x00, 0x60, 0xff, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0x80, 0xfc, 0x00,
+   0x00, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0xce, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00,
+   0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bounce1.bit b/bounce1.bit
new file mode 100644 (file)
index 0000000..e715759
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounceicon1_width 64
+#define bounceicon1_height 64
+static char bounceicon1_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0x1f, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0xff, 0x7f, 0x30, 0x00, 0x00, 0x00, 0x00, 0xf3, 0xff,
+   0x7f, 0xc0, 0x00, 0x00, 0x00, 0x80, 0xfc, 0xff, 0x7f, 0x00, 0x01, 0x00,
+   0x00, 0x60, 0xfe, 0xff, 0x7f, 0x00, 0x06, 0x00, 0x00, 0x10, 0xfe, 0xff,
+   0x7f, 0x00, 0x08, 0x00, 0x00, 0xc8, 0xfc, 0xff, 0x1f, 0x00, 0x10, 0x00,
+   0x00, 0xf4, 0x81, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0xfa, 0x01, 0x00,
+   0xf0, 0x01, 0x40, 0x00, 0x00, 0xfd, 0x01, 0x00, 0xff, 0x07, 0x80, 0x00,
+   0x80, 0xfe, 0x01, 0x00, 0xff, 0x1f, 0x20, 0x01, 0x40, 0xfe, 0x01, 0x00,
+   0xff, 0x7f, 0x70, 0x02, 0x40, 0xff, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x02,
+   0xa0, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x05, 0xd0, 0xff, 0x00, 0x00,
+   0xff, 0xff, 0xfd, 0x0b, 0xd0, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x0b,
+   0xe8, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x17, 0xe8, 0x7f, 0x00, 0x00,
+   0xff, 0xff, 0xfb, 0x17, 0xf4, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x2f,
+   0xf4, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xf3, 0x2f, 0xf4, 0x67, 0x00, 0xe0,
+   0xf0, 0xff, 0xf3, 0x2f, 0xe2, 0xf1, 0x01, 0xfc, 0xc7, 0xff, 0xe0, 0x5f,
+   0x82, 0xf8, 0x03, 0xff, 0x1f, 0x1f, 0xe0, 0x5f, 0x02, 0xfe, 0xc7, 0xff,
+   0x7f, 0x06, 0xc0, 0x5f, 0x02, 0xff, 0xcf, 0xff, 0xff, 0x00, 0x80, 0x5f,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbf, 0x01, 0xff, 0xcf, 0xff,
+   0xff, 0x01, 0x00, 0xbf, 0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbe,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbc, 0x01, 0xff, 0xcf, 0xff,
+   0xff, 0x01, 0x00, 0x80, 0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0x80,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbc, 0x01, 0xff, 0xcf, 0xff,
+   0xff, 0x01, 0x00, 0xbe, 0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbf,
+   0x01, 0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0xbf, 0x02, 0xff, 0xcf, 0xff,
+   0xff, 0x00, 0x80, 0x5f, 0x02, 0xfe, 0xc7, 0xff, 0x7f, 0x06, 0xc0, 0x5f,
+   0x82, 0xf8, 0x03, 0xff, 0x1f, 0x1f, 0xe0, 0x5f, 0xe2, 0xf1, 0x01, 0xfc,
+   0xc7, 0xff, 0xe0, 0x5f, 0xf4, 0x67, 0x00, 0xe0, 0xf0, 0xff, 0xf3, 0x2f,
+   0xf4, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xf3, 0x2f, 0xf4, 0x1f, 0x00, 0x00,
+   0xff, 0xff, 0xfb, 0x2f, 0xe8, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x17,
+   0xe8, 0x7f, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x17, 0xd0, 0x7f, 0x00, 0x00,
+   0xff, 0xff, 0xf9, 0x0b, 0xd0, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x0b,
+   0xa0, 0xff, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x05, 0x40, 0xff, 0x00, 0x00,
+   0xff, 0xff, 0xf8, 0x02, 0x40, 0xfe, 0x01, 0x00, 0xff, 0x7f, 0x70, 0x02,
+   0x80, 0xfe, 0x01, 0x00, 0xff, 0x1f, 0x20, 0x01, 0x00, 0xfd, 0x01, 0x00,
+   0xff, 0x07, 0x80, 0x00, 0x00, 0xfa, 0x01, 0x00, 0xf0, 0x01, 0x40, 0x00,
+   0x00, 0xf4, 0x81, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0xc8, 0xfc, 0xff,
+   0x1f, 0x00, 0x10, 0x00, 0x00, 0x10, 0xfe, 0xff, 0x7f, 0x00, 0x08, 0x00,
+   0x00, 0x60, 0xfe, 0xff, 0x7f, 0x00, 0x06, 0x00, 0x00, 0x80, 0xfc, 0xff,
+   0x7f, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf3, 0xff, 0x7f, 0xc0, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0xff, 0x7f, 0x30, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8,
+   0x1f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bounce2.bit b/bounce2.bit
new file mode 100644 (file)
index 0000000..848942f
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounceicon2_width 64
+#define bounceicon2_height 64
+static char bounceicon2_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00,
+   0x00, 0xce, 0x00, 0x00, 0x00, 0x80, 0xfc, 0x00, 0x00, 0x3f, 0x01, 0x00,
+   0x00, 0x60, 0xff, 0x00, 0x00, 0xff, 0x06, 0x00, 0x00, 0x90, 0xff, 0x01,
+   0x80, 0xff, 0x09, 0x00, 0x00, 0xc8, 0xff, 0xfc, 0x3f, 0xff, 0x13, 0x00,
+   0x00, 0xf4, 0x7f, 0xfe, 0x7f, 0xfe, 0x2f, 0x00, 0x00, 0xfa, 0x7f, 0xfe,
+   0x7f, 0xfe, 0x5f, 0x00, 0x00, 0xfd, 0x3f, 0xff, 0xff, 0xfc, 0xbf, 0x00,
+   0x80, 0xfe, 0x9f, 0xff, 0xff, 0xf9, 0x7f, 0x01, 0x40, 0xfe, 0xcf, 0xff,
+   0xff, 0xf3, 0x7f, 0x02, 0x40, 0xff, 0xcf, 0xff, 0xff, 0xf3, 0xff, 0x02,
+   0x20, 0xff, 0x81, 0xff, 0xff, 0x81, 0xff, 0x04, 0x10, 0x3e, 0x80, 0xff,
+   0xff, 0x01, 0x7c, 0x08, 0xd0, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x0b,
+   0xe8, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x80, 0x17, 0xe8, 0x01, 0x00, 0xfc,
+   0x3f, 0x00, 0x80, 0x17, 0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f,
+   0xf4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0xf4, 0x01, 0x00, 0xfe,
+   0x7f, 0x00, 0x80, 0x2f, 0xfa, 0x03, 0x00, 0xfe, 0x7f, 0x00, 0xc0, 0x5f,
+   0xfa, 0x03, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x5f, 0xfa, 0x03, 0x00, 0xff,
+   0xff, 0x00, 0xc0, 0x5f, 0xfa, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0x5f,
+   0xfd, 0x03, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xbf, 0xfd, 0x03, 0x80, 0xff,
+   0xff, 0x01, 0xc0, 0xbf, 0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf,
+   0xfd, 0x03, 0xc0, 0xff, 0xff, 0x03, 0xc0, 0xbf, 0xfd, 0x03, 0xc0, 0xff,
+   0xff, 0x03, 0xc0, 0xbf, 0xfd, 0xfb, 0x9f, 0xff, 0xff, 0xf9, 0xdf, 0xbf,
+   0xfd, 0xfb, 0x9f, 0xff, 0xff, 0xf9, 0xdf, 0xbf, 0xfd, 0xf9, 0xbf, 0xff,
+   0xff, 0xfd, 0x9f, 0xbf, 0xfd, 0xf9, 0x3f, 0xff, 0xff, 0xfc, 0x9f, 0xbf,
+   0xfd, 0xfd, 0x7f, 0xff, 0xff, 0xfe, 0xbf, 0xbf, 0xfa, 0xfc, 0x7f, 0xfe,
+   0x7f, 0xfe, 0x3f, 0x5f, 0xfa, 0xfc, 0xff, 0xfe, 0x7f, 0xff, 0x3f, 0x5f,
+   0x02, 0xfc, 0xff, 0xfc, 0x3f, 0xff, 0x3f, 0x40, 0x02, 0xfc, 0xff, 0xf9,
+   0x9f, 0xff, 0x3f, 0x40, 0x04, 0xf8, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x20,
+   0x04, 0xf8, 0xff, 0x03, 0xc0, 0xff, 0x1f, 0x20, 0x04, 0xf0, 0xff, 0x01,
+   0x80, 0xff, 0x0f, 0x20, 0x08, 0xf0, 0xff, 0x01, 0x80, 0xff, 0x0f, 0x10,
+   0x08, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x07, 0x10, 0x10, 0xe0, 0xff, 0x00,
+   0x00, 0xff, 0x07, 0x08, 0x10, 0xc0, 0xff, 0x00, 0x00, 0xff, 0x03, 0x08,
+   0x20, 0x80, 0x7f, 0x00, 0x00, 0xfe, 0x01, 0x04, 0x40, 0x00, 0x78, 0x00,
+   0x00, 0x1e, 0x00, 0x02, 0x40, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x02,
+   0x80, 0xc0, 0x1f, 0x00, 0x00, 0xf8, 0x03, 0x01, 0x00, 0xe1, 0x7f, 0x00,
+   0x00, 0xfe, 0x87, 0x00, 0x00, 0xf2, 0xff, 0x01, 0x80, 0xff, 0x4f, 0x00,
+   0x00, 0xe4, 0xff, 0x03, 0xc0, 0xff, 0x27, 0x00, 0x00, 0xc8, 0xff, 0x07,
+   0xe0, 0xff, 0x13, 0x00, 0x00, 0x90, 0xff, 0x1f, 0xf8, 0xff, 0x09, 0x00,
+   0x00, 0x60, 0xff, 0x3f, 0xfc, 0xff, 0x06, 0x00, 0x00, 0x80, 0xfc, 0x7f,
+   0xfe, 0x3f, 0x01, 0x00, 0x00, 0x00, 0xf3, 0x7f, 0xfe, 0xcf, 0x00, 0x00,
+   0x00, 0x00, 0x8c, 0x7f, 0xfe, 0x31, 0x00, 0x00, 0x00, 0x00, 0x70, 0x78,
+   0x1e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/bounce3.bit b/bounce3.bit
new file mode 100644 (file)
index 0000000..fe33158
--- /dev/null
@@ -0,0 +1,46 @@
+#define bounceicon3_width 64
+#define bounceicon3_height 64
+static char bounceicon3_bits[] = {
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07,
+   0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0x1f, 0x0e, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0xfe, 0xff, 0x31, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe,
+   0xff, 0xcf, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe, 0xff, 0x3f, 0x01, 0x00,
+   0x00, 0x60, 0x00, 0xfe, 0xff, 0x7f, 0x06, 0x00, 0x00, 0x10, 0x00, 0xfe,
+   0xff, 0x7f, 0x08, 0x00, 0x00, 0x08, 0x00, 0xf8, 0xff, 0x3f, 0x13, 0x00,
+   0x00, 0x04, 0x00, 0xc0, 0xff, 0x81, 0x2f, 0x00, 0x00, 0x02, 0x80, 0x0f,
+   0x00, 0x80, 0x5f, 0x00, 0x00, 0x01, 0xe0, 0xff, 0x00, 0x80, 0xbf, 0x00,
+   0x80, 0x04, 0xf8, 0xff, 0x00, 0x80, 0x7f, 0x01, 0x40, 0x0e, 0xfe, 0xff,
+   0x00, 0x80, 0x7f, 0x02, 0x40, 0x1f, 0xff, 0xff, 0x00, 0x00, 0xff, 0x02,
+   0xa0, 0xbf, 0xff, 0xff, 0x00, 0x00, 0xff, 0x05, 0xd0, 0xbf, 0xff, 0xff,
+   0x00, 0x00, 0xff, 0x0b, 0xd0, 0x9f, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x0b,
+   0xe8, 0x9f, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x17, 0xe8, 0xdf, 0xff, 0xff,
+   0x00, 0x00, 0xfe, 0x17, 0xf4, 0xdf, 0xff, 0xff, 0x00, 0x00, 0xf8, 0x2f,
+   0xf4, 0xcf, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0x2f, 0xf4, 0xcf, 0xff, 0x0f,
+   0x07, 0x00, 0xe6, 0x2f, 0xfa, 0x07, 0xff, 0xe3, 0x3f, 0x80, 0x8f, 0x47,
+   0xfa, 0x07, 0xf8, 0xf8, 0xff, 0xc0, 0x1f, 0x41, 0xfa, 0x03, 0x60, 0xfe,
+   0xff, 0xe3, 0x7f, 0x40, 0xfa, 0x01, 0x00, 0xff, 0xff, 0xf3, 0xff, 0x40,
+   0xfd, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0xfd, 0x00, 0x80, 0xff,
+   0xff, 0xf3, 0xff, 0x80, 0x7d, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80,
+   0x3d, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0x01, 0x00, 0x80, 0xff,
+   0xff, 0xf3, 0xff, 0x80, 0x01, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80,
+   0x3d, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0x7d, 0x00, 0x80, 0xff,
+   0xff, 0xf3, 0xff, 0x80, 0xfd, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80,
+   0xfd, 0x00, 0x80, 0xff, 0xff, 0xf3, 0xff, 0x80, 0xfa, 0x01, 0x00, 0xff,
+   0xff, 0xf3, 0xff, 0x40, 0xfa, 0x03, 0x60, 0xfe, 0xff, 0xe3, 0x7f, 0x40,
+   0xfa, 0x07, 0xf8, 0xf8, 0xff, 0xc0, 0x1f, 0x41, 0xfa, 0x07, 0xff, 0xe3,
+   0x3f, 0x80, 0x8f, 0x47, 0xf4, 0xcf, 0xff, 0x0f, 0x07, 0x00, 0xe6, 0x2f,
+   0xf4, 0xcf, 0xff, 0x3f, 0x00, 0x00, 0xf0, 0x2f, 0xf4, 0xdf, 0xff, 0xff,
+   0x00, 0x00, 0xf8, 0x2f, 0xe8, 0xdf, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x17,
+   0xe8, 0x9f, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x17, 0xd0, 0x9f, 0xff, 0xff,
+   0x00, 0x00, 0xfe, 0x0b, 0xd0, 0xbf, 0xff, 0xff, 0x00, 0x00, 0xff, 0x0b,
+   0xa0, 0xbf, 0xff, 0xff, 0x00, 0x00, 0xff, 0x05, 0x40, 0x1f, 0xff, 0xff,
+   0x00, 0x00, 0xff, 0x02, 0x40, 0x0e, 0xfe, 0xff, 0x00, 0x80, 0x7f, 0x02,
+   0x80, 0x04, 0xf8, 0xff, 0x00, 0x80, 0x7f, 0x01, 0x00, 0x01, 0xe0, 0xff,
+   0x00, 0x80, 0xbf, 0x00, 0x00, 0x02, 0x80, 0x0f, 0x00, 0x80, 0x5f, 0x00,
+   0x00, 0x04, 0x00, 0xc0, 0xff, 0x81, 0x2f, 0x00, 0x00, 0x08, 0x00, 0xf8,
+   0xff, 0x3f, 0x13, 0x00, 0x00, 0x10, 0x00, 0xfe, 0xff, 0x7f, 0x08, 0x00,
+   0x00, 0x60, 0x00, 0xfe, 0xff, 0x7f, 0x06, 0x00, 0x00, 0x80, 0x00, 0xfe,
+   0xff, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xcf, 0x00, 0x00,
+   0x00, 0x00, 0x0c, 0xfe, 0xff, 0x31, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8,
+   0x1f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00};
diff --git a/flame.c b/flame.c
new file mode 100644 (file)
index 0000000..7ac3615
--- /dev/null
+++ b/flame.c
@@ -0,0 +1,167 @@
+#ifndef lint
+static char sccsid[] = "@(#)flame.c 1.4 91/09/27 XLOCK";
+#endif
+/*-
+ * flame.c - recursive fractal cosmic flames.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 27-Jun-91: vary number of functions used.
+ * 24-Jun-91: fixed portability problem with integer mod (%).
+ * 06-Jun-91: Written. (received from Scott Graves, spot@cs.cmu.edu).
+ */
+
+#include "xlock.h"
+#include <math.h>
+
+#define MAXTOTAL       10000
+#define MAXBATCH       10
+#define MAXLEV         4
+
+typedef struct {
+    double      f[2][3][MAXLEV];/* three non-homogeneous transforms */
+    int         max_levels;
+    int         cur_level;
+    int         snum;
+    int         anum;
+    int         width, height;
+    int         num_points;
+    int         total_points;
+    int         pixcol;
+    Window      win;
+    XPoint      pts[MAXBATCH];
+}           flamestruct;
+
+static flamestruct flames[MAXSCREENS];
+
+static short
+halfrandom(mv)
+    int         mv;
+{
+    static short lasthalf = 0;
+    unsigned long r;
+
+    if (lasthalf) {
+       r = lasthalf;
+       lasthalf = 0;
+    } else {
+       r = random();
+       lasthalf = r >> 16;
+    }
+    return r % mv;
+}
+
+void
+initflame(win)
+    Window      win;
+{
+    flamestruct *fs = &flames[screen];
+    XWindowAttributes xwa;
+
+    srandom(time((long *) 0));
+
+    XGetWindowAttributes(dsp, win, &xwa);
+    fs->width = xwa.width;
+    fs->height = xwa.height;
+
+    fs->max_levels = batchcount;
+    fs->win = win;
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, fs->width, fs->height);
+
+    if (!mono && Scr[screen].npixels > 2) {
+       fs->pixcol = halfrandom(Scr[screen].npixels);
+       XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[fs->pixcol]);
+    } else {
+       XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+    }
+}
+
+static      Bool
+recurse(fs, x, y, l)
+    flamestruct *fs;
+    register double x, y;
+    register int l;
+{
+    int         /*xp, yp,*/ i;
+    double      nx, ny;
+
+    if (l == fs->max_levels) {
+       fs->total_points++;
+       if (fs->total_points > MAXTOTAL)        /* how long each fractal runs */
+           return False;
+
+       if (x > -1.0 && x < 1.0 && y > -1.0 && y < 1.0) {
+           /* xp = */ fs->pts[fs->num_points].x = (int) ((fs->width / 2)
+                                                   * (x + 1.0));
+           /* yp = */ fs->pts[fs->num_points].y = (int) ((fs->height / 2)
+                                                   * (y + 1.0));
+           fs->num_points++;
+           if (fs->num_points > MAXBATCH) {    /* point buffer size */
+               XDrawPoints(dsp, fs->win, Scr[screen].gc, fs->pts,
+                           fs->num_points, CoordModeOrigin);
+               fs->num_points = 0;
+           }
+       }
+    } else {
+       for (i = 0; i < fs->snum; i++) {
+           nx = fs->f[0][0][i] * x + fs->f[0][1][i] * y + fs->f[0][2][i];
+           ny = fs->f[1][0][i] * x + fs->f[1][1][i] * y + fs->f[1][2][i];
+           if (i < fs->anum) {
+               nx = sin(nx);
+               ny = sin(ny);
+           }
+           if (!recurse(fs, nx, ny, l + 1))
+               return False;
+       }
+    }
+    return True;
+}
+
+
+void
+drawflame(win)
+    Window      win;
+{
+    flamestruct *fs = &flames[screen];
+
+    int         i, j, k;
+    static      alt = 0;
+
+    if (!(fs->cur_level++ % fs->max_levels)) {
+       XClearWindow(dsp, fs->win);
+       alt = !alt;
+    } else {
+       if (Scr[screen].npixels > 2) {
+           XSetForeground(dsp, Scr[screen].gc,
+                          Scr[screen].pixels[fs->pixcol]);
+           if (--fs->pixcol < 0)
+               fs->pixcol = Scr[screen].npixels - 1;
+       }
+    }
+
+    /* number of functions */
+    fs->snum = 2 + (fs->cur_level % (MAXLEV - 1));
+
+    /* how many of them are of alternate form */
+    if (alt)
+       fs->anum = 0;
+    else
+       fs->anum = halfrandom(fs->snum) + 2;
+
+    /* 6 coefs per function */
+    for (k = 0; k < fs->snum; k++) {
+       for (i = 0; i < 2; i++)
+           for (j = 0; j < 3; j++)
+               fs->f[i][j][k] = ((double) (random() & 1023) / 512.0 - 1.0);
+    }
+    fs->num_points = 0;
+    fs->total_points = 0;
+    (void) recurse(fs, 0.0, 0.0, 0);
+    XDrawPoints(dsp, win, Scr[screen].gc,
+               fs->pts, fs->num_points, CoordModeOrigin);
+}
diff --git a/grav.c b/grav.c
new file mode 100644 (file)
index 0000000..d43340d
--- /dev/null
+++ b/grav.c
@@ -0,0 +1,255 @@
+/*
+ * grav.c - for xlock, the X Window System lockscreen.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 11-Jul-94: color version
+ * 6-Oct-93: by Greg Bowering <greg@smug.student.adelaide.edu.au>
+ */
+
+#include "xlock.h"
+#include <math.h>
+
+#define GRAV                   -0.02   /* Gravitational constant */
+#define DIST                   16.0
+#define COLLIDE                        0.0001
+#define ALMOST                 15.99
+#define HALF                   0.5
+/*#define INTRINSIC_RADIUS     200.0*/
+#define INTRINSIC_RADIUS       ((float) (gp->height/5))
+#define STARRADIUS             (unsigned int)(gp->height/(2*DIST))
+#define AVG_RADIUS             (INTRINSIC_RADIUS/DIST)
+#define RADIUS                 (unsigned int)(INTRINSIC_RADIUS/(POS(Z)+DIST))
+
+#define XR                     HALF*ALMOST
+#define YR                     HALF*ALMOST
+#define ZR                     HALF*ALMOST
+
+#define VR                     0.04
+
+#define DIMENSIONS             3
+#define X                      0
+#define Y                      1
+#define Z                      2
+
+/*#define TRAIL 1 /* For trails (works good in mono only)
+#define DAMPING 1 /* For decaying orbits */
+#if DAMPING
+#define DAMP                   0.999999
+#define MaxA                   0.1     /* Maximum acceleration */
+#endif
+
+#define POS(c) planet->P[c]
+#define VEL(c) planet->V[c]
+#define ACC(c) planet->A[c]
+
+#define Planet(x,y)\
+  if ((x) >= 0 && (y) >= 0 && (x) <= gp->width && (y) <= gp->height) {\
+    if (planet->ri < 2)\
+     XDrawPoint(dsp, win, Scr[screen].gc, (x), (y));\
+    else\
+     XFillArc(dsp, win, Scr[screen].gc,\
+      (x) - planet->ri / 2, (y) - planet->ri / 2, planet->ri, planet->ri,\
+      0, 360*64);\
+   }
+
+#define FLOATRAND(min,max)     ((min)+(random()/MAXRAND)*((max)-(min)))
+
+typedef struct {
+  double
+    P[DIMENSIONS],
+    V[DIMENSIONS],
+    A[DIMENSIONS];
+  int
+    xi,
+    yi,
+    ri;
+  unsigned long colors;
+} planetstruct;
+
+typedef struct {
+  int width, height;
+  int
+    x,
+    y,
+    sr,
+    nplanets;
+  unsigned long starcolor;
+  planetstruct *planets;
+} gravstruct;
+
+static gravstruct gravs[MAXSCREENS];
+
+static void init_planet();
+static void draw_planet();
+
+void
+initgrav(win)
+  Window      win;
+{
+  XWindowAttributes xgwa;
+  gravstruct *gp = &gravs[screen];
+  unsigned char ball;
+  
+  XGetWindowAttributes(dsp, win, &xgwa);
+  gp->width = xgwa.width;
+  gp->height = xgwa.height;
+  gp->sr = STARRADIUS;
+  
+  if (batchcount < 0)
+    batchcount = 1;
+  else if (batchcount > 20)
+    batchcount = 10;
+  gp->nplanets = batchcount;
+  if (!gp->planets)
+    gp->planets = (planetstruct *) calloc(gp->nplanets, sizeof(planetstruct));
+  XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+  XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, gp->width, gp->height);
+  if (!mono && Scr[screen].npixels > 2) {
+    gp->starcolor = random() % Scr[screen].npixels;
+    if (gp->starcolor == BlackPixel(dsp, screen))
+      gp->starcolor = WhitePixel(dsp, screen);
+  } else
+    gp->starcolor = WhitePixel(dsp, screen);
+  for (ball = 0; ball < gp->nplanets; ball++)
+    init_planet(win, &gp->planets[ball]);
+  
+  /* Draw centrepoint */
+  XDrawArc(dsp, win, Scr[screen].gc,
+    gp->width/2 - gp->sr/2, gp->height/2 - gp->sr/2, gp->sr, gp->sr,
+    0, 360*64);
+}
+
+static void
+init_planet(win, planet)
+  Window win;
+  planetstruct *planet;
+{
+  gravstruct *gp = &gravs[screen];
+
+    if (!mono && Scr[screen].npixels > 2) {
+      planet->colors = random() % Scr[screen].npixels;
+      if (planet->colors == BlackPixel(dsp, screen))
+        planet->colors = WhitePixel(dsp, screen);
+    } else
+      planet->colors = WhitePixel(dsp, screen);
+    /* Initialize positions */
+    POS(X) = FLOATRAND(-XR,XR);
+    POS(Y) = FLOATRAND(-YR,YR);
+    POS(Z) = FLOATRAND(-ZR,ZR);
+    
+    if (POS(Z) > -ALMOST) {
+      planet->xi = (unsigned int)
+        ((double)gp->width * (HALF + POS(X) / (POS(Z) + DIST)));
+      planet->yi = (unsigned int)
+        ((double)gp->height * (HALF + POS(Y) / (POS(Z) + DIST)));
+    }
+    else
+      planet->xi = planet->yi = -1;
+    planet->ri = RADIUS;
+    
+    /* Initialize velocities */
+    VEL(X) = FLOATRAND(-VR,VR);
+    VEL(Y) = FLOATRAND(-VR,VR);
+    VEL(Z) = FLOATRAND(-VR,VR);
+    
+    /* Draw planets */
+    Planet(planet->xi, planet->yi);
+}
+void
+drawgrav(win)
+     Window      win;
+{
+  gravstruct *gp = &gravs[screen];
+  register unsigned char ball;
+  
+  /* Mask centrepoint */
+  XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+  XDrawArc(dsp, win, Scr[screen].gc,
+    gp->width / 2 - gp->sr / 2, gp->height / 2 - gp->sr / 2, gp->sr, gp->sr,
+    0, 360*64);
+
+  /* Resize centrepoint */
+  switch (random() % 4) {
+   case 0:
+    if (gp->sr < STARRADIUS)
+      gp->sr++;
+    break;
+   case 1:
+    if (gp->sr > 2)
+      gp->sr--;
+  }            
+
+  /* Draw centrepoint */
+  XSetForeground(dsp, Scr[screen].gc, gp->starcolor);
+  XDrawArc(dsp, win, Scr[screen].gc,
+    gp->width / 2 - gp->sr / 2, gp->height / 2 - gp->sr / 2, gp->sr, gp->sr,
+    0, 360*64);
+  
+  for (ball = 0; ball < gp->nplanets; ball++)
+    draw_planet(win, &gp->planets[ball]);
+}
+
+static void
+draw_planet(win, planet)
+  Window win;
+  planetstruct *planet;
+{
+  gravstruct *gp = &gravs[screen];
+  double D;    /* A distance variable to work with */
+  register unsigned char cmpt;
+
+    D = POS(X) * POS(X) + POS(Y) * POS(Y) + POS(Z) * POS(Z);
+    if (D < COLLIDE)
+      D = COLLIDE;
+    D = sqrt(D);
+    D = D * D * D;
+    for (cmpt = X; cmpt < DIMENSIONS; cmpt++)
+    {
+      ACC(cmpt) = POS(cmpt) * GRAV / D;
+#ifdef DAMPING
+      if (ACC(cmpt) > MaxA)
+        ACC(cmpt) = MaxA;
+      else if (ACC(cmpt) < -MaxA)
+        ACC(cmpt) = -MaxA;
+      VEL(cmpt) = VEL(cmpt) + ACC(cmpt);
+      VEL(cmpt) *= DAMP;
+#else
+      /* update velocity */
+      VEL(cmpt) = VEL(cmpt) + ACC(cmpt);
+#endif
+      /* update position */
+      POS(cmpt) = POS(cmpt) + VEL(cmpt);
+    }
+    
+    gp->x = planet->xi;
+    gp->y = planet->yi;
+    
+    if (POS(Z) > -ALMOST) {
+      planet->xi = (unsigned int)
+        ((double) gp->width * (HALF + POS(X) / (POS(Z) + DIST)));
+      planet->yi = (unsigned int)
+        ((double) gp->height * (HALF + POS(Y) / (POS(Z) + DIST)));
+    } else
+      planet->xi = planet->yi = -1;
+    
+    /* Mask */
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    Planet(gp->x, gp->y);
+#ifdef TRAIL
+    XSetForeground(dsp, Scr[screen].gc, planet->colors);
+    XDrawPoint(dsp, win, Scr[screen].gc, gp->x, gp->y);
+#endif
+    /* Move */
+    gp->x = planet->xi;
+    gp->y = planet->yi;
+    planet->ri = RADIUS;
+    
+    /* Redraw */
+    XSetForeground(dsp, Scr[screen].gc, planet->colors);
+    Planet(gp->x, gp->y);
+}
diff --git a/helix.c b/helix.c
new file mode 100644 (file)
index 0000000..1509f93
--- /dev/null
+++ b/helix.c
@@ -0,0 +1,218 @@
+#ifndef lint
+static char sccsid[] = "@(#)helix.c 1.3 92/01/01 XLOCK";
+#endif
+/*
+ * String art
+ *
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1992:     xscreensaver version (Jamie Zawinski jwz@lucid.com)
+ */
+
+/* original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, distribute, and sell 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#include <math.h>
+#include "xlock.h"
+
+#define ANGLES 360
+
+static double cos_array[ANGLES], sin_array[ANGLES];
+typedef struct {
+    int        width;
+    int        height;
+    int xmid, ymid;
+    int color;
+    int counter;
+} helixstruct;
+
+static helixstruct helixes[MAXSCREENS];
+
+
+void
+inithelix(win)
+    Window      win;
+{
+    XWindowAttributes xgwa;
+    helixstruct *hp = &helixes[screen];
+    int i;
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    hp->width = xgwa.width;
+    hp->height = xgwa.height;
+    hp->xmid = hp->width / 2;
+    hp->ymid = hp->height / 2;
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, hp->width, hp->height);
+
+    for (i = 0; i < ANGLES; i++) {
+      cos_array[i] = cos((((double) i) / (double) (ANGLES / 2)) * M_PI);
+      sin_array[i] = sin((((double) i) / (double) (ANGLES / 2)) * M_PI);;
+    }
+
+    hp->color = 0;
+    hp->counter = 0;
+}
+
+static int
+gcd (a, b)
+     int a, b;
+{
+  while (b > 0) {
+      int tmp;
+
+      tmp = a % b;
+      a = b;
+      b = tmp;
+  }
+  return (a < 0 ? -a : a);
+}
+
+static void
+helix (win,
+       radius1, radius2, d_angle,
+       factor1, factor2, factor3, factor4)
+     Window win;
+     int radius1, radius2, d_angle;
+     int factor1, factor2, factor3, factor4;
+{
+  helixstruct *hp = &helixes[screen];
+  XWindowAttributes xgwa;
+  int x1, y1, x2, y2, angle, limit;
+  int i;
+
+  XGetWindowAttributes (dsp, win, &xgwa);
+
+  x1 = hp->xmid;
+  y1 = hp->ymid + radius2;
+  x2 = hp->xmid;
+  y2 = hp->ymid + radius1;
+  angle = 0;
+  limit = 1 + (ANGLES / gcd (ANGLES, d_angle));
+
+  for (i = 0; i < limit; i++)
+    {
+      int tmp;
+#define pmod(x,y) (tmp=(x%y),(tmp>=0?tmp:tmp+y))
+      x1 = hp->xmid + (((double) radius1) *
+        sin_array[pmod ((angle * factor1), ANGLES)]);
+      y1 = hp->ymid + (((double) radius2) *
+        cos_array[pmod ((angle * factor2), ANGLES)]);
+       if (!mono && Scr[screen].npixels > 2) {
+         XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[hp->color]);
+         if (++hp->color >= Scr[screen].npixels)
+             hp->color = 0;
+       }
+      XDrawLine (dsp, win, Scr[screen].gc, x1, y1, x2, y2);
+      x2 = hp->xmid + (((double) radius2) *
+        sin_array[pmod ((angle * factor3), ANGLES)]);
+      y2 = hp->ymid + (((double) radius1) *
+        cos_array[pmod ((angle * factor4), ANGLES)]);
+       if (!mono && Scr[screen].npixels > 2) {
+         XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[hp->color]);
+         if (++hp->color >= Scr[screen].npixels)
+             hp->color = 0;
+       }
+      XDrawLine (dsp, win, Scr[screen].gc, x1, y1, x2, y2);
+      angle += d_angle;
+    }
+}
+
+#define min(a,b) ((a)<(b)?(a):(b))
+
+void
+random_helix (win)
+     Window win;
+{
+    helixstruct *hp = &helixes[screen];
+  int radius, radius1, radius2, d_angle, factor1, factor2, factor3, factor4;
+  double divisor;
+  XWindowAttributes xgwa;
+  XGetWindowAttributes (dsp, win, &xgwa);
+
+  radius = min (hp->xmid, hp->ymid);
+
+  d_angle = 0;
+  factor1 = 2;
+  factor2 = 2;
+  factor3 = 2;
+  factor4 = 2;
+
+  divisor = ((random() / MAXRAND * 3.0 + 1) * (((random() % 1) * 2) - 1));
+
+  if ((random() & 1) == 0)
+    {
+      radius1 = radius;
+      radius2 = radius / divisor;
+    }
+  else
+    {
+      radius2 = radius;
+      radius1 = radius / divisor;
+    }
+
+  while (gcd (ANGLES, d_angle) >= 2)
+    d_angle = random () % ANGLES;
+
+#define random_factor()                                \
+  (((random() % 7) ? ((random() % 1) + 1) : 3) \
+   * (((random() % 1) * 2) - 1))
+
+  while (gcd (gcd (gcd (factor1, factor2), factor3), factor4) != 1)
+    {
+      factor1 = random_factor();
+      factor2 = random_factor();
+      factor3 = random_factor();
+      factor4 = random_factor();
+    }
+       if (!mono && Scr[screen].npixels > 2) {
+         XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[hp->color]);
+         if (++hp->color >= Scr[screen].npixels)
+             hp->color = 0;
+       } else
+         XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+
+  helix(win, radius1, radius2, d_angle,
+        factor1, factor2, factor3, factor4);
+}
+
+void
+drawhelix(win)
+    Window win;
+{
+  helixstruct *hp = &helixes[screen];
+  switch (hp->counter)
+  {
+    case 0:
+      random_helix(win);
+      break;
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+    case 5:
+    case 7:
+    case 8:
+      (void) sleep(1);
+      break;
+    case 6:
+      XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+      XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, hp->width, hp->height);
+      break;
+  }
+  if (hp->counter == 8)
+    hp->counter = 0;
+  else
+    hp->counter++;
+}
diff --git a/hopalong.c b/hopalong.c
new file mode 100644 (file)
index 0000000..0c7b37b
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef lint
+static char sccsid[] = "@(#)hopalong.c 23.9 91/05/24 XLOCK";
+#endif
+/*-
+ * hopalong.c - Real Plane Fractals for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 29-Oct-90: fix bad (int) cast.
+ * 29-Jul-90: support for multiple screens.
+ * 08-Jul-90: new timing and colors and new algorithm for fractals.
+ * 15-Dec-89: Fix for proper skipping of {White,Black}Pixel() in colors.
+ * 08-Oct-89: Fixed long standing typo bug in RandomInitHop();
+ *           Fixed bug in memory allocation in inithop();
+ *           Moved seconds() to an extern.
+ *           Got rid of the % mod since .mod is slow on a sparc.
+ * 20-Sep-89: Lint.
+ * 31-Aug-88: Forked from xlock.c for modularity.
+ * 23-Mar-88: Coded HOPALONG routines from Scientific American Sept. 86 p. 14.
+ */
+
+#include "xlock.h"
+#include <math.h>
+
+typedef struct {
+    int         centerx;
+    int         centery;       /* center of the screen */
+    double      a;
+    double      b;
+    double      c;
+    double      i;
+    double      j;             /* hopalong parameters */
+    int         inc;
+    int         pix;
+    long        startTime;
+}           hopstruct;
+
+static hopstruct hops[MAXSCREENS];
+static XPoint *pointBuffer = 0;        /* pointer for XDrawPoints */
+
+#define TIMEOUT 30
+
+void
+inithop(win)
+    Window      win;
+{
+    double      range;
+    XWindowAttributes xgwa;
+    hopstruct  *hp = &hops[screen];
+
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    hp->centerx = xgwa.width / 2;
+    hp->centery = xgwa.height / 2;
+    range = sqrt((double) hp->centerx * hp->centerx +
+                (double) hp->centery * hp->centery) /
+       (10.0 + random() % 10);
+
+    hp->pix = 0;
+    hp->inc = (int) ((random() / MAXRAND) * 200) - 100;
+    hp->a = (random() / MAXRAND) * range - range / 2.0;
+    hp->b = (random() / MAXRAND) * range - range / 2.0;
+    hp->c = (random() / MAXRAND) * range - range / 2.0;
+    if (!(random() % 2))
+       hp->c = 0.0;
+
+    hp->i = hp->j = 0.0;
+
+    if (!pointBuffer)
+       pointBuffer = (XPoint *) malloc(batchcount * sizeof(XPoint));
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0,
+                  hp->centerx * 2, hp->centery * 2);
+    XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+    hp->startTime = seconds();
+}
+
+
+void
+drawhop(win)
+    Window      win;
+{
+    double      oldj;
+    int         k = batchcount;
+    XPoint     *xp = pointBuffer;
+    hopstruct  *hp = &hops[screen];
+
+    hp->inc++;
+    if (!mono && Scr[screen].npixels > 2) {
+       XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[hp->pix]);
+       if (++hp->pix >= Scr[screen].npixels)
+           hp->pix = 0;
+    }
+    while (k--) {
+       oldj = hp->j;
+       hp->j = hp->a - hp->i;
+       hp->i = oldj + (hp->i < 0
+                       ? sqrt(fabs(hp->b * (hp->i + hp->inc) - hp->c))
+                       : -sqrt(fabs(hp->b * (hp->i + hp->inc) - hp->c)));
+       xp->x = hp->centerx + (int) (hp->i + hp->j);
+       xp->y = hp->centery - (int) (hp->i - hp->j);
+       xp++;
+    }
+    XDrawPoints(dsp, win, Scr[screen].gc,
+               pointBuffer, batchcount, CoordModeOrigin);
+    if (seconds() - hp->startTime > TIMEOUT)
+       inithop(win);
+}
diff --git a/hsbramp.c b/hsbramp.c
new file mode 100644 (file)
index 0000000..9c150b5
--- /dev/null
+++ b/hsbramp.c
@@ -0,0 +1,121 @@
+#ifndef lint
+static char sccsid[] = "@(#)hsbramp.c  23.5 91/05/24 XLOCK";
+#endif
+/*-
+ * hsbramp.c - Create an HSB ramp.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * Changes of David Bagley <bagleyd@source.asset.com>
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * Changes of Patrick J. Naughton
+ * 29-Jul-90: renamed hsbramp.c from HSBmap.c
+ *           minor optimizations.
+ * 01-Sep-88: Written.
+ */
+
+#include <sys/types.h>
+#ifdef VMS
+typedef unsigned char u_char;
+#endif
+#include <math.h>
+
+void
+hsb2rgb(H, S, B, r, g, b)
+    double      H,
+                S,
+                B;
+    u_char     *r,
+               *g,
+               *b;
+{
+    int         i;
+    double      f;
+    double      bb;
+    u_char      p;
+    u_char      q;
+    u_char      t;
+
+    H -= floor(H);             /* remove anything over 1 */
+    H *= 6.0;
+    i = floor(H);              /* 0..5 */
+    f = H - (float) i;         /* f = fractional part of H */
+    bb = 255.0 * B;
+    p = (u_char) (bb * (1.0 - S));
+    q = (u_char) (bb * (1.0 - (S * f)));
+    t = (u_char) (bb * (1.0 - (S * (1.0 - f))));
+    switch (i) {
+    case 0:
+       *r = (u_char) bb;
+       *g = t;
+       *b = p;
+       break;
+    case 1:
+       *r = q;
+       *g = (u_char) bb;
+       *b = p;
+       break;
+    case 2:
+       *r = p;
+       *g = (u_char) bb;
+       *b = t;
+       break;
+    case 3:
+       *r = p;
+       *g = q;
+       *b = (u_char) bb;
+       break;
+    case 4:
+       *r = t;
+       *g = p;
+       *b = (u_char) bb;
+       break;
+    case 5:
+       *r = (u_char) bb;
+       *g = p;
+       *b = q;
+       break;
+    }
+}
+
+
+/*
+ * Input is two points in HSB color space and a count
+ * of how many discreet rgb space values the caller wants.
+ *
+ * Output is that many rgb triples which describe a linear
+ * interpolate ramp between the two input colors.
+ */
+
+void
+hsbramp(h1, s1, b1, h2, s2, b2, count, red, green, blue)
+    double      h1,
+                s1,
+                b1,
+                h2,
+                s2,
+                b2;
+    int         count;
+
+    u_char     *red,
+               *green,
+               *blue;
+{
+    double      dh;
+    double      ds;
+    double      db;
+
+    dh = (h2 - h1) / count;
+    ds = (s2 - s1) / count;
+    db = (b2 - b1) / count;
+    while (count--) {
+       hsb2rgb(h1, s1, b1, red++, green++, blue++);
+       h1 += dh;
+       s1 += ds;
+       b1 += db;
+    }
+}
diff --git a/hyper.c b/hyper.c
new file mode 100644 (file)
index 0000000..f6aff08
--- /dev/null
+++ b/hyper.c
@@ -0,0 +1,249 @@
+#ifndef lint
+static char sccsid[] = "@(#)hyper.c 1.3 92/01/01 XLOCK";
+#endif
+/*
+ * This code derived from TI Explorer Lisp code by Joe Keane, Fritz Mueller,
+ * and Jamie Zawinski.
+ *
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1992:     xscreensaver version (Jamie Zawinski jwz@lucid.com)
+*/
+
+/* original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, distribute, and sell 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#include <math.h>
+#include "xlock.h"
+
+/* Note on port:
+  This is not as efficient as it was, but maybe its more readable.
+  I tried to replace the "##" stuff with:
+#define IDENT(X)        X
+#if defined (__STDC__) || defined (AIXV3)
+#define CAT(X,Y)        X##Y
+#else
+#define CAT(X,Y)        IDENT(X)Y
+#endif
+  A X##Y##Z could then be replaced with CAT(CAT(X,Y),Z).
+  Becuase of this and the fact I am using hyperstruct to keep track of
+  global variables, the code got really ugly, so instead of using "CAT",
+  it just uses arrays.*/
+
+#define COMBOS 6
+#define XY 0
+#define XZ 1
+#define YZ 2
+#define XW 3
+#define YW 4
+#define ZW 5
+#define DIMS 4
+#define POINTS (DIMS*DIMS)
+#define COLORS 8
+#define TIMEOUT 300
+
+typedef struct {
+  int old_x, old_y;
+  int new_x, new_y;
+  int same_p;
+} state;
+
+typedef struct {
+    int        width;
+    int        height;
+    int observer_z;
+    int x_offset, y_offset;
+    int unit_pixels;
+    double cos_array[COMBOS], sin_array[COMBOS];
+    double vars[DIMS][DIMS];
+    state points[POINTS];
+    int colors[COLORS];
+    GC xor_GC;
+    long startTime;
+} hyperstruct;
+
+static hyperstruct hypers[MAXSCREENS];
+
+static void
+move_line (win, state0, state1, color)
+     Window win;
+     state state0, state1;
+     int color;
+{
+      hyperstruct *hp = &hypers[screen];
+
+  if (state0.same_p && state1.same_p)
+    return;
+  if (mono || Scr[screen].npixels <= COLORS)
+  {
+      XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+      XDrawLine (dsp, win, Scr[screen].gc,
+                state0.old_x, state0.old_y, state1.old_x, state1.old_y);
+      XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+      XDrawLine (dsp, win, Scr[screen].gc,
+                state0.new_x, state0.new_y, state1.new_x, state1.new_y);
+  }
+  else
+  {
+      XSegment segments[2];
+      XSetForeground(dsp, hp->xor_GC, Scr[screen].pixels[hp->colors[color]]);
+      segments[0].x1 = state0.old_x; segments[0].y1 = state0.old_y;
+      segments[0].x2 = state1.old_x; segments[0].y2 = state1.old_y;
+      segments[1].x1 = state0.new_x; segments[1].y1 = state0.new_y;
+      segments[1].x2 = state1.new_x; segments[1].y2 = state1.new_y;
+      XDrawSegments (dsp, win, hp->xor_GC, segments, 2);
+  }
+}
+
+void
+inithyper(win)
+    Window      win;
+{
+    XWindowAttributes xgwa;
+    XGCValues gcv;
+    hyperstruct *hp = &hypers[screen];
+    int i, j;
+    Screen *scr;
+    double combos[COMBOS];
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    scr = ScreenOfDisplay(dsp, screen);
+    hp->width = xgwa.width;
+    hp->height = xgwa.height;
+    hp->unit_pixels = xgwa.width < xgwa.height ? xgwa.width : xgwa.height;
+    hp->x_offset = xgwa.width / 2;
+    hp->y_offset = xgwa.height / 2;
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, hp->width, hp->height);
+  
+  combos[0] = 0.0;
+  combos[1] = 0.01;
+  combos[2] = 0.005;
+  combos[3] = 0.01;
+  combos[4] = 0.0;
+  combos[5] = 0.0;
+  for (i = 0; i < COMBOS; i++)
+  {
+    hp->cos_array[i] = cos(combos[i]);
+    hp->sin_array[i] = sin(combos[i]);
+  }
+  for (i = 0; i < DIMS; i++)
+    for (j = 0; j < DIMS; j++)
+      if (i == j)
+       hp->vars[i][j] = 1.0;
+      else
+       hp->vars[i][j] = 0.0;
+  (void) memset(hp->points, 0, sizeof(hp->points));
+  hp->observer_z = 5;
+
+      gcv.function = GXxor;
+      gcv.foreground = WhitePixelOfScreen(scr) ^ BlackPixelOfScreen(scr);
+      hp->xor_GC = XCreateGC (dsp, win, GCForeground|GCFunction, &gcv);
+  for (i = 0; i < COLORS; i++)
+    hp->colors[i] = random() % Scr[screen].npixels;
+  hp->startTime = seconds();
+}
+
+
+static int left_part[COMBOS] = {0, 0, 1, 0, 1, 2};
+static int right_part[COMBOS] = {1, 2, 2, 3, 3, 3};
+#define NOTSIGN(i) (((i)==0)?(-1):(1))
+
+void
+drawhyper(win)
+    Window      win;
+{
+    hyperstruct *hp = &hypers[screen];
+
+  double temp_mult, tmp0, tmp1;
+  int i, j;
+  int sign[DIMS];
+      for (i = 0; i < POINTS; i++) {
+       for (j = 0; j < DIMS; j++)
+         sign[j] = NOTSIGN(i & (1<<(DIMS-1-j)));
+        temp_mult = (hp->unit_pixels /
+         (((sign[0]*hp->vars[0][2]) + (sign[1]*hp->vars[1][2]) +
+           (sign[2]*hp->vars[2][2]) + (sign[3]*hp->vars[3][2]) +
+           (sign[0]*hp->vars[0][3]) + (sign[1]*hp->vars[1][3]) +
+           (sign[2]*hp->vars[2][3]) + (sign[3]*hp->vars[3][3])) -
+           hp->observer_z));
+        hp->points[i].old_x = hp->points[i].new_x;
+        hp->points[i].old_y = hp->points[i].new_y;
+        hp->points[i].new_x =
+         ((((sign[0]*hp->vars[0][0]) + (sign[1]*hp->vars[1][0]) +
+            (sign[2]*hp->vars[2][0]) + (sign[3]*hp->vars[3][0])) *
+           temp_mult) + hp->x_offset);
+        hp->points[i].new_y =
+         ((((sign[0]*hp->vars[0][1]) + (sign[1]*hp->vars[1][1]) +
+            (sign[2]*hp->vars[2][1]) + (sign[3]*hp->vars[3][1])) *
+           temp_mult) + hp->y_offset);
+        hp->points[i].same_p =
+         (hp->points[i].old_x == hp->points[i].new_x &&
+          hp->points[i].old_y == hp->points[i].new_y);
+      }
+
+      move_line (win, hp->points[0], hp->points[1], 0);
+      move_line (win, hp->points[0], hp->points[2], 0);
+      move_line (win, hp->points[2], hp->points[3], 0);
+      move_line (win, hp->points[1], hp->points[3], 0);
+
+      move_line (win, hp->points[8], hp->points[9], 1);
+      move_line (win, hp->points[8], hp->points[10], 1);
+      move_line (win, hp->points[10], hp->points[11], 1);
+      move_line (win, hp->points[9], hp->points[11], 1);
+
+      move_line (win, hp->points[4], hp->points[5], 2);
+      move_line (win, hp->points[4], hp->points[6], 2);
+      move_line (win, hp->points[6], hp->points[7], 2);
+      move_line (win, hp->points[5], hp->points[7], 2);
+
+      move_line (win, hp->points[3], hp->points[7], 3);
+      move_line (win, hp->points[3], hp->points[11], 3);
+      move_line (win, hp->points[11], hp->points[15], 3);
+      move_line (win, hp->points[7], hp->points[15], 3);
+
+      move_line (win, hp->points[0], hp->points[4], 4);
+      move_line (win, hp->points[0], hp->points[8], 4);
+      move_line (win, hp->points[4], hp->points[12], 4);
+      move_line (win, hp->points[8], hp->points[12], 4);
+
+      move_line (win, hp->points[1], hp->points[5], 5);
+      move_line (win, hp->points[1], hp->points[9], 5);
+      move_line (win, hp->points[9], hp->points[13], 5);
+      move_line (win, hp->points[5], hp->points[13], 5);
+
+      move_line (win, hp->points[2], hp->points[6], 6);
+      move_line (win, hp->points[2], hp->points[10], 6);
+      move_line (win, hp->points[10], hp->points[14], 6);
+      move_line (win, hp->points[6], hp->points[14], 6);
+      
+      move_line (win, hp->points[12], hp->points[13], 7);
+      move_line (win, hp->points[12], hp->points[14], 7);
+      move_line (win, hp->points[14], hp->points[15], 7);
+      move_line (win, hp->points[13], hp->points[15], 7);
+
+      for (i = 0; i < COMBOS; i++)
+        if (hp->sin_array[i] != 0)
+          for (j = 0; j < DIMS; j++)
+          {
+            tmp0 = ((hp->vars[j][left_part[i]] * hp->cos_array[i]) +
+                 (hp->vars[j][right_part[i]] * hp->sin_array[i]));
+            tmp1 = ((hp->vars[j][right_part[i]] * hp->cos_array[i]) -
+                 (hp->vars[j][left_part[i]] * hp->sin_array[i]));
+            hp->vars[j][left_part[i]] = tmp0;
+           hp->vars[j][right_part[i]] = tmp1;
+          }
+      if (seconds() - hp->startTime > TIMEOUT)
+        inithyper(win);
+}
diff --git a/life.c b/life.c
new file mode 100644 (file)
index 0000000..4f92bcc
--- /dev/null
+++ b/life.c
@@ -0,0 +1,619 @@
+#ifndef lint
+static char sccsid[] = "@(#)life.c     23.6 91/05/24 XLOCK";
+#endif
+/*-
+ * life.c - Conway's game of Life for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * Changes of David Bagley <bagleyd@source.asset.com>
+ * 21-Jul-94: Took out bzero & bcopy since memset & memcpy is more portable
+ * 10-Jun-94: Changed name of function 'kill', which is a libc function on
+ *            many systems from Victor Langeveld <vic@mbfys.kun.nl>
+ *
+ * Changes of Patrick J. Naughton
+ * 24-May-91: Added wraparound code from johnson@bugs.comm.mot.com.
+ *           Made old cells stay blue.
+ *           Made batchcount control the number of generations till restart.
+ * 29-Jul-90: support for multiple screens.
+ * 07-Feb-90: remove bogus semi-colon after #include line.
+ * 15-Dec-89: Fix for proper skipping of {White,Black}Pixel() in colors.
+ * 08-Oct-89: Moved seconds() to an extern.
+ * 20-Sep-89: Written (life algorithm courtesy of Jim Graham, flar@sun.com).
+ */
+
+#include "xlock.h"
+#include "lifeicon.bit"
+
+static XImage logo = {
+    0, 0,                      /* width, height */
+    0, XYBitmap, 0,            /* xoffset, format, data */
+    LSBFirst, 8,               /* byte-order, bitmap-unit */
+    LSBFirst, 8, 1             /* bitmap-bit-order, bitmap-pad, depth */
+};
+#define min(a, b) ((a)<(b)?(a):(b))
+#define        MAXROWS 155
+#define MAXCOLS        144
+#define TIMEOUT 30
+
+typedef struct {
+    int         pixelmode;
+    int         xs;
+    int         ys;
+    int         xb;
+    int         yb;
+    int         generation;
+    long        shooterTime;
+    int         nrows;
+    int         ncols;
+    int         width;
+    int         height;
+    unsigned char buffer[(MAXROWS + 2) * (MAXCOLS + 2) + 2];
+    unsigned char tempbuf[MAXCOLS * 2];
+    unsigned char lastbuf[MAXCOLS];
+    unsigned char agebuf[(MAXROWS + 2) * (MAXCOLS + 2)];
+}           lifestruct;
+
+static lifestruct lifes[MAXSCREENS];
+static int  icon_width, icon_height;
+
+/* Buffer stores the data for each cell. Each cell is stored as
+ * 8 bits representing the presence of a critter in each of it's
+ * surrounding 8 cells. There is an empty row and column around
+ * the whole array to allow stores without bounds checking as well
+ * as an extra row at the end for the fetches into tempbuf.
+ *
+ * Tempbuf stores the data for the next two rows so that we know
+ * the state of those critter before he was modified by the fate
+ * of the critters that have already been processed.
+ *
+ * Agebuf stores the age of each critter.
+ */
+
+#define        UPLT    0x01
+#define UP     0x02
+#define UPRT   0x04
+#define LT     0x08
+#define RT     0x10
+#define DNLT   0x20
+#define DN     0x40
+#define DNRT   0x80
+
+/* Fates is a lookup table for the fate of a critter. The 256
+ * entries represent the 256 possible combinations of the 8
+ * neighbor cells. Each entry is one of BIRTH (create a cell
+ * or leave one alive), SAME (leave the cell alive or dead),
+ * or DEATH (kill anything in the cell).
+ */
+#define BIRTH  0
+#define SAME   1
+#define DEATH  2
+static unsigned char fates[256];
+static int  initialized = 0;
+
+static int  patterns[][128] = {
+    {                          /* EIGHT */
+       -3, -3, -2, -3, -1, -3,
+       -3, -2, -2, -2, -1, -2,
+       -3, -1, -2, -1, -1, -1,
+       0, 0, 1, 0, 2, 0,
+       0, 1, 1, 1, 2, 1,
+       0, 2, 1, 2, 2, 2,
+       99
+    },
+    {                          /* PULSAR */
+       1, 1, 2, 1, 3, 1, 4, 1, 5, 1,
+       1, 2, 5, 2,
+       99
+    },
+    {                          /* BARBER */
+       -7, -7, -6, -7,
+       -7, -6, -5, -6,
+       -5, -4, -3, -4,
+       -3, -2, -1, -2,
+       -1, 0, 1, 0,
+       1, 2, 3, 2,
+       3, 4, 5, 4,
+       4, 5, 5, 5,
+       99
+    },
+    {                          /* HERTZ */
+       -2, -6, -1, -6,
+       -2, -5, -1, -5,
+       -7, -3, -6, -3, -2, -3, -1, -3, 0, -3, 1, -3, 5, -3, 6, -3,
+       -7, -2, -5, -2, -3, -2, 2, -2, 4, -2, 6, -2,
+       -5, -1, -3, -1, -2, -1, 2, -1, 4, -1,
+       -7, 0, -5, 0, -3, 0, 2, 0, 4, 0, 6, 0,
+       -7, 1, -6, 1, -2, 1, -1, 1, 0, 1, 1, 1, 5, 1, 6, 1,
+       -2, 3, -1, 3,
+       -2, 4, -1, 4,
+       99
+    },
+    {                          /* TUMBLER */
+       -6, -6, -5, -6, 6, -6, 7, -6,
+       -6, -5, -5, -5, 6, -5, 7, -5,
+       -5, 5, 6, 5,
+       -7, 6, -5, 6, 6, 6, 8, 6,
+       -7, 7, -5, 7, 6, 7, 8, 7,
+       -7, 8, -6, 8, 7, 8, 8, 8,
+       99
+    },
+    {                          /* PERIOD4 */
+       -5, -8, -4, -8,
+       -7, -7, -5, -7,
+       -8, -6, -2, -6,
+       -7, -5, -3, -5, -2, -5,
+       -5, -3, -3, -3,
+       -4, -2,
+       99
+    },
+    {                          /* PERIOD5 */
+       -5, -8, -4, -8,
+       -6, -7, -3, -7,
+       -7, -6, -2, -6,
+       -8, -5, -1, -5,
+       -8, -4, -1, -4,
+       -7, -3, -2, -3,
+       -6, -2, -3, -2,
+       -5, -1, -4, -1,
+       99
+    },
+    {                          /* PERIOD6 */
+       -4, -8, -3, -8,
+       -8, -7, -7, -7, -5, -7,
+       -8, -6, -7, -6, -4, -6, -1, -6,
+       -3, -5, -1, -5,
+       -2, -4,
+       -3, -2, -2, -2,
+       -3, -1, -2, -1,
+       99
+    },
+    {                          /* PINWHEEL */
+       -4, -8, -3, -8,
+       -4, -7, -3, -7,
+       -4, -5, -3, -5, -2, -5, -1, -5,
+       -5, -4, -3, -4, 0, -4, 2, -4, 3, -4,
+       -5, -3, -1, -3, 0, -3, 2, -3, 3, -3,
+       -8, -2, -7, -2, -5, -2, -2, -2, 0, -2,
+       -8, -1, -7, -1, -5, -1, 0, -1,
+       -4, 0, -3, 0, -2, 0, -1, 0,
+       -2, 2, -1, 2,
+       -2, 3, -1, 3,
+       99
+    },
+    {                          /* ] */
+       -1, -1, 0, -1, 1, -1,
+       0, 0, 1, 0,
+       -1, 1, 0, 1, 1, 1,
+       99
+    },
+    {                          /* cc: */
+       -3, -1, -2, -1, -1, -1, 1, -1, 2, -1, 3, -1,
+       -3, 0, -2, 0, 1, 0, 2, 0,
+       -3, 1, -2, 1, -1, 1, 1, 1, 2, 1, 3, 1,
+       99
+    },
+    {                          /* DOLBY */
+       -3, -1, -2, -1, -1, -1, 1, -1, 2, -1, 3, -1,
+       -3, 0, -2, 0, 2, 0, 3, 0,
+       -3, 1, -2, 1, -1, 1, 1, 1, 2, 1, 3, 1,
+       99
+    },
+    {                          /* HORIZON */
+       -15, 0, -14, 0, -13, 0, -12, 0, -11, 0,
+       -10, 0, -9, 0, -8, 0, -7, 0, -6, 0,
+       -5, 0, -4, 0, -3, 0, -2, 0, -1, 0,
+       4, 0, 3, 0, 2, 0, 1, 0, 0, 0,
+       9, 0, 8, 0, 7, 0, 6, 0, 5, 0,
+       14, 0, 13, 0, 12, 0, 11, 0, 10, 0,
+       99
+    },
+    {                          /* SHEAR */
+       -7, -2, -6, -2, -5, -2, -4, -2, -3, -2,
+       -2, -2, -1, -2, 0, -2, 1, -2, 2, -2,
+       -5, -1, -4, -1, -3, -1, -2, -1, -1, -1,
+       0, -1, 1, -1, 2, -1, 3, -1, 4, -1,
+       -3, 0, -2, 0, -1, 0, 0, 0, 1, 0,
+       2, 0, 3, 0, 4, 0, 5, 0, 6, 0,
+       -10, 1, -9, 1, -8, 1, -7, 1, -6, 1,
+       -5, 1, -4, 1, -3, 1, -2, 1, -1, 1,
+       -10, 2, -9, 2, -8, 2, -7, 2, -6, 2,
+       -5, 2, -4, 2, -3, 2, -2, 2, -1, 2,
+       99
+    },
+    {                          /* VERTIGO */
+       0, -7,
+       0, -6,
+       0, -5,
+       0, -4,
+       0, -3,
+       0, -2,
+       0, -1,
+       0, 0,
+       0, 7,
+       0, 6,
+       0, 5,
+       0, 4,
+       0, 3,
+       0, 2,
+       0, 1,
+       99
+    },
+    {                          /* CROSSBAR */
+       -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, 4, 0, 3, 0, 2, 0, 1, 0, 0, 0,
+       99
+    },
+    {                          /* GOALPOSTS */
+       -8, -7, 8, -7,
+       -8, -6, 8, -6,
+       -8, -5, 8, -5,
+       -8, -4, 8, -4,
+       -8, -3, 8, -3,
+       -8, -2, 8, -2,
+       -8, -1, 8, -1,
+       -8, 0, 8, 0,
+       -8, 1, 8, 1,
+       -8, 2, 8, 2,
+       -8, 3, 8, 3,
+       -8, 4, 8, 4,
+       -8, 5, 8, 5,
+       -8, 6, 8, 6,
+       -8, 7, 8, 7,
+       99
+    },
+    {                          /* \ */
+       -8, -8, -7, -8,
+       -7, -7, -6, -7,
+       -6, -6, -5, -6,
+       -5, -5, -4, -5,
+       -4, -4, -3, -4,
+       -3, -3, -2, -3,
+       -2, -2, -1, -2,
+       -1, -1, 0, -1,
+       0, 0, 1, 0,
+       1, 1, 2, 1,
+       2, 2, 3, 2,
+       3, 3, 4, 3,
+       4, 4, 5, 4,
+       5, 5, 6, 5,
+       6, 6, 7, 6,
+       7, 7, 8, 7,
+       99
+    },
+    {                          /* LABYRINTH */
+       -4, -4, -3, -4, -2, -4, -1, -4, 0, -4, 1, -4, 2, -4, 3, -4, 4, -4,
+       -4, -3, 0, -3, 4, -3,
+       -4, -2, -2, -2, -1, -2, 0, -2, 1, -2, 2, -2, 4, -2,
+       -4, -1, -2, -1, 2, -1, 4, -1,
+       -4, 0, -2, 0, -1, 0, 0, 0, 1, 0, 2, 0, 4, 0,
+       -4, 1, -2, 1, 2, 1, 4, 1,
+       -4, 2, -2, 2, -1, 2, 0, 2, 1, 2, 2, 2, 4, 2,
+       -4, 3, 0, 3, 4, 3,
+       -4, 4, -3, 4, -2, 4, -1, 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4,
+       99
+    }
+};
+
+#define NPATS  (sizeof patterns / sizeof patterns[0])
+
+
+static void
+drawcell(win, row, col)
+    Window      win;
+    int         row, col;
+{
+    lifestruct *lp = &lifes[screen];
+
+    XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+    if (!mono && Scr[screen].npixels > 2) {
+       unsigned char *loc = lp->buffer + ((row + 1) * (lp->ncols + 2)) + col + 1;
+       unsigned char *ageptr = lp->agebuf + (loc - lp->buffer);
+       unsigned char age = *ageptr;
+
+       /* if we aren't up to blue yet, then keep aging the cell. */
+       if (age < Scr[screen].npixels * 0.7)
+           ++age;
+
+       XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[age]);
+       *ageptr = age;
+    }
+    if (lp->pixelmode)
+       XFillRectangle(dsp, win, Scr[screen].gc,
+              lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
+    else
+       XPutImage(dsp, win, Scr[screen].gc, &logo,
+                 0, 0, lp->xb + lp->xs * col, lp->yb + lp->ys * row,
+                 icon_width, icon_height);
+}
+
+
+static void
+erasecell(win, row, col)
+    Window      win;
+    int         row, col;
+{
+    lifestruct *lp = &lifes[screen];
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc,
+              lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
+}
+
+
+static void
+spawn(loc)
+    unsigned char *loc;
+{
+    lifestruct *lp = &lifes[screen];
+    unsigned char *ulloc, *ucloc, *urloc, *clloc, *crloc, *llloc, *lcloc, *lrloc,
+               *arloc;
+    int         off, row, col, lastrow;
+
+    lastrow = (lp->nrows) * (lp->ncols + 2);
+    off = loc - lp->buffer;
+    col = off % (lp->ncols + 2);
+    row = (off - col) / (lp->ncols + 2);
+    ulloc = loc - lp->ncols - 3;
+    ucloc = loc - lp->ncols - 2;
+    urloc = loc - lp->ncols - 1;
+    clloc = loc - 1;
+    crloc = loc + 1;
+    arloc = loc + 1;
+    llloc = loc + lp->ncols + 1;
+    lcloc = loc + lp->ncols + 2;
+    lrloc = loc + lp->ncols + 3;
+    if (row == 1) {
+       ulloc += lastrow;
+       ucloc += lastrow;
+       urloc += lastrow;
+    }
+    if (row == lp->nrows) {
+       llloc -= lastrow;
+       lcloc -= lastrow;
+       lrloc -= lastrow;
+    }
+    if (col == 1) {
+       ulloc += lp->ncols;
+       clloc += lp->ncols;
+       llloc += lp->ncols;
+    }
+    if (col == lp->ncols) {
+       urloc -= lp->ncols;
+       crloc -= lp->ncols;
+       lrloc -= lp->ncols;
+    }
+    *ulloc |= UPLT;
+    *ucloc |= UP;
+    *urloc |= UPRT;
+    *clloc |= LT;
+    *crloc |= RT;
+    *arloc |= RT;
+    *llloc |= DNLT;
+    *lcloc |= DN;
+    *lrloc |= DNRT;
+
+    *(lp->agebuf + (loc - lp->buffer)) = 0;
+}
+
+
+static void
+ckill(loc)
+    unsigned char *loc;
+{
+    lifestruct *lp = &lifes[screen];
+
+    unsigned char *ulloc, *ucloc, *urloc, *clloc, *crloc, *llloc, *lcloc,
+               *lrloc, *arloc;
+    int         off, row, col, lastrow;
+
+    lastrow = (lp->nrows) * (lp->ncols + 2);
+    off = loc - lp->buffer;
+    row = off / (lp->ncols + 2);
+    col = off % (lp->ncols + 2);
+    row = (off - col) / (lp->ncols + 2);
+    ulloc = loc - lp->ncols - 3;
+    ucloc = loc - lp->ncols - 2;
+    urloc = loc - lp->ncols - 1;
+    clloc = loc - 1;
+    crloc = loc + 1;
+    arloc = loc + 1;
+    llloc = loc + lp->ncols + 1;
+    lcloc = loc + lp->ncols + 2;
+    lrloc = loc + lp->ncols + 3;
+    if (row == 1) {
+       ulloc += lastrow;
+       ucloc += lastrow;
+       urloc += lastrow;
+    }
+    if (row == lp->nrows) {
+       llloc -= lastrow;
+       lcloc -= lastrow;
+       lrloc -= lastrow;
+    }
+    if (col == 1) {
+       ulloc += lp->ncols;
+       clloc += lp->ncols;
+       llloc += lp->ncols;
+    }
+    if (col == lp->ncols) {
+       urloc -= lp->ncols;
+       crloc -= lp->ncols;
+       lrloc -= lp->ncols;
+    }
+    *ulloc &= ~UPLT;
+    *ucloc &= ~UP;
+    *urloc &= ~UPRT;
+    *clloc &= ~LT;
+    *crloc &= ~RT;
+    *arloc &= ~RT;
+    *llloc &= ~DNLT;
+    *lcloc &= ~DN;
+    *lrloc &= ~DNRT;
+}
+
+
+static void
+setcell(win, row, col)
+    Window      win;
+    int         row;
+    int         col;
+{
+    lifestruct *lp = &lifes[screen];
+    unsigned char *loc;
+
+    loc = lp->buffer + ((row + 1) * (lp->ncols + 2)) + col + 1;
+    spawn(loc);
+    drawcell(win, row, col);
+}
+
+
+static void
+init_fates()
+{
+    int         i, bits, neighbors;
+
+    for (i = 0; i < 256; i++) {
+       neighbors = 0;
+       for (bits = i; bits; bits &= (bits - 1))
+           neighbors++;
+       if (neighbors == 3)
+           fates[i] = BIRTH;
+       else if (neighbors == 2)
+           fates[i] = SAME;
+       else
+           fates[i] = DEATH;
+    }
+}
+
+
+void
+initlife(win)
+    Window      win;
+{
+    int         row, col;
+    int        *patptr;
+    XWindowAttributes xgwa;
+    lifestruct *lp = &lifes[screen];
+
+    lp->generation = 0;
+    lp->shooterTime = seconds();
+    icon_width = lifeicon_width;
+    icon_height = lifeicon_height;
+
+    if (!initialized) {
+       initialized = 1;
+       init_fates();
+       logo.data = (char *) lifeicon_bits;
+       logo.width = icon_width;
+       logo.height = icon_height;
+       logo.bytes_per_line = (icon_width + 7) / 8;
+    }
+    XGetWindowAttributes(dsp, win, &xgwa);
+    lp->width = xgwa.width;
+    lp->height = xgwa.height;
+    lp->pixelmode = (lp->width < 4 * icon_width);
+    if (lp->pixelmode) {
+       lp->ncols = 32;
+       lp->nrows = 32;
+    } else {
+       lp->ncols = min(lp->width / icon_width, MAXCOLS);
+       lp->nrows = min(lp->height / icon_height, MAXROWS);
+    }
+    lp->xs = lp->width / lp->ncols;
+    lp->ys = lp->height / lp->nrows;
+    lp->xb = (lp->width - lp->xs * lp->ncols) / 2;
+    lp->yb = (lp->height - lp->ys * lp->nrows) / 2;
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, lp->width, lp->height);
+
+    (void) memset(lp->buffer, 0, sizeof(lp->buffer));
+    patptr = &patterns[random() % NPATS][0];
+    while ((col = *patptr++) != 99) {
+       row = *patptr++;
+       col += lp->ncols / 2;
+       row += lp->nrows / 2;
+       setcell(win, row, col);
+    }
+}
+
+
+void
+drawlife(win)
+    Window      win;
+{
+    unsigned char *loc, *temploc, *lastloc;
+    int         row, col;
+    unsigned char fate;
+    lifestruct *lp = &lifes[screen];
+
+    loc = lp->buffer + lp->ncols + 2 + 1;
+    temploc = lp->tempbuf;
+    /* copy the first 2 rows to the tempbuf */
+    (void) memcpy(temploc, loc, lp->ncols);
+    (void) memcpy(temploc + lp->ncols, loc + lp->ncols + 2, lp->ncols);
+
+    lastloc = lp->lastbuf;
+    /* copy the last row to another buffer for wraparound */
+    (void) memcpy(lastloc, loc + ((lp->nrows - 1) * (lp->ncols + 2)),
+             lp->ncols);
+
+    for (row = 0; row < lp->nrows; ++row) {
+       for (col = 0; col < lp->ncols; ++col) {
+           fate = fates[*temploc];
+           *temploc = (row == (lp->nrows - 3)) ?
+               *(lastloc + col) :
+               *(loc + (lp->ncols + 2) * 2);
+           switch (fate) {
+           case BIRTH:
+               if (!(*(loc + 1) & RT)) {
+                   spawn(loc);
+               }
+               /* NO BREAK */
+           case SAME:
+               if (*(loc + 1) & RT) {
+                   drawcell(win, row, col);
+               }
+               break;
+           case DEATH:
+               if (*(loc + 1) & RT) {
+                   ckill(loc);
+                   erasecell(win, row, col);
+               }
+               break;
+           }
+           loc++;
+           temploc++;
+       }
+       loc += 2;
+       if (temploc >= lp->tempbuf + lp->ncols * 2)
+           temploc = lp->tempbuf;
+    }
+
+    if (++lp->generation > batchcount)
+       initlife(win);
+
+    /*
+     * generate a randomized shooter aimed roughly toward the center of the
+     * screen after timeout.
+     */
+
+    if (seconds() - lp->shooterTime > TIMEOUT) {
+       int         hsp = random() % (lp->ncols - 5) + 3;
+       int         vsp = random() % (lp->nrows - 5) + 3;
+       int         hoff = 1;
+       int         voff = 1;
+       if (vsp > lp->nrows / 2)
+           voff = -1;
+       if (hsp > lp->ncols / 2)
+           hoff = -1;
+       setcell(win, vsp + 0 * voff, hsp + 2 * hoff);
+       setcell(win, vsp + 1 * voff, hsp + 2 * hoff);
+       setcell(win, vsp + 2 * voff, hsp + 2 * hoff);
+       setcell(win, vsp + 2 * voff, hsp + 1 * hoff);
+       setcell(win, vsp + 1 * voff, hsp + 0 * hoff);
+       lp->shooterTime = seconds();
+    }
+}
diff --git a/lifeicon.gen b/lifeicon.gen
new file mode 100644 (file)
index 0000000..39fc5cd
--- /dev/null
@@ -0,0 +1,14 @@
+#define lifeicon_width 32
+#define lifeicon_height 32
+static char lifeicon_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x60, 0x03, 0x00,
+   0x00, 0x60, 0x03, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0x78, 0x0f, 0x00,
+   0x00, 0x78, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0xfe, 0x7f,
+   0xfe, 0x5f, 0xfd, 0x3f, 0xfe, 0x6f, 0xfb, 0x3f, 0xfc, 0x6f, 0xfb, 0x1f,
+   0xf8, 0x77, 0xf7, 0x0f, 0xf8, 0x77, 0xef, 0x0f, 0xf0, 0x7b, 0xef, 0x07,
+   0xf0, 0x7d, 0xdf, 0x07, 0xe0, 0x9d, 0xbc, 0x03, 0xd0, 0xe6, 0xb3, 0x05,
+   0x30, 0xf9, 0x4f, 0x0e, 0x38, 0x00, 0x00, 0x1e, 0x4c, 0xff, 0x7f, 0x19,
+   0xf2, 0xfe, 0xbf, 0x27, 0xfc, 0xfe, 0xbf, 0x0f, 0xfe, 0xfd, 0xdf, 0x3f,
+   0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,
+   0x00, 0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00,
+   0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/lifeicon.hp b/lifeicon.hp
new file mode 100644 (file)
index 0000000..6f1c7fa
--- /dev/null
@@ -0,0 +1,20 @@
+#define lifeicon_width 46
+#define lifeicon_height 34
+static char lifeicon_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xff, 0x79, 0xfe, 0xff, 0xc1,
+   0xf8, 0xff, 0x39, 0xfe, 0xff, 0xc7, 0xfc, 0xff, 0x3d, 0xfc, 0xff, 0xcf,
+   0xfc, 0xff, 0x3c, 0xe0, 0xff, 0xcf, 0xfe, 0x7f, 0x1c, 0x80, 0xff, 0xdf,
+   0xfe, 0x3f, 0x1c, 0x00, 0xff, 0xdf, 0xfe, 0x1f, 0x1e, 0x00, 0xfe, 0xdf,
+   0xfe, 0x0f, 0x1e, 0x00, 0xfc, 0xdf, 0xfe, 0x07, 0x0e, 0x00, 0xf8, 0xdf,
+   0xfe, 0x07, 0x0f, 0x00, 0xf8, 0xdf, 0xfe, 0x03, 0x7f, 0xfc, 0xf1, 0xdf,
+   0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf, 0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf,
+   0xfe, 0x81, 0xf7, 0xde, 0xe3, 0xdf, 0xfe, 0x81, 0x77, 0xde, 0xe1, 0xdf,
+   0xfe, 0x81, 0x73, 0xce, 0xe1, 0xdf, 0xfe, 0xc1, 0x7b, 0xee, 0xe1, 0xdf,
+   0xfe, 0xc1, 0x7b, 0xef, 0xe1, 0xdf, 0xfe, 0xc1, 0x3b, 0xe7, 0xe0, 0xdf,
+   0xfe, 0xc3, 0x39, 0xff, 0xf0, 0xdf, 0xfe, 0xe3, 0xbd, 0xff, 0xf0, 0xdf,
+   0xfe, 0xe3, 0xbd, 0x7f, 0xf0, 0xdf, 0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf,
+   0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf, 0xfe, 0x0f, 0xc0, 0x03, 0xfc, 0xdf,
+   0xfe, 0x1f, 0xc0, 0x03, 0xfe, 0xdf, 0xfe, 0x3f, 0xc0, 0x01, 0xff, 0xdf,
+   0xfe, 0x7f, 0xc0, 0x81, 0xff, 0xdf, 0xfc, 0xff, 0xe1, 0xe1, 0xff, 0xcf,
+   0xfc, 0xff, 0xe7, 0xfc, 0xff, 0xcf, 0xf8, 0xff, 0xe7, 0xfc, 0xff, 0xc7,
+   0xe0, 0xff, 0xf3, 0xfc, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0};
diff --git a/lifeicon.sun b/lifeicon.sun
new file mode 100644 (file)
index 0000000..14a8a6a
--- /dev/null
@@ -0,0 +1,13 @@
+#define lifeicon_width 29
+#define lifeicon_height 29
+static char lifeicon_bits[] = {
+   0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x74, 0x07, 0x00, 0x00, 0xee, 0x0e, 0x00, 0x00, 0xdd, 0x1d, 0x00,
+   0x80, 0xbb, 0x3b, 0x00, 0x40, 0x77, 0x57, 0x00, 0xe0, 0xee, 0xee, 0x00,
+   0x70, 0xdd, 0x75, 0x01, 0xb8, 0xbb, 0xb9, 0x03, 0xdc, 0xf1, 0xdd, 0x01,
+   0xee, 0xee, 0xee, 0x0e, 0x77, 0x1f, 0x77, 0x1f, 0xbb, 0x1b, 0xbb, 0x1b,
+   0xdf, 0x1d, 0xdf, 0x1d, 0xee, 0xee, 0xee, 0x0e, 0x70, 0xf7, 0x71, 0x07,
+   0xb8, 0xb3, 0xbb, 0x03, 0xd0, 0x75, 0xd7, 0x01, 0xe0, 0xee, 0xee, 0x00,
+   0x40, 0xdd, 0x5d, 0x00, 0x80, 0xbb, 0x3b, 0x00, 0x00, 0x77, 0x17, 0x00,
+   0x00, 0xee, 0x0e, 0x00, 0x00, 0xdc, 0x05, 0x00, 0x00, 0xb8, 0x01, 0x00,
+   0x00, 0xf0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00};
diff --git a/make.com b/make.com
new file mode 100644 (file)
index 0000000..282f44f
--- /dev/null
+++ b/make.com
@@ -0,0 +1,54 @@
+$ set verify
+$ if p1.eqs."DEBUG" .or. p2.eqs."DEBUG"
+$ then
+$   cc=="CC/DEB/NOOPT"
+$   link=="LINK/DEB"
+$ endif
+$ if p1.nes."LINK"
+$ then
+$ define sys sys$library
+$!
+$ set verify
+$ copy mazeicon.gen mazeicon.bit
+$ copy lifeicon.gen lifeicon.bit
+$ cc blank.c
+$ cc blot.c
+$ cc bounce.c
+$ cc flame.c
+$ cc grav.c
+$ cc helix.c
+$ cc hopalong.c
+$ cc hsbramp.c
+$ cc hyper.c
+$ cc life.c
+$ cc maze.c
+$ cc pyro.c
+$ cc qix.c
+$ cc rect.c
+$ cc resource.c
+$ cc rock.c
+$ cc rotor.c
+$ cc sphere.c
+$ cc spline.c
+$ cc swarm.c
+$ cc world.c
+$ cc worm.c
+$ cc/noopt xlock.c
+$ cc usleep.c
+$ set noverify
+$ endif
+$!
+$ set verify
+$ link/map xlock,hsbramp,resource,usleep,-
+       hopalong,qix,life,blank,-
+       swarm,rotor,pyro,flame,worm,-
+       spline,maze,sphere,hyper,-
+       helix,rock,blot,-
+       grav,bounce,world,rect,-
+       sys$library:vaxcrtl/lib,-
+       sys$library:ucx$ipc/lib,-
+       sys$input/opt
+sys$share:decw$dxmlibshr/share
+sys$share:decw$xlibshr/share
+$ set noverify
+$ exit
diff --git a/maze.c b/maze.c
new file mode 100644 (file)
index 0000000..80f2ca2
--- /dev/null
+++ b/maze.c
@@ -0,0 +1,642 @@
+#ifndef lint
+static  char sccsid[] = "@(#)maze.c 1.4 86/12/29 XLOCK";
+#endif
+/*-
+ * maze.c - A maze for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-Jun-94: HP ANSI C compiler needs a type cast for gray_bits
+ *            Richard Lloyd (R.K.Lloyd@csc.liv.ac.uk) 
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com) 
+ * 7-Mar-93: Good ideas from xscreensaver (Jamie Zawinski jwz@lucid.com)
+ * 6-Jun-85: Martin Weiss Sun Microsystems 
+ */
+
+/* original copyright
+ ******************************************************************************
+ Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+
+ All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ 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 names of Sun or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+ software without specific prior written permission. Sun and M.I.T.
+ make no representations about the suitability of this software for
+ any purpose. It is provided "as is" without any express or implied warranty.
+
+ SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. IN NO EVENT SHALL SUN BE LIABLE FOR ANY SPECIAL, INDIRECT
+ OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, 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.
+ *****************************************************************************/
+
+#include <stdio.h>
+#include "xlock.h"
+#include <X11/bitmaps/gray1>
+#include "mazeicon.bit"
+
+#define MIN_MAZE_SIZE  3
+#define MAX_SIZE        40
+#define MIN_SIZE        7
+
+/* The following limits are adequate for displays up to 2048x2048 */
+#define MAX_MAZE_SIZE_X        300
+#define MAX_MAZE_SIZE_Y        300
+
+#define MOVE_LIST_SIZE  (MAX_MAZE_SIZE_X * MAX_MAZE_SIZE_Y)
+
+#define WALL_TOP       0x8000
+#define WALL_RIGHT     0x4000
+#define WALL_BOTTOM    0x2000
+#define WALL_LEFT      0x1000
+
+#define DOOR_IN_TOP    0x800
+#define DOOR_IN_RIGHT  0x400
+#define DOOR_IN_BOTTOM 0x200
+#define DOOR_IN_LEFT   0x100
+#define DOOR_IN_ANY    0xF00
+
+#define DOOR_OUT_TOP   0x80
+#define DOOR_OUT_RIGHT 0x40
+#define DOOR_OUT_BOTTOM        0x20
+#define DOOR_OUT_LEFT  0x10
+
+#define START_SQUARE   0x2
+#define END_SQUARE     0x1
+
+#define get_random(x)  (random() % (x))
+
+static XImage logo = {
+    0, 0,                       /* width, height */
+    0, XYBitmap, 0,             /* xoffset, format, data */
+    LSBFirst, 8,                /* byte-order, bitmap-unit */
+    LSBFirst, 8, 1              /* bitmap-bit-order, bitmap-pad, depth */
+};
+
+typedef struct {
+       u_char x;
+       u_char y;
+       u_char dir;
+       } paths;
+
+typedef struct {
+        int maze_size_x, maze_size_y, border_x, border_y;
+        int sqnum, cur_sq_x, cur_sq_y, path_length;
+        int start_x, start_y, start_dir, end_x, end_y, end_dir;
+        int logo_x, logo_y;
+        int width, height, counter;
+       int sq_size_x, sq_size_y, logo_size_x, logo_size_y;
+        GC gray_GC;
+        u_short maze[MAX_MAZE_SIZE_X][MAX_MAZE_SIZE_Y];
+        paths move_list[MOVE_LIST_SIZE];
+        paths save_path[MOVE_LIST_SIZE], path[MOVE_LIST_SIZE];
+        } mazestruct;
+
+static mazestruct mazes[MAXSCREENS];
+
+void
+initmaze(win)
+    Window win;
+{
+    XWindowAttributes xgwa;
+    Pixmap gray;
+    mazestruct *mp = &mazes[screen];
+
+    logo.data = (char *) mazeicon_bits;
+    logo.width = mazeicon_width;
+    logo.height = mazeicon_height;
+    logo.bytes_per_line = (mazeicon_width + 7) / 8;
+    
+    XGetWindowAttributes(dsp, win, &xgwa);
+    mp->width = xgwa.width;
+    mp->height = xgwa.height;
+    mp->gray_GC = XCreateGC(dsp, win, 0, 0);
+    gray = XCreateBitmapFromData(dsp, win,
+        (char *) gray1_bits, gray1_width, gray1_height);
+    XSetBackground(dsp, mp->gray_GC, BlackPixel(dsp, screen));
+    XSetStipple(dsp, mp->gray_GC, gray);
+    XSetFillStyle(dsp, mp->gray_GC, FillOpaqueStippled);
+    mp->counter = 0;
+}
+
+void
+drawmaze(win)
+    Window win;
+{
+    mazestruct *mp = &mazes[screen];
+    switch (mp->counter)
+    {
+      case 0:
+       clear_window(win);
+       set_maze_sizes();
+       initialize_maze();
+        break;
+      case 1:
+       draw_maze_border(win);
+        break;
+      case 2:
+       create_maze(win);
+        break;
+      case 3:
+      case 4:
+       (void) sleep(1);
+        break;
+      case 5:
+       solve_maze(win);
+        break;
+      case 6:
+      case 7:
+      case 8:
+      case 9:
+       (void) sleep(1);
+        break;
+    }
+    if (mp->counter == 9)
+      mp->counter = 0;
+    else
+      mp->counter++;
+} /*  end of drawmaze() */
+
+clear_window(win) /* blank the window */
+        Window win;
+{
+        mazestruct *mp = &mazes[screen];
+
+        XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+        XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, mp->width, mp->height);
+} /* end of clear_window() */
+
+
+set_maze_sizes()
+{
+        mazestruct *mp = &mazes[screen];
+       /* batchcount is the upper bound on the size */
+       if (batchcount > MAX_SIZE || batchcount <= MIN_SIZE)
+          batchcount = MAX_SIZE;
+        mp->sq_size_x = get_random(batchcount - MIN_SIZE) + MIN_SIZE;
+        /*mp->sq_size_x = batchcount;*//* 10 is a good size */
+        mp->sq_size_y = mp->sq_size_x;
+        mp->logo_size_x = logo.width / mp->sq_size_x + 1;
+        mp->logo_size_y = logo.height / mp->sq_size_y + 1;
+       
+        mp->border_x = mp->border_y = 1;
+       mp->maze_size_x = ( mp->width - mp->border_x) / mp->sq_size_x;
+       mp->maze_size_y = ( mp->height - mp->border_y ) / mp->sq_size_y;
+
+       if ( mp->maze_size_x < MIN_MAZE_SIZE ||
+              mp->maze_size_y < MIN_MAZE_SIZE) {
+            mp->sq_size_y = mp->sq_size_x = 10;
+           mp->maze_size_x = ( mp->width - mp->border_x) / mp->sq_size_x;
+           mp->maze_size_y = ( mp->height - mp->border_y ) / mp->sq_size_y;
+           if ( mp->maze_size_x < MIN_MAZE_SIZE ||
+              mp->maze_size_y < MIN_MAZE_SIZE) {
+             (void) fprintf(stderr, "maze too small, exitting\n");
+              exit(1);
+            }
+        }
+       mp->border_x = (mp->width - mp->maze_size_x * mp->sq_size_x) / 2;
+       mp->border_y = (mp->height - mp->maze_size_y * mp->sq_size_y) / 2;
+} /* end of set_maze_sizes */
+
+
+initialize_maze() /* draw the surrounding wall and start/end squares */
+{
+        mazestruct *mp = &mazes[screen];
+       register int i, j, wall;
+
+    if (Scr[screen].npixels == 2) {
+        XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+        XSetForeground(dsp, mp->gray_GC, WhitePixel(dsp, screen));
+    }
+    if (Scr[screen].npixels > 2) {
+        i = random() % Scr[screen].npixels;
+        XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[i]);
+        XSetForeground(dsp, mp->gray_GC, Scr[screen].pixels[i]);
+    }
+               /* initialize all squares */
+       for ( i=0; i<mp->maze_size_x; i++) {
+               for ( j=0; j<mp->maze_size_y; j++) {
+                       mp->maze[i][j] = 0;
+               }
+       }
+
+       /* top wall */
+       for ( i=0; i<mp->maze_size_x; i++ ) {
+               mp->maze[i][0] |= WALL_TOP;
+       }
+
+       /* right wall */
+       for ( j=0; j<mp->maze_size_y; j++ ) {
+               mp->maze[mp->maze_size_x-1][j] |= WALL_RIGHT;
+       }
+
+       /* bottom wall */
+       for ( i=0; i<mp->maze_size_x; i++ ) {
+               mp->maze[i][mp->maze_size_y-1] |= WALL_BOTTOM;
+       }
+
+       /* left wall */
+       for ( j=0; j<mp->maze_size_y; j++ ) {
+               mp->maze[0][j] |= WALL_LEFT;
+       }
+
+       /* set start square */
+       wall = get_random(4);
+       switch (wall) {
+               case 0:
+                       i = get_random(mp->maze_size_x);
+                       j = 0;
+                       break;
+               case 1:
+                       i = mp->maze_size_x - 1;
+                       j = get_random(mp->maze_size_y);
+                       break;
+               case 2:
+                       i = get_random(mp->maze_size_x);
+                       j = mp->maze_size_y - 1;
+                       break;
+               case 3:
+                       i = 0;
+                       j = get_random(mp->maze_size_y);
+                       break;
+       }
+       mp->maze[i][j] |= START_SQUARE;
+       mp->maze[i][j] |= ( DOOR_IN_TOP >> wall );
+       mp->maze[i][j] &= ~( WALL_TOP >> wall );
+       mp->cur_sq_x = i;
+       mp->cur_sq_y = j;
+       mp->start_x = i;
+       mp->start_y = j;
+       mp->start_dir = wall;
+       mp->sqnum = 0;
+
+        /* set end square */
+        wall = (wall + 2)%4;
+        switch (wall) {
+                case 0:
+                       i = get_random(mp->maze_size_x);
+                        j = 0;
+                        break;
+                case 1:
+                        i = mp->maze_size_x - 1;
+                       j = get_random(mp->maze_size_y);
+                        break;
+                case 2:
+                       i = get_random(mp->maze_size_x);
+                        j = mp->maze_size_y - 1;
+                        break;
+                case 3:
+                        i = 0;
+                       j = get_random(mp->maze_size_y);
+                        break;
+        }
+        mp->maze[i][j] |= END_SQUARE;
+        mp->maze[i][j] |= ( DOOR_OUT_TOP >> wall );
+       mp->maze[i][j] &= ~( WALL_TOP >> wall );
+       mp->end_x = i;
+       mp->end_y = j;
+       mp->end_dir = wall;
+
+       /* set logo */
+       if ( (mp->maze_size_x > mp->logo_size_x + 6) &&
+            (mp->maze_size_y > mp->logo_size_y + 6) ) {
+          mp->logo_x = get_random(mp->maze_size_x - mp->logo_size_x - 6) + 3;
+          mp->logo_y = get_random(mp->maze_size_y - mp->logo_size_y - 6) + 3;
+
+          for (i=0; i<mp->logo_size_x; i++)
+               for (j=0; j<mp->logo_size_y; j++)
+                   mp->maze[mp->logo_x + i][mp->logo_y + j] |= DOOR_IN_TOP;
+       }
+       else
+               mp->logo_y = mp->logo_x = -1;
+}
+
+
+create_maze(win) /* create a maze layout given the intiialized maze */
+        Window win;
+{
+        mazestruct *mp = &mazes[screen];
+       register int i, newdoor;
+
+       while (1) {
+           mp->move_list[mp->sqnum].x = mp->cur_sq_x;
+           mp->move_list[mp->sqnum].y = mp->cur_sq_y;
+           mp->move_list[mp->sqnum].dir = -1;
+           while ( ( newdoor = choose_door(win) ) == -1 ) /* pick a door */
+               if ( backup() == -1 ) /* no more doors ... backup */
+                   return; /* done ... return */
+
+               /* mark the out door */
+           mp->maze[mp->cur_sq_x][mp->cur_sq_y] |= ( DOOR_OUT_TOP >> newdoor );
+
+           switch (newdoor) {
+                       case 0: mp->cur_sq_y--;
+                               break;
+                       case 1: mp->cur_sq_x++;
+                               break;
+                       case 2: mp->cur_sq_y++;
+                               break;
+                       case 3: mp->cur_sq_x--;
+                               break;
+               }
+           mp->sqnum++;
+
+           /* mark the in door */
+           mp->maze[mp->cur_sq_x][mp->cur_sq_y] |=
+              ( DOOR_IN_TOP >> ((newdoor+2)%4) );
+
+           /* if end square set path length and save path */
+           if ( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & END_SQUARE ) {
+                       mp->path_length = mp->sqnum;
+                       for ( i=0; i<mp->path_length; i++) {
+                               mp->save_path[i].x = mp->move_list[i].x;
+                               mp->save_path[i].y = mp->move_list[i].y;
+                               mp->save_path[i].dir = mp->move_list[i].dir;
+                       }
+           }
+
+       }
+
+} /* end of create_maze() */
+
+
+choose_door(win) /* pick a new path */
+        Window win;
+{
+        mazestruct *mp = &mazes[screen];
+       int candidates[3];
+       register int num_candidates;
+
+       num_candidates = 0;
+
+       /* top wall */
+       if ((!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_IN_TOP )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_OUT_TOP )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & WALL_TOP ))) {
+            if ( mp->maze[mp->cur_sq_x][mp->cur_sq_y - 1] & DOOR_IN_ANY ) {
+               mp->maze[mp->cur_sq_x][mp->cur_sq_y] |= WALL_TOP;
+               mp->maze[mp->cur_sq_x][mp->cur_sq_y - 1] |= WALL_BOTTOM;
+               draw_wall(win, mp->cur_sq_x, mp->cur_sq_y, 0);
+           } else
+               candidates[num_candidates++] = 0;
+        }
+
+       /* right wall */
+       if ((!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_IN_RIGHT )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_OUT_RIGHT )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & WALL_RIGHT ))) {
+            if ( mp->maze[mp->cur_sq_x + 1][mp->cur_sq_y] & DOOR_IN_ANY ) {
+               mp->maze[mp->cur_sq_x][mp->cur_sq_y] |= WALL_RIGHT;
+               mp->maze[mp->cur_sq_x + 1][mp->cur_sq_y] |= WALL_LEFT;
+               draw_wall(win, mp->cur_sq_x, mp->cur_sq_y, 1);
+           } else
+               candidates[num_candidates++] = 1;
+        }
+
+       /* bottom wall */
+       if ((!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_IN_BOTTOM )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_OUT_BOTTOM )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & WALL_BOTTOM ))) {
+           if ( mp->maze[mp->cur_sq_x][mp->cur_sq_y + 1] & DOOR_IN_ANY ) {
+               mp->maze[mp->cur_sq_x][mp->cur_sq_y] |= WALL_BOTTOM;
+               mp->maze[mp->cur_sq_x][mp->cur_sq_y + 1] |= WALL_TOP;
+               draw_wall(win, mp->cur_sq_x, mp->cur_sq_y, 2);
+           } else
+               candidates[num_candidates++] = 2;
+        }
+
+       /* left wall */
+       if ((!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_IN_LEFT )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & DOOR_OUT_LEFT )) &&
+           (!( mp->maze[mp->cur_sq_x][mp->cur_sq_y] & WALL_LEFT ))) {
+           if ( mp->maze[mp->cur_sq_x - 1][mp->cur_sq_y] & DOOR_IN_ANY ) {
+               mp->maze[mp->cur_sq_x][mp->cur_sq_y] |= WALL_LEFT;
+               mp->maze[mp->cur_sq_x - 1][mp->cur_sq_y] |= WALL_RIGHT;
+               draw_wall(win, mp->cur_sq_x, mp->cur_sq_y, 3);
+           } else
+               candidates[num_candidates++] = 3;
+        }
+
+        /* done wall */
+       if (num_candidates == 0)
+               return ( -1 );
+       if (num_candidates == 1)
+               return ( candidates[0] );
+       return ( candidates[ get_random(num_candidates) ] );
+
+} /* end of choose_door() */
+
+
+backup() /* back up a move */
+{
+        mazestruct *mp = &mazes[screen];
+       mp->sqnum--;
+       mp->cur_sq_x = mp->move_list[mp->sqnum].x;
+       mp->cur_sq_y = mp->move_list[mp->sqnum].y;
+       return ( mp->sqnum );
+} /* end of backup() */
+
+
+draw_maze_border(win) /* draw the maze outline */
+        Window win;
+{
+        mazestruct *mp = &mazes[screen];
+       register int i, j;
+
+       for ( i=0; i<mp->maze_size_x; i++) {
+               if ( mp->maze[i][0] & WALL_TOP ) {
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                           mp->border_x + mp->sq_size_x * i,
+                           mp->border_y,
+                           mp->border_x + mp->sq_size_x * (i+1),
+                           mp->border_y);
+               }
+               if ((mp->maze[i][mp->maze_size_y - 1] & WALL_BOTTOM)) {
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                           mp->border_x + mp->sq_size_x * i,
+                           mp->border_y + mp->sq_size_y * (mp->maze_size_y),
+                           mp->border_x + mp->sq_size_x * (i+1),
+                           mp->border_y + mp->sq_size_y * (mp->maze_size_y));
+               }
+       }
+       for ( j=0; j<mp->maze_size_y; j++) {
+               if ( mp->maze[mp->maze_size_x - 1][j] & WALL_RIGHT ) {
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                           mp->border_x + mp->sq_size_x * mp->maze_size_x,
+                           mp->border_y + mp->sq_size_y * j,
+                           mp->border_x + mp->sq_size_x * mp->maze_size_x,
+                           mp->border_y + mp->sq_size_y * (j+1));
+               }
+               if ( mp->maze[0][j] & WALL_LEFT ) {
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                           mp->border_x,
+                           mp->border_y + mp->sq_size_y * j,
+                           mp->border_x,
+                           mp->border_y + mp->sq_size_y * (j+1));
+               }
+       }
+
+       if (mp->logo_x != -1) {
+               XPutImage(dsp, win, Scr[screen].gc, &logo,
+                        0, 0,
+                        mp->border_x + mp->sq_size_x * mp->logo_x +
+                          (mp->sq_size_x * mp->logo_size_x - logo.width + 1) /
+                         2,
+                       mp->border_y + mp->sq_size_y * mp->logo_y +
+                          (mp->sq_size_y * mp->logo_size_y - logo.height + 1) /
+                         2,
+                       mazeicon_width, mazeicon_height);
+       }
+
+       draw_solid_square( win, mp->start_x, mp->start_y, mp->start_dir,
+            Scr[screen].gc);
+       draw_solid_square( win, mp->end_x, mp->end_y, mp->end_dir,
+            Scr[screen].gc);
+} /* end of draw_maze() */
+
+
+draw_wall(win, i, j, dir) /* draw a single wall */
+        Window win;
+       int i, j, dir;
+{
+        mazestruct *mp = &mazes[screen];
+       switch (dir) {
+               case 0:
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                               mp->border_x + mp->sq_size_x * i,
+                               mp->border_y + mp->sq_size_y * j,
+                               mp->border_x + mp->sq_size_x * (i+1),
+                               mp->border_y + mp->sq_size_y * j);
+                       break;
+               case 1:
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                               mp->border_x + mp->sq_size_x * (i+1),
+                               mp->border_y + mp->sq_size_y * j,
+                               mp->border_x + mp->sq_size_x * (i+1),
+                               mp->border_y + mp->sq_size_y * (j+1));
+                       break;
+               case 2:
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                               mp->border_x + mp->sq_size_x * i,
+                               mp->border_y + mp->sq_size_y * (j+1),
+                               mp->border_x + mp->sq_size_x * (i+1),
+                               mp->border_y + mp->sq_size_y * (j+1));
+                       break;
+               case 3:
+                       XDrawLine(dsp, win, Scr[screen].gc,
+                               mp->border_x + mp->sq_size_x * i,
+                               mp->border_y + mp->sq_size_y * j,
+                               mp->border_x + mp->sq_size_x * i,
+                               mp->border_y + mp->sq_size_y * (j+1));
+                       break;
+       }
+} /* end of draw_wall */
+
+
+draw_solid_square(win, i, j, dir, gc) /* draw a solid square in a square */
+        Window win;
+       register int i, j, dir;
+       GC gc;
+{
+        mazestruct *mp = &mazes[screen];
+       switch (dir) {
+               case 0: XFillRectangle(dsp, win, gc,
+                       mp->border_x + 3 + mp->sq_size_x * i,
+                       mp->border_y - 3 + mp->sq_size_y * j,
+                       mp->sq_size_x - 6, mp->sq_size_y);
+                       break;
+               case 1: XFillRectangle(dsp, win, gc,
+                       mp->border_x + 3 + mp->sq_size_x * i,
+                       mp->border_y + 3 + mp->sq_size_y * j,
+                       mp->sq_size_x, mp->sq_size_y - 6);
+                       break;
+               case 2: XFillRectangle(dsp, win, gc,
+                       mp->border_x + 3 + mp->sq_size_x * i,
+                       mp->border_y + 3 + mp->sq_size_y * j,
+                       mp->sq_size_x - 6, mp->sq_size_y);
+                       break;
+               case 3: XFillRectangle(dsp, win, gc,
+                       mp->border_x - 3 + mp->sq_size_x * i,
+                       mp->border_y + 3 + mp->sq_size_y * j,
+                       mp->sq_size_x, mp->sq_size_y - 6);
+                       break;
+       }
+
+} /* end of draw_solid_square() */
+
+solve_maze(win) /* solve it with graphical feedback */
+        Window win;
+{
+        mazestruct *mp = &mazes[screen];
+       int i;
+
+
+       /* plug up the surrounding wall */
+       mp->maze[mp->start_x][mp->start_y] |= (WALL_TOP >> mp->start_dir);
+       mp->maze[mp->end_x][mp->end_y] |= (WALL_TOP >> mp->end_dir);
+
+       /* initialize search path */
+       i = 0;
+       mp->path[i].x = mp->end_x;
+       mp->path[i].y = mp->end_y;
+       mp->path[i].dir = -1;
+
+       /* do it */
+       while (1) {
+           if ( ++mp->path[i].dir >= 4 ) {
+               i--;
+               draw_solid_square( win, 
+                       (int)(mp->path[i].x), (int)(mp->path[i].y),
+                       (int)(mp->path[i].dir), mp->gray_GC);
+           }
+           else if ( ! (mp->maze[mp->path[i].x][mp->path[i].y] &
+                       (WALL_TOP >> mp->path[i].dir))  &&
+                       ( (i == 0) || ( (mp->path[i].dir !=
+                       (mp->path[i-1].dir+2)%4) ) ) ) {
+               enter_square(win, i);
+               i++;
+               if ( mp->maze[mp->path[i].x][mp->path[i].y] & START_SQUARE ) {
+                       return;
+               }
+           }
+       }
+} /* end of solve_maze() */
+
+
+enter_square(win, n) /* move into a neighboring square */
+        Window win;
+       int n;
+{
+        mazestruct *mp = &mazes[screen];
+       draw_solid_square( win, (int)mp->path[n].x, (int)mp->path[n].y,
+               (int)mp->path[n].dir, Scr[screen].gc);
+
+       mp->path[n+1].dir = -1;
+       switch (mp->path[n].dir) {
+               case 0: mp->path[n+1].x = mp->path[n].x;
+                       mp->path[n+1].y = mp->path[n].y - 1;
+                       break;
+               case 1: mp->path[n+1].x = mp->path[n].x + 1;
+                       mp->path[n+1].y = mp->path[n].y;
+                       break;
+               case 2: mp->path[n+1].x = mp->path[n].x;
+                       mp->path[n+1].y = mp->path[n].y + 1;
+                       break;
+               case 3: mp->path[n+1].x = mp->path[n].x - 1;
+                       mp->path[n+1].y = mp->path[n].y;
+                       break;
+       }
+
+
+} /* end of enter_square() */
diff --git a/mazeicon.gen b/mazeicon.gen
new file mode 100644 (file)
index 0000000..e2ff8e0
--- /dev/null
@@ -0,0 +1,46 @@
+#define mazeicon_width 64
+#define mazeicon_height 64
+static char mazeicon_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+   0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
+   0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x3e, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7c, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e,
+   0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f,
+   0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xfe, 0x01, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f,
+   0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x5f, 0xfa, 0xff, 0xff, 0x3f,
+   0xf8, 0xff, 0xff, 0x5f, 0xfa, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x6f,
+   0xf6, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x77, 0xee, 0xff, 0xff, 0x0f,
+   0xe0, 0xff, 0xff, 0x77, 0xee, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x7b,
+   0xde, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x7d, 0xbe, 0xff, 0xff, 0x03,
+   0x80, 0xff, 0xff, 0x7d, 0xbe, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff, 0x7e,
+   0x7e, 0xff, 0xff, 0x01, 0x00, 0xff, 0x7f, 0x7f, 0xfe, 0xfe, 0xff, 0x00,
+   0x00, 0xfe, 0x7f, 0x7f, 0xfe, 0xfe, 0x7f, 0x00, 0x00, 0xfe, 0xbf, 0x7f,
+   0xfe, 0xfd, 0x7f, 0x00, 0x00, 0xfc, 0xdf, 0x7f, 0xfe, 0xfb, 0x3f, 0x00,
+   0x00, 0xf8, 0xdf, 0x3f, 0xfc, 0xfb, 0x1f, 0x00, 0x00, 0xf8, 0xef, 0x1f,
+   0xf8, 0xf7, 0x1f, 0x00, 0x00, 0xf4, 0xf7, 0x87, 0xe1, 0xef, 0x2f, 0x00,
+   0x00, 0xec, 0xf7, 0xe1, 0x87, 0xef, 0x37, 0x00, 0x00, 0xee, 0x7b, 0xf8,
+   0x1f, 0xde, 0x77, 0x00, 0x00, 0xdf, 0x1d, 0xfe, 0x7f, 0xb8, 0xfb, 0x00,
+   0x00, 0xbf, 0x85, 0xff, 0xff, 0xa1, 0xfd, 0x00, 0x80, 0x3f, 0xe0, 0xff,
+   0xff, 0x07, 0xfc, 0x01, 0xc0, 0x7f, 0xf8, 0xff, 0xff, 0x1f, 0xfe, 0x03,
+   0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe0, 0x87, 0xfe, 0xff,
+   0xff, 0x7f, 0xe1, 0x07, 0xf0, 0xe1, 0xfd, 0xff, 0xff, 0xbf, 0x87, 0x0f,
+   0x70, 0xf8, 0xfb, 0xff, 0xff, 0xdf, 0x1f, 0x0e, 0x18, 0xfe, 0xfb, 0xff,
+   0xff, 0xdf, 0x7f, 0x18, 0x80, 0xff, 0xf7, 0xff, 0xff, 0xef, 0xff, 0x01,
+   0xf0, 0xff, 0xef, 0xff, 0xff, 0xf7, 0xff, 0x0f, 0x00, 0x00, 0xe0, 0xff,
+   0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
+   0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+   0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/mazeicon.hp b/mazeicon.hp
new file mode 100644 (file)
index 0000000..a46ca21
--- /dev/null
@@ -0,0 +1,20 @@
+#define mazeicon_width 46
+#define mazeicon_height 34
+static char mazeicon_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xff, 0x79, 0xfe, 0xff, 0xc1,
+   0xf8, 0xff, 0x39, 0xfe, 0xff, 0xc7, 0xfc, 0xff, 0x3d, 0xfc, 0xff, 0xcf,
+   0xfc, 0xff, 0x3c, 0xe0, 0xff, 0xcf, 0xfe, 0x7f, 0x1c, 0x80, 0xff, 0xdf,
+   0xfe, 0x3f, 0x1c, 0x00, 0xff, 0xdf, 0xfe, 0x1f, 0x1e, 0x00, 0xfe, 0xdf,
+   0xfe, 0x0f, 0x1e, 0x00, 0xfc, 0xdf, 0xfe, 0x07, 0x0e, 0x00, 0xf8, 0xdf,
+   0xfe, 0x07, 0x0f, 0x00, 0xf8, 0xdf, 0xfe, 0x03, 0x7f, 0xfc, 0xf1, 0xdf,
+   0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf, 0xfe, 0x03, 0xff, 0xfc, 0xf3, 0xdf,
+   0xfe, 0x81, 0xf7, 0xde, 0xe3, 0xdf, 0xfe, 0x81, 0x77, 0xde, 0xe1, 0xdf,
+   0xfe, 0x81, 0x73, 0xce, 0xe1, 0xdf, 0xfe, 0xc1, 0x7b, 0xee, 0xe1, 0xdf,
+   0xfe, 0xc1, 0x7b, 0xef, 0xe1, 0xdf, 0xfe, 0xc1, 0x3b, 0xe7, 0xe0, 0xdf,
+   0xfe, 0xc3, 0x39, 0xff, 0xf0, 0xdf, 0xfe, 0xe3, 0xbd, 0xff, 0xf0, 0xdf,
+   0xfe, 0xe3, 0xbd, 0x7f, 0xf0, 0xdf, 0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf,
+   0xfe, 0x07, 0x80, 0x03, 0xf8, 0xdf, 0xfe, 0x0f, 0xc0, 0x03, 0xfc, 0xdf,
+   0xfe, 0x1f, 0xc0, 0x03, 0xfe, 0xdf, 0xfe, 0x3f, 0xc0, 0x01, 0xff, 0xdf,
+   0xfe, 0x7f, 0xc0, 0x81, 0xff, 0xdf, 0xfc, 0xff, 0xe1, 0xe1, 0xff, 0xcf,
+   0xfc, 0xff, 0xe7, 0xfc, 0xff, 0xcf, 0xf8, 0xff, 0xe7, 0xfc, 0xff, 0xc7,
+   0xe0, 0xff, 0xf3, 0xfc, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0};
diff --git a/mazeicon.sun b/mazeicon.sun
new file mode 100644 (file)
index 0000000..30646af
--- /dev/null
@@ -0,0 +1,46 @@
+#define mazeicon_width 64
+#define mazeicon_height 64
+static char mazeicon_bits[] = {
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
+   0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+   0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x7e, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe,
+   0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfc, 0xfd, 0x07, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xfd, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb,
+   0xf7, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf4, 0xf7, 0xef, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xee, 0xef, 0xdf, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xdf,
+   0xbf, 0xff, 0x00, 0x00, 0x00, 0x80, 0xbf, 0xbf, 0x7f, 0xff, 0x00, 0x00,
+   0x00, 0x80, 0x7f, 0x7f, 0xff, 0x7e, 0x03, 0x00, 0x00, 0x60, 0xff, 0xfe,
+   0xfe, 0xbd, 0x07, 0x00, 0x00, 0xf0, 0xfe, 0xfd, 0xfd, 0xdb, 0x0f, 0x00,
+   0x00, 0xf8, 0xfd, 0xfb, 0xfb, 0xe7, 0x1f, 0x00, 0x00, 0xfc, 0xfb, 0xf7,
+   0xf7, 0xf7, 0x2f, 0x00, 0x00, 0xfe, 0xf5, 0xef, 0xef, 0xfb, 0x77, 0x00,
+   0x00, 0xff, 0xee, 0xdf, 0xcf, 0xfd, 0xfb, 0x00, 0x80, 0x7f, 0xdf, 0xbf,
+   0x9f, 0xfe, 0xfd, 0x01, 0xc0, 0xbf, 0xbf, 0xff, 0x1f, 0xff, 0xfe, 0x00,
+   0xe0, 0xdf, 0x1f, 0xff, 0x9f, 0x7f, 0x7f, 0x00, 0xf0, 0xef, 0x0f, 0xfe,
+   0xcf, 0xbf, 0x3f, 0x07, 0xf8, 0xf7, 0xe7, 0xfc, 0xef, 0xdf, 0xdf, 0x1f,
+   0xfc, 0xfb, 0xfb, 0xfb, 0xf7, 0xef, 0xef, 0x3f, 0xfe, 0xfd, 0xfd, 0xe7,
+   0xf9, 0xf7, 0xf7, 0x7f, 0xfe, 0xfe, 0xfe, 0x07, 0xf8, 0xfb, 0xfb, 0x7f,
+   0x7f, 0x7f, 0xff, 0x0f, 0xfc, 0xfd, 0xfd, 0xff, 0xbf, 0xbf, 0xff, 0x0f,
+   0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xdf, 0xdf, 0x0f, 0xfc, 0x7f, 0xff, 0xfe,
+   0xff, 0xef, 0xef, 0x0f, 0xfc, 0xbf, 0x7f, 0xff, 0xfe, 0xf7, 0xf7, 0x07,
+   0xf8, 0xdf, 0xbf, 0x7f, 0xfe, 0xfb, 0xfb, 0xe7, 0xf9, 0xef, 0xdf, 0x7f,
+   0xfc, 0xfd, 0xfd, 0xfb, 0xf7, 0xf7, 0xef, 0x3f, 0x70, 0xfe, 0xfe, 0xfd,
+   0xcf, 0xf9, 0xf7, 0x1f, 0x00, 0x7f, 0xff, 0xfc, 0x1f, 0xfc, 0xfb, 0x0f,
+   0x80, 0xbf, 0x7f, 0xfe, 0x3f, 0xfe, 0xfd, 0x07, 0xc0, 0xdf, 0x3f, 0xfe,
+   0x7f, 0xff, 0xfe, 0x03, 0x80, 0xef, 0x5f, 0x7e, 0xff, 0x7e, 0xff, 0x01,
+   0x00, 0xf7, 0xef, 0xfc, 0xfe, 0xbd, 0xff, 0x00, 0x00, 0xfa, 0xf7, 0xfd,
+   0xfd, 0xdb, 0x7f, 0x00, 0x00, 0xfc, 0xfb, 0xfb, 0xfb, 0xe7, 0x3f, 0x00,
+   0x00, 0xf8, 0xf9, 0xf7, 0xf7, 0xef, 0x1f, 0x00, 0x00, 0xf0, 0xee, 0xef,
+   0xef, 0xdf, 0x0f, 0x00, 0x00, 0x60, 0xdf, 0xdf, 0xdf, 0xbf, 0x07, 0x00,
+   0x00, 0x80, 0xbf, 0xbf, 0xbf, 0x7f, 0x03, 0x00, 0x00, 0x80, 0x7f, 0x7f,
+   0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfe, 0xfe, 0xfe, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0xfd, 0xfd, 0x7d, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfb,
+   0xfb, 0x3b, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf7, 0xf7, 0x17, 0x00, 0x00,
+   0x00, 0x00, 0xf0, 0xef, 0xef, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf,
+   0xdf, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x03, 0x00, 0x00,
+   0x00, 0x00, 0x80, 0x7f, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+   0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
+   0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x00};
diff --git a/pyro.c b/pyro.c
new file mode 100644 (file)
index 0000000..7289bed
--- /dev/null
+++ b/pyro.c
@@ -0,0 +1,389 @@
+#ifndef lint
+static char sccsid[] = "@(#)pyro.c     1.1 91/05/24 XLOCK";
+#endif
+/*-
+ * pyro.c - Fireworks for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 16-Mar-91: Written. (received from David Brooks, brooks@osf.org).
+ */
+
+/* The physics of the rockets is a little bogus, but it looks OK.  Each is
+ * given an initial velocity impetus.  They decelerate slightly (gravity
+ * overcomes the rocket's impulse) and explode as the rocket's main fuse
+ * gives out (we could add a ballistic stage, maybe).  The individual
+ * stars fan out from the rocket, and they decelerate less quickly.
+ * That's called bouyancy, but really it's again a visual preference.
+ */
+
+#include "xlock.h"
+#include <math.h>
+#define TWOPI 6.2831853
+
+/* Define this >1 to get small rectangles instead of points */
+#ifndef STARSIZE
+#define STARSIZE 2
+#endif
+
+#define SILENT 0
+#define REDGLARE 1
+#define BURSTINGINAIR 2
+
+#define CLOUD 0
+#define DOUBLECLOUD 1
+/* Clearly other types and other fascinating visual effects could be added...*/
+
+/* P_xxx parameters represent the reciprocal of the probability... */
+#define P_IGNITE 5000          /* ...of ignition per cycle */
+#define P_DOUBLECLOUD 10       /* ...of an ignition being double */
+#define P_MULTI 75             /* ...of an ignition being several @ once */
+#define P_FUSILLADE 250                /* ...of an ignition starting a fusillade */
+
+#define ROCKETW 2              /* Dimensions of rocket */
+#define ROCKETH 4
+#define XVELFACTOR 0.0025      /* Max horizontal velocity / screen width */
+#define MINYVELFACTOR 0.016    /* Min vertical velocity / screen height */
+#define MAXYVELFACTOR 0.018
+#define GRAVFACTOR 0.0002      /* delta v / screen height */
+#define MINFUSE 50             /* range of fuse lengths for rocket */
+#define MAXFUSE 100
+
+#define FUSILFACTOR 10         /* Generate fusillade by reducing P_IGNITE */
+#define FUSILLEN 100           /* Length of fusillade, in ignitions */
+
+#define SVELFACTOR 0.1         /* Max star velocity / yvel */
+#define BOUYANCY 0.2           /* Reduction in grav deceleration for stars */
+#define MAXSTARS 75            /* Number of stars issued from a shell */
+#define MINSTARS 50
+#define MINSFUSE 50            /* Range of fuse lengths for stars */
+#define MAXSFUSE 100
+
+#define INTRAND(min,max) (random()%((max+1)-(min))+(min))
+#define FLOATRAND(min,max) ((min)+(random()/MAXRAND)*((max)-(min)))
+
+static void ignite();
+static void animate();
+static void shootup();
+static void burst();
+
+typedef struct {
+    int         state;
+    int         shelltype;
+    long        color1, color2;
+    int         fuse;
+    float       xvel, yvel;
+    float       x, y;
+    int         nstars;
+#if STARSIZE > 1
+    XRectangle  Xpoints[MAXSTARS];
+    XRectangle  Xpoints2[MAXSTARS];
+#else
+    XPoint      Xpoints[MAXSTARS];
+    XPoint      Xpoints2[MAXSTARS];
+#endif
+    float       sx[MAXSTARS], sy[MAXSTARS];    /* Distance from notional
+                                                * center  */
+    float       sxvel[MAXSTARS], syvel[MAXSTARS];      /* Relative to notional
+                                                        * center */
+}           rocket;
+
+typedef struct {
+    Screen     *scr;
+    Colormap    cmap;
+    int         p_ignite;
+    unsigned long bgpixel;
+    unsigned long fgpixel;
+    unsigned long rockpixel;
+    GC          bgGC;
+    int         nflying;
+    int         fusilcount;
+    int         width, lmargin, rmargin, height;
+    float       minvelx, maxvelx;
+    float       minvely, maxvely;
+    float       maxsvel;
+    float       rockdecel, stardecel;
+    rocket     *rockq;
+}           pyrostruct;
+
+static pyrostruct pyros[MAXSCREENS];
+static int  orig_p_ignite;
+static int  just_started = True;/* Greet the user right away */
+
+void
+initpyro(win)
+    Window      win;
+{
+    pyrostruct *pp = &pyros[screen];
+    rocket     *rp;
+    XWindowAttributes xwa;
+    XGCValues   xgcv;
+    int         rockn, starn, bsize;
+
+    XGetWindowAttributes(dsp, win, &xwa);
+
+    if (batchcount < 1)
+      batchcount = 1;
+    orig_p_ignite = P_IGNITE / batchcount;
+    if (orig_p_ignite <= 0)
+       orig_p_ignite = 1;
+    pp->p_ignite = orig_p_ignite;
+
+    if (!pp->rockq) {
+       pp->rockq = (rocket *) malloc(batchcount * sizeof(rocket));
+    }
+    pp->nflying = pp->fusilcount = 0;
+
+    bsize = (xwa.height <= 64) ? 1 : STARSIZE;
+    for (rockn = 0, rp = pp->rockq; rockn < batchcount; rockn++, rp++) {
+       rp->state = SILENT;
+#if STARSIZE > 1
+       for (starn = 0; starn < MAXSTARS; starn++) {
+           rp->Xpoints[starn].width = rp->Xpoints[starn].height =
+               rp->Xpoints2[starn].width = rp->Xpoints2[starn].height = bsize;
+       }
+#endif
+    }
+
+    pp->width = xwa.width;
+    pp->lmargin = xwa.width / 16;
+    pp->rmargin = xwa.width - pp->lmargin;
+    pp->height = xwa.height;
+    pp->scr = ScreenOfDisplay(dsp, screen);
+    pp->cmap = DefaultColormapOfScreen(pp->scr);
+
+    pp->fgpixel = WhitePixelOfScreen(pp->scr);
+    pp->bgpixel = BlackPixelOfScreen(pp->scr);
+    if (!mono && Scr[screen].npixels > 3)
+       pp->rockpixel = Scr[screen].pixels[3];  /* Just the right shade of
+                                                * orange */
+    else
+       pp->rockpixel = pp->fgpixel;
+
+    if (!pp->bgGC) {
+       xgcv.foreground = pp->bgpixel;
+       pp->bgGC = XCreateGC(dsp, win, GCForeground, &xgcv);
+    }
+/* Geometry-dependent physical data: */
+    pp->maxvelx = (float) (xwa.width) * XVELFACTOR;
+    pp->minvelx = -pp->maxvelx;
+    pp->minvely = -(float) (xwa.height) * MINYVELFACTOR;
+    pp->maxvely = -(float) (xwa.height) * MAXYVELFACTOR;
+    pp->maxsvel = pp->minvely * SVELFACTOR;
+    pp->rockdecel = (float) (pp->height) * GRAVFACTOR;
+    pp->stardecel = pp->rockdecel * BOUYANCY;
+
+    XFillRectangle(dsp, win, pp->bgGC, 0, 0, xwa.width, xwa.height);
+}
+
+/*ARGSUSED*/
+void
+drawpyro(win)
+    Window      win;
+{
+    pyrostruct *pp = &pyros[screen];
+    rocket     *rp;
+    int         rockn;
+
+    if (just_started || (random() % pp->p_ignite == 0)) {
+       just_started = False;
+       if (random() % P_FUSILLADE == 0) {
+           pp->p_ignite = orig_p_ignite / FUSILFACTOR;
+           pp->fusilcount = INTRAND(FUSILLEN * 9 / 10, FUSILLEN * 11 / 10);
+       }
+       ignite(pp);
+       if (pp->fusilcount > 0) {
+           if (--pp->fusilcount == 0)
+               pp->p_ignite = orig_p_ignite;
+       }
+    }
+    for (rockn = pp->nflying, rp = pp->rockq; rockn > 0; rp++) {
+       if (rp->state != SILENT) {
+           animate(win, pp, rp);
+           rockn--;
+       }
+    }
+}
+
+static void
+ignite(pp)
+    pyrostruct *pp;
+{
+    rocket     *rp;
+    int         multi, shelltype, nstars, fuse, npix, pix;
+    unsigned long      color1, color2;
+    float       xvel, yvel, x;
+
+    x = random() % pp->width;
+    xvel = FLOATRAND(-pp->maxvelx, pp->maxvelx);
+/* All this to stop too many rockets going offscreen: */
+    if (x < pp->lmargin && xvel < 0.0 || x > pp->rmargin && xvel > 0.0)
+       xvel = -xvel;
+    yvel = FLOATRAND(pp->minvely, pp->maxvely);
+    fuse = INTRAND(MINFUSE, MAXFUSE);
+    nstars = INTRAND(MINSTARS, MAXSTARS);
+    if (!mono && (npix = Scr[screen].npixels) > 2) {
+       color1 = Scr[screen].pixels[pix = random() % npix];
+       color2 = Scr[screen].pixels[(pix + (npix / 2)) % npix];
+    } else {
+       color1 = color2 = WhitePixel(dsp, screen);
+    }
+
+    multi = 1;
+    if (random() % P_DOUBLECLOUD == 0)
+       shelltype = DOUBLECLOUD;
+    else {
+       shelltype = CLOUD;
+       if (random() % P_MULTI == 0)
+           multi = INTRAND(5, 15);
+    }
+
+    rp = pp->rockq;
+    while (multi--) {
+       if (pp->nflying >= batchcount)
+           return;
+       while (rp->state != SILENT)
+           rp++;
+       pp->nflying++;
+       rp->shelltype = shelltype;
+       rp->state = REDGLARE;
+       rp->color1 = color1;
+       rp->color2 = color2;
+       rp->xvel = xvel;
+       rp->yvel = FLOATRAND(yvel * 0.97, yvel * 1.03);
+       rp->fuse = INTRAND((fuse * 90) / 100, (fuse * 110) / 100);
+       rp->x = x + FLOATRAND(multi * 7.6, multi * 8.4);
+       rp->y = pp->height - 1;
+       rp->nstars = nstars;
+    }
+}
+
+static void
+animate(win, pp, rp)
+    Window      win;
+    pyrostruct *pp;
+    rocket     *rp;
+{
+    int         starn;
+    float       r, theta;
+
+    if (rp->state == REDGLARE) {
+       shootup(win, pp, rp);
+
+/* Handle setup for explosion */
+       if (rp->state == BURSTINGINAIR) {
+           for (starn = 0; starn < rp->nstars; starn++) {
+               rp->sx[starn] = rp->sy[starn] = 0.0;
+               rp->Xpoints[starn].x = (int) rp->x;
+               rp->Xpoints[starn].y = (int) rp->y;
+               if (rp->shelltype == DOUBLECLOUD) {
+                   rp->Xpoints2[starn].x = (int) rp->x;
+                   rp->Xpoints2[starn].y = (int) rp->y;
+               }
+/* This isn't accurate solid geometry, but it looks OK. */
+
+               r = FLOATRAND(0.0, pp->maxsvel);
+               theta = FLOATRAND(0.0, TWOPI);
+               rp->sxvel[starn] = r * cos(theta);
+               rp->syvel[starn] = r * sin(theta);
+           }
+           rp->fuse = INTRAND(MINSFUSE, MAXSFUSE);
+       }
+    }
+    if (rp->state == BURSTINGINAIR) {
+       burst(win, pp, rp);
+    }
+}
+
+static void
+shootup(win, pp, rp)
+    Window      win;
+    pyrostruct *pp;
+    rocket     *rp;
+{
+    XFillRectangle(dsp, win, pp->bgGC, (int) (rp->x), (int) (rp->y),
+                  ROCKETW, ROCKETH + 3);
+
+    if (rp->fuse-- <= 0) {
+       rp->state = BURSTINGINAIR;
+       return;
+    }
+    rp->x += rp->xvel;
+    rp->y += rp->yvel;
+    rp->yvel += pp->rockdecel;
+    XSetForeground(dsp, Scr[screen].gc, pp->rockpixel);
+    XFillRectangle(dsp, win, Scr[screen].gc, (int) (rp->x), (int) (rp->y),
+                  ROCKETW, ROCKETH + random() % 4);
+}
+
+static void
+burst(win, pp, rp)
+    Window      win;
+    pyrostruct *pp;
+    rocket     *rp;
+{
+    register int starn;
+    register int nstars, stype;
+    register float rx, ry, sd; /* Help compiler optimize :-) */
+    register float sx, sy;
+
+    nstars = rp->nstars;
+    stype = rp->shelltype;
+
+#if STARSIZE > 1
+    XFillRectangles(dsp, win, pp->bgGC, rp->Xpoints, nstars);
+    if (stype == DOUBLECLOUD)
+       XFillRectangles(dsp, win, pp->bgGC, rp->Xpoints2, nstars);
+#else
+    XDrawPoints(dsp, win, pp->bgGC, rp->Xpoints, nstars, CoordModeOrigin);
+    if (stype == DOUBLECLOUD)
+       XDrawPoints(dsp, win, pp->bgGC, rp->Xpoints2, nstars, CoordModeOrigin);
+#endif
+
+    if (rp->fuse-- <= 0) {
+       rp->state = SILENT;
+       pp->nflying--;
+       return;
+    }
+/* Stagger the stars' decay */
+    if (rp->fuse <= 7) {
+       if ((rp->nstars = nstars = nstars * 90 / 100) == 0)
+           return;
+    }
+    rx = rp->x;
+    ry = rp->y;
+    sd = pp->stardecel;
+    for (starn = 0; starn < nstars; starn++) {
+       sx = rp->sx[starn] += rp->sxvel[starn];
+       sy = rp->sy[starn] += rp->syvel[starn];
+       rp->syvel[starn] += sd;
+       rp->Xpoints[starn].x = (int) (rx + sx);
+       rp->Xpoints[starn].y = (int) (ry + sy);
+       if (stype == DOUBLECLOUD) {
+           rp->Xpoints2[starn].x = (int) (rx + 1.7 * sx);
+           rp->Xpoints2[starn].y = (int) (ry + 1.7 * sy);
+       }
+    }
+    rp->x = rx + rp->xvel;
+    rp->y = ry + rp->yvel;
+    rp->yvel += sd;
+
+    XSetForeground(dsp, Scr[screen].gc, rp->color1);
+#if STARSIZE > 1
+    XFillRectangles(dsp, win, Scr[screen].gc, rp->Xpoints, nstars);
+    if (stype == DOUBLECLOUD) {
+       XSetForeground(dsp, Scr[screen].gc, rp->color2);
+       XFillRectangles(dsp, win, Scr[screen].gc, rp->Xpoints2, nstars);
+    }
+#else
+    XDrawPoints(dsp, win, Scr[screen].gc, rp->Xpoints, nstars, CoordModeOrigin);
+    if (stype == DOUBLECLOUD) {
+       XSetForeground(dsp, Scr[screen].gc, rp->color2);
+       XDrawPoints(dsp, win, Scr[screen].gc, rp->Xpoints2, nstars,
+                   CoordModeOrigin);
+    }
+#endif
+}
diff --git a/qix.c b/qix.c
new file mode 100644 (file)
index 0000000..7b47f9d
--- /dev/null
+++ b/qix.c
@@ -0,0 +1,140 @@
+#ifndef lint
+static char sccsid[] = "@(#)qix.c      23.8 91/05/24 XLOCK";
+#endif
+/*-
+ * qix.c - Vector swirl for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 29-Jul-90: support for multiple screens.
+ *           made check_bounds_?() a macro.
+ *           fixed initial parameter setup.
+ * 15-Dec-89: Fix for proper skipping of {White,Black}Pixel() in colors.
+ * 08-Oct-89: Fixed bug in memory allocation in initqix().
+ *           Moved seconds() to an extern.
+ * 23-Sep-89: Switch to random() and fixed bug w/ less than 4 lines.
+ * 20-Sep-89: Lint.
+ * 24-Mar-89: Written.
+ */
+
+#include "xlock.h"
+
+typedef struct {
+    int         x;
+    int         y;
+}           point;
+
+typedef struct {
+    int         pix;
+    long        startTime;
+    int         first;
+    int         last;
+    int         dx1;
+    int         dy1;
+    int         dx2;
+    int         dy2;
+    int         x1;
+    int         y1;
+    int         x2;
+    int         y2;
+    int         offset;
+    int         delta;
+    int         width;
+    int         height;
+    int         nlines;
+    point      *lineq;
+}           qixstruct;
+
+static qixstruct qixs[MAXSCREENS];
+
+void
+initqix(win)
+    Window      win;
+{
+    XWindowAttributes xgwa;
+    qixstruct  *qp = &qixs[screen];
+
+    qp->startTime = seconds();
+    qp->nlines = (batchcount + 1) * 2;
+    if (!qp->lineq) {
+       qp->lineq = (point *) malloc(qp->nlines * sizeof(point));
+       (void) memset(qp->lineq, 0, qp->nlines * sizeof(point));
+    }
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    qp->width = xgwa.width;
+    qp->height = xgwa.height;
+    qp->delta = 16;
+
+    if (qp->width < 100) {     /* icon window */
+       qp->nlines /= 4;
+       qp->delta /= 4;
+    }
+    qp->offset = qp->delta / 3;
+    qp->last = 0;
+    qp->pix = 0;
+    qp->dx1 = random() % qp->delta + qp->offset;
+    qp->dy1 = random() % qp->delta + qp->offset;
+    qp->dx2 = random() % qp->delta + qp->offset;
+    qp->dy2 = random() % qp->delta + qp->offset;
+    qp->x1 = random() % qp->width;
+    qp->y1 = random() % qp->height;
+    qp->x2 = random() % qp->width;
+    qp->y2 = random() % qp->height;
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, qp->width, qp->height);
+}
+
+#define check_bounds(qp, val, del, max)                                \
+{                                                              \
+    if ((val) < 0) {                                           \
+       *(del) = (random() % (qp)->delta) + (qp)->offset;       \
+    } else if ((val) > (max)) {                                        \
+       *(del) = -(random() % (qp)->delta) - (qp)->offset;      \
+    }                                                          \
+}
+
+void
+drawqix(win)
+    Window      win;
+{
+    qixstruct  *qp = &qixs[screen];
+
+    qp->first = (qp->last + 2) % qp->nlines;
+
+    qp->x1 += qp->dx1;
+    qp->y1 += qp->dy1;
+    qp->x2 += qp->dx2;
+    qp->y2 += qp->dy2;
+    check_bounds(qp, qp->x1, &qp->dx1, qp->width);
+    check_bounds(qp, qp->y1, &qp->dy1, qp->height);
+    check_bounds(qp, qp->x2, &qp->dx2, qp->width);
+    check_bounds(qp, qp->y2, &qp->dy2, qp->height);
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XDrawLine(dsp, win, Scr[screen].gc,
+             qp->lineq[qp->first].x, qp->lineq[qp->first].y,
+             qp->lineq[qp->first + 1].x, qp->lineq[qp->first + 1].y);
+    if (!mono && Scr[screen].npixels > 2) {
+       XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[qp->pix]);
+       if (++qp->pix >= Scr[screen].npixels)
+           qp->pix = 0;
+    } else
+       XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+
+    XDrawLine(dsp, win, Scr[screen].gc, qp->x1, qp->y1, qp->x2, qp->y2);
+
+    qp->lineq[qp->last].x = qp->x1;
+    qp->lineq[qp->last].y = qp->y1;
+    qp->last++;
+    if (qp->last >= qp->nlines)
+       qp->last = 0;
+
+    qp->lineq[qp->last].x = qp->x2;
+    qp->lineq[qp->last].y = qp->y2;
+    qp->last++;
+    if (qp->last >= qp->nlines)
+       qp->last = 0;
+}
diff --git a/rect.c b/rect.c
new file mode 100644 (file)
index 0000000..47161f1
--- /dev/null
+++ b/rect.c
@@ -0,0 +1,126 @@
+#ifndef lint
+static char sccsid[] = "@(#)rect.c 1.3 92/01/01 XLOCK";
+#endif
+/*-
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 15-Jul-94: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1992:     xscreensaver version (Jamie Zawinski jwz@lucid.com)
+ */
+
+/* original copyright
+ * xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@lucid.com>
+ *
+ * Permission to use, copy, modify, distribute, and sell 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#include       "xlock.h"
+
+#define NBITS 12
+#define MAXTIME 256
+#include <X11/bitmaps/stipple>
+#include <X11/bitmaps/cross_weave>
+#include <X11/bitmaps/dimple1>
+#include <X11/bitmaps/dimple3>
+#include <X11/bitmaps/flipped_gray>
+#include <X11/bitmaps/gray1>
+#include <X11/bitmaps/gray3>
+#include <X11/bitmaps/hlines2>
+#include <X11/bitmaps/light_gray>
+#include <X11/bitmaps/root_weave>
+#include <X11/bitmaps/vlines2>
+#include <X11/bitmaps/vlines3>
+
+#define BITS(n,w,h)\
+  rp->pixmaps[init_bits++]=\
+  XCreatePixmapFromBitmapData(dsp,win,(char *)n,w,h,1,0,1)
+
+typedef struct {
+    int                width;
+    int                height;
+    int                color;
+    int                time;
+    int                x, y, w, h;
+    GC         stippled_GC;
+    Pixmap     pixmaps[NBITS];
+} rectstruct;
+
+static rectstruct rects[MAXSCREENS];
+static init_bits = 0;
+
+void
+initrect(win)
+    Window      win;
+{
+    XGCValues gcv;
+    Screen *scr;
+    XWindowAttributes xgwa;
+    rectstruct *rp = &rects[screen];
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    scr = ScreenOfDisplay(dsp, screen);
+    rp->width = xgwa.width;
+    rp->height = xgwa.height;
+    rp->time = 0;
+
+    gcv.foreground = WhitePixelOfScreen(scr);
+    gcv.background = BlackPixelOfScreen(scr); 
+    gcv.fill_style = FillOpaqueStippled;
+    rp->stippled_GC = XCreateGC(dsp, win,
+      GCForeground|GCBackground|GCFillStyle, &gcv);
+
+    if (!init_bits) {
+      BITS(stipple_bits, stipple_width, stipple_height);
+      BITS(cross_weave_bits, cross_weave_width, cross_weave_height);
+      BITS(dimple1_bits, dimple1_width, dimple1_height);
+      BITS(dimple3_bits, dimple3_width, dimple3_height);
+      BITS(flipped_gray_bits, flipped_gray_width, flipped_gray_height);
+      BITS(gray1_bits, gray1_width, gray1_height);
+      BITS(gray3_bits, gray3_width, gray3_height);
+      BITS(hlines2_bits, hlines2_width, hlines2_height);
+      BITS(light_gray_bits, light_gray_width, light_gray_height);
+      BITS(root_weave_bits, root_weave_width, root_weave_height);
+      BITS(vlines2_bits, vlines2_width, vlines2_height);
+      BITS(vlines3_bits, vlines3_width, vlines3_height);
+    }
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, rp->width, rp->height);
+}
+
+void
+drawrect(win)
+    Window      win;
+{
+    XGCValues gcv;
+    rectstruct *rp = &rects[screen];
+    int i;
+
+  for (i = 0; i < 10; i++) /* minimize area, but don't try too hard */ {
+      rp->w = 50 + random () % (rp->width - 50);
+      rp->h = 50 + random () % (rp->height - 50);
+      if (rp->w + rp->h < rp->width && rp->w + rp->h < rp->height)
+        break;
+  }
+  rp->x = random () % (rp->width - rp->w);
+  rp->y = random () % (rp->height - rp->h);
+  gcv.stipple = rp->pixmaps[random() % NBITS];
+  gcv.foreground = (!mono && Scr[screen].npixels > 2) ?
+    random() % Scr[screen].npixels : WhitePixel(dsp, screen);
+  gcv.background = (!mono && Scr[screen].npixels > 2) ?
+    random() % Scr[screen].npixels : BlackPixel(dsp, screen);
+  XChangeGC (dsp, rp->stippled_GC, GCStipple|GCForeground|GCBackground, &gcv);
+  XFillRectangle (dsp, win, rp->stippled_GC, rp->x, rp->y, rp->w, rp->h);
+
+    if (++rp->time > MAXTIME)
+      initrect(win);
+}
diff --git a/resource.c b/resource.c
new file mode 100644 (file)
index 0000000..a5e1c3a
--- /dev/null
@@ -0,0 +1,855 @@
+#ifndef lint
+static char sccsid[] = "@(#)resource.c 1.20 91/09/27 XLOCK";
+#endif
+/*-
+ * resource.c - resource management for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ *
+ * Changes of David Bagley (bagleyd@source.asset.com)
+ * 11-Jul-94: added grav mode, and inwindow option from Greg Bowering
+ *            <greg@cs.adelaide.edu.au>
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 17-Jun-94: default changed from life to blank
+ * 21-Mar-94: patch fix for AIXV3 from (R.K.Lloyd@csc.liv.ac.uk)
+ * 01-Dec-93: added patch for AIXV3 from
+ *            (Tom McConnell, tmcconne@sedona.intel.com)
+ * 29-Jun-93: added spline, maze, sphere, hyper, helix, rock, and blot mode.
+ *
+ * Changes of Patrick J. Naughton
+ * 25-Sep-91: added worm mode.
+ * 24-Jun-91: changed name to username.
+ * 06-Jun-91: Added flame mode.
+ * 24-May-91: Added -name and -usefirst and -resources.
+ * 16-May-91: Added random mode and pyro mode.
+ * 26-Mar-91: CheckResources: delay must be >= 0.
+ * 29-Oct-90: Added #include <ctype.h> for missing isupper() on some OS revs.
+ *           moved -mode option, reordered Xrm database evaluation.
+ * 28-Oct-90: Added text strings.
+ * 26-Oct-90: Fix bug in mode specific options.
+ * 31-Jul-90: Fix ':' handling in parsefilepath
+ * 07-Jul-90: Created from resource work in xlock.c
+ *
+ */
+
+#include <stdio.h>
+#ifdef VMS
+#include <stdlib.h>
+#endif
+#include "xlock.h"
+#include <netdb.h>
+#include <math.h>
+#include <ctype.h>
+
+#include <X11/Xresource.h>
+
+/*
+ * Declare external interface routines for supported screen savers.
+ */
+
+extern void inithop();
+extern void drawhop();
+
+extern void initlife();
+extern void drawlife();
+
+extern void initqix();
+extern void drawqix();
+
+extern void initblank();
+extern void drawblank();
+
+extern void initswarm();
+extern void drawswarm();
+
+extern void initrotor();
+extern void drawrotor();
+
+extern void initpyro();
+extern void drawpyro();
+
+extern void initflame();
+extern void drawflame();
+
+extern void initworm();
+extern void drawworm();
+
+extern void initspline();
+extern void drawspline();
+
+extern void initmaze();
+extern void drawmaze();
+
+extern void initsphere();
+extern void drawsphere();
+
+extern void inithyper();
+extern void drawhyper();
+
+extern void inithelix();
+extern void drawhelix();
+
+extern void initrock();
+extern void drawrock();
+
+extern void initblot();
+extern void drawblot();
+
+extern void initgrav();
+extern void drawgrav();
+
+extern void initbounce();
+extern void drawbounce();
+
+extern void initworld();
+extern void drawworld();
+
+extern void initrect();
+extern void drawrect();
+
+typedef struct {
+    char       *cmdline_arg;
+    void        (*lp_init) ();
+    void        (*lp_callback) ();
+    int         def_delay;
+    int         def_batchcount;
+    float       def_saturation;
+    char       *desc;
+}           LockStruct;
+
+static char randomstring[] = "random";
+
+static LockStruct LockProcs[] = {
+    {"hop", inithop, drawhop, 1000, 1000, 1.0, "Hopalong iterated fractals"},
+    {"qix", initqix, drawqix, 30000, 64, 1.0, "Spinning lines a la Qix(tm)"},
+    {"life", initlife, drawlife, 1000000, 100, 1.0, "Conway's game of Life"},
+    {"swarm", initswarm, drawswarm, 10000, 100, 1.0, "Swarm of bees"},
+    {"rotor", initrotor, drawrotor, 100000, 4, 0.4, "Tom's Roto-Rooter"},
+    {"pyro", initpyro, drawpyro, 15000, 40, 1.0, "Fireworks"},
+    {"flame", initflame, drawflame, 10000, 20, 1.0, "Cosmic Flame Fractals"},
+    {"worm", initworm, drawworm, 10000, 20, 1.0, "Wiggly Worms"},
+    {"spline", initspline, drawspline, 30000, 6, 0.4, "Moving Splines"},
+    {"maze", initmaze, drawmaze, 10000, 40, 1.0, "aMAZEing"},
+    {"sphere", initsphere, drawsphere, 10000, 1, 1.0, "Shaded spheres"},
+    {"hyper", inithyper, drawhyper, 10000, 1, 1.0, "Spinning Tesseract"},
+    {"helix", inithelix, drawhelix, 10000, 1, 1.0, "Helix"},
+    {"rock", initrock, drawrock, 30000, 100, 1.0, "Asteroid field"},
+    {"blot", initblot, drawblot, 10000, 6, 0.4, "Rorschach's ink blot test"},
+    {"grav", initgrav, drawgrav, 10000, 10, 1.0, "Orbiting planets"},
+    {"bounce", initbounce, drawbounce, 10000, 10, 1.0, "Bouncing ball"},
+    {"world", initworld, drawworld, 100000, 8, 0.3, "Random Spinning Earths"},
+    {"rect", initrect, drawrect, 10000, 100, 1.0, "Greynetic rectangles"},
+    {"blank", initblank, drawblank, 5000000, 1, 1.0, "Blank screen"},
+    {randomstring, NULL, NULL, 0, 0, 0.0, "Random mode"},
+};
+#define NUMPROCS (sizeof LockProcs / sizeof LockProcs[0])
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64      /* SunOS 3.5 does not define this */
+#endif
+
+extern char *getenv();
+
+#ifndef DEF_FILESEARCHPATH
+#ifdef VMS
+#define DEF_FILESEARCHPATH "DECW$SYSTEM_DEFAULTS:DECW$%N.DAT%S"
+#else
+#define DEF_FILESEARCHPATH "/usr/lib/X11/%T/%N%S"
+#endif
+#endif
+#ifdef VMS
+#define DEF_DISPLAY     "DECW$DISPLAY:"
+#else
+#define DEF_DISPLAY    ":0"
+#endif
+#define DEF_MODE       "blank"
+#ifndef AIXV3
+#define DEF_FONT       "-b&h-lucida-medium-r-normal-sans-24-*-*-*-*-*-iso8859-1"
+#else /* AIXV3 */
+#define DEF_FONT       "fixed"
+#endif /* AIXV3 */
+#define DEF_BG         "White"
+#define DEF_FG         "Black"
+#define DEF_NAME       "Name: "
+#define DEF_PASS       "Password: "
+#define DEF_INFO       "Enter password to unlock; select icon to lock."
+#define DEF_VALID      "Validating login..."
+#define DEF_INVALID    "Invalid login."
+#define DEF_TIMEOUT    "30"    /* secs till password entry times out */
+#define DEF_BC         "100"   /* vectors (or whatever) per batch */
+#define DEF_DELAY      "200000"/* microseconds between batches */
+#define DEF_NICE       "10"    /* xlock process nicelevel */
+#define DEF_SAT                "1.0"   /* color ramp saturation 0->1 */
+#define DEF_CLASSNAME  "XLock"
+
+static char *classname;
+static char modename[1024];
+static char modeclass[1024];
+
+static XrmOptionDescRec genTable[] = {
+    {"-mode", ".mode", XrmoptionSepArg, (caddr_t) NULL},
+    {"-nolock", ".nolock", XrmoptionNoArg, (caddr_t) "on"},
+    {"+nolock", ".nolock", XrmoptionNoArg, (caddr_t) "off"},
+    {"-remote", ".remote", XrmoptionNoArg, (caddr_t) "on"},
+    {"+remote", ".remote", XrmoptionNoArg, (caddr_t) "off"},
+    {"-mono", ".mono", XrmoptionNoArg, (caddr_t) "on"},
+    {"+mono", ".mono", XrmoptionNoArg, (caddr_t) "off"},
+    {"-allowroot", ".allowroot", XrmoptionNoArg, (caddr_t) "on"},
+    {"+allowroot", ".allowroot", XrmoptionNoArg, (caddr_t) "off"},
+    {"-enablesaver", ".enablesaver", XrmoptionNoArg, (caddr_t) "on"},
+    {"+enablesaver", ".enablesaver", XrmoptionNoArg, (caddr_t) "off"},
+    {"-allowaccess", ".allowaccess", XrmoptionNoArg, (caddr_t) "on"},
+    {"+allowaccess", ".allowaccess", XrmoptionNoArg, (caddr_t) "off"},
+    {"-echokeys", ".echokeys", XrmoptionNoArg, (caddr_t) "on"},
+    {"+echokeys", ".echokeys", XrmoptionNoArg, (caddr_t) "off"},
+    {"-usefirst", ".usefirst", XrmoptionNoArg, (caddr_t) "on"},
+    {"+usefirst", ".usefirst", XrmoptionNoArg, (caddr_t) "off"},
+    {"-v", ".verbose", XrmoptionNoArg, (caddr_t) "on"},
+    {"+v", ".verbose", XrmoptionNoArg, (caddr_t) "off"},
+    {"-inwindow",".inwindow", XrmoptionNoArg, (caddr_t) "on"},
+    {"+inwindow",".inwindow", XrmoptionNoArg, (caddr_t) "off"},
+    {"-nice", ".nice", XrmoptionSepArg, (caddr_t) NULL},
+    {"-timeout", ".timeout", XrmoptionSepArg, (caddr_t) NULL},
+    {"-font", ".font", XrmoptionSepArg, (caddr_t) NULL},
+    {"-bg", ".background", XrmoptionSepArg, (caddr_t) NULL},
+    {"-fg", ".foreground", XrmoptionSepArg, (caddr_t) NULL},
+    {"-background", ".background", XrmoptionSepArg, (caddr_t) NULL},
+    {"-foreground", ".foreground", XrmoptionSepArg, (caddr_t) NULL},
+    {"-username", ".username", XrmoptionSepArg, (caddr_t) NULL},
+    {"-password", ".password", XrmoptionSepArg, (caddr_t) NULL},
+    {"-info", ".info", XrmoptionSepArg, (caddr_t) NULL},
+    {"-validate", ".validate", XrmoptionSepArg, (caddr_t) NULL},
+    {"-invalid", ".invalid", XrmoptionSepArg, (caddr_t) NULL},
+};
+#define genEntries (sizeof genTable / sizeof genTable[0])
+
+static XrmOptionDescRec modeTable[] = {
+    {"-delay", ".delay", XrmoptionSepArg, (caddr_t) NULL},
+    {"-batchcount", ".batchcount", XrmoptionSepArg, (caddr_t) NULL},
+    {"-saturation", ".saturation", XrmoptionSepArg, (caddr_t) NULL},
+};
+#define modeEntries (sizeof modeTable / sizeof modeTable[0])
+
+static XrmOptionDescRec cmdlineTable[] = {
+    {"-display", ".display", XrmoptionSepArg, (caddr_t) NULL},
+    {"-nolock", ".nolock", XrmoptionNoArg, (caddr_t) "on"},
+    {"+nolock", ".nolock", XrmoptionNoArg, (caddr_t) "off"},
+    {"-remote", ".remote", XrmoptionNoArg, (caddr_t) "on"},
+    {"+remote", ".remote", XrmoptionNoArg, (caddr_t) "off"},
+};
+#define cmdlineEntries (sizeof cmdlineTable / sizeof cmdlineTable[0])
+
+static XrmOptionDescRec nameTable[] = {
+    {"-name", ".name", XrmoptionSepArg, (caddr_t) NULL},
+};
+
+
+typedef struct {
+    char       *opt;
+    char       *desc;
+}           OptionStruct;
+
+static OptionStruct opDesc[] = {
+    {"-help", "print out this message"},
+    {"-resources", "print default resource file to standard output"},
+    {"-display displayname", "X server to contact"},
+    {"-name resourcename", "class name to use for resources (default is XLock)"},
+    {"-/+mono", "turn on/off monochrome override"},
+    {"-/+nolock", "turn on/off no password required mode"},
+    {"-/+remote", "turn on/off remote host access"},
+    {"-/+allowroot", "turn on/off allow root password mode"},
+    {"-/+enablesaver", "turn on/off enable X server screen saver"},
+    {"-/+allowaccess", "turn on/off allow new clients to connect"},
+    {"-/+echokeys", "turn on/off echo '?' for each password key"},
+    {"-/+usefirst", "turn on/off using the first char typed in password"},
+    {"-/+v", "turn on/off verbose mode"},
+    {"-/+inwindow", "turn on/off making xlock run in a window"},
+    {"-delay usecs", "microsecond delay between screen updates"},
+    {"-batchcount num", "number of things per batch"},
+    {"-nice level", "nice level for xlock process"},
+    {"-timeout seconds", "number of seconds before password times out"},
+    {"-saturation value", "saturation of color ramp"},
+    {"-font fontname", "font to use for password prompt"},
+    {"-bg color", "background color to use for password prompt"},
+    {"-fg color", "foreground color to use for password prompt"},
+    {"-username string", "text string to use for Name prompt"},
+    {"-password string", "text string to use for Password prompt"},
+    {"-info string", "text string to use for instructions"},
+    {"-validate string", "text string to use for validating password message"},
+    {"-invalid string", "text string to use for invalid password message"},
+};
+#define opDescEntries (sizeof opDesc / sizeof opDesc[0])
+
+char       *displayname;
+char       *mode;
+char       *fontname;
+char       *background;
+char       *foreground;
+char       *text_name;
+char       *text_pass;
+char       *text_info;
+char       *text_valid;
+char       *text_invalid;
+float       saturation;
+int         nicelevel;
+int         delay;
+int         batchcount;
+int         timeout;
+Bool        mono;
+Bool        nolock;
+Bool        remote;
+Bool        allowroot;
+Bool        enablesaver;
+Bool        allowaccess;
+Bool        echokeys;
+Bool        usefirst;
+Bool        verbose;
+Bool        inwindow;
+
+#define t_String       0
+#define t_Float                1
+#define t_Int          2
+#define t_Bool         3
+
+typedef struct {
+    caddr_t    *var;
+    char       *name;
+    char       *class;
+    char       *def;
+    int         type;
+}           argtype;
+
+static argtype genvars[] = {
+    {(caddr_t *) &fontname, "font", "Font", DEF_FONT, t_String},
+    {(caddr_t *) &background, "background", "Background", DEF_BG, t_String},
+    {(caddr_t *) &foreground, "foreground", "Foreground", DEF_FG, t_String},
+    {(caddr_t *) &text_name, "username", "Username", DEF_NAME, t_String},
+    {(caddr_t *) &text_pass, "password", "Password", DEF_PASS, t_String},
+    {(caddr_t *) &text_info, "info", "Info", DEF_INFO, t_String},
+    {(caddr_t *) &text_valid, "validate", "Validate", DEF_VALID, t_String},
+    {(caddr_t *) &text_invalid, "invalid", "Invalid", DEF_INVALID, t_String},
+    {(caddr_t *) &nicelevel, "nice", "Nice", DEF_NICE, t_Int},
+    {(caddr_t *) &timeout, "timeout", "Timeout", DEF_TIMEOUT, t_Int},
+    {(caddr_t *) &mono, "mono", "Mono", "off", t_Bool},
+    {(caddr_t *) &nolock, "nolock", "NoLock", "off", t_Bool},
+    {(caddr_t *) &remote, "remote", "Remote", "off", t_Bool},
+    {(caddr_t *) &allowroot, "allowroot", "AllowRoot", "off", t_Bool},
+    {(caddr_t *) &enablesaver, "enablesaver", "EnableSaver", "off", t_Bool},
+    {(caddr_t *) &allowaccess, "allowaccess", "AllowAccess", "off", t_Bool},
+    {(caddr_t *) &echokeys, "echokeys", "EchoKeys", "off", t_Bool},
+    {(caddr_t *) &usefirst, "usefirst", "Usefirst", "off", t_Bool},
+    {(caddr_t *) &verbose, "verbose", "Verbose", "off", t_Bool},
+    {(caddr_t *) &inwindow, "inwindow", "InWindow", "off", t_Bool},
+};
+#define NGENARGS (sizeof genvars / sizeof genvars[0])
+
+static argtype modevars[] = {
+    {(caddr_t *) &delay, "delay", "Delay", DEF_DELAY, t_Int},
+    {(caddr_t *) &batchcount, "batchcount", "BatchCount", DEF_BC, t_Int},
+    {(caddr_t *) &saturation, "saturation", "Saturation", DEF_SAT, t_Float},
+};
+#define NMODEARGS (sizeof modevars / sizeof modevars[0])
+
+#ifdef VMS
+static char *stripname(string)  
+char *string;    
+{
+  char *characters;
+  while (string && *string++ != ']'); 
+  characters = string; 
+  while (characters)
+    if (*characters == '.') {  
+      *characters = '\0';   
+      return string; 
+    } else 
+      characters++; 
+  return string; 
+}
+#endif
+
+static void
+Syntax(badOption)
+    char       *badOption;
+{
+    int         col, len, i;
+
+    (void) fprintf(stderr, "%s:  bad command line option \"%s\"\n\n",
+            ProgramName, badOption);
+
+    (void) fprintf(stderr, "usage:  %s", ProgramName);
+    col = 8 + strlen(ProgramName);
+    for (i = 0; i < opDescEntries; i++) {
+       len = 3 + strlen(opDesc[i].opt);        /* space [ string ] */
+       if (col + len > 79) {
+           (void) fprintf(stderr, "\n   ");    /* 3 spaces */
+           col = 3;
+       }
+       (void) fprintf(stderr, " [%s]", opDesc[i].opt);
+       col += len;
+    }
+
+    len = 8 + strlen(LockProcs[0].cmdline_arg);
+    if (col + len > 79) {
+       (void) fprintf(stderr, "\n   ");        /* 3 spaces */
+       col = 3;
+    }
+    (void) fprintf(stderr, " [-mode %s", LockProcs[0].cmdline_arg);
+    col += len;
+    for (i = 1; i < NUMPROCS; i++) {
+       len = 3 + strlen(LockProcs[i].cmdline_arg);
+       if (col + len > 79) {
+           (void) fprintf(stderr, "\n   ");    /* 3 spaces */
+           col = 3;
+       }
+       (void) fprintf(stderr, " | %s", LockProcs[i].cmdline_arg);
+       col += len;
+    }
+    (void) fprintf(stderr, "]\n");
+
+    (void) fprintf(stderr, "\nType %s -help for a full description.\n\n",
+            ProgramName);
+    exit(1);
+}
+
+static void
+Help()
+{
+    int         i;
+
+    (void) fprintf(stderr, "usage:\n        %s [-options ...]\n\n",
+             ProgramName);
+    (void) fprintf(stderr, "where options include:\n");
+    for (i = 0; i < opDescEntries; i++) {
+       (void) fprintf(stderr, "    %-28s %s\n",
+                 opDesc[i].opt, opDesc[i].desc);
+    }
+
+    (void) fprintf(stderr, "    %-28s %s\n", "-mode mode", "animation mode");
+    (void) fprintf(stderr, "    where mode is one of:\n");
+    for (i = 0; i < NUMPROCS; i++) {
+       (void) fprintf(stderr, "          %-23s %s\n",
+                LockProcs[i].cmdline_arg, LockProcs[i].desc);
+    }
+    (void) putc('\n', stderr);
+
+    exit(0);
+}
+
+static void
+DumpResources()
+{
+    int         i;
+
+    (void) printf("%s.mode: %s\n", classname, DEF_MODE);
+
+    for (i = 0; i < NGENARGS; i++)
+       (void) printf("%s.%s: %s\n",
+              classname, genvars[i].name, genvars[i].def);
+
+    for (i = 0; i < NUMPROCS - 1; i++) {
+       (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+              "delay", LockProcs[i].def_delay);
+       (void) printf("%s.%s.%s: %d\n", classname, LockProcs[i].cmdline_arg,
+              "batchcount", LockProcs[i].def_batchcount);
+       (void) printf("%s.%s.%s: %g\n", classname, LockProcs[i].cmdline_arg,
+              "saturation", LockProcs[i].def_saturation);
+    }
+    exit(0);
+}
+
+
+static void
+LowerString(s)
+    char       *s;
+{
+
+    while (*s) {
+       if (isupper(*s))
+           *s += ('a' - 'A');
+       s++;
+    }
+}
+
+static void
+GetResource(database, parentname, parentclass,
+           name, class, valueType, def, valuep)
+    XrmDatabase database;
+    char       *parentname;
+    char       *parentclass;
+    char       *name;
+    char       *class;
+    int         valueType;
+    char       *def;
+    caddr_t    *valuep;                /* RETURN */
+{
+    char       *type;
+    XrmValue    value;
+    char       *string;
+    char        buffer[1024];
+    char        fullname[1024];
+    char        fullclass[1024];
+    int         len;
+
+    (void) sprintf(fullname, "%s.%s", parentname, name);
+    (void) sprintf(fullclass, "%s.%s", parentclass, class);
+    if (XrmGetResource(database, fullname, fullclass, &type, &value)) {
+       string = value.addr;
+       len = value.size;
+    } else {
+       string = def;
+       len = strlen(string);
+    }
+    (void) strncpy(buffer, string, sizeof(buffer));
+    buffer[sizeof(buffer) - 1] = '\0';
+
+    switch (valueType) {
+    case t_String:
+       {
+           char       *s = (char *) malloc(len + 1);
+           if (s == (char *) NULL)
+               error("%s: GetResource - couldn't allocate memory");
+           (void) strncpy(s, string, len);
+           s[len] = '\0';
+           *((char **) valuep) = s;
+       }
+       break;
+    case t_Bool:
+       LowerString(buffer);
+       *((int *) valuep) = (!strcmp(buffer, "true") ||
+                            !strcmp(buffer, "on") ||
+                            !strcmp(buffer, "enabled") ||
+                            !strcmp(buffer, "yes")) ? True : False;
+       break;
+    case t_Int:
+       *((int *) valuep) = atoi(buffer);
+       break;
+    case t_Float:
+       *((float *) valuep) = (float) atof(buffer);
+       break;
+    }
+}
+
+
+static      XrmDatabase
+parsefilepath(xfilesearchpath, TypeName, ClassName)
+    char       *xfilesearchpath;
+    char       *TypeName;
+    char       *ClassName;
+{
+    XrmDatabase database = NULL;
+    char        appdefaults[1024];
+    char       *src;
+    char       *dst;
+
+    src = xfilesearchpath;
+    appdefaults[0] = '\0';
+    dst = appdefaults;
+    while (1) {
+       if (*src == '%') {
+           src++;
+           switch (*src) {
+           case '%':
+           case ':':
+               *dst++ = *src++;
+               *dst = '\0';
+               break;
+           case 'T':
+               (void) strcat(dst, TypeName);
+               src++;
+               dst += strlen(TypeName);
+               break;
+           case 'N':
+               (void) strcat(dst, ClassName);
+               src++;
+               dst += strlen(ClassName);
+               break;
+           case 'S':
+               src++;
+               break;
+           default:
+               src++;
+               break;
+           }
+#ifdef VMS
+        } else if (*src == '#') {/* Colons required in VMS use #*/
+#else
+       } else if (*src == ':') {
+#endif
+           database = XrmGetFileDatabase(appdefaults);
+           if (database == NULL) {
+               dst = appdefaults;
+               src++;
+           } else
+               break;
+       } else if (*src == '\0') {
+           database = XrmGetFileDatabase(appdefaults);
+           break;
+       } else {
+           *dst++ = *src++;
+           *dst = '\0';
+       }
+    }
+    return database;
+}
+
+
+static void
+open_display()
+{
+    if (displayname != NULL) {
+       extern char *strchr();
+       char       *colon = strchr(displayname, ':');
+       int         n = colon - displayname;
+
+       if (colon == NULL)
+           error("%s: Malformed -display argument, \"%s\"\n", displayname);
+
+       /*
+        * only restrict access to other displays if we are locking and if the
+        * Remote resource is not set.
+        */
+       if (nolock)
+           remote = True;
+       if (!remote && n
+               && strncmp(displayname, "unix", n)
+               && strncmp(displayname, "localhost", n)) {
+           char        hostname[MAXHOSTNAMELEN];
+           struct hostent *host;
+           char      **hp;
+           int         badhost = 1;
+
+           if (gethostname(hostname, MAXHOSTNAMELEN))
+               error("%s: Can't get local hostname.\n");
+
+           if (!(host = gethostbyname(hostname)))
+               error("%s: Can't get hostbyname.\n");
+
+           if (strncmp(displayname, host->h_name, n)) {
+               for (hp = host->h_aliases; *hp; hp++) {
+                   if (!strncmp(displayname, *hp, n)) {
+                       badhost = 0;
+                       break;
+                   }
+               }
+               if (badhost) {
+                   *colon = (char) 0;
+                   error("%s: can't lock %s's display\n", displayname);
+               }
+           }
+       }
+    } else
+       displayname = ":0.0";
+    if (!(dsp = XOpenDisplay(displayname)))
+       error("%s: unable to open display %s.\n", displayname);
+}
+
+
+void
+printvar(class, var)
+    char       *class;
+    argtype     var;
+{
+    switch (var.type) {
+    case t_String:
+       (void) fprintf(stderr, "%s.%s: %s\n",
+               class, var.name, *((char **) var.var));
+       break;
+    case t_Bool:
+       (void) fprintf(stderr, "%s.%s: %s\n",
+               class, var.name, *((int *) var.var)
+               ? "True" : "False");
+       break;
+    case t_Int:
+       (void) fprintf(stderr, "%s.%s: %d\n",
+               class, var.name, *((int *) var.var));
+       break;
+    case t_Float:
+       (void) fprintf(stderr, "%s.%s: %g\n",
+               class, var.name, *((float *) var.var));
+       break;
+    }
+}
+
+
+void
+GetResources(argc, argv)
+    int         argc;
+    char       *argv[];
+{
+    XrmDatabase RDB = NULL;
+    XrmDatabase nameDB = NULL;
+    XrmDatabase modeDB = NULL;
+    XrmDatabase cmdlineDB = NULL;
+    XrmDatabase generalDB = NULL;
+    XrmDatabase homeDB = NULL;
+    XrmDatabase applicationDB = NULL;
+    XrmDatabase serverDB = NULL;
+    XrmDatabase userDB = NULL;
+    char        userfile[1024];
+    char       *homeenv;
+    char       *userpath;
+    char       *env;
+    char       *serverString;
+    int         i;
+
+    XrmInitialize();
+
+    for (i = 0; i < argc; i++) {
+       if (!strncmp(argv[i], "-help", strlen(argv[i])))
+           Help();
+       /* NOTREACHED */
+    }
+
+    /*
+     * get -name arg from command line so you can have different resource
+     * files for different configurations/machines etc...
+     */
+#ifdef VMS
+    /*Strip off directory and .exe; parts*/
+    ProgramName = stripname(ProgramName);
+#endif
+    XrmParseCommand(&nameDB, nameTable, 1, ProgramName,
+                   &argc, argv);
+    GetResource(nameDB, ProgramName, "*", "name", "Name", t_String,
+               DEF_CLASSNAME, &classname);
+
+
+    homeenv = getenv("HOME");
+    if (!homeenv)
+       homeenv = "";
+
+    env = getenv("XFILESEARCHPATH");
+    applicationDB = parsefilepath(env ? env : DEF_FILESEARCHPATH,
+                                 "app-defaults", classname);
+
+    XrmParseCommand(&cmdlineDB, cmdlineTable, cmdlineEntries, ProgramName,
+                   &argc, argv);
+
+    userpath = getenv("XUSERFILESEARCHPATH");
+    if (!userpath) {
+       env = getenv("XAPPLRESDIR");
+       if (env)
+           (void) sprintf(userfile, "%s/%%N:%s/%%N", env, homeenv);
+       else
+#ifdef VMS
+            (void) sprintf(userfile, "%sDECW$%%N.DAT#%sDECW$XDEFAULTS.DAT",
+                    homeenv, homeenv);
+#else
+           (void) sprintf(userfile, "%s/%%N", homeenv);
+#endif
+       userpath = userfile;
+    }
+    userDB = parsefilepath(userpath, "app-defaults", classname);
+
+    (void) XrmMergeDatabases(applicationDB, &RDB);
+    (void) XrmMergeDatabases(userDB, &RDB);
+    (void) XrmMergeDatabases(cmdlineDB, &RDB);
+
+    env = getenv("DISPLAY");
+    GetResource(RDB, ProgramName, classname, "display", "Display", t_String,
+               env ? env : DEF_DISPLAY, &displayname);
+    GetResource(RDB, ProgramName, classname, "nolock", "NoLock", t_Bool,
+               "off", (caddr_t *) &nolock);
+    GetResource(RDB, ProgramName, classname, "remote", "Remote", t_Bool,
+               "off", (caddr_t *) &remote);
+
+    open_display();
+    serverString = XResourceManagerString(dsp);
+    if (serverString) {
+       serverDB = XrmGetStringDatabase(serverString);
+       (void) XrmMergeDatabases(serverDB, &RDB);
+    } else {
+       char        buf[1024];
+       (void) sprintf(buf, "%s/.Xdefaults", homeenv);
+       homeDB = XrmGetFileDatabase(buf);
+       (void) XrmMergeDatabases(homeDB, &RDB);
+    }
+
+    XrmParseCommand(&generalDB, genTable, genEntries, ProgramName, &argc, argv);
+    (void) XrmMergeDatabases(generalDB, &RDB);
+
+    GetResource(RDB, ProgramName, classname, "mode", "Mode", t_String,
+               DEF_MODE, (caddr_t *) &mode);
+
+    /*
+     * if random< mode, then just grab a random entry from the table
+     */
+    if (!strcmp(mode, randomstring))
+       mode = LockProcs[random() % (NUMPROCS - 2)].cmdline_arg;
+
+    (void) sprintf(modename, "%s.%s", ProgramName, mode);
+    (void) sprintf(modeclass, "%s.%s", classname, mode);
+
+    XrmParseCommand(&modeDB, modeTable, modeEntries, modeclass, &argc, argv);
+    (void) XrmMergeDatabases(modeDB, &RDB);
+
+    /* Parse the rest of the command line */
+    for (argc--, argv++; argc > 0; argc--, argv++) {
+       if (**argv != '-')
+           Syntax(*argv);
+       switch (argv[0][1]) {
+       case 'r':
+           DumpResources();
+           /* NOTREACHED */
+       default:
+           Syntax(*argv);
+           /* NOTREACHED */
+       }
+    }
+
+    /* the RDB is set, now query load the variables from the database */
+
+    for (i = 0; i < NGENARGS; i++)
+       GetResource(RDB, ProgramName, classname,
+                   genvars[i].name, genvars[i].class,
+                   genvars[i].type, genvars[i].def, genvars[i].var);
+
+    for (i = 0; i < NMODEARGS; i++)
+       GetResource(RDB, modename, modeclass,
+                   modevars[i].name, modevars[i].class,
+                   modevars[i].type, modevars[i].def, modevars[i].var);
+
+    (void) XrmDestroyDatabase(RDB);
+
+    if (verbose) {
+       for (i = 0; i < NGENARGS; i++)
+           printvar(classname, genvars[i]);
+       for (i = 0; i < NMODEARGS; i++)
+           printvar(modename, modevars[i]);
+    }
+}
+
+
+CheckResources()
+{
+    int         i;
+
+    if (batchcount < 1)
+       Syntax("-batchcount argument must be positive.");
+    if (saturation < 0.0 || saturation > 1.0)
+       Syntax("-saturation argument must be between 0.0 and 1.0.");
+    if (delay < 0)
+       Syntax("-delay argument must be positive.");
+
+    /* in case they have a 'xlock*mode: ' empty resource */
+    if (!mode || *mode == '\0')
+      mode = DEF_MODE;
+
+    for (i = 0; i < NUMPROCS; i++) {
+       if (!strncmp(LockProcs[i].cmdline_arg, mode, strlen(mode))) {
+           init = LockProcs[i].lp_init;
+           callback = LockProcs[i].lp_callback;
+           break;
+       }
+    }
+    if (i == NUMPROCS) {
+       (void) fprintf(stderr, "Unknown mode: ");
+       Syntax(mode);
+    }
+}
diff --git a/rock.c b/rock.c
new file mode 100644 (file)
index 0000000..a51bd87
--- /dev/null
+++ b/rock.c
@@ -0,0 +1,276 @@
+#ifndef lint
+static char sccsid[] = "@(#)rock.c 1.3 92/01/01 XLOCK";
+#endif
+/*
+ * Flying through an asteroid field.  Based on TI Explorer Lisp code by
+ *  John Nguyen <johnn@hx.lcs.mit.edu>
+ *
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1992:     xscreensaver version (Jamie Zawinski jwz@lucid.com)
+ */
+
+/* original copyright
+ * Copyright (c) 1992 by Jamie Zawinski
+ *
+ * Permission to use, copy, modify, distribute, and sell 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.  No representations are made about the suitability of this
+ * software for any purpose.  It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#include <math.h>
+#include <stdio.h>
+#include "xlock.h"
+
+#define MIN_DEPTH 2            /* rocks disappear when they get this close */
+#define MAX_DEPTH 60           /* this is where rocks appear */
+#define MAX_WIDTH 100          /* how big (in pixels) rocks are at depth 1 */
+#define DEPTH_SCALE 100                /* how many ticks there are between depths */
+#define RESOLUTION 1000
+
+/* there's not much point in the above being user-customizable, but those
+   numbers might want to be tweaked for displays with an order of magnitude
+   higher resolution or compute power.
+ */
+typedef struct {
+  int real_size;
+  int r;
+  unsigned long color;
+  int theta;
+  int depth;
+  int size, x, y;
+} arock;
+
+typedef struct {
+    int        width;
+    int        height;
+    int midx, midy;
+    int rotate_p, speed, nrocks;
+    double cos_array[RESOLUTION], sin_array[RESOLUTION];
+    double depths[(MAX_DEPTH + 1) * DEPTH_SCALE];
+    arock *arocks;
+    Pixmap pixmaps[MAX_WIDTH];
+} rockstruct;
+
+static rockstruct rocks[MAXSCREENS];
+
+static void rock_reset(), rock_tick(), rock_compute(), rock_draw();
+static void init_pixmaps(), init_rocks(), tick_rocks(), rocks_once();
+
+static void
+rock_reset(win, arocks)
+     Window win;
+     arock *arocks;
+{
+  arocks->real_size = MAX_WIDTH;
+  arocks->r = (RESOLUTION * 0.7) + (random() % (30 * RESOLUTION));
+  arocks->theta = random() % RESOLUTION;
+  arocks->depth = MAX_DEPTH * DEPTH_SCALE;
+  if (!mono && Scr[screen].npixels > 2) {
+    arocks->color = random() % Scr[screen].npixels;
+    if (arocks->color == BlackPixel(dsp, screen))
+      arocks->color = WhitePixel(dsp, screen);
+  } else
+    arocks->color = WhitePixel(dsp, screen);
+  rock_compute(arocks);
+  rock_draw(win, arocks, True);
+}
+
+static void
+rock_tick (win, arocks, d)
+     Window win;
+     arock *arocks;
+     int d;
+{
+  rockstruct *rp = &rocks[screen];
+  if (arocks->depth > 0)
+    {
+      rock_draw(win, arocks, False);
+      arocks->depth -= rp->speed;
+      if (rp->rotate_p)
+         arocks->theta = (arocks->theta + d) % RESOLUTION;
+      while (arocks->theta < 0)
+       arocks->theta += RESOLUTION;
+      if (arocks->depth < (MIN_DEPTH * DEPTH_SCALE))
+       arocks->depth = 0;
+      else
+       {
+         rock_compute(arocks);
+         rock_draw(win, arocks, True);
+       }
+    }
+  else if ((random() % 40) == 0)
+    rock_reset(win, arocks);
+}
+
+static void
+rock_compute(arocks)
+     arock *arocks;
+{
+  rockstruct *rp = &rocks[screen];
+  double factor = rp->depths [arocks->depth];
+  arocks->size = (int) ((arocks->real_size * factor) + 0.5);
+  arocks->x = rp->midx + (rp->cos_array[arocks->theta] * arocks->r * factor);
+  arocks->y = rp->midy + (rp->sin_array[arocks->theta] * arocks->r * factor);
+}
+
+static void
+rock_draw(win, arocks, draw_p)
+     Window win;
+     arock *arocks;
+     int draw_p;
+{
+  rockstruct *rp = &rocks[screen];
+  if (draw_p)
+      XSetForeground(dsp, Scr[screen].gc, arocks->color);
+  else
+      XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+  if (arocks->x <= 0 || arocks->y <= 0 ||
+      arocks->x >= rp->width || arocks->y >= rp->height)
+    {
+      /* this means that if a rock were to go off the screen at 12:00, but
+        would have been visible at 3:00, it won't come back once the observer
+        rotates around so that the rock would have been visible again.
+        Oh well.
+       */
+      arocks->depth = 0;
+      return;
+    }
+  if (arocks->size <= 1)
+    XDrawPoint (dsp, win, Scr[screen].gc, arocks->x, arocks->y);
+  else if (arocks->size <= 3 || !draw_p)
+    XFillRectangle(dsp, win, Scr[screen].gc,
+                   arocks->x - arocks->size/2, arocks->y - arocks->size/2,
+                   arocks->size, arocks->size);
+  else if (arocks->size < MAX_WIDTH)
+    XCopyPlane(dsp, rp->pixmaps[arocks->size], win, Scr[screen].gc,
+               0, 0, arocks->size, arocks->size,
+               arocks->x - arocks->size/2, arocks->y - arocks->size/2,
+               1);
+}
+
+static void
+init_pixmaps(win)
+     Window win;
+{
+  rockstruct *rp = &rocks[screen];
+  int i;
+  XGCValues gcv;
+  GC fg_gc = 0, bg_gc;
+  rp->pixmaps[0] = rp->pixmaps[1] = 0;
+  for (i = MIN_DEPTH; i < MAX_WIDTH; i++)
+    {
+      int w = (1+(i/32))<<5; /* server might be faster if word-aligned */
+      int h = i;
+
+      Pixmap p = XCreatePixmap(dsp, win, w, h, 1);
+      XPoint points[7];
+      rp->pixmaps[i] = p;
+      if (!p)
+       {
+         (void) fprintf (stderr, "%s: couldn't allocate pixmaps", "xlock");
+         exit (1);
+       }
+      if (!fg_gc)
+       {       /* must use drawable of pixmap, not window (fmh) */
+         gcv.foreground = 1;
+         fg_gc = XCreateGC (dsp, p, GCForeground, &gcv);
+         gcv.foreground = 0;
+         bg_gc = XCreateGC (dsp, p, GCForeground, &gcv);
+       }
+      XFillRectangle(dsp, p, bg_gc, 0, 0, w, h);
+      points[0].x = i * 0.15; points[0].y = i * 0.85;
+      points[1].x = i * 0.00; points[1].y = i * 0.20;
+      points[2].x = i * 0.30; points[2].y = i * 0.00;
+      points[3].x = i * 0.40; points[3].y = i * 0.10;
+      points[4].x = i * 0.90; points[4].y = i * 0.10;
+      points[5].x = i * 1.00; points[5].y = i * 0.55;
+      points[6].x = i * 0.45; points[6].y = i * 1.00;
+      XFillPolygon(dsp, p, fg_gc, points, 7, Nonconvex, CoordModeOrigin);
+    }
+  XFreeGC(dsp, fg_gc);
+  XFreeGC(dsp, bg_gc);
+}
+
+void
+initrock(win)
+     Window win;
+{
+  rockstruct *rp = &rocks[screen];
+  int i;
+  XWindowAttributes xgwa;
+  XGetWindowAttributes(dsp, win, &xgwa);
+
+      rp->width = xgwa.width;
+      rp->height = xgwa.height;
+      rp->midx = rp->width/2;
+      rp->midy = rp->height/2;
+  rp->speed = 100;
+  rp->rotate_p = True;
+  if (batchcount < 1)
+    batchcount = 1;
+  rp->nrocks = batchcount;
+  if (rp->speed < 1) rp->speed = 1;
+  if (rp->speed > 100) rp->speed = 100;
+
+  for (i = 0; i < RESOLUTION; i++)
+    {
+      rp->sin_array[i] = sin((((double) i) / (RESOLUTION / 2)) * M_PI);
+      rp->cos_array[i] = cos((((double) i) / (RESOLUTION / 2)) * M_PI);
+    }
+  /* we actually only need i/speed of these, but wtf */
+  for (i = 1; i < (sizeof(rp->depths) / sizeof(rp->depths[0])); i++)
+    rp->depths[i] = atan(((double) 0.5) / (((double) i) / DEPTH_SCALE));
+  rp->depths[0] = M_PI/2; /* avoid division by 0 */
+
+  if (!rp->arocks)
+    rp->arocks = (arock *) calloc(rp->nrocks, sizeof(arock));
+  XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+  XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, rp->width, rp->height);
+  init_pixmaps(win);
+}
+
+static void
+tick_rocks(win, d)
+     Window win;
+     int d;
+{
+  rockstruct *rp = &rocks[screen];
+  int i;
+  for (i = 0; i < rp->nrocks; i++)
+    rock_tick(win, &rp->arocks[i], d);
+}
+
+void
+drawrock(win)
+    Window win;
+{
+  static int current_delta = 0;        /* observer Z rotation */
+  static int window_tick = 50;
+  static int new_delta = 0;
+  static int dchange_tick = 0;
+
+  if (window_tick++ == 50)
+      window_tick = 0;
+  if (current_delta != new_delta) {
+    if (dchange_tick++ == 5) {
+      dchange_tick = 0;
+      if (current_delta < new_delta)
+        current_delta++;
+      else
+        current_delta--;
+    }
+  } else {
+    if ((random() % 50) == 0) {
+      new_delta = ((random() % 11) - 5);
+      if ((random() % 10) == 0)
+       new_delta *= 5;
+    }
+  }
+  tick_rocks (win, current_delta);
+}
diff --git a/rotor.c b/rotor.c
new file mode 100644 (file)
index 0000000..bd5b837
--- /dev/null
+++ b/rotor.c
@@ -0,0 +1,251 @@
+#ifndef lint
+static char sccsid[] = "@(#)rotor.c    1.6 91/05/24 XLOCK";
+#endif
+/*-
+ * rotor.c - A swirly rotor for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 01-Dec-93: added patch for AIXV3 from
+ *            (Tom McConnell, tmcconne@sedona.intel.com)
+ * 11-Nov-90: put into xlock (by Steve Zellers, zellers@sun.com)
+ * 16-Oct-90: Received from Tom Lawrence (tcl@cs.brown.edu: 'flight' simulator)
+ */
+
+/*
+ * A 'batchcount' of 3 or 4 works best!
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include "xlock.h"
+
+#define SAVE           100     /* this is a good constant to tweak */
+#define REPS           50
+
+#define MAXANGLE       10000.0 /* irrectangular */
+#define DEFAULTCOUNT   3
+
+typedef unsigned char Boolean;
+
+#define IDENT(X)       X
+#if defined (__STDC__) || defined (AIXV3)
+#define CAT(X,Y)       X##Y
+#else
+#define CAT(X,Y)       IDENT(X)Y
+#endif
+
+struct elem {
+    float       angle;
+    float       radius;
+    float       start_radius;
+    float       end_radius;
+    float       radius_drift_max;
+    float       radius_drift_now;
+
+    float       ratio;
+    float       start_ratio;
+    float       end_ratio;
+    float       ratio_drift_max;
+    float       ratio_drift_now;
+};
+
+typedef struct flightstruct {
+    struct elem *elements;
+    int         pix;
+    int         lastx,
+                lasty;
+    int         num,
+                rotor,
+                prev;
+    int         savex[SAVE],
+                savey[SAVE];
+    float       angle;
+    int         centerx,
+                centery;
+    Boolean     firsttime;
+    Boolean     smallscreen;   /* for iconified view */
+    Boolean     forward;
+    Boolean     unused;
+}           flightstruct;
+
+
+static flightstruct flights[MAXSCREENS];
+
+void
+initrotor(win)
+    Window      win;
+{
+    flightstruct *fs = &flights[screen];
+    XWindowAttributes xgwa;
+    int         x;
+    struct elem *pelem;
+    Boolean     wassmall;
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    fs->centerx = xgwa.width / 2;
+    fs->centery = xgwa.height / 2;
+
+    /*
+     * sometimes, you go into small view, only to see a really whizzy pattern
+     * that you would like to look more closely at. Normally, clicking in the
+     * icon reinitializes everything - but I don't, cuz I'm that kind of guy.
+     * HENCE, the wassmall stuff you see here.
+     */
+
+    wassmall = fs->smallscreen;
+    fs->smallscreen = (xgwa.width < 100);
+
+    if (wassmall && !fs->smallscreen)
+       fs->firsttime = True;
+    else {
+       if (batchcount > 12)
+           batchcount = DEFAULTCOUNT;
+       fs->num = batchcount;
+
+       if (fs->elements == NULL) {
+           if ((fs->elements = (struct elem *)
+               malloc(sizeof(struct elem) * fs->num)) == 0) {
+               perror("malloc");
+               exit(1);
+           }
+       }
+       (void) memset(fs->savex, 0, sizeof(fs->savex));
+
+       pelem = fs->elements;
+
+       for (x = fs->num; --x >= 0; pelem++) {
+           pelem->radius_drift_max = 1.0;
+           pelem->radius_drift_now = 1.0;
+
+           pelem->end_radius = 100.0;
+
+           pelem->ratio_drift_max = 1.0;
+           pelem->ratio_drift_now = 1.0;
+           pelem->end_ratio = 10.0;
+       }
+
+       fs->rotor = 0;
+       fs->prev = 1;
+       fs->lastx = fs->centerx;
+       fs->lasty = fs->centery;
+       fs->angle = (random() % (long) MAXANGLE) / 3;
+       fs->forward = fs->firsttime = True;
+    }
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, xgwa.width, xgwa.height);
+}
+
+void
+drawrotor(win)
+    Window      win;
+{
+    register flightstruct *fs = &flights[screen];
+    register struct elem *pelem;
+    int         thisx,
+                thisy;
+    int         i,
+                rp;
+    int         x1,
+                y1,
+                x2,
+                y2;
+
+
+#define SCALE(W,N)     CAT(W,N)/=12; CAT(W,N)+=(CAT(fs->center,W)-2)
+#define SCALEIFSMALL()    if (fs->smallscreen) {       \
+                              SCALE(x,1); SCALE(x,2);  \
+                             SCALE(y,1); SCALE(y,2);   \
+                         }
+
+    for (rp = 0; rp < REPS; rp++) {
+       thisx = fs->centerx;
+       thisy = fs->centery;
+
+       for (i = fs->num, pelem = fs->elements; --i >= 0; pelem++) {
+           if (pelem->radius_drift_max <= pelem->radius_drift_now) {
+               pelem->start_radius = pelem->end_radius;
+               pelem->end_radius =
+                   (float) (random() % 40000) / 100.0 - 200.0;
+               pelem->radius_drift_max =
+                   (float) (random() % 100000) + 10000.0;
+               pelem->radius_drift_now = 0.0;
+           }
+           if (pelem->ratio_drift_max <= pelem->ratio_drift_now) {
+               pelem->start_ratio = pelem->end_ratio;
+               pelem->end_ratio =
+                   (float) (random() % 2000) / 100.0 - 10.0;
+               pelem->ratio_drift_max =
+                   (float) (random() % 100000) + 10000.0;
+               pelem->ratio_drift_now = 0.0;
+           }
+           pelem->ratio = pelem->start_ratio +
+               (pelem->end_ratio - pelem->start_ratio) /
+               pelem->ratio_drift_max * pelem->ratio_drift_now;
+           pelem->angle = fs->angle * pelem->ratio;
+           pelem->radius = pelem->start_radius +
+               (pelem->end_radius - pelem->start_radius) /
+               pelem->radius_drift_max * pelem->radius_drift_now;
+
+           thisx += (int) (cos(pelem->angle) * pelem->radius);
+           thisy += (int) (sin(pelem->angle) * pelem->radius);
+
+           pelem->ratio_drift_now += 1.0;
+           pelem->radius_drift_now += 1.0;
+       }
+       if (fs->firsttime)
+           fs->firsttime = False;
+       else {
+           XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+
+           x1 = (int) fs->savex[fs->rotor];
+           y1 = (int) fs->savey[fs->rotor];
+           x2 = (int) fs->savex[fs->prev];
+           y2 = (int) fs->savey[fs->prev];
+
+           SCALEIFSMALL();
+
+           XDrawLine(dsp, win, Scr[screen].gc, x1, y1, x2, y2);
+
+           if (!mono && Scr[screen].npixels > 2) {
+               XSetForeground(dsp, Scr[screen].gc,
+                              Scr[screen].pixels[fs->pix]);
+               if (++fs->pix >= Scr[screen].npixels)
+                   fs->pix = 0;
+           } else
+               XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+
+           x1 = fs->lastx;
+           y1 = fs->lasty;
+           x2 = thisx;
+           y2 = thisy;
+
+           SCALEIFSMALL();
+
+           XDrawLine(dsp, win, Scr[screen].gc, x1, y1, x2, y2);
+       }
+       fs->savex[fs->rotor] = fs->lastx = thisx;
+       fs->savey[fs->rotor] = fs->lasty = thisy;
+
+       ++fs->rotor;
+       fs->rotor %= SAVE;
+       ++fs->prev;
+       fs->prev %= SAVE;
+       if (fs->forward) {
+           fs->angle += 0.01;
+           if (fs->angle >= MAXANGLE) {
+               fs->angle = MAXANGLE;
+               fs->forward = False;
+           }
+       } else {
+           fs->angle -= 0.1;
+           if (fs->angle <= 0) {
+               fs->angle = 0.0;
+               fs->forward = True;
+           }
+       }
+    }
+}
diff --git a/sphere.c b/sphere.c
new file mode 100644 (file)
index 0000000..8e5a753
--- /dev/null
+++ b/sphere.c
@@ -0,0 +1,119 @@
+#ifndef lint
+static char sccsid[] = "@(#)sphere.c 1.3 88/02/26 XLOCK";
+#endif
+
+/*-
+ * sphere.c - Draw a bunch of shaded spheres for xlock,
+ * the X Window System lockscreen.
+ *
+ * Copyright (c) 1988 by Sun Microsystems
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 2-Sep-93: xlock version (David Bagley bagleyd@source.asset.com)
+ * 1988: Revised to use SunView canvas instead of gfxsw Sun Microsystems
+ * 1982: Orignal Algorithm  Tom Duff  Lucasfilm Ltd.
+ */
+
+/* original copyright
+ ******************************************************************************
+ Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
+
+ All Rights Reserved
+
+ Permission to use, copy, modify, and distribute this software and its
+ documentation for any purpose and without fee is hereby granted,
+ 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 names of Sun or MIT not be
+ used in advertising or publicity pertaining to distribution of the
+ software without specific prior written permission. Sun and M.I.T.
+ make no representations about the suitability of this software for
+ any purpose. It is provided "as is" without any express or implied warranty.
+
+ SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. IN NO EVENT SHALL SUN BE LIABLE FOR ANY SPECIAL, INDIRECT
+ OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ OF USE, DATA OR PROFITS, 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.
+ *****************************************************************************/
+
+#include <math.h>
+#include "xlock.h"
+/*
+ * (NX, NY, NZ) is the light source vector -- length should be
+ * 100
+ */
+#define NX 48
+#define NY (-36)
+#define NZ 80
+#define NR 100
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define SQRT(a) ((int)sqrt((double)(a)))
+
+typedef struct {
+    int      width, height;
+    int      radius;
+    int      x0;               /* x center */
+    int      y0;               /* y center */
+    int      color;
+    int      x;
+    int      maxy;
+} spherestruct;
+
+static spherestruct spheres[MAXSCREENS];
+
+void
+initsphere(win)
+    Window        win;
+{
+    spherestruct *ss = &spheres[screen];
+    XWindowAttributes xwa;
+
+    XGetWindowAttributes(dsp, win, &xwa);
+    ss->width = xwa.width;
+    ss->height = xwa.height;
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, ss->width, ss->height);
+
+    ss->x = ss->radius = 0;
+}
+
+void
+drawsphere(win)
+    Window        win;
+{
+    spherestruct *ss = &spheres[screen];
+    register      y;
+
+    if (ss->x >= ss->radius) {
+       ss->radius = random() % (MIN(ss->width / 2, ss->height / 2) - 1) + 1;
+       ss->x0 = random() % ss->width;
+       ss->y0 = random() % ss->height;
+       ss->x = -ss->radius;
+
+        if (Scr[screen].npixels > 2)
+            ss->color = random() % Scr[screen].npixels;
+    }
+    ss->maxy = SQRT(ss->radius * ss->radius - ss->x * ss->x);
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XDrawLine(dsp, win, Scr[screen].gc,
+        ss->x0 + ss->x, ss->y0 - ss->maxy,
+        ss->x0 + ss->x, ss->y0 + ss->maxy);
+    if (!mono && Scr[screen].npixels > 2)
+        XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[ss->color]);
+    else
+        XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+    for (y = -ss->maxy; y <= ss->maxy; y++)
+        if ((random() % (ss->radius * NR)) <=
+                (NX * ss->x + NY * y + NZ *
+                SQRT(ss->radius * ss->radius - ss->x * ss->x - y * y)))
+            XDrawPoint(dsp, win, Scr[screen].gc,
+                ss->x + ss->x0, y + ss->y0);
+    ss->x++;
+}
+
diff --git a/spline.c b/spline.c
new file mode 100644 (file)
index 0000000..1bd728f
--- /dev/null
+++ b/spline.c
@@ -0,0 +1,177 @@
+#ifndef lint
+static char sccsid[] = "@(#)spline.c 1.3 92/01/01 XLOCK";
+#endif
+/*-
+ * spline.c - spline fun #3 
+ *
+ * Copyright (c) 1992 by Jef Poskanzer
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 2-Sep-93: xlock version: (David Bagley bagleyd@source.asset.com)
+ * 1992:     X11 version (Jef Poskanzer jef@netcom.com || jef@well.sf.ca.us)
+ * 
+ */
+
+/* original copyright
+** xsplinefun.c - X11 version of spline fun #3
+**
+** Displays colorful moving splines in the X11 root window.
+**
+** Copyright (C) 1992 by Jef Poskanzer
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation for any purpose and without fee is hereby granted, provided
+** that the above copyright notice appear in all copies and that both that
+** copyright notice and this permission notice appear in supporting
+** documentation.  This software is provided "as is" without express or
+** implied warranty.
+*/
+
+#include       "xlock.h"
+
+#define MAXPOINTS 99
+#define MAX_DELTA 3
+#define MAX_SPLINES 2048
+
+#define SPLINE_THRESH 5
+
+typedef struct {
+    int                width;
+    int                height;
+    int                color;
+    int                points;
+    int         generation;
+    int x[MAXPOINTS], y[MAXPOINTS], dx[MAXPOINTS], dy[MAXPOINTS];
+} splinestruct;
+
+static splinestruct splines[MAXSCREENS];
+
+static void move_splines();
+static void XDrawSpline();
+
+void
+initspline(win)
+    Window      win;
+{
+    int i;
+    XWindowAttributes xgwa;
+    splinestruct *sp = &splines[screen];
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    sp->width = xgwa.width;
+    sp->height = xgwa.height;
+    /* batchcount is the upper bound on the number of points */
+    if (batchcount > MAXPOINTS || batchcount <= 3)
+      batchcount = 5;
+    /*sp->points = batchcount;*/
+    sp->points = random() % (batchcount - 3) + 3;
+    sp->generation = 0;
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, sp->width, sp->height);
+
+    /* Initialize points. */
+    for ( i = 0; i < sp->points; ++i )
+        {
+        sp->x[i] = random() % sp->width;
+        sp->y[i] = random() % sp->height;
+        sp->dx[i] = random() % ( MAX_DELTA * 2 ) - MAX_DELTA;
+        if ( sp->dx[i] <= 0 ) --sp->dx[i];
+        sp->dy[i] = random() % ( MAX_DELTA * 2 ) - MAX_DELTA;
+        if ( sp->dy[i] <= 0 ) --sp->dy[i];
+        }
+    
+    sp->color = 0;
+}
+
+
+void
+drawspline(win)
+    Window      win;
+{
+    int i, t, px, py, zx, zy, nx, ny;
+    splinestruct *sp = &splines[screen];
+
+    /* Move the points. */
+    for ( i = 0; i < sp->points; i++ )
+        {
+        for ( ; ; )
+            {
+            t = sp->x[i] + sp->dx[i];
+            if ( t >= 0 && t < sp->width ) break;
+            sp->dx[i] = random() % ( MAX_DELTA * 2 ) - MAX_DELTA;
+            if ( sp->dx[i] <= 0 ) --sp->dx[i];
+            }
+        sp->x[i] = t;
+        for ( ; ; )
+            {
+            t = sp->y[i] + sp->dy[i];
+            if ( t >= 0 && t < sp->height ) break;
+            sp->dy[i] = random() % ( MAX_DELTA * 2 ) - MAX_DELTA;
+            if ( sp->dy[i] <= 0 ) --sp->dy[i];
+            }
+        sp->y[i] = t;
+        }
+
+    /* Draw the figure. */
+    px = zx = ( sp->x[0] + sp->x[sp->points-1] ) / 2;
+    py = zy = ( sp->y[0] + sp->y[sp->points-1] ) / 2;
+    for ( i = 0; i < sp->points-1; ++i )
+        {
+        nx = ( sp->x[i+1] + sp->x[i] ) / 2;
+        ny = ( sp->y[i+1] + sp->y[i] ) / 2;
+        XDrawSpline( dsp, win, Scr[screen].gc,
+         px, py, sp->x[i], sp->y[i], nx, ny );
+        px = nx;
+        py = ny;
+        }
+       if (!mono && Scr[screen].npixels > 2) {
+         XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[sp->color]);
+         if (++sp->color >= Scr[screen].npixels)
+            sp->color = 0;
+       } else
+         XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+
+    XDrawSpline( dsp, win, Scr[screen].gc,
+      px, py, sp->x[sp->points-1], sp->y[sp->points-1], zx, zy );
+
+    if (++sp->generation > MAX_SPLINES)
+      initspline(win);
+}
+
+/* X spline routine. */
+
+#define abs(x) ((x) < 0 ? -(x) : (x))
+
+static void
+XDrawSpline(display, d, gc, x0, y0, x1, y1, x2, y2)
+Display* display;
+Drawable d;
+GC gc;
+int x0, y0, x1, y1, x2, y2;
+    {
+    register int xa, ya, xb, yb, xc, yc, xp, yp;
+
+    xa = (x0 + x1) / 2;
+    ya = (y0 + y1) / 2;
+    xc = (x1 + x2) / 2;
+    yc = (y1 + y2) / 2;
+    xb = (xa + xc) / 2;
+    yb = (ya + yc) / 2;
+
+    xp = (x0 + xb) / 2;
+    yp = (y0 + yb) / 2;
+    if (abs(xa - xp) + abs(ya - yp) > SPLINE_THRESH)
+        XDrawSpline(display, d, gc, x0, y0, xa, ya, xb, yb);
+    else
+        XDrawLine(display, d, gc, x0, y0, xb, yb);
+
+    xp = (x2 + xb) / 2;
+    yp = (y2 + yb) / 2;
+    if (abs(xc - xp) + abs(yc - yp) > SPLINE_THRESH)
+        XDrawSpline(display, d, gc, xb, yb, xc, yc, x2, y2);
+    else
+        XDrawLine(display, d, gc, xb, yb, x2, y2);
+    }
diff --git a/swarm.c b/swarm.c
new file mode 100644 (file)
index 0000000..da96e9f
--- /dev/null
+++ b/swarm.c
@@ -0,0 +1,203 @@
+#ifndef lint
+static char sccsid[] = "@(#)swarm.c    1.5 91/05/24 XLOCK";
+#endif
+/*-
+ * swarm.c - swarm of bees for xlock, the X Window System lockscreen.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Revision History:
+ * 31-Aug-90: Adapted from xswarm by Jeff Butterworth. (butterwo@ncsc.org)
+ */
+
+#include "xlock.h"
+
+#define TIMES  4               /* number of time positions recorded */
+#define BEEACC 3               /* acceleration of bees */
+#define WASPACC 5              /* maximum acceleration of wasp */
+#define BEEVEL 11              /* maximum bee velocity */
+#define WASPVEL 12             /* maximum wasp velocity */
+
+/* Macros */
+#define X(t,b) (sp->x[(t)*sp->beecount+(b)])
+#define Y(t,b) (sp->y[(t)*sp->beecount+(b)])
+#define RAND(v)        ((random()%(v))-((v)/2))        /* random number around 0 */
+
+typedef struct {
+    int         pix;
+    long        startTime;
+    int         width;
+    int         height;
+    int         border;                /* wasp won't go closer than this to the edge */
+    int         beecount;      /* number of bees */
+    XSegment   *segs;          /* bee lines */
+    XSegment   *old_segs;      /* old bee lines */
+    short      *x;
+    short      *y;             /* bee positions x[time][bee#] */
+    short      *xv;
+    short      *yv;            /* bee velocities xv[bee#] */
+    short       wx[3];
+    short       wy[3];
+    short       wxv;
+    short       wyv;
+}           swarmstruct;
+
+static swarmstruct swarms[MAXSCREENS];
+
+void
+initswarm(win)
+    Window      win;
+{
+    XWindowAttributes xgwa;
+    swarmstruct *sp = &swarms[screen];
+    int         b;
+
+    sp->startTime = seconds();
+    sp->beecount = batchcount;
+
+    XGetWindowAttributes(dsp, win, &xgwa);
+    sp->width = xgwa.width;
+    sp->height = xgwa.height;
+    sp->border = (sp->width + sp->height) / 50;
+
+    /* Clear the background. */
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, sp->width, sp->height);
+
+    /* Allocate memory. */
+
+    if (!sp->segs) {
+       sp->segs = (XSegment *) malloc(sizeof(XSegment) * sp->beecount);
+       sp->old_segs = (XSegment *) malloc(sizeof(XSegment) * sp->beecount);
+       sp->x = (short *) malloc(sizeof(short) * sp->beecount * TIMES);
+       sp->y = (short *) malloc(sizeof(short) * sp->beecount * TIMES);
+       sp->xv = (short *) malloc(sizeof(short) * sp->beecount);
+       sp->yv = (short *) malloc(sizeof(short) * sp->beecount);
+    }
+    /* Initialize point positions, velocities, etc. */
+
+    /* wasp */
+    sp->wx[0] = sp->border + random() % (sp->width - 2 * sp->border);
+    sp->wy[0] = sp->border + random() % (sp->height - 2 * sp->border);
+    sp->wx[1] = sp->wx[0];
+    sp->wy[1] = sp->wy[0];
+    sp->wxv = 0;
+    sp->wyv = 0;
+
+    /* bees */
+    for (b = 0; b < sp->beecount; b++) {
+       X(0, b) = random() % sp->width;
+       X(1, b) = X(0, b);
+       Y(0, b) = random() % sp->height;
+       Y(1, b) = Y(0, b);
+       sp->xv[b] = RAND(7);
+       sp->yv[b] = RAND(7);
+    }
+}
+
+
+
+void
+drawswarm(win)
+    Window      win;
+{
+    swarmstruct *sp = &swarms[screen];
+    int         b;
+
+    /* <=- Wasp -=> */
+    /* Age the arrays. */
+    sp->wx[2] = sp->wx[1];
+    sp->wx[1] = sp->wx[0];
+    sp->wy[2] = sp->wy[1];
+    sp->wy[1] = sp->wy[0];
+    /* Accelerate */
+    sp->wxv += RAND(WASPACC);
+    sp->wyv += RAND(WASPACC);
+
+    /* Speed Limit Checks */
+    if (sp->wxv > WASPVEL)
+       sp->wxv = WASPVEL;
+    if (sp->wxv < -WASPVEL)
+       sp->wxv = -WASPVEL;
+    if (sp->wyv > WASPVEL)
+       sp->wyv = WASPVEL;
+    if (sp->wyv < -WASPVEL)
+       sp->wyv = -WASPVEL;
+
+    /* Move */
+    sp->wx[0] = sp->wx[1] + sp->wxv;
+    sp->wy[0] = sp->wy[1] + sp->wyv;
+
+    /* Bounce Checks */
+    if ((sp->wx[0] < sp->border) || (sp->wx[0] > sp->width - sp->border - 1)) {
+       sp->wxv = -sp->wxv;
+       sp->wx[0] += sp->wxv;
+    }
+    if ((sp->wy[0] < sp->border) || (sp->wy[0] > sp->height - sp->border - 1)) {
+       sp->wyv = -sp->wyv;
+       sp->wy[0] += sp->wyv;
+    }
+    /* Don't let things settle down. */
+    sp->xv[random() % sp->beecount] += RAND(3);
+    sp->yv[random() % sp->beecount] += RAND(3);
+
+    /* <=- Bees -=> */
+    for (b = 0; b < sp->beecount; b++) {
+       int         distance,
+                   dx,
+                   dy;
+       /* Age the arrays. */
+       X(2, b) = X(1, b);
+       X(1, b) = X(0, b);
+       Y(2, b) = Y(1, b);
+       Y(1, b) = Y(0, b);
+
+       /* Accelerate */
+       dx = sp->wx[1] - X(1, b);
+       dy = sp->wy[1] - Y(1, b);
+       distance = abs(dx) + abs(dy);   /* approximation */
+       if (distance == 0)
+           distance = 1;
+       sp->xv[b] += (dx * BEEACC) / distance;
+       sp->yv[b] += (dy * BEEACC) / distance;
+
+       /* Speed Limit Checks */
+       if (sp->xv[b] > BEEVEL)
+           sp->xv[b] = BEEVEL;
+       if (sp->xv[b] < -BEEVEL)
+           sp->xv[b] = -BEEVEL;
+       if (sp->yv[b] > BEEVEL)
+           sp->yv[b] = BEEVEL;
+       if (sp->yv[b] < -BEEVEL)
+           sp->yv[b] = -BEEVEL;
+
+       /* Move */
+       X(0, b) = X(1, b) + sp->xv[b];
+       Y(0, b) = Y(1, b) + sp->yv[b];
+
+       /* Fill the segment lists. */
+       sp->segs[b].x1 = X(0, b);
+       sp->segs[b].y1 = Y(0, b);
+       sp->segs[b].x2 = X(1, b);
+       sp->segs[b].y2 = Y(1, b);
+       sp->old_segs[b].x1 = X(1, b);
+       sp->old_segs[b].y1 = Y(1, b);
+       sp->old_segs[b].x2 = X(2, b);
+       sp->old_segs[b].y2 = Y(2, b);
+    }
+
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XDrawLine(dsp, win, Scr[screen].gc,
+             sp->wx[1], sp->wy[1], sp->wx[2], sp->wy[2]);
+    XDrawSegments(dsp, win, Scr[screen].gc, sp->old_segs, sp->beecount);
+
+    XSetForeground(dsp, Scr[screen].gc, WhitePixel(dsp, screen));
+    XDrawLine(dsp, win, Scr[screen].gc,
+             sp->wx[0], sp->wy[0], sp->wx[1], sp->wy[1]);
+    if (!mono && Scr[screen].npixels > 2) {
+       XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[sp->pix]);
+       if (++sp->pix >= Scr[screen].npixels)
+           sp->pix = 0;
+    }
+    XDrawSegments(dsp, win, Scr[screen].gc, sp->segs, sp->beecount);
+}
diff --git a/usleep.c b/usleep.c
new file mode 100644 (file)
index 0000000..0e65346
--- /dev/null
+++ b/usleep.c
@@ -0,0 +1,87 @@
+#ifndef lint
+static char sccsid[] = "@(#)usleep.c   1.3 91/05/24 XLOCK";
+#endif
+/*-
+ * usleep.c - OS dependant implementation of usleep().
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * Revision History:
+ *
+ * Changes of David Bagley <bagleyd@source.asset.com>
+ * 22-Jun-94: Fudged for VMS by Anthony Clarke
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 10-Jun-94: patch for BSD from Victor Langeveld <vic@mbfys.kun.nl>
+ * 02-May-94: patch for Linux, got ideas from Darren Senn's xlock
+ *            <sinster@scintilla.capitola.ca.us>
+ * 21-Mar-94: patch fix for HP from <R.K.Lloyd@csc.liv.ac.uk> 
+ * 01-Dec-93: added patch for HP
+ *
+ * Changes of Patrick J. Naughton
+ * 30-Aug-90: written.
+ *
+ */
+
+#include "xlock.h"
+
+#if !defined (linux) && !defined(__FreeBSD__) /* usleep should be defined */
+int
+usleep(usec)
+    unsigned long usec;
+{
+#if (defined (SYSV) || defined(SVR4)) && !defined(__hpux)
+    poll((struct poll *) 0, (size_t) 0, usec / 1000);  /* ms resolution */
+#else
+#ifdef VMS
+    long timadr[2];
+    if (usec !=0) {
+      timadr[0] = -usec*10;
+      timadr[1] = -1;
+      sys$setimr(4,&timadr,0,0,0);
+      sys$waitfr(4);
+    }
+#else
+    struct timeval time_out;
+    time_out.tv_usec = usec % (unsigned long) 1000000;
+    time_out.tv_sec = usec / (unsigned long) 1000000;
+    (void) select(0, (void *) 0, (void *) 0, (void *) 0, &time_out);
+#endif
+#endif
+    return 0;
+}
+#endif
+
+/*
+ * returns the number of seconds since 01-Jan-70.
+ * This is used to control rate and timeout in many of the animations.
+ */
+long
+seconds()
+{
+#ifdef VMS
+    return 12088800;
+#else
+    struct timeval now;
+
+    (void) gettimeofday(&now, (struct timezone *) 0);
+    return now.tv_sec;
+#endif
+}
+
+#ifdef VMS
+static long ran;
+long random()
+{
+  mth$random(&ran);
+  return labs(ran) % 2147483647;
+}
+void srandom(seed)
+int seed;
+{
+  ran = seed;
+}
+#endif
diff --git a/world.c b/world.c
new file mode 100644 (file)
index 0000000..793cef9
--- /dev/null
+++ b/world.c
@@ -0,0 +1,218 @@
+#ifndef lint
+static char sccsid[] = "@(#)world.c    1.7 91/05/24 XLOCK";
+#endif
+/*-
+ * world.c - World Spinner for Xlock
+ *
+ * Copyright (c) 1993 Matthew Moyle-Croft <mmc@cs.adelaide.edu.au>
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 17-Jul-94 Got batchcount to work.
+ * 09-Jan-94 Written [ Modified from image.c ]
+ * 29-Jul-90 image.c written. Copyright (c) 1991 by Patrick J. Naughton.
+ */
+
+#include "xlock.h"
+#define NUM_EARTHS 30
+#define SIZE_X 64
+#define SIZE_Y 64
+#define NUM_REV 4
+
+#include <math.h>
+#include "world/terra-00.xbm"
+#include "world/terra-01.xbm"
+#include "world/terra-02.xbm"
+#include "world/terra-03.xbm"
+#include "world/terra-04.xbm"
+#include "world/terra-05.xbm"
+#include "world/terra-06.xbm"
+#include "world/terra-07.xbm"
+#include "world/terra-08.xbm"
+#include "world/terra-09.xbm"
+#include "world/terra-10.xbm"
+#include "world/terra-11.xbm"
+#include "world/terra-12.xbm"
+#include "world/terra-13.xbm"
+#include "world/terra-14.xbm"
+#include "world/terra-15.xbm"
+#include "world/terra-16.xbm"
+#include "world/terra-17.xbm"
+#include "world/terra-18.xbm"
+#include "world/terra-19.xbm"
+#include "world/terra-20.xbm"
+#include "world/terra-21.xbm"
+#include "world/terra-22.xbm"
+#include "world/terra-23.xbm"
+#include "world/terra-24.xbm"
+#include "world/terra-25.xbm"
+#include "world/terra-26.xbm"
+#include "world/terra-27.xbm"
+#include "world/terra-28.xbm"
+#include "world/terra-29.xbm"
+
+static XImage Earths[NUM_EARTHS] =
+{ 
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra00_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra01_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra02_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra03_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra04_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra05_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra06_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra07_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra08_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra09_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra10_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra11_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra12_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra13_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra14_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra15_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra16_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra17_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra18_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra19_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra20_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra21_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra22_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra23_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra24_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra25_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra26_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra27_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra28_bits,LSBFirst,8,LSBFirst,8,1},
+  {SIZE_X,SIZE_Y,0, XYBitmap, (char *) terra29_bits,LSBFirst,8,LSBFirst,8,1}};
+
+static int current_frame = 0;
+
+
+#define MAXICONS 64
+
+typedef struct {
+  int         x;
+  int         y;
+  unsigned long color;
+  int         frame;
+  int        direction;
+}           point;
+
+typedef struct {
+    int         width;
+    int         height;
+    int         nrows;
+    int         ncols;
+    int         xb;
+    int         yb;
+    int         iconmode;
+    int         iconcount;
+    point       icons[MAXICONS];
+    long        startTime;
+}           worldstruct;
+
+static worldstruct worlds[MAXSCREENS];
+
+static int frame_num;
+
+void
+drawworld(win)
+    Window      win;
+{
+    worldstruct *wp = &worlds[screen];
+    int         i;
+#ifndef NOFLASH
+    int col[MAXICONS], j;
+
+    for (i = 0; i < wp->ncols; i++)
+      col[i] = 0;
+#endif
+    if (frame_num == NUM_EARTHS * NUM_REV) {
+       frame_num = 0;
+       XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+       for (i = 0; i < wp->iconcount; i++) {
+           if (!wp->iconmode)
+             XFillRectangle(dsp, win, Scr[screen].gc,
+                            wp->xb + SIZE_X * wp->icons[i].x,
+                            wp->yb + SIZE_Y * wp->icons[i].y,
+                            SIZE_X, SIZE_Y);
+#ifdef NOFLASH
+           wp->icons[i].x = random() % wp->ncols;
+#else
+           do {
+              j = random() % wp->ncols;
+              if (!col[j])
+                wp->icons[i].x = j;
+              col[j]++;
+            } while (col[j] > 1);
+#endif
+           wp->icons[i].y = random() % wp->nrows;
+           wp->icons[i].direction = random() % 2;
+           wp->icons[i].frame = random() % NUM_EARTHS;
+            if (!mono && Scr[screen].npixels > 2) {
+              wp->icons[i].color = random() % Scr[screen].npixels;
+              if (wp->icons[i].color == BlackPixel(dsp, screen))
+                wp->icons[i].color = WhitePixel(dsp, screen);
+            } else
+              wp->icons[i].color = WhitePixel(dsp, screen);
+         }
+      }
+    for(i = 0; i< wp->iconcount;i++) {
+       XSetForeground(dsp, Scr[screen].gc, wp->icons[i].color);
+       if ( wp->icons[i].frame == NUM_EARTHS)
+               wp->icons[i].frame = 0;
+       else {
+               if ((wp->icons[i].frame <= 0) && wp->icons[i].direction == 0)
+                       wp->icons[i].frame = NUM_EARTHS - 1;
+       }
+       XPutImage(dsp, win, Scr[screen].gc, (Earths + wp->icons[i].frame),
+                 0, 0,
+                 wp->xb + SIZE_X * wp->icons[i].x,
+                 wp->yb + SIZE_Y * wp->icons[i].y,
+                 SIZE_X, SIZE_Y);
+
+       (wp->icons[i].direction) ? wp->icons[i].frame++ : wp->icons[i].frame--; 
+      }               
+    frame_num++;
+  }
+
+void
+initworld(win)
+    Window      win;
+{
+    int x;
+    XWindowAttributes xgwa;
+    worldstruct *wp = &worlds[screen];
+    frame_num = NUM_EARTHS * NUM_REV;
+    wp->startTime = seconds();  
+    for (x = 0; x < NUM_EARTHS; x++)
+      Earths[x].bytes_per_line = 8;
+    XGetWindowAttributes(dsp, win, &xgwa);
+    wp->width = xgwa.width;
+    wp->height = xgwa.height;
+    wp->ncols = wp->width / SIZE_X;
+    wp->nrows = wp->height / SIZE_Y;
+    wp->iconmode = (wp->ncols < 2 || wp->nrows < 2);
+    if (wp->iconmode) {
+       wp->xb = 0;
+       wp->yb = 0;
+       wp->iconcount = 1;      /* icon mode */
+    } else {
+       wp->xb = (wp->width - SIZE_X * wp->ncols) / 2;
+       wp->yb = (wp->height - SIZE_Y * wp->nrows) / 2;
+#ifdef NOFLASH
+        wp->iconcount = batchcount;
+        if (wp->iconcount > MAXICONS)
+          wp->iconcount = 16;
+#else
+        wp->iconcount = batchcount;
+        if (wp->iconcount > MAXICONS)
+          wp->iconcount = 8;
+        if (wp->iconcount > wp->ncols)
+         wp->iconcount = wp->ncols;
+#endif
+    }
+    XSetForeground(dsp, Scr[screen].gc, BlackPixel(dsp, screen));
+    XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, wp->width, wp->height);
+}
diff --git a/world/terra-00.xbm b/world/terra-00.xbm
new file mode 100644 (file)
index 0000000..699c208
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra00_width 64
+#define terra00_height 64
+#define terra00_x_hot 32
+#define terra00_y_hot 32
+static char terra00_bits[] = {
+0x00, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x01, 0xf8, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x20, 0x00, 0xdc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 
+0xdc, 0xff, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xd8, 0xff, 0x03, 0x00, 
+0x00, 0xe0, 0x00, 0xe0, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x78, 0x00, 0x00, 
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x1c, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x00, 
+0x00, 0x0e, 0x00, 0x80, 0xf7, 0xff, 0x7f, 0x00, 0x00, 0x03, 0x00, 0xf0, 
+0x21, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0xf0, 0x80, 0xfb, 0xff, 0x01, 
+0x00, 0x00, 0x00, 0x60, 0x00, 0xf2, 0xff, 0x01, 0x40, 0x00, 0x00, 0xa0, 
+0x1f, 0x80, 0xff, 0x03, 0x20, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xff, 0x07, 
+0x00, 0x00, 0x00, 0xf0, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 
+0xff, 0xff, 0xdf, 0x0f, 0x08, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3e, 0x1f, 
+0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7d, 0x18, 0x00, 0x00, 0x00, 0xff, 
+0xff, 0xff, 0xf9, 0x19, 0x04, 0x00, 0x80, 0xff, 0xff, 0xff, 0xfb, 0x31, 
+0x08, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf7, 0x21, 0x00, 0x00, 0x00, 0xff, 
+0xff, 0xff, 0xe7, 0x21, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xef, 0x00, 
+0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x7f, 0x40, 0x04, 0x00, 0x80, 0xff, 
+0xff, 0xff, 0x1f, 0x40, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 
+0x1e, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x1e, 0x00, 0x00, 0xfc, 
+0xf8, 0xff, 0xff, 0x00, 0x7e, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 
+0x7e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x7f, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x3f, 0x00, 0xff, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0x00, 
+0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0xff, 0x0f, 0x00, 0x00, 
+0xc0, 0xff, 0x0f, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 
+0xfe, 0x3f, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0xfe, 0x1f, 0x00, 0x00, 
+0x80, 0xff, 0x0f, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 
+0xfc, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x8f, 0x00, 0xfc, 0x0f, 0x00, 0x00, 
+0x80, 0xff, 0xcf, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x67, 0x00, 
+0xf0, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x63, 0x00, 0xf0, 0x0f, 0x00, 0x00, 
+0x80, 0xff, 0x21, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0xff, 0x21, 0x00, 
+0xe0, 0x07, 0x00, 0x00, 0x00, 0xff, 0x11, 0x00, 0xe0, 0x03, 0x00, 0x00, 
+0x00, 0x7f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 
+0xc0, 0x03, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 
+0x00, 0x1e, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-01.xbm b/world/terra-01.xbm
new file mode 100644 (file)
index 0000000..f6bb419
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra01_width 64
+#define terra01_height 64
+#define terra01_x_hot 32
+#define terra01_y_hot 32
+static char terra01_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3e, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x07, 0xe0, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x86, 0x01, 0x60, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 
+0xe0, 0xfe, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0xc6, 0xfc, 0x03, 0x00, 
+0x00, 0xe0, 0x03, 0x00, 0xce, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x02, 0x00, 
+0xf0, 0xff, 0x1f, 0x00, 0x00, 0x7c, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 
+0x00, 0x3c, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x0f, 0x00, 0x00, 
+0x3e, 0xf4, 0xff, 0x00, 0x80, 0x03, 0x00, 0x00, 0x1e, 0xa0, 0xff, 0x01, 
+0x80, 0x01, 0x00, 0x00, 0x1c, 0x48, 0xff, 0x01, 0xc0, 0x00, 0x00, 0x00, 
+0xf0, 0x03, 0xf0, 0x03, 0x60, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x07, 
+0x20, 0x00, 0x00, 0x00, 0xfe, 0x9f, 0xfd, 0x07, 0x30, 0x00, 0x00, 0x00, 
+0xff, 0xff, 0xff, 0x0f, 0x38, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x19, 
+0x38, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xdf, 0x13, 0x38, 0x00, 0x00, 0xc0, 
+0xff, 0xff, 0xbf, 0x0f, 0x24, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x0f, 
+0x40, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x0f, 0x02, 0x00, 0x00, 0xc0, 
+0xff, 0xff, 0xff, 0x0e, 0x02, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x0e, 
+0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x07, 0x20, 0x00, 0x00, 0xc0, 
+0xff, 0xff, 0xff, 0x03, 0xf0, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x0f, 
+0xfc, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0x01, 0x00, 0x00, 
+0x7e, 0xfe, 0xff, 0x0f, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 
+0xf8, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xfc, 0x0f, 0x00, 0x00, 
+0x00, 0xf0, 0xff, 0x07, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 
+0xfc, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0xfc, 0xff, 0x03, 0x00, 
+0x00, 0xe0, 0xff, 0x01, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x01, 
+0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xf8, 0xff, 0x07, 0x00, 
+0x00, 0xc0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x01, 
+0xf0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x01, 0xf0, 0xff, 0x03, 0x00, 
+0x00, 0xe0, 0xff, 0x04, 0xe0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0x04, 
+0xc0, 0xff, 0x03, 0x00, 0x00, 0xe0, 0x7f, 0x02, 0x80, 0xff, 0x01, 0x00, 
+0x00, 0xe0, 0x3f, 0x02, 0x80, 0xff, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x01, 
+0x80, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x01, 0x00, 0x7f, 0x00, 0x00, 
+0x00, 0xe0, 0x0f, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 
+0x00, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x3e, 0x00, 0x00, 
+0x00, 0xc0, 0x01, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xfe, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-02.xbm b/world/terra-02.xbm
new file mode 100644 (file)
index 0000000..d811494
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra02_width 64
+#define terra02_height 64
+#define terra02_x_hot 32
+#define terra02_y_hot 32
+static char terra02_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf9, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3c, 0x80, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x08, 0x0c, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 
+0x00, 0xf7, 0x00, 0x00, 0x00, 0xc0, 0x1e, 0x00, 0x60, 0xe4, 0x03, 0x00, 
+0x00, 0xe0, 0x3f, 0x00, 0xa0, 0xfe, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 
+0x00, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xff, 0x3f, 0x00, 
+0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x7f, 0x00, 0x00, 
+0xc0, 0x07, 0xff, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x80, 0x03, 0xff, 0x01, 
+0x80, 0x0f, 0x00, 0x00, 0x80, 0x03, 0xf4, 0x01, 0xc0, 0x07, 0x00, 0x00, 
+0x00, 0x7d, 0xc0, 0x03, 0xe0, 0x03, 0x00, 0x00, 0x80, 0xff, 0x80, 0x07, 
+0xe0, 0x01, 0x00, 0x00, 0x80, 0xff, 0xfb, 0x07, 0x30, 0x00, 0x00, 0x00, 
+0xc0, 0xff, 0xff, 0x0f, 0x18, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1e, 
+0x08, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x00, 
+0xf0, 0xff, 0xff, 0x1f, 0x04, 0x01, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 
+0x14, 0x02, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x37, 0x0c, 0x00, 0x00, 0x00, 
+0xf0, 0xff, 0xff, 0x37, 0x18, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x2f, 
+0x18, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x1f, 0x10, 0x03, 0x00, 0x00, 
+0xf0, 0xff, 0xff, 0x1f, 0x90, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 
+0xc0, 0x3f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0x80, 0x7f, 0x00, 0x00, 
+0x80, 0x9f, 0xff, 0x3f, 0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x3f, 
+0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xc0, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0xfc, 0x3f, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc, 0x1f, 
+0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xe0, 0xff, 0xff, 0x00, 
+0x00, 0x00, 0xf8, 0x1f, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x0f, 
+0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x0f, 0xc0, 0xff, 0xff, 0x01, 
+0x00, 0x00, 0xf8, 0x0f, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x0f, 
+0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0xff, 0xff, 0x00, 
+0x00, 0x00, 0xfc, 0x2f, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x07, 
+0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xfc, 0x13, 0x00, 0xfc, 0x7f, 0x00, 
+0x00, 0x00, 0xf8, 0x01, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0x09, 
+0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xf8, 0x0f, 0x00, 
+0x00, 0x00, 0xfc, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x7c, 0x00, 
+0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0xf0, 0x07, 0x00, 
+0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xf8, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x90, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-03.xbm b/world/terra-03.xbm
new file mode 100644 (file)
index 0000000..4651b02
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra03_width 64
+#define terra03_height 64
+#define terra03_x_hot 32
+#define terra03_y_hot 32
+static char terra03_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe3, 
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x00, 0x0e, 0x00, 0x00, 
+0x00, 0x00, 0x2e, 0x70, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 
+0x00, 0xd8, 0x00, 0x00, 0x00, 0xc0, 0xf3, 0x01, 0x00, 0xa2, 0x03, 0x00, 
+0x00, 0xe0, 0xff, 0x01, 0x00, 0xec, 0x07, 0x00, 0x00, 0xf8, 0x3f, 0x01, 
+0x00, 0xf0, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 
+0x00, 0xfe, 0x0f, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xff, 0x03, 0x00, 
+0x00, 0x78, 0xf8, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x78, 0xe8, 0x01, 
+0xc0, 0xff, 0x00, 0x00, 0x00, 0x30, 0xe8, 0x01, 0xc0, 0x7f, 0x00, 0x00, 
+0x00, 0xe0, 0x07, 0x03, 0xe0, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x06, 
+0xe0, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x07, 0xe0, 0x08, 0x00, 0x00, 
+0x00, 0xf0, 0xff, 0x0f, 0x70, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 
+0x30, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0xff, 0x1f, 0x30, 0x11, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 
+0xb0, 0x40, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0xf0, 0x00, 0x00, 0x00, 
+0x00, 0xf8, 0xff, 0x3f, 0xc0, 0x01, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 
+0x80, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x61, 0x00, 0x00, 
+0x00, 0xf8, 0xff, 0x7f, 0x00, 0xf1, 0x03, 0x00, 0x00, 0xf0, 0xff, 0x7f, 
+0x00, 0xfa, 0x07, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0xf8, 0x0f, 0x00, 
+0x00, 0xc0, 0xe7, 0xff, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 
+0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x00, 
+0x00, 0x00, 0x80, 0xff, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x80, 0x7f, 
+0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x7f, 0x00, 0xfe, 0xff, 0x7f, 
+0x00, 0x00, 0x00, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x7f, 
+0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xf8, 0xff, 0xff, 
+0x00, 0x00, 0x00, 0x3f, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x3f, 
+0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xf0, 0xff, 0x3f, 
+0x00, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x3f, 
+0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x80, 0xff, 0x3f, 
+0x00, 0x00, 0x80, 0x0f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x80, 0x0f, 
+0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xff, 0x03, 
+0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x80, 0x03, 
+0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xff, 0x00, 
+0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xe0, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x30, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-04.xbm b/world/terra-04.xbm
new file mode 100644 (file)
index 0000000..d87219d
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra04_width 64
+#define terra04_height 64
+#define terra04_x_hot 32
+#define terra04_y_hot 32
+static char terra04_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9d, 0x07, 0x08, 0x00, 0x00, 
+0x00, 0x00, 0x3e, 0x81, 0x03, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0b, 
+0x00, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x9f, 0x0f, 0x00, 0x90, 0x02, 0x00, 
+0x00, 0xe0, 0xdf, 0x1f, 0x00, 0x70, 0x07, 0x00, 0x00, 0xf8, 0xff, 0x31, 
+0x00, 0x80, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x3f, 0x00, 
+0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0xfe, 0x7f, 0x00, 
+0x00, 0x80, 0xf3, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc3, 0x01, 
+0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x02, 0x01, 0x80, 0xff, 0x07, 0x00, 
+0x00, 0x00, 0x38, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x7e, 0x00, 
+0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x07, 0xc0, 0x07, 0x01, 0x00, 
+0x00, 0x00, 0xfe, 0x0f, 0xc0, 0x03, 0x01, 0x00, 0x00, 0x00, 0xff, 0x1f, 
+0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x80, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0x1f, 0x80, 0x11, 0x02, 0x00, 0x00, 0x00, 0xff, 0x3f, 
+0x80, 0x1b, 0x18, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x80, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 
+0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x10, 0x08, 0x00, 
+0x00, 0x00, 0xfe, 0x7f, 0x00, 0x20, 0xfe, 0x01, 0x00, 0x00, 0xfc, 0x7f, 
+0x00, 0x40, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0xff, 0x07, 
+0x00, 0x00, 0xf8, 0xfe, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xfc, 
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0x7f, 
+0x00, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf8, 
+0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x00, 0x80, 0xff, 0xff, 
+0x3f, 0x00, 0x00, 0xf0, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0xf0, 
+0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xff, 0xff, 
+0x7f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 0x70, 
+0x00, 0x00, 0xfe, 0xff, 0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0xfc, 0xff, 
+0x1f, 0x00, 0x00, 0x78, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x38, 
+0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff, 
+0x0f, 0x00, 0x00, 0x38, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 0x1c, 
+0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xe0, 0xff, 
+0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x0c, 
+0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xe0, 0x3f, 
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x80, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x70, 0x1e, 0x00, 0x00, 0x00};
diff --git a/world/terra-05.xbm b/world/terra-05.xbm
new file mode 100644 (file)
index 0000000..fddf0d2
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra05_width 64
+#define terra05_height 64
+#define terra05_x_hot 32
+#define terra05_y_hot 32
+static char terra05_bits[] = {
+0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 
+0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x3c, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x00, 0x0c, 0x20, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x78, 
+0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf8, 0x00, 0x40, 0x02, 0x00, 
+0x00, 0xc0, 0xff, 0xfd, 0x01, 0x80, 0x06, 0x00, 0x00, 0xe0, 0xff, 0x7f, 
+0x02, 0x00, 0x1e, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x3c, 0x00, 
+0x00, 0xf8, 0xff, 0x2f, 0x00, 0x00, 0x70, 0x00, 0x00, 0xf8, 0xff, 0x07, 
+0x00, 0x00, 0xdc, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x38, 0x01, 
+0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x30, 0x01, 0x00, 0xfe, 0xff, 0x00, 
+0x00, 0x00, 0xc0, 0x01, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x03, 
+0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x7c, 0x20, 0x00, 
+0x00, 0x00, 0xe0, 0x0f, 0x00, 0x3c, 0x20, 0x00, 0x00, 0x00, 0xe0, 0x1f, 
+0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x38, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0x1f, 0x00, 0x38, 0xc2, 0x00, 0x00, 0x00, 0xe0, 0x3f, 
+0x00, 0x38, 0x03, 0x06, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0xf0, 0x01, 0x00, 
+0x00, 0x00, 0xe0, 0x3f, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0xe0, 0x7f, 
+0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x04, 0x02, 
+0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x88, 0x7f, 0x00, 0x00, 0x80, 0x7f, 
+0x00, 0x00, 0xd0, 0xff, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x80, 0xff, 
+0x03, 0x00, 0x00, 0xef, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0xe0, 
+0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 
+0x1f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0xc0, 
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xff, 
+0xff, 0x0f, 0x00, 0x80, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x80, 
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 
+0xff, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x40, 
+0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff, 
+0xff, 0x07, 0x00, 0x40, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x20, 
+0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 
+0xff, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 
+0x1f, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x08, 
+0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x19, 0x00, 0x00, 0x00};
diff --git a/world/terra-06.xbm b/world/terra-06.xbm
new file mode 100644 (file)
index 0000000..2ce1be1
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra06_width 64
+#define terra06_height 64
+#define terra06_x_hot 32
+#define terra06_y_hot 32
+static char terra06_bits[] = {
+0x00, 0x00, 0x00, 0x60, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 
+0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x9f, 0xf3, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x07, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc3, 
+0x05, 0x80, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc7, 0x0f, 0x00, 0x02, 0x00, 
+0x00, 0x80, 0xff, 0xdf, 0x1f, 0x00, 0x06, 0x00, 0x00, 0x80, 0xff, 0xff, 
+0x07, 0x00, 0x18, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x30, 0x00, 
+0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x40, 0x00, 0x00, 0xe0, 0xff, 0xff, 
+0x00, 0x00, 0xe0, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0xc0, 0x00, 
+0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x80, 0x00, 0x00, 0xf0, 0xff, 0x3f, 
+0x00, 0x00, 0x00, 0x03, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x07, 
+0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0xc0, 0x1f, 0x08, 
+0x00, 0x00, 0x00, 0x0e, 0x00, 0xc0, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x1e, 
+0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x80, 0x07, 0x00, 
+0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x87, 0x20, 0x00, 0x00, 0x00, 0x3e, 
+0x00, 0x00, 0xcf, 0x00, 0x03, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x7e, 0x00, 
+0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x7c, 
+0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x81, 
+0x01, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xc2, 0x3f, 0x00, 0x00, 0x78, 
+0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xe0, 
+0xff, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x80, 
+0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 
+0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x07, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 
+0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00};
diff --git a/world/terra-07.xbm b/world/terra-07.xbm
new file mode 100644 (file)
index 0000000..9479aa5
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra07_width 64
+#define terra07_height 64
+#define terra07_x_hot 32
+#define terra07_y_hot 32
+static char terra07_bits[] = {
+0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 
+0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xcc, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x3f, 0x08, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x1f, 
+0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x7c, 0x00, 0x02, 0x00, 
+0x00, 0x00, 0xfc, 0xff, 0xfd, 0x01, 0x08, 0x00, 0x00, 0x00, 0xfc, 0xff, 
+0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 
+0x1f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x01, 
+0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x04, 
+0x00, 0x00, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 
+0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x18, 
+0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xe0, 0x01, 
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xe0, 0x21, 0x08, 0x00, 0x00, 0x30, 
+0x00, 0x00, 0xe0, 0x33, 0xe0, 0x00, 0x00, 0x30, 0x00, 0x00, 0x80, 0x3f, 
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x60, 
+0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 
+0x40, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0xe1, 0x0f, 0x00, 0x40, 
+0x00, 0x00, 0x00, 0x00, 0xfa, 0x1f, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 
+0xf0, 0x3f, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x7f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x00};
diff --git a/world/terra-08.xbm b/world/terra-08.xbm
new file mode 100644 (file)
index 0000000..3e3f745
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra08_width 64
+#define terra08_height 64
+#define terra08_x_hot 32
+#define terra08_y_hot 32
+static char terra08_bits[] = {
+0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 
+0x83, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x33, 0x06, 0x00, 0x00, 
+0x00, 0x00, 0xfc, 0xff, 0x61, 0x08, 0x00, 0x00, 0x00, 0x00, 0xe2, 0xff, 
+0xe1, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xc7, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 
+0xff, 0x2f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 
+0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 
+0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7e, 0x80, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x02, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x40, 
+0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xf8, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00};
diff --git a/world/terra-09.xbm b/world/terra-09.xbm
new file mode 100644 (file)
index 0000000..37a2f89
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra09_width 64
+#define terra09_height 64
+#define terra09_x_hot 32
+#define terra09_y_hot 32
+static char terra09_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 
+0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x9f, 0x0c, 0x00, 0x00, 
+0x00, 0x00, 0xf8, 0xff, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x88, 0xff, 
+0x0f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x1e, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 
+0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 
+0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 
+0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0x3f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x1f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x40, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x86, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x7e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-10.xbm b/world/terra-10.xbm
new file mode 100644 (file)
index 0000000..3be1f5d
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra10_width 64
+#define terra10_height 64
+#define terra10_x_hot 32
+#define terra10_y_hot 32
+static char terra10_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0xbf, 0x01, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xff, 0xff, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0xc6, 0xff, 0x7f, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf8, 
+0x7f, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x73, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf0, 0x0f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xd0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x10, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-11.xbm b/world/terra-11.xbm
new file mode 100644 (file)
index 0000000..d2fc13a
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra11_width 64
+#define terra11_height 64
+#define terra11_x_hot 32
+#define terra11_y_hot 32
+static char terra11_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0xff, 0x0b, 0x00, 0x00, 
+0x00, 0x00, 0x0e, 0xff, 0xff, 0x33, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc3, 
+0xff, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xdf, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xfc, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfd, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x40, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x13, 0x04, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 
+0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x08, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 
+0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x10, 0x00, 0x00, 
+0x00, 0x00, 0x60, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 
+0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-12.xbm b/world/terra-12.xbm
new file mode 100644 (file)
index 0000000..9d1fa46
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra12_width 64
+#define terra12_height 64
+#define terra12_x_hot 32
+#define terra12_y_hot 32
+static char terra12_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfb, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x3e, 0xf8, 0xff, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 
+0xfc, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf8, 0x7f, 0x03, 0x00, 
+0x00, 0x20, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, 0x08, 0x00, 0x00, 
+0xc0, 0xff, 0x1f, 0x00, 0x00, 0x04, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 
+0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0xff, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 
+0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x20, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 
+0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 
+0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xe0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x80, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x01, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xc0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-13.xbm b/world/terra-13.xbm
new file mode 100644 (file)
index 0000000..b43b1f7
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra13_width 64
+#define terra13_height 64
+#define terra13_x_hot 32
+#define terra13_y_hot 32
+static char terra13_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 
+0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xc1, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 
+0xe1, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0x0c, 0x00, 0x80, 0xff, 0x03, 0x00, 
+0x00, 0x60, 0x02, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x38, 0x00, 0x00, 
+0x00, 0xfc, 0x1f, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 
+0x00, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0xc0, 0x01, 0x00, 0x00, 
+0x00, 0x80, 0xff, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1c, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-14.xbm b/world/terra-14.xbm
new file mode 100644 (file)
index 0000000..e2fab6f
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra14_width 64
+#define terra14_height 64
+#define terra14_x_hot 32
+#define terra14_y_hot 32
+static char terra14_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 
+0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x0f, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 
+0x1c, 0xfe, 0x00, 0x00, 0x00, 0xc0, 0x61, 0x00, 0x00, 0xfc, 0x03, 0x00, 
+0x00, 0xe0, 0x01, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xf8, 0x01, 0x00, 
+0x00, 0xc0, 0x1f, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 
+0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0x00, 0x80, 0x13, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x40, 0x05, 0x00, 0x00, 
+0x00, 0x00, 0xf8, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 
+0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x07, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
+0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3e, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x70, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x10, 0x1e, 0x00, 0x00, 0x00};
diff --git a/world/terra-15.xbm b/world/terra-15.xbm
new file mode 100644 (file)
index 0000000..1c7bf6b
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra15_width 64
+#define terra15_height 64
+#define terra15_x_hot 32
+#define terra15_y_hot 32
+static char terra15_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xf9, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0x7f, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x04, 
+0xc0, 0xf8, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x06, 0x00, 0xe0, 0x03, 0x00, 
+0x00, 0xe0, 0x0f, 0x01, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xf8, 0x0f, 0x00, 
+0x00, 0x00, 0x1e, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x3c, 0x00, 
+0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3f, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 
+0x80, 0x8b, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x41, 0x00, 0x00, 
+0x00, 0x00, 0xc0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 
+0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x0e, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 
+0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 
+0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x06, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x16, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x3c, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x27, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x07, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x70, 0x1c, 0x00, 0x00, 0x00};
diff --git a/world/terra-16.xbm b/world/terra-16.xbm
new file mode 100644 (file)
index 0000000..9034d6c
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra16_width 64
+#define terra16_height 64
+#define terra16_x_hot 32
+#define terra16_y_hot 32
+static char terra16_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1b, 
+0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xef, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0x83, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x61, 
+0x00, 0xe6, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x30, 0x00, 0x00, 0x03, 0x00, 
+0x00, 0xe0, 0xff, 0x10, 0x00, 0x00, 0x06, 0x00, 0x00, 0xf8, 0x7f, 0x00, 
+0x00, 0x00, 0x18, 0x00, 0x00, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0x30, 0x00, 
+0x00, 0xfe, 0x4f, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xff, 0x01, 0x00, 
+0x00, 0x00, 0xc0, 0x00, 0x80, 0xbf, 0x10, 0x00, 0x00, 0x00, 0x80, 0x01, 
+0x80, 0x9f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x0f, 0x06, 0x00, 
+0x00, 0x00, 0x00, 0x02, 0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 
+0xe0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x08, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x18, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x68, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x40, 0x04, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0c, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfc, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfe, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x18, 0x00, 0x00, 0x00};
diff --git a/world/terra-17.xbm b/world/terra-17.xbm
new file mode 100644 (file)
index 0000000..647b51c
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra17_width 64
+#define terra17_height 64
+#define terra17_x_hot 32
+#define terra17_y_hot 32
+static char terra17_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0x1f, 0x7e, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0x06, 0x90, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x03, 0x03, 0x10, 0x02, 0x00, 
+0x00, 0xe0, 0xff, 0x07, 0x01, 0x00, 0x04, 0x00, 0x00, 0xf8, 0xff, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1b, 0x02, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x81, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xec, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x41, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xc2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x10, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x20, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0e, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x40, 0x26, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0xe0, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x87, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0x3f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x1e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xc0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00};
diff --git a/world/terra-18.xbm b/world/terra-18.xbm
new file mode 100644 (file)
index 0000000..45c9291
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra18_width 64
+#define terra18_height 64
+#define terra18_x_hot 32
+#define terra18_y_hot 32
+static char terra18_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0e, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x78, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 
+0x30, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xbf, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x43, 
+0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x41, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0x1f, 0x61, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x11, 
+0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x04, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x70, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x38, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1e, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x08, 0x3c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x38, 0x30, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x08, 0x02, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x22, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x86, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xcc, 0x09, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xf0, 
+0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x40, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x8f, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xdf, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 
+0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xf8, 
+0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xc0, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00};
diff --git a/world/terra-19.xbm b/world/terra-19.xbm
new file mode 100644 (file)
index 0000000..fd4dea4
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra19_width 64
+#define terra19_height 64
+#define terra19_x_hot 32
+#define terra19_y_hot 32
+static char terra19_bits[] = {
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 
+0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x67, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0x07, 0x81, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x83, 0x01, 0x00, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 
+0x08, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x23, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0xff, 0x63, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 
+0x06, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 
+0xe8, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xff, 0x7f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc4, 0xe7, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xc4, 0xe3, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xe1, 0x07, 0x04, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x40, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x08, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf1, 0x02, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x73, 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 
+0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 
+0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 
+0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00};
diff --git a/world/terra-20.xbm b/world/terra-20.xbm
new file mode 100644 (file)
index 0000000..3b828fc
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra20_width 64
+#define terra20_height 64
+#define terra20_x_hot 32
+#define terra20_y_hot 32
+static char terra20_bits[] = {
+0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 
+0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0x3f, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x08, 0x02, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0x7f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 
+0x0f, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x0d, 0x00, 0x00, 0x00, 
+0x80, 0xff, 0xff, 0xff, 0x08, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 
+0x88, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x20, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 
+0x01, 0x00, 0x00, 0x00, 0xd8, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 
+0x38, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x38, 0xfe, 0xff, 0x1f, 
+0x01, 0x00, 0x00, 0x00, 0x3c, 0xfe, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x1c, 0x7c, 0xf8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3c, 0xf8, 0x01, 
+0x01, 0x00, 0x00, 0x00, 0x06, 0x0c, 0xe0, 0x03, 0x01, 0x00, 0x00, 0x00, 
+0x02, 0x0c, 0xe0, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x03, 
+0x04, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x03, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x20, 0x40, 
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x68, 0x60, 0x00, 0x00, 0x00, 0x00, 
+0x01, 0x00, 0x50, 0x70, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x60, 0x7c, 
+0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x60, 0x3c, 0xc0, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xc0, 0x38, 0x81, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 
+0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1b, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0xff, 0x3f, 0x00, 0x00, 0x08, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0x83, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-21.xbm b/world/terra-21.xbm
new file mode 100644 (file)
index 0000000..1b969ee
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra21_width 64
+#define terra21_height 64
+#define terra21_x_hot 32
+#define terra21_y_hot 32
+static char terra21_bits[] = {
+0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 
+0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0xff, 0x21, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x61, 0x00, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 
+0xff, 0x21, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x9f, 0x21, 0x00, 0x00, 
+0xc0, 0xff, 0xff, 0xff, 0x1f, 0x21, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 
+0x1f, 0x30, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x04, 0x00, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0xff, 0xff, 
+0x7f, 0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 
+0xf8, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe8, 0xe3, 0xff, 0xff, 
+0x0f, 0x00, 0x00, 0x00, 0xfc, 0xc1, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00, 
+0xf4, 0x81, 0x0f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x76, 0x80, 0x07, 0xfe, 
+0x00, 0x00, 0x00, 0x00, 0x36, 0x80, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 
+0x1e, 0x80, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x01, 0xe0, 
+0x00, 0x00, 0x00, 0x00, 0x1e, 0x80, 0x01, 0x40, 0x00, 0x03, 0x00, 0x00, 
+0x1f, 0x00, 0x02, 0x08, 0x00, 0x03, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x10, 
+0x10, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x16, 0x38, 0x00, 0x00, 0x00, 
+0x0f, 0x00, 0x00, 0x2c, 0x1c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x18, 
+0x3e, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x30, 0x1e, 0x20, 0x00, 0x00, 
+0x03, 0x00, 0x00, 0x70, 0xdc, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x60, 
+0x00, 0x80, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x06, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 
+0x00, 0x7e, 0x06, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0xff, 0x06, 0x00, 
+0x24, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x24, 0x00, 0x00, 0x00, 
+0xe0, 0xff, 0x0f, 0x00, 0x28, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 
+0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x08, 0x00, 0x00, 0x00, 
+0xf8, 0xff, 0x0f, 0x00, 0x10, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf0, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x90, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-22.xbm b/world/terra-22.xbm
new file mode 100644 (file)
index 0000000..49c663d
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra22_width 64
+#define terra22_height 64
+#define terra22_x_hot 32
+#define terra22_y_hot 32
+static char terra22_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 
+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0xff, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x8f, 0x01, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0xff, 0x7f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xff, 
+0xff, 0x3f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x13, 0x02, 0x00, 
+0x80, 0xff, 0xff, 0xff, 0xff, 0x23, 0x02, 0x00, 0x00, 0xfe, 0xff, 0xff, 
+0xff, 0x27, 0x03, 0x00, 0x20, 0xfe, 0xff, 0xff, 0xff, 0x87, 0x00, 0x00, 
+0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xf7, 0xff, 0xff, 
+0xff, 0x0f, 0x00, 0x00, 0xf8, 0xe7, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0xb8, 0x0f, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0xb8, 0x3f, 0xfc, 0xff, 
+0xff, 0x03, 0x00, 0x00, 0xbc, 0x3f, 0xf0, 0xc7, 0xbf, 0x00, 0x00, 0x00, 
+0xbc, 0x1f, 0xf0, 0x83, 0x9f, 0x00, 0x00, 0x00, 0xbe, 0x0f, 0xf0, 0x81, 
+0x3f, 0x00, 0x00, 0x00, 0xbe, 0x03, 0xf0, 0x00, 0x7e, 0x00, 0x00, 0x00, 
+0xfe, 0x00, 0x60, 0x00, 0x7e, 0x20, 0x00, 0x00, 0x7e, 0x00, 0x60, 0x00, 
+0x70, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x60, 0x00, 0x20, 0xc0, 0x00, 0x00, 
+0xff, 0x01, 0x80, 0x00, 0x02, 0xc0, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 
+0x04, 0x88, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x09, 0x0c, 0x00, 0x00, 
+0xff, 0x00, 0x00, 0x00, 0x0a, 0x0e, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 
+0x8c, 0x0f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x1c, 0x0f, 0x08, 0x00, 
+0x1f, 0x00, 0x00, 0x00, 0x38, 0x27, 0x78, 0x00, 0x1f, 0x00, 0x00, 0x00, 
+0x10, 0x20, 0xe0, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 
+0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x3e, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x02, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x3e, 0x03, 0x00, 0x00, 
+0x00, 0x80, 0x4f, 0x00, 0x3e, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x7f, 0x00, 
+0x3c, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x3c, 0x02, 0x00, 0x00, 
+0x00, 0xf8, 0xff, 0x00, 0x38, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 
+0x38, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0xff, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x00, 
+0x60, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x40, 0x00, 0x00, 0x00, 
+0x00, 0x1e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-23.xbm b/world/terra-23.xbm
new file mode 100644 (file)
index 0000000..0f128c7
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra23_width 64
+#define terra23_height 64
+#define terra23_x_hot 32
+#define terra23_y_hot 32
+static char terra23_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 
+0xdf, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0xff, 0x3f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff, 0xff, 
+0xff, 0xff, 0x01, 0x00, 0x00, 0xfa, 0xff, 0xff, 0xff, 0xbf, 0x01, 0x00, 
+0x40, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x40, 0xe0, 0xff, 0xff, 
+0xff, 0x7f, 0x30, 0x00, 0x20, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x08, 0x00, 
+0xe0, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf0, 0x7f, 0xfe, 0xff, 
+0xff, 0xff, 0x01, 0x00, 0xf8, 0xff, 0xfc, 0xff, 0xff, 0xff, 0x01, 0x00, 
+0xf8, 0xfb, 0x84, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0xfb, 0x0f, 0xff, 
+0xff, 0x7f, 0x00, 0x00, 0xfc, 0xfb, 0x07, 0xfc, 0xf3, 0x2f, 0x00, 0x00, 
+0xfc, 0xf3, 0x03, 0xfc, 0xe1, 0x27, 0x00, 0x00, 0xfe, 0xf3, 0x01, 0x7c, 
+0xc0, 0x0f, 0x04, 0x00, 0xfe, 0x73, 0x00, 0x38, 0x00, 0x1f, 0x04, 0x00, 
+0xfe, 0x1f, 0x00, 0x38, 0x00, 0x1f, 0x08, 0x00, 0xfe, 0x07, 0x00, 0x38, 
+0x00, 0x1c, 0x10, 0x00, 0xfe, 0x7f, 0x00, 0x10, 0x00, 0x08, 0x10, 0x00, 
+0xff, 0x3f, 0x00, 0x40, 0x00, 0x01, 0x10, 0x00, 0xff, 0x3f, 0x00, 0x00, 
+0x00, 0x02, 0x02, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x80, 0x02, 0x03, 0x00, 
+0xfe, 0x0f, 0x00, 0x00, 0x00, 0x87, 0x03, 0x00, 0xfe, 0x07, 0x00, 0x00, 
+0x00, 0xc7, 0x13, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0xc6, 0x03, 0x00, 
+0xfe, 0x03, 0x00, 0x00, 0x00, 0xcc, 0x09, 0x07, 0xfc, 0x01, 0x00, 0x00, 
+0x00, 0x0c, 0x08, 0x0e, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 
+0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, 0xfc, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x10, 0x10, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xf8, 0x63, 0x00, 0x00, 
+0x00, 0x00, 0xf0, 0x05, 0xf8, 0x33, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 
+0xf8, 0x21, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x21, 0x00, 0x00, 
+0x00, 0x00, 0xff, 0x07, 0xf0, 0x23, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 
+0xe0, 0x23, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0xe0, 0x03, 0x00, 0x00, 
+0x00, 0xc0, 0xff, 0x07, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 
+0x80, 0x03, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x80, 0x03, 0x00, 0x00, 
+0x00, 0xc0, 0xe3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-24.xbm b/world/terra-24.xbm
new file mode 100644 (file)
index 0000000..44bae9c
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra24_width 64
+#define terra24_height 64
+#define terra24_x_hot 32
+#define terra24_y_hot 32
+static char terra24_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 
+0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 
+0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff, 
+0xff, 0xff, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 
+0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xe8, 0xff, 0xff, 
+0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, 
+0x00, 0xd4, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00, 0xc0, 0x01, 0xff, 0xff, 
+0xff, 0xff, 0xa7, 0x00, 0xe0, 0x01, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x00, 
+0xe0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0xdf, 0xff, 
+0xff, 0xff, 0x1f, 0x00, 0xf8, 0xbf, 0x1f, 0xff, 0xff, 0xff, 0x1f, 0x00, 
+0xf8, 0x3f, 0xbf, 0xe0, 0xff, 0xff, 0x1f, 0x00, 0xf8, 0x7f, 0xff, 0xc1, 
+0xff, 0xff, 0x0f, 0x00, 0xfc, 0x7f, 0xff, 0x01, 0xff, 0xfc, 0x01, 0x00, 
+0xfc, 0x7f, 0xfe, 0x00, 0x7e, 0xf8, 0x05, 0x00, 0xfe, 0x7f, 0x7e, 0x00, 
+0x3e, 0xf0, 0x03, 0x00, 0xfe, 0xff, 0x1e, 0x00, 0x1e, 0xc0, 0x03, 0x00, 
+0xfe, 0xff, 0x03, 0x00, 0x0c, 0xc0, 0x07, 0x00, 0xfe, 0xff, 0x01, 0x00, 
+0x0c, 0x00, 0x07, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x0c, 0x00, 0x02, 0x00, 
+0xff, 0xff, 0x0f, 0x00, 0x00, 0x40, 0x00, 0x02, 0xff, 0xff, 0x07, 0x00, 
+0x00, 0x80, 0x40, 0x02, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x20, 0x60, 0x00, 
+0xf0, 0xff, 0x03, 0x00, 0x00, 0x40, 0x61, 0x00, 0xf0, 0xff, 0x01, 0x00, 
+0x00, 0x80, 0x71, 0x00, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x80, 0x71, 0x00, 
+0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x33, 0x30, 0xf0, 0x7f, 0x00, 0x00, 
+0x00, 0x00, 0x02, 0x20, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 
+0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x62, 0xe0, 0x7f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0x7f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0xe0, 0xff, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x0e, 0xc0, 0x7f, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x1f, 
+0xc0, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0x80, 0x1f, 0xc0, 0x3f, 0x0c, 0x00, 
+0x00, 0x00, 0xe0, 0x1f, 0x80, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xf0, 0x1f, 
+0x00, 0x3f, 0x0c, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x3f, 0x00, 0x00, 
+0x00, 0x00, 0xf8, 0x0f, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 
+0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x1c, 0x00, 0x00, 
+0x00, 0x00, 0x18, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-25.xbm b/world/terra-25.xbm
new file mode 100644 (file)
index 0000000..6283965
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra25_width 64
+#define terra25_height 64
+#define terra25_x_hot 32
+#define terra25_y_hot 32
+static char terra25_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xff, 
+0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xf4, 0xff, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 
+0xff, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 
+0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x4c, 0xff, 0xff, 
+0xff, 0xff, 0x3f, 0x00, 0x00, 0x06, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00, 
+0x00, 0x03, 0xfd, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x0f, 0xe0, 0xff, 
+0xff, 0xff, 0x7f, 0x02, 0x80, 0x0f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x02, 
+0xc0, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xf3, 
+0xff, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xf7, 0xc7, 0xff, 0xff, 0xff, 0x01, 
+0xf0, 0xff, 0xef, 0x2f, 0xf8, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xef, 0xff, 
+0xf0, 0xff, 0xff, 0x01, 0xf8, 0xff, 0xcf, 0x7f, 0xc0, 0x3f, 0x3f, 0x00, 
+0xf8, 0xff, 0xcf, 0x7f, 0x80, 0x1f, 0x3e, 0x00, 0xfc, 0xff, 0x9f, 0x1f, 
+0x80, 0x0f, 0x7c, 0x00, 0xfc, 0xff, 0x9f, 0x07, 0x80, 0x07, 0x78, 0x00, 
+0xfc, 0xff, 0xff, 0x01, 0x00, 0x07, 0x78, 0x08, 0xfc, 0xff, 0x7f, 0x00, 
+0x00, 0x07, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x02, 0x40, 0x10, 
+0xfc, 0xff, 0xff, 0x03, 0x00, 0x08, 0x10, 0x10, 0xdc, 0xff, 0xff, 0x03, 
+0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x28, 0x04, 
+0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x30, 0x06, 0x80, 0xff, 0x7f, 0x00, 
+0x00, 0x00, 0x30, 0x07, 0x80, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x20, 0x46, 
+0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xc6, 0x00, 0xff, 0x1f, 0x00, 
+0x00, 0x00, 0x40, 0x80, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80, 
+0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xfe, 0x1f, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xfe, 0x1f, 0x06, 
+0x00, 0x00, 0x00, 0x70, 0x00, 0xfe, 0x1f, 0x03, 0x00, 0x00, 0x00, 0x38, 
+0x00, 0xfc, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0xfc, 0x07, 0x03, 
+0x00, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1f, 
+0x00, 0xf8, 0x07, 0x01, 0x00, 0x00, 0x00, 0x1f, 0x00, 0xf0, 0x07, 0x00, 
+0x00, 0x00, 0x80, 0x1f, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x80, 0x0f, 
+0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0xc0, 0x03, 0x00, 
+0x00, 0x00, 0xc0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x06, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-26.xbm b/world/terra-26.xbm
new file mode 100644 (file)
index 0000000..7790d05
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra26_width 64
+#define terra26_height 64
+#define terra26_x_hot 32
+#define terra26_y_hot 32
+static char terra26_bits[] = {
+0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfe, 
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x32, 0xff, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 
+0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x70, 0xf4, 0xff, 
+0xff, 0xff, 0xff, 0x00, 0x00, 0x38, 0xb1, 0xff, 0xff, 0xff, 0xff, 0x01, 
+0x00, 0x18, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0x00, 0xfc, 
+0xff, 0xff, 0xff, 0x01, 0x00, 0xfc, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x03, 
+0x00, 0xfe, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0xff, 
+0xfe, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xfd, 0xf1, 0xff, 0xff, 0x07, 
+0xc0, 0xff, 0xff, 0xf9, 0x0b, 0xfe, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0xfb, 
+0x3f, 0xfc, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xf3, 0x3f, 0xf0, 0xe7, 0x03, 
+0xe0, 0xff, 0xff, 0xf3, 0x1f, 0xe0, 0xc3, 0x03, 0xf0, 0xff, 0xff, 0xe7, 
+0x07, 0xe0, 0xc3, 0x03, 0xf0, 0xff, 0xff, 0xef, 0x01, 0xc0, 0x01, 0x07, 
+0xf0, 0xff, 0xff, 0x5f, 0x00, 0xc0, 0x00, 0x07, 0xf0, 0xff, 0xff, 0x1f, 
+0x00, 0x80, 0x00, 0x04, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x80, 0x00, 0x04, 
+0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x02, 0x00, 0xe0, 0xfd, 0xff, 0xff, 
+0x00, 0x00, 0x00, 0x02, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x21, 
+0x00, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x22, 0x00, 0xf0, 0xff, 0x3f, 
+0x00, 0x00, 0x00, 0xf2, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf4, 
+0x00, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x6c, 0x00, 0xe0, 0xff, 0x07, 
+0x00, 0x00, 0x00, 0x04, 0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x08, 
+0x00, 0xc0, 0xff, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0xc0, 0xff, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x8f, 
+0x01, 0x00, 0x00, 0x40, 0x00, 0xc0, 0xff, 0xc7, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0xc0, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x20, 0x00, 0x80, 0xff, 0xc1, 
+0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0xff, 0xc1, 0x00, 0x00, 0x00, 0x18, 
+0x00, 0x00, 0xff, 0x41, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xff, 0x00, 
+0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x0c, 
+0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x78, 0x00, 
+0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-27.xbm b/world/terra-27.xbm
new file mode 100644 (file)
index 0000000..57fcb79
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra27_width 64
+#define terra27_height 64
+#define terra27_x_hot 32
+#define terra27_y_hot 32
+static char terra27_bits[] = {
+0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0xf8, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0xfb, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0xdc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x3f, 0x00, 
+0x00, 0x00, 0x7c, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x80, 0xc7, 0xfe, 
+0xff, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x83, 0xf6, 0xff, 0xff, 0xff, 0x01, 
+0x00, 0xc0, 0x41, 0xf0, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x1f, 0x00, 
+0xff, 0xff, 0xff, 0x03, 0x00, 0xe0, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x07, 
+0x00, 0xf0, 0x7f, 0xef, 0xff, 0xff, 0xff, 0x07, 0x00, 0xf8, 0xff, 0xff, 
+0xbf, 0xff, 0xff, 0x0f, 0x00, 0xfc, 0xff, 0x7f, 0x7f, 0xfc, 0xff, 0x1f, 
+0x00, 0xfe, 0xff, 0xff, 0xfe, 0x82, 0xff, 0x1f, 0x00, 0xfe, 0xff, 0xff, 
+0xfe, 0x0f, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xfc, 0x0f, 0x7c, 0x1e, 
+0x00, 0xff, 0xff, 0xff, 0xf9, 0x07, 0x7c, 0x1c, 0x00, 0xff, 0xff, 0xff, 
+0xf9, 0x03, 0x38, 0x1c, 0x80, 0xff, 0xff, 0xff, 0xf3, 0x00, 0x38, 0x18, 
+0x80, 0xff, 0xff, 0xff, 0x37, 0x00, 0x30, 0x30, 0x80, 0xff, 0xff, 0xff, 
+0x0f, 0x00, 0x30, 0x20, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x20, 
+0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x40, 0x00, 0x00, 0xbe, 0xff, 0xff, 
+0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x90, 
+0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0x90, 0x00, 0x00, 0xfc, 0xff, 
+0x0f, 0x00, 0x00, 0xb0, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xa0, 
+0x01, 0x00, 0xfc, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x01, 0x00, 0xf8, 0xff, 
+0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x00, 
+0x03, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 
+0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 
+0x02, 0x00, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 
+0x43, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0xff, 0x71, 0x00, 0x00, 0x00, 
+0x04, 0x00, 0xf0, 0xff, 0x60, 0x00, 0x00, 0x00, 0x04, 0x00, 0xe0, 0x7f, 
+0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x30, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0xe0, 0x7f, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0xc0, 0x3f, 
+0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-28.xbm b/world/terra-28.xbm
new file mode 100644 (file)
index 0000000..5280733
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra28_width 64
+#define terra28_height 64
+#define terra28_x_hot 32
+#define terra28_y_hot 32
+static char terra28_bits[] = {
+0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 
+0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0xff, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x04, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 
+0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0x98, 0xff, 0xff, 0x03, 0x00, 
+0x00, 0x00, 0xe0, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 
+0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x78, 0xc8, 
+0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x3c, 0xd0, 0xfe, 0xff, 0xff, 0x01, 
+0x00, 0x00, 0x1c, 0x88, 0xfe, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0x03, 
+0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xfc, 0x03, 0xe0, 0xff, 0xff, 0x07, 
+0x00, 0x00, 0xfe, 0xcf, 0xfb, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 
+0xff, 0xef, 0xff, 0x0f, 0x00, 0xc0, 0xff, 0xff, 0xdf, 0x9f, 0xff, 0x1f, 
+0x00, 0xc0, 0xff, 0xff, 0xbf, 0xbf, 0xf0, 0x1f, 0x00, 0xe0, 0xff, 0xff, 
+0x3f, 0xff, 0xe1, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xff, 0xc1, 0x37, 
+0x00, 0xe0, 0xff, 0xff, 0x7f, 0xfe, 0x81, 0x33, 0x00, 0xf0, 0xff, 0xff, 
+0xff, 0xfc, 0x80, 0x23, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3d, 0x00, 0x63, 
+0x00, 0xf0, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x43, 0x00, 0xf0, 0xff, 0xff, 
+0xff, 0x03, 0x00, 0x02, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 
+0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x01, 0xc0, 0xe7, 0xff, 
+0xff, 0x1f, 0x00, 0x00, 0x01, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0x00, 
+0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x01, 0x00, 0x00, 0xff, 
+0xff, 0x07, 0x00, 0x80, 0x03, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x80, 
+0x07, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x80, 0x0f, 0x00, 0x00, 0xfe, 
+0xff, 0x01, 0x00, 0x00, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 
+0x1f, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 
+0xff, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 
+0x0e, 0x00, 0x00, 0xfc, 0xff, 0x21, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 
+0xff, 0x31, 0x00, 0x00, 0x0e, 0x00, 0x00, 0xfc, 0x7f, 0x18, 0x00, 0x00, 
+0x1c, 0x00, 0x00, 0xfc, 0x3f, 0x18, 0x00, 0x00, 0x1c, 0x00, 0x00, 0xf8, 
+0x3f, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf8, 0x3f, 0x0c, 0x00, 0x00, 
+0x08, 0x00, 0x00, 0xf8, 0x1f, 0x04, 0x00, 0x00, 0x18, 0x00, 0x00, 0xf0, 
+0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xe0, 
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/world/terra-29.xbm b/world/terra-29.xbm
new file mode 100644 (file)
index 0000000..6b6f8a2
--- /dev/null
@@ -0,0 +1,48 @@
+#define terra29_width 64
+#define terra29_height 64
+#define terra29_x_hot 32
+#define terra29_y_hot 32
+static char terra29_bits[] = {
+0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 
+0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xdf, 0x0f, 0x00, 0x00, 
+0x00, 0x00, 0x08, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 
+0xfb, 0xff, 0x00, 0x00, 0x00, 0x40, 0x00, 0x8c, 0xf9, 0xff, 0x03, 0x00, 
+0x00, 0x20, 0x00, 0xce, 0xff, 0xff, 0x07, 0x00, 0x00, 0x18, 0x00, 0xf8, 
+0xff, 0xff, 0x1f, 0x00, 0x00, 0x04, 0x00, 0xfc, 0xff, 0xff, 0x3f, 0x00, 
+0x00, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0f, 
+0xf9, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0x07, 0xda, 0xff, 0xff, 0x01, 
+0x00, 0x00, 0x80, 0x03, 0x90, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x7d, 
+0x00, 0xf8, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xf8, 0xff, 0x07, 
+0x00, 0x00, 0xc0, 0xff, 0xf3, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 
+0xff, 0xff, 0xfd, 0x0f, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0xf3, 0x1f, 
+0x00, 0x00, 0xf8, 0xff, 0xff, 0xef, 0x07, 0x1f, 0x00, 0x00, 0xfc, 0xff, 
+0xff, 0xef, 0x3f, 0x1e, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xdf, 0x3f, 0x1c, 
+0x00, 0x00, 0xfc, 0xff, 0xff, 0x9f, 0x3f, 0x18, 0x00, 0x00, 0xfc, 0xff, 
+0xff, 0xbf, 0x1f, 0x18, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0x0f, 0x18, 
+0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x03, 0x10, 0x00, 0x00, 0xfe, 0xff, 
+0xff, 0xff, 0x00, 0x10, 0x02, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0x00, 
+0x03, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x07, 0x00, 0x03, 0x00, 0xf0, 0xf3, 
+0xff, 0xff, 0x07, 0x00, 0x07, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00, 
+0x07, 0x00, 0x00, 0x80, 0xff, 0xff, 0x03, 0x00, 0x07, 0x00, 0x00, 0x80, 
+0xff, 0xff, 0x01, 0x00, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x00, 0x00, 
+0x3f, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 
+0xff, 0x7f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 
+0xff, 0x01, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 
+0xfe, 0x7f, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 
+0xfe, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x04, 0x00, 0xfe, 0x00, 0x00, 0x00, 
+0xff, 0x7f, 0x06, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x07, 0x00, 
+0xfc, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x03, 0x00, 0xfc, 0x00, 0x00, 0x00, 
+0xfe, 0x0f, 0x03, 0x00, 0xf8, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x01, 0x00, 
+0x78, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x01, 0x00, 0x70, 0x00, 0x00, 0x00, 
+0xfc, 0x03, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 
+0x60, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 
+0x78, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x03, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00};
diff --git a/worm.c b/worm.c
new file mode 100644 (file)
index 0000000..bc1ea66
--- /dev/null
+++ b/worm.c
@@ -0,0 +1,205 @@
+#ifndef lint
+static char sccsid[] = "@(#)worm.c 1.3 91/01/01 XLOCK";
+#endif
+/*-
+ * worm.c - draw wiggly worms.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ * 23-Sep-93: got rid of "rint". (David Bagley)
+ * 27-Sep-91: got rid of all malloc calls since there were no calls to free().
+ * 25-Sep-91: Integrated into X11R5 contrib xlock.
+ *
+ * Adapted from a concept in the Dec 87 issue of Scientific American.
+ *
+ * SunView version: Brad Taylor (brad@sun.com)
+ * X11 version: Dave Lemke (lemke@ncd.com)
+ * xlock version: Boris Putanec (bp@cs.brown.edu)
+ *
+ * This code is a static memory pig... like almost 200K... but as contributed
+ * it leaked at a massive rate, so I made everything static up front... feel
+ * free to contribute the proper memory management code.
+ * 
+ */
+
+#include       "xlock.h"
+#include       <math.h>
+
+#define MAXCOLORS 64
+#define MAXWORMS 64
+#define CIRCSIZE 2
+#define MAXWORMLEN 50
+
+#define SEGMENTS  36
+#define IRINT(x) ((int)(((x)>0.0)?(x)+0.5:(x)-0.5))
+
+static int  sintab[SEGMENTS];
+static int  costab[SEGMENTS];
+static int  init_table = 0;
+
+typedef struct {
+    int         xcirc[MAXWORMLEN];
+    int         ycirc[MAXWORMLEN];
+    int         dir;
+    int         tail;
+    int         x;
+    int         y;
+}           wormstuff;
+
+typedef struct {
+    int         xsize;
+    int         ysize;
+    int         wormlength;
+    unsigned long        monopix;
+    int         nc;
+    int         nw;
+    wormstuff   worm[MAXWORMS];
+    XRectangle  rects[MAXCOLORS][MAXWORMS];
+    int         size[MAXCOLORS];
+}           wormstruct;
+
+static wormstruct worms[MAXSCREENS];
+
+int
+round(x)
+    float       x;
+{
+    /*return ((int) rint ((double) x));*/
+    return IRINT((double) x);
+}
+
+
+void
+worm_doit(win, wp, which, color)
+    Window      win;
+    wormstruct *wp;
+    int         which;
+    unsigned long color;
+{
+    wormstuff  *ws = &wp->worm[which];
+    int         x, y;
+
+    ws->tail++;
+    if (ws->tail == wp->wormlength)
+       ws->tail = 0;
+
+    x = ws->xcirc[ws->tail];
+    y = ws->ycirc[ws->tail];
+    XClearArea(dsp, win, x, y, CIRCSIZE, CIRCSIZE, False);
+
+    if (random() & 1) {
+       ws->dir = (ws->dir + 1) % SEGMENTS;
+    } else {
+       ws->dir = (ws->dir + SEGMENTS - 1) % SEGMENTS;
+    }
+
+    x = (ws->x + costab[ws->dir] + wp->xsize) % wp->xsize;
+    y = (ws->y + sintab[ws->dir] + wp->ysize) % wp->ysize;
+
+    ws->xcirc[ws->tail] = x;
+    ws->ycirc[ws->tail] = y;
+    ws->x = x;
+    ws->y = y;
+
+    wp->rects[color][wp->size[color]].x = x;
+    wp->rects[color][wp->size[color]].y = y;
+    wp->size[color]++;
+}
+
+
+void
+initworm(win)
+    Window      win;
+{
+    int         i, j;
+    wormstruct *wp = &worms[screen];
+    XWindowAttributes xwa;
+
+    wp->nc = Scr[screen].npixels;
+    if (wp->nc > MAXCOLORS)
+       wp->nc = MAXCOLORS;
+
+    wp->nw = batchcount;
+    if (wp->nw > MAXWORMS)
+       wp->nw = MAXWORMS;
+
+    if (!init_table) {
+       init_table = 1;
+       for (i = 0; i < SEGMENTS; i++) {
+           sintab[i] = round(CIRCSIZE * sin(i * 2 * M_PI / SEGMENTS));
+           costab[i] = round(CIRCSIZE * cos(i * 2 * M_PI / SEGMENTS));
+       }
+    }
+    XGetWindowAttributes(dsp, win, &xwa);
+    wp->xsize = xwa.width;
+    wp->ysize = xwa.height;
+
+    if (xwa.width < 100) {
+       wp->monopix = BlackPixel(dsp, screen);
+       wp->wormlength = MAXWORMLEN / 10;
+    } else {
+       wp->monopix = WhitePixel(dsp, screen);
+       wp->wormlength = MAXWORMLEN;
+    }
+
+    for (i = 0; i < wp->nc; i++) {
+       for (j = 0; j < wp->nw / wp->nc + 1; j++) {
+           wp->rects[i][j].width = CIRCSIZE;
+           wp->rects[i][j].height = CIRCSIZE;
+       }
+    }
+    (void) memset(wp->size, 0, wp->nc * sizeof(int));
+
+    for (i = 0; i < wp->nw; i++) {
+       for (j = 0; j < wp->wormlength; j++) {
+           wp->worm[i].xcirc[j] = wp->xsize / 2;
+           wp->worm[i].ycirc[j] = wp->ysize / 2;
+       }
+       wp->worm[i].dir = (unsigned) random() % SEGMENTS;
+       wp->worm[i].tail = 0;
+       wp->worm[i].x = wp->xsize / 2;
+       wp->worm[i].y = wp->ysize / 2;
+    }
+
+    XClearWindow(dsp, win);
+}
+
+
+void
+drawworm(win)
+    Window      win;
+{
+    int         i;
+    wormstruct *wp = &worms[screen];
+    unsigned long wcolor;
+    static unsigned int chromo = 0;
+
+    (void) memset(wp->size, 0, wp->nc * sizeof(int));
+
+    for (i = 0; i < wp->nw; i++) {
+       if (!mono && wp->nc > 2) {
+           wcolor = (i + chromo) % wp->nc;
+
+           worm_doit(win, wp, i, wcolor);
+       } else
+           worm_doit(win, wp, i, (unsigned long) 0);
+    }
+
+    if (!mono && wp->nc > 2) {
+       for (i = 0; i < wp->nc; i++) {
+           XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[i]);
+           XFillRectangles(dsp, win, Scr[screen].gc, wp->rects[i],
+                           wp->size[i]);
+       }
+    } else {
+       XSetForeground(dsp, Scr[screen].gc, wp->monopix);
+       XFillRectangles(dsp, win, Scr[screen].gc, wp->rects[0],
+                       wp->size[0]);
+    }
+
+    if (++chromo == wp->nc)
+       chromo = 0;
+}
diff --git a/xlock.c b/xlock.c
new file mode 100644 (file)
index 0000000..b1782aa
--- /dev/null
+++ b/xlock.c
@@ -0,0 +1,946 @@
+#ifndef lint
+static char sccsid[] = "@(#)xlock.c    23.21 91/06/27 XLOCK";
+#endif
+/*-
+ * xlock.c - X11 client to lock a display and show a screen saver.
+ *
+ * Copyright (c) 1988-91 by Patrick J. Naughton.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind.  The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof.  In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * Revision History:
+ *
+ * Changes of David Bagley <bagleyd@source.asset.com>
+ * 11-Jul-94: added -inwindow option from Greg Bowering
+ *            <greg@cs.adelaide.edu.au>
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 10-Jun-94: patch for BSD from Victor Langeveld <vic@mbfys.kun.nl>
+ * 02-May-94: patched to work on Linux from Darren Senn's
+ *            (sinster@scintilla.capitola.ca.us) xlock for Linux.
+ *            Took out "bounce" since it was too buggy (maybe I will put
+ *            it back later).
+ * 21-Mar-94: patch to to trap Shift-Ctrl-Reset courtesy of Jamie Zawinski
+ *            <jwz@lucid.com>, patched the patch (my mistake) for AIXV3 and
+ *            HP from <R.K.Lloyd@csc.liv.ac.uk>.
+ * 01-Dec-93: added patch for AIXV3 from
+ *            (Tom McConnell, tmcconne@sedona.intel.com) also added a patch
+ *            for HP-UX 8.0.
+ * 29-Jul-93: "hyper", "helix", "rock", and "blot" (also tips on "maze") I
+ *            got courtesy of Jamie Zawinski <jwz@lucid.com>;
+ *            at the time I couldn't get his stuff to work for the hpux 8.0,
+ *            so I scrapped it but threw his stuff in xlock.
+ *            "maze" and "sphere" I got courtesy of Sun Microsystems. 
+ *            "spline" I got courtesy of Jef Poskanzer <jef@netcom.com or
+ *            jef@well.sf.ca.us>.
+ *
+ * Changes of Patrick J. Naughton
+ * 24-Jun-91: make foreground and background color get used on mono.
+ * 24-May-91: added -usefirst.
+ * 16-May-91: added pyro and random modes.
+ *           ripped big comment block out of all other files.
+ * 08-Jan-91: fix some problems with password entry.
+ *           removed renicing code.
+ * 29-Oct-90: added cast to XFree() arg.
+ *           added volume arg to call to XBell().
+ * 28-Oct-90: center prompt screen.
+ *           make sure Xlib input buffer does not use up all of swap.
+ *           make displayed text come from resource file for better I18N.
+ *           add backward compatible signal handlers for pre 4.1 machines.
+ * 31-Aug-90: added blank mode.
+ *           added swarm mode.
+ *           moved usleep() and seconds() out to usleep.c.
+ *           added SVR4 defines to xlock.h
+ * 29-Jul-90: added support for multiple screens to be locked by one xlock.
+ *           moved global defines to xlock.h
+ *           removed use of allowsig().
+ * 07-Jul-90: reworked commandline args and resources to use Xrm.
+ *           moved resource processing out to resource.c
+ * 02-Jul-90: reworked colors to not use dynamic colormap.
+ * 23-May-90: added autoraise when obscured.
+ * 15-Apr-90: added hostent alias searching for host authentication.
+ * 18-Feb-90: added SunOS3.5 fix.
+ *           changed -mono -> -color, and -saver -> -lock.
+ *           allow non-locking screensavers to display on remote machine.
+ *           added -echokeys to disable echoing of '?'s on input.
+ *           cleaned up all of the parameters and defaults.
+ * 20-Dec-89: added -xhost to allow access control list to be left alone.
+ *           added -screensaver (don't disable screen saver) for the paranoid.
+ *           Moved seconds() here from all of the display mode source files.
+ *           Fixed bug with calling XUngrabHosts() in finish().
+ * 19-Dec-89: Fixed bug in GrabPointer.
+ *           Changed fontname to XLFD style.
+ * 23-Sep-89: Added fix to allow local hostname:0 as a display.
+ *           Put empty case for Enter/Leave events.
+ *           Moved colormap installation later in startup.
+ * 20-Sep-89: Linted and made -saver mode grab the keyboard and mouse.
+ *           Replaced SunView code for life mode with Jim Graham's version,
+ *             so I could contrib it without legal problems.
+ *           Sent to expo for X11R4 contrib.
+ * 19-Sep-89: Added '?'s on input.
+ * 27-Mar-89: Added -qix mode.
+ *           Fixed GContext->GC.
+ * 20-Mar-89: Added backup font (fixed) if XQueryLoadFont() fails.
+ *           Changed default font to lucida-sans-24.
+ * 08-Mar-89: Added -nice, -mode and -display, built vector for life and hop.
+ * 24-Feb-89: Replaced hopalong display with life display from SunView1.
+ * 22-Feb-89: Added fix for color servers with n < 8 planes.
+ * 16-Feb-89: Updated calling conventions for XCreateHsbColormap();
+ *           Added -count for number of iterations per color.
+ *           Fixed defaulting mechanism.
+ *           Ripped out VMS hacks.
+ *           Sent to expo for X11R3 contrib.
+ * 15-Feb-89: Changed default font to pellucida-sans-18.
+ * 20-Jan-89: Added -verbose and fixed usage message.
+ * 19-Jan-89: Fixed monochrome gc bug.
+ * 16-Dec-88: Added SunView style password prompting.
+ * 19-Sep-88: Changed -color to -mono. (default is color on color displays).
+ *           Added -saver option. (just do display... don't lock.)
+ * 31-Aug-88: Added -time option.
+ *           Removed code for fractals to separate file for modularity.
+ *           Added signal handler to restore host access.
+ *           Installs dynamic colormap with a Hue Ramp.
+ *           If grabs fail then exit.
+ *           Added VMS Hacks. (password 'iwiwuu').
+ *           Sent to expo for X11R2 contrib.
+ * 08-Jun-88: Fixed root password pointer problem and changed PASSLENGTH to 20.
+ * 20-May-88: Added -root to allow root to unlock.
+ * 12-Apr-88: Added root password override.
+ *           Added screen saver override.
+ *           Removed XGrabServer/XUngrabServer.
+ *           Added access control handling instead.
+ * 01-Apr-88: Added XGrabServer/XUngrabServer for more security.
+ * 30-Mar-88: Removed startup password requirement.
+ *           Removed cursor to avoid phosphor burn.
+ * 27-Mar-88: Rotate fractal by 45 degrees clockwise.
+ * 24-Mar-88: Added color support. [-color]
+ *           wrote the man page.
+ * 23-Mar-88: Added HOPALONG routines from Scientific American Sept. 86 p. 14.
+ *           added password requirement for invokation
+ *           removed option for command line password
+ *           added requirement for display to be "unix:0".
+ * 22-Mar-88: Recieved Walter Milliken's comp.windows.x posting.
+ *
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#ifndef VMS
+#include <pwd.h>
+#endif
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <stdlib.h>
+#endif
+
+#include "xlock.h"
+#include <X11/cursorfont.h>
+#include <X11/Xatom.h>
+
+extern char *crypt();
+extern char *getenv();
+
+char       *ProgramName;       /* argv[0] */
+perscreen   Scr[MAXSCREENS];
+Display    *dsp = NULL;                /* server display connection */
+int         screen;            /* current screen */
+void        (*callback) () = NULL;
+void        (*init) () = NULL;
+
+static int  screens;           /* number of screens */
+static Window win[MAXSCREENS]; /* window used to cover screen */
+static Window icon[MAXSCREENS];        /* window used during password typein */
+static Window root[MAXSCREENS];        /* convenience pointer to the root window */
+static GC   textgc[MAXSCREENS];        /* graphics context used for text rendering */
+static long fgcol[MAXSCREENS]; /* used for text rendering */
+static long bgcol[MAXSCREENS]; /* background of text screen */
+static int  iconx[MAXSCREENS]; /* location of left edge of icon */
+static int  icony[MAXSCREENS]; /* location of top edge of icon */
+static Cursor mycursor;                /* blank cursor */
+static Pixmap lockc;
+static Pixmap lockm;           /* pixmaps for cursor and mask */
+static char no_bits[] = {0};   /* dummy array for the blank cursor */
+static int  passx;             /* position of the ?'s */
+static int  passy;
+static XFontStruct *font;
+static int  sstimeout;         /* screen saver parameters */
+static int  ssinterval;
+static int  ssblanking;
+static int  ssexposures;
+
+#define PASSLENGTH 20
+#define FALLBACK_FONTNAME      "fixed"
+#define ICONW                  64
+#define ICONH                  64
+
+#define AllPointerEventMask \
+       (ButtonPressMask | ButtonReleaseMask | \
+       EnterWindowMask | LeaveWindowMask | \
+       PointerMotionMask | PointerMotionHintMask | \
+       Button1MotionMask | Button2MotionMask | \
+       Button3MotionMask | Button4MotionMask | \
+       Button5MotionMask | ButtonMotionMask | \
+       KeymapStateMask)
+
+
+/* VARARGS1 */
+void
+error(s1, s2)
+    char       *s1, *s2;
+{
+    (void) fprintf(stderr, s1, ProgramName, s2);
+    exit(1);
+}
+
+/*
+ * Server access control support.
+ */
+
+static XHostAddress *XHosts;   /* the list of "friendly" client machines */
+static int  HostAccessCount;   /* the number of machines in XHosts */
+static Bool HostAccessState;   /* whether or not we even look at the list */
+
+static void
+XGrabHosts(display)
+    Display    *display;
+{
+    XHosts = XListHosts(display, &HostAccessCount, &HostAccessState);
+    if (XHosts)
+       XRemoveHosts(display, XHosts, HostAccessCount);
+    XEnableAccessControl(display);
+}
+
+static void
+XUngrabHosts(display)
+    Display    *display;
+{
+    if (XHosts) {
+       XAddHosts(display, XHosts, HostAccessCount);
+       XFree((char *) XHosts);
+    }
+    if (HostAccessState == False)
+       XDisableAccessControl(display);
+}
+
+
+/*
+ * Simple wrapper to get an asynchronous grab on the keyboard and mouse.
+ * If either grab fails, we sleep for one second and try again since some
+ * window manager might have had the mouse grabbed to drive the menu choice
+ * that picked "Lock Screen..".  If either one fails the second time we print
+ * an error message and exit.
+ */
+static void
+GrabKeyboardAndMouse()
+{
+    Status      status;
+
+    status = XGrabKeyboard(dsp, win[0], True,
+                          GrabModeAsync, GrabModeAsync, CurrentTime);
+    if (status != GrabSuccess) {
+       (void) sleep(1);
+       status = XGrabKeyboard(dsp, win[0], True,
+                              GrabModeAsync, GrabModeAsync, CurrentTime);
+
+       if (status != GrabSuccess)
+           error("%s: couldn't grab keyboard! (%d)\n", status);
+    }
+    status = XGrabPointer(dsp, win[0], True, AllPointerEventMask,
+                         GrabModeAsync, GrabModeAsync, None, mycursor,
+                         CurrentTime);
+    if (status != GrabSuccess) {
+       (void) sleep(1);
+       status = XGrabPointer(dsp, win[0], True, AllPointerEventMask,
+                             GrabModeAsync, GrabModeAsync, None, mycursor,
+                             CurrentTime);
+
+       if (status != GrabSuccess)
+           error("%s: couldn't grab pointer! (%d)\n", status);
+    }
+}
+
+
+/*
+ * Assuming that we already have an asynch grab on the pointer,
+ * just grab it again with a new cursor shape and ignore the return code.
+ */
+static void
+XChangeGrabbedCursor(cursor)
+    Cursor      cursor;
+{
+#ifndef DEBUG
+    if (!inwindow)
+      (void) XGrabPointer(dsp, win[0], True, AllPointerEventMask,
+                   GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime);
+#endif
+}
+
+
+/*
+ * Restore all grabs, reset screensaver, restore colormap, close connection.
+ */
+static void
+finish()
+{
+    XSync(dsp, False);
+    if (!nolock && !allowaccess)
+       XUngrabHosts(dsp);
+    XUngrabPointer(dsp, CurrentTime);
+    XUngrabKeyboard(dsp, CurrentTime);
+    if (!enablesaver)
+       XSetScreenSaver(dsp, sstimeout, ssinterval, ssblanking, ssexposures);
+    XFlush(dsp);
+    XCloseDisplay(dsp);
+}
+
+
+static int
+ReadXString(s, slen)
+    char       *s;
+    int         slen;
+{
+    XEvent      event;
+    char        keystr[20];
+    char        c;
+    int         i;
+    int         bp;
+    int         len;
+    int         thisscreen = screen;
+    char        pwbuf[PASSLENGTH];
+
+    for (screen = 0; screen < screens; screen++)
+       if (thisscreen == screen)
+           init(icon[screen]);
+       else
+           init(win[screen]);
+    bp = 0;
+    *s = 0;
+    while (True) {
+       unsigned long lasteventtime = seconds();
+       while (!XPending(dsp)) {
+           for (screen = 0; screen < screens; screen++)
+               if (thisscreen == screen)
+                   callback(icon[screen]);
+               else
+                   callback(win[screen]);
+           XFlush(dsp);
+           (void) usleep(delay);
+           if (seconds() - lasteventtime > timeout) {
+               screen = thisscreen;
+               return 1;
+           }
+       }
+       screen = thisscreen;
+       XNextEvent(dsp, &event);
+       switch (event.type) {
+       case KeyPress:
+           len = XLookupString((XKeyEvent *) & event, keystr, 20, NULL, NULL);
+           for (i = 0; i < len; i++) {
+               c = keystr[i];
+               switch (c) {
+               case 8: /* ^H */
+               case 127:       /* DEL */
+                   if (bp > 0)
+                       bp--;
+                   break;
+               case 10:        /* ^J */
+               case 13:        /* ^M */
+                   s[bp] = '\0';
+                   return 0;
+               case 21:        /* ^U */
+                   bp = 0;
+                   break;
+               default:
+                   s[bp] = c;
+                   if (bp < slen - 1)
+                       bp++;
+                   else
+                       XSync(dsp, True);       /* flush input buffer */
+               }
+           }
+           XSetForeground(dsp, Scr[screen].gc, bgcol[screen]);
+           if (echokeys) {
+               (void) memset(pwbuf, '?', slen);
+               XFillRectangle(dsp, win[screen], Scr[screen].gc,
+                              passx, passy - font->ascent,
+                              XTextWidth(font, pwbuf, slen),
+                              font->ascent + font->descent);
+               XDrawString(dsp, win[screen], textgc[screen],
+                           passx, passy, pwbuf, bp);
+           }
+           /*
+            * eat all events if there are more than enough pending... this
+            * keeps the Xlib event buffer from growing larger than all
+            * available memory and crashing xlock.
+            */
+           if (XPending(dsp) > 100) {  /* 100 is arbitrarily big enough */
+               register Status status;
+               do {
+                   status = XCheckMaskEvent(dsp,
+                                     KeyPressMask | KeyReleaseMask, &event);
+               } while (status);
+               XBell(dsp, 100);
+           }
+           break;
+
+       case ButtonPress:
+           if (((XButtonEvent *) & event)->window == icon[screen]) {
+               return 1;
+           }
+           break;
+
+       case VisibilityNotify:
+           if (event.xvisibility.state != VisibilityUnobscured) {
+#ifndef DEBUG
+                if (!inwindow)
+                 XRaiseWindow(dsp, win[screen]);
+#endif
+               s[0] = '\0';
+               return 1;
+           }
+           break;
+
+       case KeymapNotify:
+       case KeyRelease:
+       case ButtonRelease:
+       case MotionNotify:
+       case LeaveNotify:
+       case EnterNotify:
+       case NoExpose:
+           break;
+
+       default:
+           (void) fprintf(stderr, "%s: unexpected event: %d\n",
+                    ProgramName, event.type);
+           break;
+       }
+    }
+}
+
+
+
+static int
+getPassword()
+{
+#ifdef VMS
+#include <uaidef.h>
+#endif
+
+    char        buffer[PASSLENGTH];
+    char        userpass[PASSLENGTH];
+    char        rootpass[PASSLENGTH];
+    char       *user;
+    XWindowAttributes xgwa;
+    int         y, left, done;
+#ifdef VMS
+    char *root = "SYSTEM";
+    struct itmlst {
+      short buflen;
+      short code;
+      long  addr;
+      long  retadr;
+    };
+    struct itmlst il[4];
+    short uai_salt,root_salt;
+    char hash_password[9], hash_system[9],root_password[9],root_system[9];
+    char uai_encrypt,root_encrypt;
+    struct ascid {
+      short  len;
+      char dtype;
+      char class;
+      char *addr;
+    };
+    struct ascid username, password, rootuser;
+
+    user = cuserid(NULL);
+    il[0].buflen = 2;
+    il[0].code   = UAI$_SALT;
+    il[0].addr   = &uai_salt;
+    il[0].retadr = 0;
+    il[1].buflen = 8;
+    il[1].code   = UAI$_PWD;
+    il[1].addr   = &hash_password;
+    il[1].retadr = 0;
+    il[2].buflen = 1;
+    il[2].code   = UAI$_ENCRYPT;
+    il[2].addr   = &uai_encrypt;
+    il[2].retadr = 0;
+    il[3].buflen = 0;
+    il[3].code   = 0;
+    il[3].addr   = 0;
+    il[3].retadr = 0;
+    username.len   = strlen(user);
+    username.dtype = 0;
+    username.class = 0;
+    username.addr  = user;
+    sys$getuai(0,0,&username,&il,0,0,0);
+    il[0].buflen = 2;
+    il[0].code   = UAI$_SALT;
+    il[0].addr   = &root_salt;
+    il[0].retadr = 0;
+    il[1].buflen = 8;
+    il[1].code   = UAI$_PWD;
+    il[1].addr   = &root_password;
+    il[1].retadr = 0;
+    il[2].buflen = 1;
+    il[2].code   = UAI$_ENCRYPT;
+    il[2].addr   = &root_encrypt;
+    il[2].retadr = 0;
+    il[3].buflen = 0;
+    il[3].code   = 0;
+    il[3].addr   = 0;
+    il[3].retadr = 0;
+    rootuser.len   = strlen(root);
+    rootuser.dtype = 0;
+    rootuser.class = 0;
+    rootuser.addr  = root;
+    sys$getuai(0,0,&rootuser,&il,0,0,0);
+#else
+    struct passwd *pw;
+
+    pw = (struct passwd *)getpwnam("root");
+    (void) strcpy(rootpass, pw->pw_passwd);
+
+#ifdef SOLARIS_SHADOW
+    pw = (struct passwd *)getpwnam(cuserid(NULL));
+#else
+    pw = (struct passwd *)getpwuid(getuid());
+#endif
+#if defined(HAS_SHADOW) && defined(linux)
+   {
+     struct spwd *spw;
+
+     if ((spw = getspnam(pw->pw_name)) == NULL)
+       pw->pw_passwd = "";
+     else
+       pw->pw_passwd = spw->sp_pwdp;
+    }
+#endif
+    (void) strcpy(userpass, pw->pw_passwd);
+
+    user = pw->pw_name;
+#endif
+
+    XGetWindowAttributes(dsp, win[screen], &xgwa);
+
+    XChangeGrabbedCursor(XCreateFontCursor(dsp, XC_left_ptr));
+
+    XSetForeground(dsp, Scr[screen].gc, bgcol[screen]);
+    XFillRectangle(dsp, win[screen], Scr[screen].gc,
+                  0, 0, xgwa.width, xgwa.height);
+
+    XMapWindow(dsp, icon[screen]);
+    XRaiseWindow(dsp, icon[screen]);
+
+    left = iconx[screen] + ICONW + font->max_bounds.width;
+    y = icony[screen] + font->ascent;
+
+    XDrawString(dsp, win[screen], textgc[screen],
+               left, y, text_name, strlen(text_name));
+    XDrawString(dsp, win[screen], textgc[screen],
+               left + 1, y, text_name, strlen(text_name));
+    XDrawString(dsp, win[screen], textgc[screen],
+               left + XTextWidth(font, text_name, strlen(text_name)), y,
+               user, strlen(user));
+
+    y += font->ascent + font->descent + 2;
+    XDrawString(dsp, win[screen], textgc[screen],
+               left, y, text_pass, strlen(text_pass));
+    XDrawString(dsp, win[screen], textgc[screen],
+               left + 1, y, text_pass, strlen(text_pass));
+
+    passx = left + 1 + XTextWidth(font, text_pass, strlen(text_pass))
+       + XTextWidth(font, " ", 1);
+    passy = y;
+
+    y = icony[screen] + ICONH + font->ascent + 2;
+    XDrawString(dsp, win[screen], textgc[screen],
+               iconx[screen], y, text_info, strlen(text_info));
+
+    XFlush(dsp);
+
+    y += font->ascent + font->descent + 2;
+
+    done = False;
+    while (!done) {
+       if (ReadXString(buffer, PASSLENGTH))
+           break;
+
+       /*
+        * we don't allow for root to have no password, but we handle the case
+        * where the user has no password correctly; they have to hit return
+        * only
+        */
+#ifdef VMS
+        password.len   = strlen(&buffer);
+        password.dtype = 0;
+        password.class = 0;
+        password.addr  = &buffer;
+        str$upcase(&password,&password);
+        sys$hash_password(&password,uai_encrypt,uai_salt,
+                          &username,&hash_system);
+        sys$hash_password(&password,root_encrypt,root_salt,
+                          &rootuser,&root_system);
+        hash_password[8]=0;
+        hash_system[8]=0;
+        root_password[8]=0;
+        root_system[8]=0;
+        done = !((strcmp(hash_password,hash_system)) &&
+                 (!allowroot || strcmp(root_password,root_system)));
+#else
+#if defined(HAS_SHADOW) && defined(linux)
+        done = !((strcmp(pw_encrypt(buffer, userpass), userpass)) &&
+          (!allowroot || strcmp(pw_encrypt(buffer, rootpass), rootpass)));
+#else
+       done = !((strcmp(crypt(buffer, userpass), userpass)) &&
+          (!allowroot || strcmp(crypt(buffer, rootpass), rootpass)));
+#endif
+#endif
+       if (!done && !*buffer) {
+           /* just hit return, and it wasn't his password */
+           break;
+       }
+       if (!*userpass && *buffer) {
+           /*
+            * the user has no password, but something was typed anyway.
+            * sounds fishy: don't let him in...
+            */
+           done = False;
+       }
+       /* clear plaintext password so you can't grunge around /dev/kmem */
+       (void) memset(buffer, 0, sizeof(buffer));
+
+       XSetForeground(dsp, Scr[screen].gc, bgcol[screen]);
+
+       XFillRectangle(dsp, win[screen], Scr[screen].gc,
+                      iconx[screen], y - font->ascent,
+                      XTextWidth(font, text_invalid, strlen(text_invalid)),
+                      font->ascent + font->descent + 2);
+
+       XDrawString(dsp, win[screen], textgc[screen],
+                   iconx[screen], y, text_valid, strlen(text_valid));
+
+       if (done)
+           return 0;
+       else {
+           XSync(dsp, True);   /* flush input buffer */
+           (void) sleep(1);
+           XFillRectangle(dsp, win[screen], Scr[screen].gc,
+                          iconx[screen], y - font->ascent,
+                          XTextWidth(font, text_valid, strlen(text_valid)),
+                          font->ascent + font->descent + 2);
+           XDrawString(dsp, win[screen], textgc[screen],
+                       iconx[screen], y, text_invalid, strlen(text_invalid));
+           if (echokeys)       /* erase old echo */
+               XFillRectangle(dsp, win[screen], Scr[screen].gc,
+                              passx, passy - font->ascent,
+                              xgwa.width - passx,
+                              font->ascent + font->descent);
+       }
+    }
+    XChangeGrabbedCursor(mycursor);
+    XUnmapWindow(dsp, icon[screen]);
+    return 1;
+}
+
+
+static void
+justDisplay()
+{
+    XEvent      event;
+
+    for (screen = 0; screen < screens; screen++)
+       init(win[screen]);
+    do {
+       while (!XPending(dsp)) {
+           for (screen = 0; screen < screens; screen++)
+               callback(win[screen]);
+           XFlush(dsp);
+           (void) usleep(delay);
+       }
+       XNextEvent(dsp, &event);
+#ifndef DEBUG
+        if (!inwindow && event.type == VisibilityNotify)
+           XRaiseWindow(dsp, event.xany.window);
+#endif
+    } while (event.type != ButtonPress && event.type != KeyPress);
+    for (screen = 0; screen < screens; screen++)
+       if (event.xbutton.root == RootWindow(dsp, screen))
+           break;
+    if (usefirst)
+       XPutBackEvent(dsp, &event);
+}
+
+
+static void
+sigcatch()
+{
+    finish();
+    error("%s: caught terminate signal.\nAccess control list restored.\n");
+}
+
+
+static void
+lockDisplay()
+{
+    if (!allowaccess) {
+#if defined(SYSV) || defined(SVR4)
+       sigset_t    oldsigmask;
+       sigset_t    newsigmask;
+
+       sigemptyset(&newsigmask);
+       sigaddset(&newsigmask, SIGHUP);
+       sigaddset(&newsigmask, SIGINT);
+       sigaddset(&newsigmask, SIGQUIT);
+       sigaddset(&newsigmask, SIGTERM);
+       sigprocmask(SIG_BLOCK, &newsigmask, &oldsigmask);
+#else
+       int         oldsigmask;
+#ifndef VMS
+       oldsigmask = sigblock(sigmask(SIGHUP) |
+                             sigmask(SIGINT) |
+                             sigmask(SIGQUIT) |
+                             sigmask(SIGTERM));
+#endif
+#endif
+
+       (void) signal(SIGHUP, (void (*) ()) sigcatch);
+       (void) signal(SIGINT, (void (*) ()) sigcatch);
+       (void) signal(SIGQUIT, (void (*) ()) sigcatch);
+       (void) signal(SIGTERM, (void (*) ()) sigcatch);
+
+       XGrabHosts(dsp);
+
+#if defined(SYSV) || defined(SVR4)
+       (void) sigprocmask(SIG_SETMASK, &oldsigmask, &oldsigmask);
+#else
+       (void) sigsetmask(oldsigmask);
+#endif
+    }
+#ifdef __hpux
+       XHPDisableReset(dsp);
+#endif
+    do {
+       justDisplay();
+    } while (getPassword());
+#ifdef __hpux
+       XHPEnableReset(dsp);
+#endif
+}
+
+
+long
+allocpixel(cmap, name, def)
+    Colormap    cmap;
+    char       *name;
+    char       *def;
+{
+    XColor      col;
+    XColor      tmp;
+    XParseColor(dsp, cmap, name, &col);
+    if (!XAllocColor(dsp, cmap, &col)) {
+       (void) fprintf(stderr, "couldn't allocate: %s, using %s instead\n",
+                name, def);
+       XAllocNamedColor(dsp, cmap, def, &col, &tmp);
+    }
+    return col.pixel;
+}
+
+
+int
+main(argc, argv)
+    int         argc;
+    char       *argv[];
+{
+    XSetWindowAttributes xswa;
+    XGCValues   xgcv;
+    XColor      nullcolor;
+
+    ProgramName = strrchr(argv[0], '/');
+    if (ProgramName)
+       ProgramName++;
+    else
+       ProgramName = argv[0];
+
+    srandom(time((long *) 0)); /* random mode needs the seed set. */
+
+    GetResources(argc, argv);
+
+    CheckResources();
+
+    font = XLoadQueryFont(dsp, fontname);
+    if (font == NULL) {
+       (void) fprintf(stderr, "%s: can't find font: %s, using %s...\n",
+                ProgramName, fontname, FALLBACK_FONTNAME);
+       font = XLoadQueryFont(dsp, FALLBACK_FONTNAME);
+       if (font == NULL)
+           error("%s: can't even find %s!!!\n", FALLBACK_FONTNAME);
+    }
+    screens = ScreenCount(dsp);
+    if (screens > MAXSCREENS)
+       error("%s: can only support %d screens.\n", MAXSCREENS);
+    for (screen = 0; screen < screens; screen++) {
+       Screen     *scr = ScreenOfDisplay(dsp, screen);
+       Colormap    cmap = DefaultColormapOfScreen(scr);
+
+       root[screen] = RootWindowOfScreen(scr);
+        bgcol[screen] = allocpixel(cmap, background, "White");
+        fgcol[screen] = allocpixel(cmap, foreground, "Black");
+
+       if (mono || CellsOfScreen(scr) == 2) {
+           Scr[screen].pixels[0] = fgcol[screen];
+           Scr[screen].pixels[1] = bgcol[screen];
+           Scr[screen].npixels = 2;
+       } else {
+           int         colorcount = NUMCOLORS;
+           u_char      red[NUMCOLORS];
+           u_char      green[NUMCOLORS];
+           u_char      blue[NUMCOLORS];
+           int         i;
+
+           hsbramp(0.0, saturation, 1.0, 1.0, saturation, 1.0, colorcount,
+                   red, green, blue);
+           Scr[screen].npixels = 0;
+           for (i = 0; i < colorcount; i++) {
+               XColor      xcolor;
+
+               xcolor.red = red[i] << 8;
+               xcolor.green = green[i] << 8;
+               xcolor.blue = blue[i] << 8;
+               xcolor.flags = DoRed | DoGreen | DoBlue;
+
+               if (!XAllocColor(dsp, cmap, &xcolor))
+                   break;
+
+               Scr[screen].pixels[i] = xcolor.pixel;
+               Scr[screen].npixels++;
+           }
+           if (verbose)
+               (void) fprintf(stderr,
+                         "%d pixels allocated\n", Scr[screen].npixels);
+       }
+
+       xswa.override_redirect = True;
+       xswa.background_pixel = BlackPixelOfScreen(scr);
+       xswa.event_mask = KeyPressMask | ButtonPressMask | VisibilityChangeMask;
+
+#ifdef DEBUG
+#define WIDTH WidthOfScreen(scr) - 100
+#define HEIGHT HeightOfScreen(scr) - 100
+#define CWMASK CWBackPixel | CWEventMask
+#else
+#define WIDTH (inwindow? WidthOfScreen(scr)/2 : WidthOfScreen(scr))
+#define HEIGHT (inwindow? HeightOfScreen(scr)/2 : HeightOfScreen(scr))
+#define CWMASK ((inwindow? 0 : CWOverrideRedirect) | CWBackPixel | CWEventMask)
+#endif
+
+       win[screen] = XCreateWindow(dsp, root[screen], 0, 0, WIDTH, HEIGHT, 0,
+                                CopyFromParent, InputOutput, CopyFromParent,
+                                   CWMASK, &xswa);
+
+#ifdef DEBUG
+       {
+           XWMHints    xwmh;
+
+           xwmh.flags = InputHint;
+           xwmh.input = True;
+           XChangeProperty(dsp, win[screen],
+                           XA_WM_HINTS, XA_WM_HINTS, 32, PropModeReplace,
+                       (unsigned char *) &xwmh, sizeof(xwmh) / sizeof(int));
+       }
+#else
+        if (inwindow) {
+            XWMHints    xwmh;
+            xwmh.flags = InputHint;
+            xwmh.input = True;
+            XChangeProperty(dsp, win[screen],
+                            XA_WM_HINTS, XA_WM_HINTS, 32, PropModeReplace,
+                        (unsigned char *) &xwmh, sizeof(xwmh) / sizeof(int));
+        }
+#endif
+
+       iconx[screen] = (DisplayWidth(dsp, screen) -
+                        XTextWidth(font, text_info, strlen(text_info))) / 2;
+
+       icony[screen] = DisplayHeight(dsp, screen) / 6;
+
+       xswa.border_pixel = fgcol[screen];
+       xswa.background_pixel = bgcol[screen];
+       xswa.event_mask = ButtonPressMask;
+#define CIMASK CWBorderPixel | CWBackPixel | CWEventMask
+       icon[screen] = XCreateWindow(dsp, win[screen],
+                                    iconx[screen], icony[screen],
+                                    ICONW, ICONH, 1, CopyFromParent,
+                                    InputOutput, CopyFromParent,
+                                    CIMASK, &xswa);
+
+       XMapWindow(dsp, win[screen]);
+       XRaiseWindow(dsp, win[screen]);
+
+       xgcv.foreground = WhitePixelOfScreen(scr);
+       xgcv.background = BlackPixelOfScreen(scr);
+       Scr[screen].gc = XCreateGC(dsp, win[screen],
+                                  GCForeground | GCBackground, &xgcv);
+
+       xgcv.foreground = fgcol[screen];
+       xgcv.background = bgcol[screen];
+       xgcv.font = font->fid;
+       textgc[screen] = XCreateGC(dsp, win[screen],
+                               GCFont | GCForeground | GCBackground, &xgcv);
+    }
+    lockc = XCreateBitmapFromData(dsp, root[0], no_bits, 1, 1);
+    lockm = XCreateBitmapFromData(dsp, root[0], no_bits, 1, 1);
+    mycursor = XCreatePixmapCursor(dsp, lockc, lockm,
+                                  &nullcolor, &nullcolor, 0, 0);
+    XFreePixmap(dsp, lockc);
+    XFreePixmap(dsp, lockm);
+
+
+    if (!enablesaver) {
+       XGetScreenSaver(dsp, &sstimeout, &ssinterval,
+                       &ssblanking, &ssexposures);
+       XSetScreenSaver(dsp, 0, 0, 0, 0);       /* disable screen saver */
+    }
+#ifndef DEBUG
+    if (!inwindow)
+      GrabKeyboardAndMouse();
+#endif
+
+    (void) nice(nicelevel);
+
+    if (nolock)
+       justDisplay();
+    else
+       lockDisplay();
+
+    finish();
+
+#ifdef VMS
+    return 1;
+#else
+    return 0;
+#endif
+}
diff --git a/xlock.h b/xlock.h
new file mode 100644 (file)
index 0000000..78dddb4
--- /dev/null
+++ b/xlock.h
@@ -0,0 +1,139 @@
+/*-
+ * @(#)xlock.h 1.9 91/05/24 XLOCK
+ *
+ * xlock.h - external interfaces for new modes and SYSV OS defines.
+ *
+ * Copyright (c) 1991 by Patrick J. Naughton.
+ *
+ * See xlock.c for copying information.
+ *
+ * Revision History:
+ *
+ * Changes of David Bagley <bagleyd@source.asset.com>
+ * 11-Jul-94: added Bool flag: inwindow, which tells xlock to run in a
+ *            window from Greg Bowering <greg@cs.adelaide.edu.au>
+ * 11-Jul-94: patch for Solaris SYR4 from Chris P. Ross <cross@eng.umd.edu>
+ * 28-Jun-94: Reorganized shadow stuff
+ * 24-Jun-94: Reorganized
+ * 22-Jun-94: Modified for VMS
+ *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
+ * 17-Jun-94: patched shadow passwords and bcopy and bzero for SYSV from
+ *            <reggers@julian.uwo.ca>
+ * 21-Mar-94: patched the patch for AIXV3 and HP from
+ *            <R.K.Lloyd@csc.liv.ac.uk>.
+ * 01-Dec-93: added patch for AIXV3 from
+ *            (Tom McConnell, tmcconne@sedona.intel.com) also added a patch
+ *            for HP-UX 8.0.
+ *
+ */
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xos.h>
+
+#define MAXSCREENS 3
+#define NUMCOLORS 64
+
+#ifdef VMS
+typedef unsigned long u_long;
+typedef unsigned short u_short;
+typedef unsigned char u_char;
+#define M_PI    3.14159265358979323846
+#define M_PI_2  1.57079632679489661923
+#define M_PI_4  0.78539816339744830962
+#endif
+typedef struct {
+    GC          gc;            /* graphics context for animation */
+    int         npixels;       /* number of valid entries in pixels */
+    u_long      pixels[NUMCOLORS];     /* pixel values in the colormap */
+}           perscreen;
+
+extern perscreen Scr[MAXSCREENS];
+extern Display *dsp;
+extern int  screen;
+
+extern char *ProgramName;
+extern char *displayname;
+extern char *mode;
+extern char *fontname;
+extern char *background;
+extern char *foreground;
+extern char *text_name;
+extern char *text_pass;
+extern char *text_info;
+extern char *text_valid;
+extern char *text_invalid;
+extern float saturation;
+extern int  nicelevel;
+extern int delay;
+extern int  batchcount;
+extern int  reinittime;
+extern int  timeout;
+extern Bool usefirst;
+extern Bool mono;
+extern Bool nolock;
+extern Bool allowroot;
+extern Bool enablesaver;
+extern Bool allowaccess;
+extern Bool echokeys;
+extern Bool verbose;
+extern Bool inwindow;
+extern void (*callback) ();
+extern void (*init) ();
+
+extern void GetResources();
+extern void hsbramp();
+extern void error();
+extern long seconds();
+extern void usage();
+
+
+/* System V Release 4 redefinitions of BSD functions and structures */
+#if defined(SYSV) || defined(SVR4)
+
+#if defined(HAS_SHADOW) || defined(SOLARIS_SHADOW)
+#define passwd spwd
+#define pw_passwd sp_pwdp
+#include <shadow.h>
+#define getpwnam getspnam
+#ifdef SOLARIS_SHADOW
+#define pw_name sp_namp
+#endif
+#endif
+
+#include <sys/time.h>
+#ifndef __hpux
+#ifdef AIXV3
+#undef NULL
+#define NULL 0
+#include <sys/poll.h>
+struct passwd {
+        char    *pw_name;
+        char    *pw_passwd;
+        uid_t   pw_uid;
+        gid_t   pw_gid;
+        char    *pw_gecos;
+        char    *pw_dir;
+        char    *pw_shell;
+};
+#else
+#include <poll.h>
+#endif
+#endif
+#define srandom(a) srand(a)
+#define random() rand()
+#define MAXRAND (32767.0)
+
+#else
+
+#if defined(HAS_SHADOW)
+#include <shadow.h>
+#define passwd spwd
+#define pw_passwd sp_pwdp
+#define pw_name sp_namp
+#endif
+
+#define MAXRAND (2147483648.0)
+
+#endif
diff --git a/xlock.man b/xlock.man
new file mode 100644 (file)
index 0000000..5c398bd
--- /dev/null
+++ b/xlock.man
@@ -0,0 +1,434 @@
+.\" @(#)xlock.man      1.11 91/09/27; Copyright (c) 1991 - Patrick J. Naughton
+.\" xlockmore updates from David A. Bagley
+.TH XLOCK 1 "2 Sep 1994" "X11R6 Contrib"
+.SH NAME
+xlock \- Locks the local X display until a password is entered.
+
+.IX xlock#(1) "" "\fLxlock\fP(1)"
+.SH SYNOPSIS
+.B xlock
+[
+.BI \-display " dsp"
+]
+[
+.BI \-help
+]
+[
+.BI \-name "resource-name"
+]
+[
+.BI \-resources
+]
+[
+.BI -/+remote
+]
+[
+.BI -/+mono
+]
+[
+.BI -/+nolock
+]
+[
+.BI -/+allowroot
+]
+[
+.BI -/+enablesaver
+]
+[
+.BI -/+allowaccess
+]
+[
+.BI -/+echokeys
+]
+[
+.BI -/+usefirst
+]
+[
+.BI -/+v
+]
+[
+.BI -/+inwindow
+]
+[
+.BI \-delay " usecs"
+]
+[
+.BI \-batchcount " num"
+]
+[
+.BI \-nice " level"
+]
+[
+.BI \-timeout " seconds"
+]
+[
+.BI \-saturation " value"
+]
+[
+.BI \-font " fontname"
+]
+[
+.BI \-bg " color"
+]
+[
+.BI \-fg " color"
+]
+[
+.BI \-mode " mode"
+]
+[
+.BI \-username " textstring"
+]
+[
+.BI \-password " textstring"
+]
+[
+.BI \-info " textstring"
+]
+[
+.BI \-validate " textstring"
+]
+[
+.BI \-invalid " textstring"
+]
+
+.SH DESCRIPTION
+.B xlock
+locks the X server till the user enters their password at the keyboard.
+While
+.B xlock
+is running,
+all new server connections are refused.
+The screen saver is disabled.
+The mouse cursor is turned off.
+The screen is blanked and a changing pattern is put on the screen.
+If a key or a mouse button is pressed then the user is prompted for the
+password of the user who started
+.B xlock.
+
+If the correct password is typed, then the screen is unlocked and the X
+server is restored.  When typing the password Control-U and Control-H are
+active as kill and erase respectively.  To return to the locked screen,
+click in the small icon version of the changing pattern.
+
+.SH "NOTE ON ETIQUETTE"
+.I Xlock
+should not be used on public terminals when there is a high demand for them.
+
+If you find a public terminal that has been locked by another user and
+there are no other terminals available, and the terminal appears to have
+been left idle for a while (normally more than 15 minutes), it's fair to
+try to reset the session in some manner.
+
+.SH OPTIONS
+.TP 5
+.B \-display " dsp"
+The
+.I display
+option sets the X11 display to lock.
+.B xlock
+locks all available screens on a given server,
+and restricts you to locking only a local server such as
+.BI unix:0,
+.BI localhost:0,
+or
+.BI :0
+unless you set the
+.B \-remote
+option.
+.TP 5
+.B \-name " resource-name"
+.I resource-name
+is used instead of
+.B XLock
+when looking for resources to configure xlock.
+.TP 5
+.B \-mode " modename"
+As of this writing there are eight display modes supported
+(plus one more for random selection of one of the eight).
+.TP 8
+.B hop
+Hop mode shows the "real plane fractals" from the September 1986 issue of
+Scientific American.
+.TP 8
+.B life
+Life mode shows Conway's game of life.
+.TP 8
+.B qix
+Qix mode shows the spinning lines similar to the old video game
+by the same name.
+.TP 8
+.B swarm
+Swarm mode shows a swarm of bees following a wasp.
+.TP 8
+.B rotor
+Rotor mode shows a swirling rotorlike thing.
+.TP 8
+.B pyro
+Pyro mode shows fireworks.
+.TP 8
+.B flame
+Flame mode shows weird but cool cosmic flame fractals.
+.TP 8
+.B worm
+Worm mode shows wiggly worms...
+.TP 8
+.B spline
+Spline mode shows colorful moving splines, from spline fun #3.
+.TP 8
+.B maze
+Maze mode shows a random maze and a depth first search solution.
+.TP 8
+.B sphere
+Sphere mode draws a bunch of shaded spheres.
+.TP 8
+.B hyper
+Hyper mode draws a spinning tesseract in 4D space.
+.TP 8
+.B helix
+Helix mode shows string art.
+.TP 8
+.B rock
+Rock mode shows asteroid field with a twist.
+.TP 8
+.B blot
+Blot mode shows Rorschach's in blot test. (I always see a daemon,
+what does that mean?)
+.TP 8
+.B grav
+Grav mode shows orbiting planets.
+.TP 8
+.B bounce
+Bounce mode shows bouncing footballs.
+.TP 8
+.B world
+World mode makes the Earth spin.
+.TP 8
+.B rect
+Rect mode makes the stippled rectangles.
+.TP 8
+.B blank
+Blank mode shows nothing but a black screen.
+.TP 8
+.B random
+Random mode picks a random mode from all of the above except blank mode.
+
+.TP 5
+.B \-delay " usecs"
+The
+.I delay
+option sets the speed at which a mode will operate.  It simply sets the
+number of microseconds to delay between batches of "hopalong pixels",
+"qix lines", "life generations", "world blits", "swarm motions", etc.  In
+blank mode, it is important to set this to some small number of seconds,
+because the keyboard and mouse are only checked after each delay, so you
+cannot set the delay too high, but a delay of zero would needlessly
+consume cpu checking for mouse and keyboard input in a tight loop, since
+blank mode has no work to do.
+.TP 5
+.B \-batchcount " num"
+The
+.I batchcount
+option sets number of
+.I things
+to do per batch to
+.I num .
+In hop mode this refers to the number of pixels rendered in the same color.
+In life mode it is the number of generations to let each species live.
+In qix mode it is the number of lines rendered in the same color.
+In swarm mode it is the number of bees.
+In rotor mode it is the number of rotor thingys which whirr...
+In pyro mode it is the maximum number flying rockets at one time.
+In flame mode it is the number of levels to recurse (larger = more complex).
+In worm mode it is the number of worms.
+In spline mode it is the upper bound on the of points "splined".
+In maze mode it is the upper bound on the of size of the maze.
+In sphere mode it means nothing.
+In hyper mode it means nothing.
+In helix mode it means nothing.
+In rock mode it is the number of asteroids on the screen at once.
+In blot mode this refers to the number of pixels rendered in the same color.
+In grav mode it is the number of planets.
+In world mode it is the number of worlds.
+In rect mode it means nothing.
+In blank mode it means nothing.
+.TP 5
+.B \-nice " nicelevel"
+The
+.I nice
+option sets system nicelevel of the xlock process to
+.I nicelevel .
+.TP 5
+.B \-timeout " seconds"
+The
+.I timeout
+option sets the number of
+.I seconds
+before the password screen will time out.
+.TP 5
+.B \-saturation " value"
+The
+.I saturation
+option sets saturation of the color ramp used to
+.I value .
+0 is grayscale and 1 is very rich color.  0.4 is a nice pastel.
+.TP 5
+.B \-font " fontname"
+The
+.I font
+option sets the font to be used on the prompt screen.
+.TP 5
+.B \-fg " color"
+The
+.I fg
+option sets the color of the text on the password screen to
+.I color .
+.TP 5
+.B \-bg " color"
+The
+.I bg
+option sets the color of the background on the password screen to
+.I color .
+.TP 5
+.B \-username " textstring"
+.I textstring
+is shown in front of user name, defaults to "Name: ".
+.TP 5
+.B \-password " textstring"
+.I textstring
+is the password prompt string, defaults to "Password: ".
+.TP 5
+.B \-info " textstring"
+.I textstring
+is an informational message to tell the user what to do, defaults to
+"Enter password to unlock; select icon to lock.".
+.TP 5
+.BI \-validate " textstring"
+.I textstring
+.BI \-validate " message shown while validating the password, defaults to
+"Validating login..."
+.TP 5
+.BI \-invalid " textstring"
+.I textstring
+.BI \-invalid " message shown when password is invalid, defaults to
+"Invalid login."
+
+.TP 5
+.B \-resources
+The
+.I resources
+option prints the default resource file for xlock to standard output.
+.TP 5
+.B -/+remote
+The
+.I remote
+option tells xlock to not stop you from locking remote X11 servers.  This
+option should be used with care and is intended mainly to lock X11 terminals
+which cannot run
+.I xlock
+locally.  If you lock someone else's workstation, they will have to know
+.B your
+password to unlock it.
+.TP 5
+.B -/+mono
+The
+.I mono
+option causes xlock to display monochrome, (black and white) pixels rather
+than the default colored ones on color displays
+.TP 5
+.B +/-nolock
+The
+.I nolock
+option causes xlock to only draw the patterns and not lock the display.
+A keypress or a mouse click will terminate the screen saver.
+.TP 5
+.B -/+allowroot
+The
+.I allowroot
+option allows the root password to unlock the server as well as the user
+who started xlock.
+.TP 5
+.B -/+enablesaver
+By default xlock will disable the normal X server's screen saver since
+it is in effect a replacement for it.  Since it is possible to set delay
+parameters long enough to cause phosphor burn on some displays, this
+option will turn back on the default screensaver which is very careful
+to keep most of the screen black.
+.TP 5
+.B -/+allowaccess
+This option is required for servers which do not allow clients to modify
+the host access control list.  It is also useful if you need to run x
+clients on a server which is locked for some reason...  When allowaccess
+is true, the X11 server is left open for clients to attach and thus
+lowers the inherent security of this lockscreen.  A side effect of using
+this option is that if xlock is killed -KILL, the access control list is
+not lost.
+.TP 5
+.B -/+echokeys
+The
+.I echokeys
+option causes xlock to echo '?' characters for each key typed into the
+password prompt.  Some consider this a security risk, so the default is
+to not echo anything. 
+.TP 5
+.B -/+usefirst
+The
+.I usefirst
+option causes xlock to use the keystroke which got you to the password screen
+as the first character in the password.  The default is to ignore the first
+key pressed.
+.TP 5
+.B \-v
+Verbose mode, tells what options it is going to use.
+.TP 5
+.B \-inwindow
+Runs xlock in a window, so that you can inconify, move, or resize it and
+still use your screen for other stuff.  When running in a window, xlock no
+longer locks your screen, it just looks good.  It means you can now run
+multiple xlocks in different parts of your screen, but that would not be
+particularly 'nice'.
+
+.SH BUGS
+"kill -KILL
+.B xlock
+" causes the server that was locked to be unusable, since all hosts
+(including localhost) were removed from the access control list
+to lock out new X clients, and since xlock couldn't catch SIGKILL,
+it terminated before restoring the access control list.  This will
+leave the X server in a state where
+\fI"you can no longer connect to that server,
+and this operation cannot be reversed unless you reset the server."\fP
+               -From the X11R4 Xlib Documentation, Chapter 7.
+
+NCD terminals do not allow xlock to remove all the hosts from the access
+control list.  Therefore you will need to use the "-remote" and
+"-noaccess" switches.  If you happen to run without "-noaccess" on an
+NCD terminal,
+.B xlock
+won't work and you will need to reboot the terminal, or simply go into
+the SETUP menus, under 'Network Parameters', and turn off TCP/IP access
+control. 
+
+.SH SEE ALSO
+X(1), Xlib Documentation.
+.SH AUTHOR
+Maintained by:
+ David A. Bagley      (bagleyd@source.asset.com)
+ The latest version is currently at:
+ ftp.x.org in /contrib/applications/xlockmore-x.xx.tar.gz
+
+Original Author: 
+ Patrick J. Naughton    (naughton@eng.sun.com)
+ Mailstop 21-14
+ Sun Microsystems Laboratories, Inc.
+ Mountain View, CA  94043
+ 415/336-1080
+
+.SH COPYRIGHT
+Copyright (c) 1988-91 by Patrick J. Naughton
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation.