Empty stacks drawn jit.
This commit is contained in:
parent
22aa293645
commit
e2554f181e
@ -68,78 +68,6 @@ void erase_stack(struct stack *stack) {
|
|||||||
delwin(empty_stack);
|
delwin(empty_stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_empty_stacks() {
|
|
||||||
WINDOW **empty_stack;
|
|
||||||
|
|
||||||
if (!(empty_stack = malloc(EMPTY_STACKS_NUMBER * sizeof(**empty_stack)))) {
|
|
||||||
fprintf(stderr, "%s: %s (%s:%d)\n", program_name, strerror(errno), __FILE__, __LINE__ - 1);
|
|
||||||
exit(errno);
|
|
||||||
}
|
|
||||||
|
|
||||||
empty_stack[0] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
STOCK_STARTING_Y,
|
|
||||||
STOCK_STARTING_X);
|
|
||||||
empty_stack[1] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
WASTE_PILE_STARTING_Y,
|
|
||||||
WASTE_PILE_STARTING_X);
|
|
||||||
empty_stack[2] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
FOUNDATION_STARTING_Y,
|
|
||||||
FOUNDATION_0_STARTING_X);
|
|
||||||
empty_stack[3] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
FOUNDATION_STARTING_Y,
|
|
||||||
FOUNDATION_1_STARTING_X);
|
|
||||||
empty_stack[4] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
FOUNDATION_STARTING_Y,
|
|
||||||
FOUNDATION_2_STARTING_X);
|
|
||||||
empty_stack[5] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
FOUNDATION_STARTING_Y,
|
|
||||||
FOUNDATION_3_STARTING_X);
|
|
||||||
empty_stack[6] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_0_STARTING_X);
|
|
||||||
empty_stack[7] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_1_STARTING_X);
|
|
||||||
empty_stack[8] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_2_STARTING_X);
|
|
||||||
empty_stack[9] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_3_STARTING_X);
|
|
||||||
empty_stack[10] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_4_STARTING_X);
|
|
||||||
empty_stack[11] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_5_STARTING_X);
|
|
||||||
empty_stack[12] = newwin(FRAME_HEIGHT,
|
|
||||||
FRAME_WIDTH,
|
|
||||||
MANEUVRE_STARTING_Y,
|
|
||||||
MANEUVRE_6_STARTING_X);
|
|
||||||
|
|
||||||
for (int i = 0; i < EMPTY_STACKS_NUMBER; i++) {
|
|
||||||
box(empty_stack[i], 0, 0);
|
|
||||||
wrefresh(empty_stack[i]);
|
|
||||||
delwin(empty_stack[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(empty_stack);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_value(struct card *card) {
|
void draw_value(struct card *card) {
|
||||||
mvwprintw(card->frame->shape, 0, 0, card_value(card->value));
|
mvwprintw(card->frame->shape, 0, 0, card_value(card->value));
|
||||||
mvwprintw(card->frame->shape,
|
mvwprintw(card->frame->shape,
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
extern const char *program_name;
|
extern const char *program_name;
|
||||||
|
|
||||||
void erase_stack(struct stack *);
|
void erase_stack(struct stack *);
|
||||||
void draw_empty_stacks();
|
|
||||||
void draw_value(struct card *);
|
void draw_value(struct card *);
|
||||||
void draw_suit(struct card *);
|
void draw_suit(struct card *);
|
||||||
void draw_front(struct card *);
|
void draw_front(struct card *);
|
||||||
|
@ -294,11 +294,8 @@ void initialize_game() {
|
|||||||
shuffle_deck(deck);
|
shuffle_deck(deck);
|
||||||
deal_cards(deck);
|
deal_cards(deck);
|
||||||
|
|
||||||
draw_empty_stacks();
|
|
||||||
draw_cursor(cursor);
|
draw_cursor(cursor);
|
||||||
draw_deck(deck);
|
draw_deck(deck);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void end_game() {
|
void end_game() {
|
||||||
|
Loading…
Reference in New Issue
Block a user