]> git.gir.st - minesVIiper.git/blob - schemes.h
add compile time flag 'FLAGALL_ON_CHOORD'
[minesVIiper.git] / schemes.h
1 /*
2 contains color/monchrome schemes for tty-mines.
3 */
4 #ifndef __SCHEMES_H__
5 #define __SCHEMES_H__
6
7 #define SGR(color, string) "\033[" color "m" string "\033[0m"
8 #define BOLD "1"
9 #define BLINK "5"
10 #define REV "7"
11 #define RED "31"
12 #define GREEN "32"
13 #define YELLOW "33"
14 #define BLUE "34"
15 #define CYAN "36"
16 #define GREY "37"
17 #define BRED "91"
18 #define BBLUE "94"
19 #define WHITE "97"
20
21 enum e_emoticons {
22 EMOT_SMILE,
23 EMOT_DEAD,
24 EMOT_WON,
25 EMOT_OHH,
26 NUM_EMOT,
27 };
28
29 enum e_border_lines {
30 B_TOP,
31 B_STATUS,
32 B_DIVIDER,
33 B_FIELD,
34 B_BOTTOM,
35 };
36 enum e_border_cols {
37 B_LEFT,
38 B_MIDDLE,
39 B_RIGHT,
40 };
41
42 struct minescheme {
43 char* number[9];
44 char* field_closed;
45 char* field_flagged;
46 char* field_question;
47 char* mine_normal;
48 char* mine_death;
49 char* mine_wrongf;
50 char* mine_wrongq;
51
52 char* emoticons[NUM_EMOT];
53
54 char* border[5][3];
55
56 int cell_width;
57 int display_width;
58 char* init_seq;
59 char* reset_seq;
60 };
61
62 struct minescheme symbols_mono = {
63 .number = {" ", "1", "2", "3", "4", "5", "6", "7", "8"},
64 .field_closed = "░░",
65 .field_flagged = "▕▀",
66 .field_question = "?",
67 .mine_normal = "*",
68 .mine_death = "#",
69 .mine_wrongf = "/",
70 .mine_wrongq = "\",
71
72 .emoticons = {":)", ":(", ":D", ":o"},
73
74 .border = {{"╔═","══","═╗"},
75 {"║ "," "," ║"},
76 {"╟─","──","─╢"},
77 {"║ "," "," ║"},
78 {"╚═","══","═╝"}},
79
80 .cell_width = 2,
81 .display_width = 2,
82 };
83
84 struct minescheme symbols_col1 = {
85 .number = {" ",
86 SGR(BBLUE, "1"),
87 SGR(GREEN, "2"),
88 SGR(RED, "3"),
89 SGR(BLUE, "4"),
90 SGR(YELLOW,"5"),
91 SGR(CYAN, "6"),
92 SGR(GREY, "7"),
93 SGR(WHITE, "8")},
94 .field_closed = "░░",
95 .field_flagged = SGR(GREY,"▕\033["BRED"m▀"),
96 .field_question = "?",
97 .mine_normal = "*",
98 .mine_death = SGR(RED,"*"),
99 .mine_wrongf = "/",
100 .mine_wrongq = "\",
101
102 .emoticons = {":)", ":(", ":D", ":o"},
103
104 .border = {{"╔═","══","═╗"},
105 {"║ "," "," ║"},
106 {"╟─","──","─╢"},
107 {"║ "," "," ║"},
108 {"╚═","══","═╝"}},
109
110 .cell_width = 2,
111 .display_width = 2,
112 };
113
114 struct minescheme symbols_doublewidth = {
115 /* for the vt220.
116 DEC Special Graphics Character Set:
117 http://vt100.net/docs/vt220-rm/table2-4.html
118 Dynamically Redefinable Character Set:
119 https://vt100.net/docs/vt220-rm/chapter4.html#S4.16 */
120 .number = {" ",
121 SGR(BOLD,"1"),
122 SGR(BOLD,"2"),
123 SGR(BOLD,"3"),
124 SGR(BOLD,"4"),
125 SGR(BOLD,"5"),
126 SGR(BOLD,"6"),
127 SGR(BOLD,"7"),
128 SGR(BOLD,"8")},
129 .field_closed = "\x61",
130 .field_flagged = SGR(BOLD,"\033O!"),
131 .field_question = SGR(BOLD,"?"),
132 .mine_normal = SGR(BOLD,"*"),
133 .mine_death = SGR(BOLD,"#"),
134 .mine_wrongf = SGR(BOLD,"/"),
135 .mine_wrongq = SGR(BOLD,"\\"),
136
137 .emoticons = {":)", ":(", ":D", ":\033No"},
138
139 .border = {{"\033#6\x6c","\x71","\x6b"},
140 {"\033#6\x78"," ","\x78"},
141 {"\033[?25l\033#6\x74","\x71","\x75"},
142 {"\033#6\x78"," ","\x78"},
143 {"\033#6\x6d","\x71","\x6a"}},
144
145 .cell_width = 1,
146 .display_width = 2,
147 /* NOTE: sending the DRCS makes the VT220 hang for a few seconds. Then
148 the input buffer will not be cleared to read the minefield afterwards */
149 .init_seq = "\033P0;1;0;4;1;1{P" /*config for DRCS "P": 7x10,erase-all*/
150 "??~^^^^/??N????\033\\" /* flag at '!' resembling ▕▀ */
151 "\033(0\033*B\033+P" /* G0=Graphics,G2=ASCII,G3="P" */
152 "\x0f" /* invoke G0 (locking shift) */
153 "\033[?3l", /* disable 132 column mode (DECCOLM) */
154 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
155 "\033[?3h", /* reenable DECCOLM (WARN: unconditionally!) */
156 };
157
158 #undef SGR
159 #undef BOLD
160 #undef BLINK
161 #undef RED
162 #undef GREEN
163 #undef YELLOW
164 #undef BLUE
165 #undef CYAN
166 #undef GREY
167 #undef BRED
168 #undef BBLUE
169 #undef WHITE
170 #endif
Imprint / Impressum