Moved curses initialization related stuff to display.c.
This commit is contained in:
parent
042b45f36a
commit
1910bfe868
@ -1,9 +1,18 @@
|
||||
#include <ncurses.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include "card.h"
|
||||
#include "display.h"
|
||||
|
||||
void init_curses() {
|
||||
setlocale(LC_ALL, ""); /* supporting unicode characters */
|
||||
initscr(); /* initialize the terminal in curses mode */
|
||||
raw(); /* disable line buffers */
|
||||
noecho(); /* character echo is unnecessary */
|
||||
keypad(stdscr, TRUE); /* enable F and arrow keys */
|
||||
}
|
||||
|
||||
char *card_suit(enum suit suit) {
|
||||
char *card_suit;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <ncurses.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
#include "common.h"
|
||||
#include "../lib/card.h"
|
||||
|
||||
@ -9,11 +8,7 @@ int main(int argc, const char *argv[]) {
|
||||
char message[] = "Welcome to tty-solitaire.";
|
||||
int row_number, column_number;
|
||||
|
||||
setlocale(LC_ALL, ""); /* supporting unicode characters */
|
||||
initscr(); /* initialize the terminal in curses mode */
|
||||
raw(); /* disable line buffers */
|
||||
noecho(); /* character echo is unnecessary */
|
||||
keypad(stdscr, TRUE); /* enable F and arrow keys */
|
||||
init_curses();
|
||||
|
||||
getmaxyx(stdscr, row_number, column_number);
|
||||
mvprintw(row_number / 2 - 1,
|
||||
|
Loading…
Reference in New Issue
Block a user