diff --git a/lib/display.c b/lib/display.c index 4bf13f8..ae496e6 100644 --- a/lib/display.c +++ b/lib/display.c @@ -68,78 +68,6 @@ void erase_stack(struct stack *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) { mvwprintw(card->frame->shape, 0, 0, card_value(card->value)); mvwprintw(card->frame->shape, diff --git a/lib/display.h b/lib/display.h index e69605a..8dc4168 100644 --- a/lib/display.h +++ b/lib/display.h @@ -21,7 +21,6 @@ extern const char *program_name; void erase_stack(struct stack *); -void draw_empty_stacks(); void draw_value(struct card *); void draw_suit(struct card *); void draw_front(struct card *); diff --git a/lib/game.c b/lib/game.c index 73ce95f..9e18ae2 100644 --- a/lib/game.c +++ b/lib/game.c @@ -294,11 +294,8 @@ void initialize_game() { shuffle_deck(deck); deal_cards(deck); - draw_empty_stacks(); draw_cursor(cursor); draw_deck(deck); - - return; } void end_game() {