Only traverse maneuvre stacks for drawing.

This commit is contained in:
Murilo Pereira 2011-05-01 02:05:35 -03:00
parent 0a37b5982a
commit 20d68a6f3d
2 changed files with 10 additions and 9 deletions

View File

@ -199,15 +199,16 @@ void draw_card(struct card *card) {
void draw_stack(struct stack *stack) { void draw_stack(struct stack *stack) {
if (!empty(stack)) { if (!empty(stack)) {
struct stack *iterator = stack->next; if (maneuvre_stack(stack)) {
while (iterator != NULL) { struct stack *reversed_stack = reverse(stack);
draw_card(iterator->card);
iterator = iterator->next; for (struct stack *i = reversed_stack; i; i = i->next) {
draw_card(i->card);
} }
} else {
draw_card(stack->card); draw_card(stack->card);
} }
}
return;
} }
void draw_deck(struct deck *deck) { void draw_deck(struct deck *deck) {

View File

@ -8,7 +8,7 @@
#include "util.h" #include "util.h"
#include "game.h" #include "game.h"
static bool maneuvre_stack(struct stack *stack) { bool maneuvre_stack(struct stack *stack) {
return(stack->card->frame->start_y >= MANEUVRE_STACKS_STARTING_Y); return(stack->card->frame->start_y >= MANEUVRE_STACKS_STARTING_Y);
} }