mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 15:03:03 +01:00
Fix a graphical bug with the game border on some terminal emulators
This commit is contained in:
parent
f2b1c81279
commit
d02f3b4acb
@ -540,20 +540,20 @@ static void game_draw_border(const GameData *game, const int max_x, const int ma
|
|||||||
const int x = (max_x - game_max_x) / 2;
|
const int x = (max_x - game_max_x) / 2;
|
||||||
const int y = (max_y - game_max_y) / 2;
|
const int y = (max_y - game_max_y) / 2;
|
||||||
|
|
||||||
wattron(win, A_BOLD | COLOR_PAIR(GAME_BORDER_COLOUR));
|
wattron(win, COLOR_PAIR(GAME_BORDER_COLOUR));
|
||||||
|
|
||||||
mvwaddch(win, y, x, ' ');
|
mvwaddch(win, y, x, ACS_ULCORNER);
|
||||||
mvwhline(win, y, x + 1, ' ', game_max_x - 1);
|
mvwhline(win, y, x + 1, ACS_HLINE, game_max_x - 1);
|
||||||
mvwvline(win, y + 1, x, ' ', game_max_y - 1);
|
mvwvline(win, y + 1, x, ACS_VLINE, game_max_y - 1);
|
||||||
mvwvline(win, y, x - 1, ' ', game_max_y + 1);
|
mvwvline(win, y, x - 1, ACS_VLINE, game_max_y + 1);
|
||||||
mvwaddch(win, y, x + game_max_x, ' ');
|
mvwaddch(win, y, x + game_max_x, ACS_URCORNER);
|
||||||
mvwvline(win, y + 1, x + game_max_x, ' ', game_max_y - 1);
|
mvwvline(win, y + 1, x + game_max_x, ACS_VLINE, game_max_y - 1);
|
||||||
mvwvline(win, y, x + game_max_x + 1, ' ', game_max_y + 1);
|
mvwvline(win, y, x + game_max_x + 1, ACS_VLINE, game_max_y + 1);
|
||||||
mvwaddch(win, y + game_max_y, x, ' ');
|
mvwaddch(win, y + game_max_y, x, ACS_LLCORNER);
|
||||||
mvwhline(win, y + game_max_y, x + 1, ' ', game_max_x - 1);
|
mvwhline(win, y + game_max_y, x + 1, ACS_HLINE, game_max_x - 1);
|
||||||
mvwaddch(win, y + game_max_y, x + game_max_x, ' ');
|
mvwaddch(win, y + game_max_y, x + game_max_x, ACS_LRCORNER);
|
||||||
|
|
||||||
wattroff(win, A_BOLD | COLOR_PAIR(GAME_BORDER_COLOUR));
|
wattroff(win, COLOR_PAIR(GAME_BORDER_COLOUR));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void game_draw_status(const GameData *game, const int max_x, const int max_y)
|
static void game_draw_status(const GameData *game, const int max_x, const int max_y)
|
||||||
@ -561,7 +561,7 @@ static void game_draw_status(const GameData *game, const int max_x, const int ma
|
|||||||
WINDOW *win = game->window;
|
WINDOW *win = game->window;
|
||||||
|
|
||||||
int x = ((max_x - game->game_max_x) / 2) - 1;
|
int x = ((max_x - game->game_max_x) / 2) - 1;
|
||||||
int y = ((max_y - game->game_max_y) / 2) - 1;
|
const int y = ((max_y - game->game_max_y) / 2) - 1;
|
||||||
|
|
||||||
wattron(win, A_BOLD);
|
wattron(win, A_BOLD);
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "game_util.h"
|
#include "game_util.h"
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
|
||||||
#define GAME_BORDER_COLOUR BAR_TEXT
|
#define GAME_BORDER_COLOUR BAR_SOLID
|
||||||
|
|
||||||
|
|
||||||
/* Max size of a default square game window */
|
/* Max size of a default square game window */
|
||||||
|
@ -383,6 +383,7 @@ static void init_term(void)
|
|||||||
init_pair(BLACK_BG, COLOR_BLACK, bar_bg_color);
|
init_pair(BLACK_BG, COLOR_BLACK, bar_bg_color);
|
||||||
init_pair(PURPLE_BG, COLOR_MAGENTA, bar_bg_color);
|
init_pair(PURPLE_BG, COLOR_MAGENTA, bar_bg_color);
|
||||||
init_pair(BAR_TEXT, bar_fg_color, bar_bg_color);
|
init_pair(BAR_TEXT, bar_fg_color, bar_bg_color);
|
||||||
|
init_pair(BAR_SOLID, bar_bg_color, bar_bg_color);
|
||||||
init_pair(BAR_ACCENT, bar_accent_color, bar_bg_color);
|
init_pair(BAR_ACCENT, bar_accent_color, bar_bg_color);
|
||||||
init_pair(BAR_NOTIFY, bar_notify_color, bar_bg_color);
|
init_pair(BAR_NOTIFY, bar_notify_color, bar_bg_color);
|
||||||
init_pair(STATUS_ONLINE, COLOR_GREEN, bar_bg_color);
|
init_pair(STATUS_ONLINE, COLOR_GREEN, bar_bg_color);
|
||||||
|
@ -72,6 +72,7 @@ typedef enum {
|
|||||||
STATUS_BUSY,
|
STATUS_BUSY,
|
||||||
STATUS_AWAY,
|
STATUS_AWAY,
|
||||||
BAR_NOTIFY,
|
BAR_NOTIFY,
|
||||||
|
BAR_SOLID,
|
||||||
} C_COLOURS;
|
} C_COLOURS;
|
||||||
|
|
||||||
/* tab alert types: lower types take priority (this relies on the order of C_COLOURS) */
|
/* tab alert types: lower types take priority (this relies on the order of C_COLOURS) */
|
||||||
|
Loading…
Reference in New Issue
Block a user