Fixed screen flicker on cursor movement.
This commit is contained in:
parent
1c63b767f6
commit
ae5ccc75cb
@ -19,7 +19,7 @@ void allocate_cursor(struct cursor **cursor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initialize_cursor(struct cursor *cursor) {
|
void initialize_cursor(struct cursor *cursor) {
|
||||||
cursor->window = newwin(0, 0, cursor->y, cursor->x);
|
cursor->window = newwin(1, 1, cursor->y, cursor->x);
|
||||||
cursor->x = CURSOR_BEGIN_X;
|
cursor->x = CURSOR_BEGIN_X;
|
||||||
cursor->y = CURSOR_BEGIN_Y;
|
cursor->y = CURSOR_BEGIN_Y;
|
||||||
cursor->marked = false;
|
cursor->marked = false;
|
||||||
|
@ -145,13 +145,16 @@ void draw_deck(struct deck *deck) {
|
|||||||
|
|
||||||
void draw_cursor(struct cursor *cursor) {
|
void draw_cursor(struct cursor *cursor) {
|
||||||
if (cursor->marked) {
|
if (cursor->marked) {
|
||||||
mvwaddch(cursor->window, cursor->y, cursor->x, '@');
|
mvwin(cursor->window, cursor->y, cursor->x);
|
||||||
|
waddch(cursor->window, '@');
|
||||||
} else {
|
} else {
|
||||||
mvwaddch(cursor->window, cursor->y, cursor->x, '*');
|
mvwin(cursor->window, cursor->y, cursor->x);
|
||||||
|
waddch(cursor->window, '*');
|
||||||
}
|
}
|
||||||
wrefresh(cursor->window);
|
wrefresh(cursor->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void erase_cursor(struct cursor *cursor) {
|
void erase_cursor(struct cursor *cursor) {
|
||||||
mvwdelch(cursor->window, cursor->y, cursor->x);
|
wdelch(cursor->window);
|
||||||
|
wrefresh(cursor->window);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user