From ce99997280e99a5a618f516aad6049d377bdaff8 Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Sun, 15 May 2011 15:02:34 -0300 Subject: [PATCH] Traverse the stack's cards and paint their backgrounds. --- lib/display.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/display.c b/lib/display.c index 7a044d1..1c6f21d 100644 --- a/lib/display.c +++ b/lib/display.c @@ -56,17 +56,11 @@ static char *card_value(enum value value) { } void erase_stack(struct stack *stack) { - WINDOW *empty_stack = NULL; - - wbkgd(stack->card->frame->window, WHITE_ON_GREEN); - wrefresh(stack->card->frame->window); - empty_stack = newwin(FRAME_HEIGHT, - FRAME_WIDTH, - stack->card->frame->begin_y, - stack->card->frame->begin_x); - box(empty_stack, 0, 0); - wrefresh(empty_stack); - delwin(empty_stack); + for (; stack; stack = stack->next) { + werase(stack->card->frame->window); + wbkgd(stack->card->frame->window, WHITE_ON_GREEN); + wrefresh(stack->card->frame->window); + } } void draw_value(struct card *card) {