| Updated - gnuskii - GNUSki improved for ascii skiing experience. | |
| git clone git://bitreich.org/gnuskii git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws… | |
| Log | |
| Files | |
| Refs | |
| Tags | |
| README | |
| LICENSE | |
| --- | |
| commit c0b6bad9246bef5b3bfe6c0b8d4300956600a4df | |
| parent b00bc9ac431fe18d253ef22940afad2e46250b7a | |
| Author: Rudolf Olah <[email protected]> | |
| Date: Thu, 9 Jun 2005 09:20:06 -0400 | |
| Updated | |
| Diffstat: | |
| A src/init.h | 53 ++++++++++++++++++++++++++++++ | |
| 1 file changed, 53 insertions(+), 0 deletions(-) | |
| --- | |
| diff --git a/src/init.h b/src/init.h | |
| @@ -0,0 +1,53 @@ | |
| +/******************************** | |
| +* SkiFree GNU * | |
| +* Rudolf Olah * | |
| +* Copyright 2005 * | |
| +* Released under the GNU GPL * | |
| +********************************/ | |
| +#ifndef INIT_H | |
| +#define INIT_H | |
| + | |
| +#include <curses.h> | |
| +#include <signal.h> | |
| +#include <stdlib.h> | |
| + | |
| +static void finish(int sig); | |
| + | |
| +//Code from VMS Empire (C-Empire) | |
| +void init_colors() | |
| +{ | |
| + start_color(); | |
| + | |
| + init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK); | |
| + init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK); | |
| + init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK); | |
| + init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK); | |
| + init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); | |
| + init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); | |
| + init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK); | |
| + init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); | |
| +}; | |
| + | |
| +WINDOW* initStuff(WINDOW* wnd) | |
| +{ | |
| + signal(SIGINT, finish); // arrange interrupts to terminate | |
| + | |
| + wnd = initscr(); //initialize the curses library | |
| + attron(A_BOLD); | |
| + keypad(stdscr, TRUE); // enable keyboard mapping | |
| + nonl(); // tell curses not to do NL->CR/NL on outp… | |
| + cbreak(); // take input chars one at a time, no wait… | |
| + noecho(); // don't echo input | |
| + | |
| + init_colors(); | |
| + return wnd; | |
| +}; | |
| + | |
| +static void finish(int sig) | |
| +{ | |
| + endwin(); | |
| + /* do your non-curses wrapup here */ | |
| + echo(); | |
| + exit(0); | |
| +}; | |
| +#endif |