]> git.gir.st - VIper.git/blob - schemes.h
longhelp: add -l
[VIper.git] / schemes.h
1 #ifndef __SCHEMES_H__
2 #define __SCHEMES_H__
3
4 #include "viiper.h" /* for enum items */
5
6 #define BORDER_T 0
7 #define BORDER_C 1
8 #define BORDER_B 2
9 #define BORDER_S 3
10 #define BORDER_L 0
11 #define BORDER_R 2
12 //#define BORDER(v,h) op.sch->border[BORDER_ ## v][BORDER_ ## h]
13 #define BORDER(v,h) (g.b.a&&g.b.t==BONUS_WRAP?op.sch->permeable:op.sch->border) \
14 [BORDER_ ## v][BORDER_ ## h]
15
16 struct scheme {
17 char* border[4][3];
18 char* permeable[4][3]; /* for wrap-around mode */
19
20 char* snake[5][5]; /* [predecessor][successor] */
21 char* color[3]; /* 0=even, 1=odd, 2=head */
22
23 char* food[NUM_FOODS];
24 char* boni[NUM_BONI];
25
26 /* for en-/disabling e.g. DEC charset: */
27 char* init_seq;
28 char* reset_seq;
29
30 int cell_width; /* number of characters per cell */
31 int display_width; /* how wide a cell appears to be */
32 };
33
34 struct scheme unic0de = {
35 .border = {
36 {"╔", "══", "╗"},
37 {"║", " ", "║"},
38 {"╚", "══", "╝"},
39 { "╡","","╞" },
40 },
41 .permeable = {//┅╍
42 {"┏", "╍╍", "┓"},
43 {"┋", " ", "┋"},
44 {"┗", "╍╍", "┛"},
45 { "┥","","┝" },
46 },
47
48 .snake = { /* sorted like in the enum directions */
49 /*NOTE: same-to-same direction is for wrap-around*/
50 {/* NONE -> */
51 /*NONE */ "",
52 /*NORTH*/ "⢿⡿",
53 /*EAST */ "⢾⣿",
54 /*SOUTH*/ "⣾⣷",
55 /*WEST */ "⣿⡷",
56 },{/* NORTH -> */
57 /*NONE */ "⢇⡸",
58 /*NORTH*/ "⢇⠜",
59 /*EAST */ "⢇⣈",
60 /*SOUTH*/ "⡇⢸",
61 /*WEST */ "⣁⡸",
62 },{/* EAST -> */
63 /*NONE */ "⢎⣉",
64 /*NORTH*/ "⢇⣈",
65 /*EAST */ "⠪⣉",
66 /*SOUTH*/ "⡎⢉",
67 /*WEST */ "⣉⣉",
68 },{/* SOUTH -> */
69 /*NONE */ "⡎⢱",
70 /*NORTH*/ "⡇⢸",
71 /*EAST */ "⡎⢉",
72 /*SOUTH*/ "⡔⢱",
73 /*WEST */ "⡉⢱",
74 },{/* WEST -> */
75 /*NONE */ "⣉⡱",
76 /*NORTH*/ "⣁⡸",
77 /*EAST */ "⣉⣉",
78 /*SOUTH*/ "⡉⢱",
79 /*WEST */ "⣉⡢",
80 },
81 },
82 .color = {"32", "92", "92;1"},
83
84 .food = {
85 [FOOD_5] = "🍐",
86 [FOOD_10] = "🍎",
87 [FOOD_20] = "🥑",
88 },
89 .boni = {
90 [BONUS_SNIP] = "✂️ ",
91 [BONUS_GROW] = "🐍",
92 [BONUS_SLOW] = "🐌",
93 [BONUS_FAST] = "🐇",
94 [BONUS_WRAP] = "🧱",
95 },
96
97 .cell_width = 2,
98 .display_width = 2,
99 };
100
101 struct scheme vt220_charset = {
102 .border = {
103 {"\033#6\x6c","\x71","\x6b"},
104 {"\033#6\x78"," ","\x78"},
105 {"\033#6\x6d","\x71","\x6a"},
106 { "=","","=" },
107 },
108 .permeable = {//TODO: ascii-colons?
109 {"\033#6\x6c","\x71","\x6b"},
110 {"\033#6\x78"," ","\x78"},
111 {"\033#6\x6d","\x71","\x6a"},
112 { "=","","=" },
113 },
114
115 .snake = {
116 {"@","A",">","V","<"}, //head
117 {"#","#","#","#","#"},
118 {"#","#","#","#","#"},
119 {"#","#","#","#","#"},
120 {"#","#","#","#","#"},
121 },
122 .color = {"0", "0", "1"},
123
124 .food = { "$", "%", "&", },
125 .boni = { "\033Nx", "\033N|", "\033Ns", "\033Nf", "\033Nw", },
126
127 .init_seq = "\033(0\033*B\x0f" /* G0=Graphics, G2=ASCII, invoke G0 */
128 "\033[?3l", /* disable 132 column mode (DECCOLM) */
129 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
130 "\033[?3h", /* reenable DECCOLM (WARN: unconditionally!)*/
131
132 .cell_width = 1,
133 .display_width = 2,
134 };
135
136 #endif
Imprint / Impressum