ftp://ftp.smr.ru/pub/0/FreeBSD/releases/distfiles/xscreensaver-3.16.tar.gz
[xscreensaver] / hacks / automata.h
1 /* -*- Mode: C; tab-width: 4 -*- */
2 /*-
3  * automata.c - special stuff for automata modes
4  *
5  * Copyright (c) 1995 by David Bagley.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation for any purpose and without fee is hereby granted,
9  * provided that the above copyright notice appear in all copies and that
10  * both that copyright notice and this permission notice appear in
11  * supporting documentation.
12  *
13  * This file is provided AS IS with no warranties of any kind.  The author
14  * shall have no liability with respect to the infringement of copyrights,
15  * trade secrets or any patents by this file or any part thereof.  In no
16  * event will the author be liable for any lost revenue or profits or
17  * other special, indirect and consequential damages.
18  */
19
20 #define NUMSTIPPLES 11
21 #define STIPPLESIZE 8
22
23 static XPoint hexagonUnit[6] =
24 {
25         {0, 0},
26         {1, 1},
27         {0, 2},
28         {-1, 1},
29         {-1, -1},
30         {0, -2}
31 };
32
33 static XPoint triangleUnit[2][3] =
34 {
35         {
36                 {0, 0},
37                 {1, -1},
38                 {0, 2}
39         },
40         {
41                 {0, 0},
42                 {-1, 1},
43                 {0, -2}
44         }
45 };
46
47
48 static unsigned char stipples[NUMSTIPPLES][STIPPLESIZE] =
49 {
50         {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},       /* white */
51         {0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22},       /* grey+white | stripe */
52         {0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00},       /* spots */
53         {0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11},       /* lt. / stripe */
54         {0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66},       /* | bars */
55         {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa},       /* 50% grey */
56         {0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00},       /* - bars */
57         {0xee, 0xdd, 0xbb, 0x77, 0xee, 0xdd, 0xbb, 0x77},       /* dark \ stripe */
58         {0xff, 0x99, 0x99, 0xff, 0xff, 0x99, 0x99, 0xff},       /* spots */
59         {0xaa, 0xff, 0xff, 0x55, 0xaa, 0xff, 0xff, 0x55},       /* black+grey - stripe */
60         {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}        /* black */
61 };