drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / payloads / libpayload / curses / PDCurses / demos / xmas.c
blob706858a5aa9809d4d637e3783a7f96ca8dda71af
1 /******************************************************************************/
2 /* asciixmas */
3 /* December 1989 Larry Bartz Indianapolis, IN */
4 /* */
5 /* */
6 /* I'm dreaming of an ascii character-based monochrome Christmas, */
7 /* Just like the one's I used to know! */
8 /* Via a full duplex communications channel, */
9 /* At 9600 bits per second, */
10 /* Even though it's kinda slow. */
11 /* */
12 /* I'm dreaming of an ascii character-based monochrome Christmas, */
13 /* With ev'ry C program I write! */
14 /* May your screen be merry and bright! */
15 /* And may all your Christmases be amber or green, */
16 /* (for reduced eyestrain and improved visibility)! */
17 /* */
18 /* */
19 /* */
20 /* IMPLEMENTATION */
21 /* */
22 /* Feel free to modify the defined string FROMWHO to reflect you, your */
23 /* organization, your site, whatever. */
24 /* */
25 /* This looks a lot better if you can turn off your cursor before execution. */
26 /* The cursor is distracting but it doesn't really ruin the show. */
27 /* */
28 /* At our site, we invoke this for our users just after login and the */
29 /* determination of terminal type. */
30 /* */
31 /* */
32 /* PORTABILITY */
33 /* */
34 /* I wrote this using only the very simplest curses functions so that it */
35 /* might be the most portable. I was personally able to test on five */
36 /* different cpu/UNIX combinations. */
37 /* */
38 /* */
39 /* COMPILE */
40 /* */
41 /* usually this: */
42 /* */
43 /* cc -O xmas.c -lcurses -o xmas -s */
44 /* */
45 /******************************************************************************/
47 /* $Id: xmas.c,v 1.29 2008/07/13 16:08:17 wmcbrine Exp $ */
49 #include <curses.h>
50 #include <signal.h>
52 void lil(WINDOW *);
53 void midtop(WINDOW *);
54 void bigtop(WINDOW *);
55 void bigface(WINDOW *, chtype);
56 void legs1(WINDOW *);
57 void legs2(WINDOW *);
58 void legs3(WINDOW *);
59 void legs4(WINDOW *);
60 void initdeer(void);
61 void boxit(void);
62 void seas(void);
63 void greet(void);
64 void fromwho(void);
65 void del_msg(void);
66 void tree(void);
67 void balls(void);
68 void star(void);
69 void strng1(void);
70 void strng2(void);
71 void strng3(void);
72 void strng4(void);
73 void strng5(void);
74 void blinkit(void);
75 void reindeer(void);
77 #define FROMWHO "From Larry Bartz, Mark Hessling and William McBrine"
79 int y_pos, x_pos;
81 WINDOW *treescrn, *treescrn2, *treescrn3, *treescrn4, *treescrn5,
82 *treescrn6, *treescrn7, *treescrn8, *dotdeer0, *stardeer0,
83 *lildeer0, *lildeer1, *lildeer2, *lildeer3, *middeer0,
84 *middeer1, *middeer2, *middeer3, *bigdeer0, *bigdeer1,
85 *bigdeer2, *bigdeer3, *bigdeer4, *lookdeer0, *lookdeer1,
86 *lookdeer2, *lookdeer3, *lookdeer4, *w_holiday, *w_del_msg;
88 int main(int argc, char **argv)
90 int loopy;
92 #ifdef XCURSES
93 Xinitscr(argc, argv);
94 #else
95 initscr();
96 #endif
97 nodelay(stdscr, TRUE);
98 noecho();
99 nonl();
100 refresh();
102 #ifdef A_COLOR
103 if (has_colors())
104 start_color();
105 #endif
106 curs_set(0);
108 treescrn = newwin(16, 27, 3, 53);
109 treescrn2 = newwin(16, 27, 3, 53);
110 treescrn3 = newwin(16, 27, 3, 53);
111 treescrn4 = newwin(16, 27, 3, 53);
112 treescrn5 = newwin(16, 27, 3, 53);
113 treescrn6 = newwin(16, 27, 3, 53);
114 treescrn7 = newwin(16, 27, 3, 53);
115 treescrn8 = newwin(16, 27, 3, 53);
117 w_holiday = newwin(1, 26, 3, 27);
119 w_del_msg = newwin(1, 12, 23, 60);
121 mvwaddstr(w_holiday, 0, 0, "H A P P Y H O L I D A Y S");
123 initdeer();
125 clear();
126 werase(treescrn);
127 touchwin(treescrn);
128 werase(treescrn2);
129 touchwin(treescrn2);
130 werase(treescrn8);
131 touchwin(treescrn8);
132 refresh();
133 napms(1000);
135 boxit();
136 del_msg();
137 napms(1000);
139 seas();
140 del_msg();
141 napms(1000);
143 greet();
144 del_msg();
145 napms(1000);
147 fromwho();
148 del_msg();
149 napms(1000);
151 tree();
152 napms(1000);
154 balls();
155 napms(1000);
157 star();
158 napms(1000);
160 strng1();
161 strng2();
162 strng3();
163 strng4();
164 strng5();
166 /* set up the windows for our blinking trees */
167 /* **************************************** */
168 /* treescrn3 */
170 overlay(treescrn, treescrn3);
172 /* balls */
173 mvwaddch(treescrn3, 4, 18, ' ');
174 mvwaddch(treescrn3, 7, 6, ' ');
175 mvwaddch(treescrn3, 8, 19, ' ');
176 mvwaddch(treescrn3, 11, 22, ' ');
178 /* star */
179 mvwaddch(treescrn3, 0, 12, '*');
181 /* strng1 */
182 mvwaddch(treescrn3, 3, 11, ' ');
184 /* strng2 */
185 mvwaddch(treescrn3, 5, 13, ' ');
186 mvwaddch(treescrn3, 6, 10, ' ');
188 /* strng3 */
189 mvwaddch(treescrn3, 7, 16, ' ');
190 mvwaddch(treescrn3, 7, 14, ' ');
192 /* strng4 */
193 mvwaddch(treescrn3, 10, 13, ' ');
194 mvwaddch(treescrn3, 10, 10, ' ');
195 mvwaddch(treescrn3, 11, 8, ' ');
197 /* strng5 */
198 mvwaddch(treescrn3, 11, 18, ' ');
199 mvwaddch(treescrn3, 12, 13, ' ');
201 /* treescrn4 */
203 overlay(treescrn, treescrn4);
205 /* balls */
206 mvwaddch(treescrn4, 3, 9, ' ');
207 mvwaddch(treescrn4, 4, 16, ' ');
208 mvwaddch(treescrn4, 7, 6, ' ');
209 mvwaddch(treescrn4, 8, 19, ' ');
210 mvwaddch(treescrn4, 11, 2, ' ');
211 mvwaddch(treescrn4, 12, 23, ' ');
213 /* star */
214 mvwaddch(treescrn4, 0, 12, '*' | A_STANDOUT);
216 /* strng1 */
217 mvwaddch(treescrn4, 3, 13, ' ');
219 /* strng2 */
221 /* strng3 */
222 mvwaddch(treescrn4, 7, 15, ' ');
223 mvwaddch(treescrn4, 8, 11, ' ');
225 /* strng4 */
226 mvwaddch(treescrn4, 9, 16, ' ');
227 mvwaddch(treescrn4, 10, 12, ' ');
228 mvwaddch(treescrn4, 11, 8, ' ');
230 /* strng5 */
231 mvwaddch(treescrn4, 11, 18, ' ');
232 mvwaddch(treescrn4, 12, 14, ' ');
234 /* treescrn5 */
236 overlay(treescrn, treescrn5);
238 /* balls */
239 mvwaddch(treescrn5, 3, 15, ' ');
240 mvwaddch(treescrn5, 10, 20, ' ');
241 mvwaddch(treescrn5, 12, 1, ' ');
243 /* star */
244 mvwaddch(treescrn5, 0, 12, '*');
246 /* strng1 */
247 mvwaddch(treescrn5, 3, 11, ' ');
249 /* strng2 */
250 mvwaddch(treescrn5, 5, 12, ' ');
252 /* strng3 */
253 mvwaddch(treescrn5, 7, 14, ' ');
254 mvwaddch(treescrn5, 8, 10, ' ');
256 /* strng4 */
257 mvwaddch(treescrn5, 9, 15, ' ');
258 mvwaddch(treescrn5, 10, 11, ' ');
259 mvwaddch(treescrn5, 11, 7, ' ');
261 /* strng5 */
262 mvwaddch(treescrn5, 11, 17, ' ');
263 mvwaddch(treescrn5, 12, 13, ' ');
265 /* treescrn6 */
267 overlay(treescrn, treescrn6);
269 /* balls */
270 mvwaddch(treescrn6, 6, 7, ' ');
271 mvwaddch(treescrn6, 7, 18, ' ');
272 mvwaddch(treescrn6, 10, 4, ' ');
273 mvwaddch(treescrn6, 11, 23, ' ');
275 /* star */
276 mvwaddch(treescrn6, 0, 12, '*' | A_STANDOUT);
278 /* strng1 */
280 /* strng2 */
281 mvwaddch(treescrn6, 5, 11, ' ');
283 /* strng3 */
284 mvwaddch(treescrn6, 7, 13, ' ');
285 mvwaddch(treescrn6, 8, 9, ' ');
287 /* strng4 */
288 mvwaddch(treescrn6, 9, 14, ' ');
289 mvwaddch(treescrn6, 10, 10, ' ');
290 mvwaddch(treescrn6, 11, 6, ' ');
292 /* strng5 */
293 mvwaddch(treescrn6, 11, 16, ' ');
294 mvwaddch(treescrn6, 12, 12, ' ');
296 /* treescrn7 */
298 overlay(treescrn, treescrn7);
300 /* balls */
301 mvwaddch(treescrn7, 3, 15, ' ');
302 mvwaddch(treescrn7, 6, 7, ' ');
303 mvwaddch(treescrn7, 7, 18, ' ');
304 mvwaddch(treescrn7, 10, 4, ' ');
305 mvwaddch(treescrn7, 11, 22, ' ');
307 /* star */
308 mvwaddch(treescrn7, 0, 12, '*');
310 /* strng1 */
311 mvwaddch(treescrn7, 3, 12, ' ');
313 /* strng2 */
314 mvwaddch(treescrn7, 5, 13, ' ');
315 mvwaddch(treescrn7, 6, 9, ' ');
317 /* strng3 */
318 mvwaddch(treescrn7, 7, 15, ' ');
319 mvwaddch(treescrn7, 8, 11, ' ');
321 /* strng4 */
322 mvwaddch(treescrn7, 9, 16, ' ');
323 mvwaddch(treescrn7, 10, 12, ' ');
324 mvwaddch(treescrn7, 11, 8, ' ');
326 /* strng5 */
327 mvwaddch(treescrn7, 11, 18, ' ');
328 mvwaddch(treescrn7, 12, 14, ' ');
330 napms(1000);
331 reindeer();
333 touchwin(w_holiday);
334 wrefresh(w_holiday);
335 wrefresh(w_del_msg);
337 napms(1000);
339 for (loopy = 0; loopy < 50; loopy++)
340 blinkit();
342 clear();
343 refresh();
344 endwin();
346 return 0;
349 void lil(WINDOW *win)
351 mvwaddch(win, 0, 0, (chtype) 'V');
352 mvwaddch(win, 1, 0, (chtype) '@');
353 mvwaddch(win, 1, 3, (chtype) '~');
356 void midtop(WINDOW *win)
358 mvwaddstr(win, 0, 2, "yy");
359 mvwaddstr(win, 1, 2, "0(=)~");
362 void bigtop(WINDOW *win)
364 mvwaddstr(win, 0, 17, "\\/");
365 mvwaddstr(win, 0, 20, "\\/");
366 mvwaddch(win, 1, 18, (chtype) '\\');
367 mvwaddch(win, 1, 20, (chtype) '/');
368 mvwaddstr(win, 2, 19, "|_");
369 mvwaddstr(win, 3, 18, "/^0\\");
370 mvwaddstr(win, 4, 17, "//\\");
371 mvwaddch(win, 4, 22, (chtype) '\\');
372 mvwaddstr(win, 5, 7, "^~~~~~~~~// ~~U");
375 void bigface(WINDOW *win, chtype noseattr)
377 mvwaddstr(win, 0, 16, "\\/ \\/");
378 mvwaddstr(win, 1, 17, "\\Y/ \\Y/");
379 mvwaddstr(win, 2, 19, "\\=/");
380 mvwaddstr(win, 3, 17, "^\\o o/^");
381 mvwaddstr(win, 4, 17, "//( )");
382 mvwaddstr(win, 5, 7, "^~~~~~~~~// \\");
383 waddch(win, 'O' | noseattr);
384 waddstr(win, "/");
387 void legs1(WINDOW *win)
389 mvwaddstr(win, 6, 7, "( \\_____( /");
390 mvwaddstr(win, 7, 8, "( ) /");
391 mvwaddstr(win, 8, 9, "\\\\ /");
392 mvwaddstr(win, 9, 11, "\\>/>");
395 void legs2(WINDOW *win)
397 mvwaddstr(win, 6, 7, "(( )____( /");
398 mvwaddstr(win, 7, 7, "( / |");
399 mvwaddstr(win, 8, 8, "\\/ |");
400 mvwaddstr(win, 9, 9, "|> |>");
403 void legs3(WINDOW *win)
405 mvwaddstr(win, 6, 6, "( ()_____( /");
406 mvwaddstr(win, 7, 6, "/ / /");
407 mvwaddstr(win, 8, 5, "|/ \\");
408 mvwaddstr(win, 9, 5, "/> \\>");
411 void legs4(WINDOW *win)
413 mvwaddstr(win, 6, 6, "( )______( /");
414 mvwaddstr(win, 7, 5, "(/ \\");
415 mvwaddstr(win, 8, 0, "v___= ----^");
418 void initdeer(void)
420 chtype noseattr;
422 #ifdef A_COLOR
423 if (has_colors())
425 init_pair(31, COLOR_RED, COLOR_BLACK);
426 noseattr = COLOR_PAIR(31);
428 else
429 #endif
430 noseattr = A_NORMAL;
432 /* set up the windows for our various reindeer */
434 dotdeer0 = newwin(3, 71, 0, 8);
435 stardeer0 = newwin(4, 56, 0, 8);
436 lildeer0 = newwin(7, 54, 0, 8);
437 middeer0 = newwin(15, 42, 0, 8);
438 bigdeer0 = newwin(10, 23, 0, 0);
439 lookdeer0 = newwin(10, 25, 0, 0);
441 /* lildeer1 */
442 lildeer1 = newwin(2, 4, 0, 0);
443 lil(lildeer1);
444 mvwaddstr(lildeer1, 1, 1, "<>");
446 /* lildeer2 */
447 lildeer2 = newwin(2, 4, 0, 0);
448 lil(lildeer2);
449 mvwaddstr(lildeer2, 1, 1, "||");
451 /* lildeer3 */
452 lildeer3 = newwin(2, 4, 0, 0);
453 lil(lildeer3);
454 mvwaddstr(lildeer3, 1, 1, "><");
456 /* middeer1 */
457 middeer1 = newwin(3, 7, 0, 0);
458 midtop(middeer1);
459 mvwaddstr(middeer1, 2, 3, "\\/");
461 /* middeer2 */
462 middeer2 = newwin(3, 7, 0, 0);
463 midtop(middeer2);
464 mvwaddch(middeer2, 2, 3, (chtype) '|');
465 mvwaddch(middeer2, 2, 5, (chtype) '|');
467 /* middeer3 */
468 middeer3 = newwin(3, 7, 0, 0);
469 midtop(middeer3);
470 mvwaddch(middeer3, 2, 2, (chtype) '/');
471 mvwaddch(middeer3, 2, 6, (chtype) '\\');
473 /* bigdeer1 */
474 bigdeer1 = newwin(10, 23, 0, 0);
475 bigtop(bigdeer1);
476 legs1(bigdeer1);
478 /* bigdeer2 */
479 bigdeer2 = newwin(10, 23, 0, 0);
480 bigtop(bigdeer2);
481 legs2(bigdeer2);
483 /* bigdeer3 */
484 bigdeer3 = newwin(10, 23, 0, 0);
485 bigtop(bigdeer3);
486 legs3(bigdeer3);
488 /* bigdeer4 */
489 bigdeer4 = newwin(10, 23, 0, 0);
490 bigtop(bigdeer4);
491 legs4(bigdeer4);
493 /* lookdeer1 */
494 lookdeer1 = newwin(10, 25, 0, 0);
495 bigface(lookdeer1, noseattr);
496 legs1(lookdeer1);
498 /* lookdeer2 */
499 lookdeer2 = newwin(10, 25, 0, 0);
500 bigface(lookdeer2, noseattr);
501 legs2(lookdeer2);
503 /* lookdeer3 */
504 lookdeer3 = newwin(10, 25, 0, 0);
505 bigface(lookdeer3, noseattr);
506 legs3(lookdeer3);
508 /* lookdeer4 */
509 lookdeer4 = newwin(10, 25, 0, 0);
510 bigface(lookdeer4, noseattr);
511 legs4(lookdeer4);
514 void boxit(void)
516 int x;
518 for (x = 0; x < 20; ++x)
519 mvaddch(x, 7, '|');
521 for (x = 0; x < 80; ++x)
523 if (x > 7)
524 mvaddch(19, x, '_');
526 mvaddch(22, x, '_');
530 void seas(void)
532 mvaddch(4, 1, 'S');
533 mvaddch(6, 1, 'E');
534 mvaddch(8, 1, 'A');
535 mvaddch(10, 1, 'S');
536 mvaddch(12, 1, 'O');
537 mvaddch(14, 1, 'N');
538 mvaddch(16, 1, '`');
539 mvaddch(18, 1, 'S');
542 void greet(void)
544 mvaddch(3, 5, 'G');
545 mvaddch(5, 5, 'R');
546 mvaddch(7, 5, 'E');
547 mvaddch(9, 5, 'E');
548 mvaddch(11, 5, 'T');
549 mvaddch(13, 5, 'I');
550 mvaddch(15, 5, 'N');
551 mvaddch(17, 5, 'G');
552 mvaddch(19, 5, 'S');
555 void fromwho(void)
557 mvaddstr(21, 13, FROMWHO);
560 void del_msg(void)
562 refresh();
565 void tree(void)
567 #ifdef A_COLOR
568 if (has_colors())
570 init_pair(30, COLOR_GREEN, COLOR_BLACK);
571 wattrset(treescrn, COLOR_PAIR(30));
573 #endif
574 mvwaddch(treescrn, 1, 11, (chtype) '/');
575 mvwaddch(treescrn, 2, 11, (chtype) '/');
576 mvwaddch(treescrn, 3, 10, (chtype) '/');
577 mvwaddch(treescrn, 4, 9, (chtype) '/');
578 mvwaddch(treescrn, 5, 9, (chtype) '/');
579 mvwaddch(treescrn, 6, 8, (chtype) '/');
580 mvwaddch(treescrn, 7, 7, (chtype) '/');
581 mvwaddch(treescrn, 8, 6, (chtype) '/');
582 mvwaddch(treescrn, 9, 6, (chtype) '/');
583 mvwaddch(treescrn, 10, 5, (chtype) '/');
584 mvwaddch(treescrn, 11, 3, (chtype) '/');
585 mvwaddch(treescrn, 12, 2, (chtype) '/');
587 mvwaddch(treescrn, 1, 13, (chtype) '\\');
588 mvwaddch(treescrn, 2, 13, (chtype) '\\');
589 mvwaddch(treescrn, 3, 14, (chtype) '\\');
590 mvwaddch(treescrn, 4, 15, (chtype) '\\');
591 mvwaddch(treescrn, 5, 15, (chtype) '\\');
592 mvwaddch(treescrn, 6, 16, (chtype) '\\');
593 mvwaddch(treescrn, 7, 17, (chtype) '\\');
594 mvwaddch(treescrn, 8, 18, (chtype) '\\');
595 mvwaddch(treescrn, 9, 18, (chtype) '\\');
596 mvwaddch(treescrn, 10, 19, (chtype) '\\');
597 mvwaddch(treescrn, 11, 21, (chtype) '\\');
598 mvwaddch(treescrn, 12, 22, (chtype) '\\');
600 mvwaddch(treescrn, 4, 10, (chtype) '_');
601 mvwaddch(treescrn, 4, 14, (chtype) '_');
602 mvwaddch(treescrn, 8, 7, (chtype) '_');
603 mvwaddch(treescrn, 8, 17, (chtype) '_');
605 mvwaddstr(treescrn, 13, 0,
606 "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
608 #ifdef A_COLOR
609 if (has_colors())
611 init_pair(20, COLOR_YELLOW, COLOR_BLACK);
612 wattrset(treescrn, COLOR_PAIR(20));
614 #endif
615 mvwaddstr(treescrn, 14, 11, "| |");
616 mvwaddstr(treescrn, 15, 11, "|_|");
618 wrefresh(treescrn);
619 wrefresh(w_del_msg);
622 void balls(void)
624 chtype ball1, ball2, ball3, ball4, ball5, ball6;
626 overlay(treescrn, treescrn2);
628 #ifdef A_COLOR
629 if (has_colors())
631 init_pair(1, COLOR_BLUE, COLOR_BLACK);
632 init_pair(2, COLOR_RED, COLOR_BLACK);
633 init_pair(3, COLOR_MAGENTA, COLOR_BLACK);
634 init_pair(4, COLOR_CYAN, COLOR_BLACK);
635 init_pair(5, COLOR_YELLOW, COLOR_BLACK);
636 init_pair(6, COLOR_WHITE, COLOR_BLACK);
637 ball1 = COLOR_PAIR(1) | '@';
638 ball2 = COLOR_PAIR(2) | '@';
639 ball3 = COLOR_PAIR(3) | '@';
640 ball4 = COLOR_PAIR(4) | '@';
641 ball5 = COLOR_PAIR(5) | '@';
642 ball6 = COLOR_PAIR(6) | '@';
644 else
645 #endif
646 ball1 = ball2 = ball3 = ball4 = ball5 = ball6 = '@';
648 mvwaddch(treescrn2, 3, 9, ball1);
649 mvwaddch(treescrn2, 3, 15, ball2);
650 mvwaddch(treescrn2, 4, 8, ball3);
651 mvwaddch(treescrn2, 4, 16, ball4);
652 mvwaddch(treescrn2, 5, 7, ball5);
653 mvwaddch(treescrn2, 5, 17, ball6);
654 mvwaddch(treescrn2, 7, 6, ball1 | A_BOLD);
655 mvwaddch(treescrn2, 7, 18, ball2 | A_BOLD);
656 mvwaddch(treescrn2, 8, 5, ball3 | A_BOLD);
657 mvwaddch(treescrn2, 8, 19, ball4 | A_BOLD);
658 mvwaddch(treescrn2, 10, 4, ball5 | A_BOLD);
659 mvwaddch(treescrn2, 10, 20, ball6 | A_BOLD);
660 mvwaddch(treescrn2, 11, 2, ball1);
661 mvwaddch(treescrn2, 11, 22, ball2);
662 mvwaddch(treescrn2, 12, 1, ball3);
663 mvwaddch(treescrn2, 12, 23, ball4);
665 wrefresh(treescrn2);
666 wrefresh(w_del_msg);
669 void star(void)
671 mvwaddch(treescrn2, 0, 12, (chtype) '*' | A_STANDOUT);
673 wrefresh(treescrn2);
674 wrefresh(w_del_msg);
677 void strng1(void)
679 #ifdef A_COLOR
680 if (has_colors())
682 init_pair(10, COLOR_YELLOW, COLOR_BLACK);
683 wattrset(treescrn2, COLOR_PAIR(10) | A_BOLD);
685 #endif
686 mvwaddstr(treescrn2, 3, 11, ".:'");
688 wrefresh(treescrn2);
689 wrefresh(w_del_msg);
692 void strng2(void)
694 #ifdef A_COLOR
695 if (has_colors())
697 init_pair(11, COLOR_RED, COLOR_BLACK);
698 wattrset(treescrn2, COLOR_PAIR(11) | A_BOLD);
700 #endif
701 mvwaddstr(treescrn2, 5, 11, ",.:'");
702 mvwaddstr(treescrn2, 6, 9, ":'");
704 wrefresh(treescrn2);
705 wrefresh(w_del_msg);
708 void strng3(void)
710 #ifdef A_COLOR
711 if (has_colors())
713 init_pair(12, COLOR_GREEN, COLOR_BLACK);
714 wattrset(treescrn2, COLOR_PAIR(12) | A_BOLD);
716 #endif
717 mvwaddstr(treescrn2, 7, 13, ",.:'");
718 mvwaddstr(treescrn2, 8, 9, ",.:'");
720 wrefresh(treescrn2);
721 wrefresh(w_del_msg);
724 void strng4(void)
726 #ifdef A_COLOR
727 if (has_colors())
729 init_pair(13, COLOR_WHITE, COLOR_BLACK);
730 wattrset(treescrn2, COLOR_PAIR(13) | A_BOLD);
732 #endif
733 mvwaddstr(treescrn2, 9, 14, ",.:'");
734 mvwaddstr(treescrn2, 10, 10, ",.:'");
735 mvwaddstr(treescrn2, 11, 6, ",.:'");
736 mvwaddch(treescrn2, 12, 5, (chtype) '\'');
738 wrefresh(treescrn2);
739 wrefresh(w_del_msg);
742 void strng5(void)
744 #ifdef A_COLOR
745 if (has_colors())
747 init_pair(14, COLOR_CYAN, COLOR_BLACK);
748 wattrset(treescrn2, COLOR_PAIR(14) | A_BOLD);
750 #endif
751 mvwaddstr(treescrn2, 11, 16, ",.:'");
752 mvwaddstr(treescrn2, 12, 12, ",.:'");
754 /* save a fully lit tree */
755 overlay(treescrn2, treescrn);
757 wrefresh(treescrn2);
758 wrefresh(w_del_msg);
761 void blinkit(void)
763 static int cycle;
765 if (cycle > 4)
766 cycle = 0;
768 touchwin(treescrn8);
770 switch (cycle)
772 case 0:
773 overlay(treescrn3, treescrn8);
774 break;
776 case 1:
777 overlay(treescrn4, treescrn8);
778 break;
780 case 2:
781 overlay(treescrn5, treescrn8);
782 break;
784 case 3:
785 overlay(treescrn6, treescrn8);
786 break;
788 case 4:
789 overlay(treescrn7, treescrn8);
792 wrefresh(treescrn8);
793 wrefresh(w_del_msg);
795 napms(50);
796 touchwin(treescrn8);
798 /*ALL ON************************************************** */
800 overlay(treescrn, treescrn8);
801 wrefresh(treescrn8);
802 wrefresh(w_del_msg);
804 ++cycle;
807 #define TSHOW(win, pause) touchwin(win); wrefresh(win); \
808 wrefresh(w_del_msg); napms(pause)
810 #define SHOW(win, pause) mvwin(win, y_pos, x_pos); wrefresh(win); \
811 wrefresh(w_del_msg); napms(pause)
813 void reindeer(void)
815 int looper;
817 y_pos = 0;
819 for (x_pos = 70; x_pos > 62; x_pos--)
821 if (x_pos < 62)
822 y_pos = 1;
824 for (looper = 0; looper < 4; looper++)
826 mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '.');
827 wrefresh(dotdeer0);
828 wrefresh(w_del_msg);
829 werase(dotdeer0);
830 wrefresh(dotdeer0);
831 wrefresh(w_del_msg);
835 y_pos = 2;
837 for (; x_pos > 50; x_pos--)
839 for (looper = 0; looper < 4; looper++)
841 if (x_pos < 56)
843 y_pos = 3;
845 mvwaddch(stardeer0, y_pos, x_pos, (chtype) '*');
846 wrefresh(stardeer0);
847 wrefresh(w_del_msg);
848 werase(stardeer0);
849 wrefresh(stardeer0);
851 else
853 mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '*');
854 wrefresh(dotdeer0);
855 wrefresh(w_del_msg);
856 werase(dotdeer0);
857 wrefresh(dotdeer0);
859 wrefresh(w_del_msg);
863 x_pos = 58;
865 for (y_pos = 2; y_pos < 5; y_pos++)
867 TSHOW(lildeer0, 50);
869 for (looper = 0; looper < 4; looper++)
871 SHOW(lildeer3, 50);
872 SHOW(lildeer2, 50);
873 SHOW(lildeer1, 50);
874 SHOW(lildeer2, 50);
875 SHOW(lildeer3, 50);
877 TSHOW(lildeer0, 50);
879 x_pos -= 2;
883 x_pos = 35;
885 for (y_pos = 5; y_pos < 10; y_pos++)
887 touchwin(middeer0);
888 wrefresh(middeer0);
889 wrefresh(w_del_msg);
891 for (looper = 0; looper < 2; looper++)
893 SHOW(middeer3, 50);
894 SHOW(middeer2, 50);
895 SHOW(middeer1, 50);
896 SHOW(middeer2, 50);
897 SHOW(middeer3, 50);
899 TSHOW(middeer0, 50);
901 x_pos -= 3;
905 napms(2000);
907 y_pos = 1;
909 for (x_pos = 8; x_pos < 16; x_pos++)
911 SHOW(bigdeer4, 30);
912 SHOW(bigdeer3, 30);
913 SHOW(bigdeer2, 30);
914 SHOW(bigdeer1, 30);
915 SHOW(bigdeer2, 30);
916 SHOW(bigdeer3, 30);
917 SHOW(bigdeer4, 30);
918 SHOW(bigdeer0, 30);
921 --x_pos;
923 for (looper = 0; looper < 6; looper++)
925 SHOW(lookdeer4, 40);
926 SHOW(lookdeer3, 40);
927 SHOW(lookdeer2, 40);
928 SHOW(lookdeer1, 40);
929 SHOW(lookdeer2, 40);
930 SHOW(lookdeer3, 40);
931 SHOW(lookdeer4, 40);
934 SHOW(lookdeer0, 40);
936 for (; y_pos < 10; y_pos++)
938 for (looper = 0; looper < 2; looper++)
940 SHOW(bigdeer4, 30);
941 SHOW(bigdeer3, 30);
942 SHOW(bigdeer2, 30);
943 SHOW(bigdeer1, 30);
944 SHOW(bigdeer2, 30);
945 SHOW(bigdeer3, 30);
946 SHOW(bigdeer4, 30);
949 SHOW(bigdeer0, 30);
952 --y_pos;
954 mvwin(lookdeer3, y_pos, x_pos);
955 wrefresh(lookdeer3);
956 wrefresh(w_del_msg);