From daf0b4809f9f62299bf0b875bd0a0fd617a2477a Mon Sep 17 00:00:00 2001 From: Murilo Pereira Date: Wed, 16 Feb 2011 23:50:29 -0200 Subject: [PATCH] Putting functions were they belong. --- lib/cursor.c | 16 ---------------- lib/cursor.h | 2 -- lib/display.c | 13 ++++++++++++- lib/display.h | 3 +++ lib/keyboard.c | 4 ++++ 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/cursor.c b/lib/cursor.c index bd442e3..88f626d 100644 --- a/lib/cursor.c +++ b/lib/cursor.c @@ -24,18 +24,6 @@ void initialize_cursor(struct cursor *cursor) { return; } -void draw_cursor(struct cursor *cursor) { - mvaddch(cursor->y, cursor->x, '*'); - - return; -} - -void erase_cursor(struct cursor *cursor) { - mvdelch(cursor->y, cursor->x); - - return; -} - void move_cursor(struct cursor *cursor, enum movement movement) { switch (movement) { case LEFT: @@ -105,7 +93,3 @@ void move_cursor(struct cursor *cursor, enum movement movement) { return; } - -bool cursor_on_stock(struct cursor *cursor) { - return((cursor->x == CURSOR_STARTING_X) && (cursor->y == CURSOR_STARTING_Y)); -} diff --git a/lib/cursor.h b/lib/cursor.h index e557fc8..3d280e8 100644 --- a/lib/cursor.h +++ b/lib/cursor.h @@ -36,8 +36,6 @@ extern const char *program_name; void allocate_cursor(struct cursor **); void initialize_cursor(struct cursor *); -void draw_cursor(struct cursor *); void move_cursor(struct cursor *, enum movement); -bool cursor_on_stock(struct cursor *); #endif diff --git a/lib/display.c b/lib/display.c index 1d535bb..727be23 100644 --- a/lib/display.c +++ b/lib/display.c @@ -5,7 +5,6 @@ #include #include #include "display.h" -#include "game.h" static char *card_suit(enum suit suit) { char *card_suit; @@ -229,3 +228,15 @@ void draw_deck(struct deck *deck) { return; } + +void draw_cursor(struct cursor *cursor) { + mvaddch(cursor->y, cursor->x, '*'); + + return; +} + +void erase_cursor(struct cursor *cursor) { + mvdelch(cursor->y, cursor->x); + + return; +} diff --git a/lib/display.h b/lib/display.h index d36df18..e69605a 100644 --- a/lib/display.h +++ b/lib/display.h @@ -4,6 +4,7 @@ #include "card.h" #include "stack.h" #include "deck.h" +#include "cursor.h" #define EMPTY_STACKS_NUMBER 13 @@ -28,5 +29,7 @@ void draw_back(struct card *); void draw_card(struct card *); void draw_stack(struct stack *); void draw_deck(struct deck *); +void draw_cursor(struct cursor *); +void erase_cursor(struct cursor *); #endif diff --git a/lib/keyboard.c b/lib/keyboard.c index e8eda0d..ea1ac6a 100644 --- a/lib/keyboard.c +++ b/lib/keyboard.c @@ -3,6 +3,10 @@ #include "display.h" #include "keyboard.h" +static bool cursor_on_stock(struct cursor *cursor) { + return((cursor->x == CURSOR_STARTING_X) && (cursor->y == CURSOR_STARTING_Y)); +} + static struct stack *cursor_stack(struct cursor *cursor) { struct stack *cursor_stack = NULL;