These are only used here.

This commit is contained in:
Murilo Pereira 2011-06-03 00:15:47 -03:00
parent 548fe23b5d
commit fefb2ed92f
2 changed files with 20 additions and 24 deletions

View File

@ -14,23 +14,7 @@ static const char *card_values[13] = {
"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"
}; };
void erase_card(struct card *card) { static void draw_value(struct card *card) {
werase(card->frame->window);
wbkgd(card->frame->window, WHITE_ON_GREEN);
wrefresh(card->frame->window);
}
void erase_stack(struct stack *stack) {
if (maneuvre_stack(stack)) {
for (; stack; stack = stack->next) {
erase_card(stack->card);
}
} else {
erase_card(stack->card);
}
}
void draw_value(struct card *card) {
mvwprintw(card->frame->window, 0, 0, card_values[card->value]); mvwprintw(card->frame->window, 0, 0, card_values[card->value]);
mvwprintw(card->frame->window, mvwprintw(card->frame->window,
4, 4,
@ -38,7 +22,7 @@ void draw_value(struct card *card) {
card_values[card->value]); card_values[card->value]);
} }
void draw_suit(struct card *card) { static void draw_suit(struct card *card) {
if (card->suit % 2 == 0) { if (card->suit % 2 == 0) {
wattron(card->frame->window, COLOR_PAIR(RED_ON_WHITE)); wattron(card->frame->window, COLOR_PAIR(RED_ON_WHITE));
} else { } else {
@ -59,13 +43,13 @@ void draw_suit(struct card *card) {
} }
} }
void draw_front(struct card *card) { static void draw_front(struct card *card) {
wbkgd(card->frame->window, COLOR_PAIR(BLACK_ON_WHITE)); wbkgd(card->frame->window, COLOR_PAIR(BLACK_ON_WHITE));
draw_value(card); draw_value(card);
draw_suit(card); draw_suit(card);
} }
void draw_back(struct card *card) { static void draw_back(struct card *card) {
wbkgd(card->frame->window, COLOR_PAIR(WHITE_ON_BLUE)); wbkgd(card->frame->window, COLOR_PAIR(WHITE_ON_BLUE));
} }
@ -116,6 +100,22 @@ void draw_cursor(struct cursor *cursor) {
wrefresh(cursor->window); wrefresh(cursor->window);
} }
void erase_card(struct card *card) {
werase(card->frame->window);
wbkgd(card->frame->window, WHITE_ON_GREEN);
wrefresh(card->frame->window);
}
void erase_stack(struct stack *stack) {
if (maneuvre_stack(stack)) {
for (; stack; stack = stack->next) {
erase_card(stack->card);
}
} else {
erase_card(stack->card);
}
}
void erase_cursor(struct cursor *cursor) { void erase_cursor(struct cursor *cursor) {
wdelch(cursor->window); wdelch(cursor->window);
wrefresh(cursor->window); wrefresh(cursor->window);

View File

@ -14,10 +14,6 @@
#define WHITE_ON_GREEN 4 #define WHITE_ON_GREEN 4
void erase_stack(struct stack *); void erase_stack(struct stack *);
void draw_value(struct card *);
void draw_suit(struct card *);
void draw_front(struct card *);
void draw_back(struct card *);
void draw_card(struct card *); void draw_card(struct card *);
void draw_stack(struct stack *); void draw_stack(struct stack *);
void draw_deck(struct deck *); void draw_deck(struct deck *);