mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 07:15:05 +00:00
Raise the maximum number of colors to 768 in SDL and X11. The logic is
that each color pair can have a unique foreground and background color defined via init_color(), without altering any of the first (preset) 256 colors.
This commit is contained in:
@@ -20,8 +20,8 @@ SDL_Surface *pdc_screen = NULL, *pdc_font = NULL, *pdc_icon = NULL,
|
||||
*pdc_back = NULL, *pdc_tileback = NULL;
|
||||
int pdc_sheight = 0, pdc_swidth = 0, pdc_yoffset = 0, pdc_xoffset = 0;
|
||||
|
||||
SDL_Color pdc_color[256];
|
||||
Uint32 pdc_mapped[256];
|
||||
SDL_Color pdc_color[MAX_COLORS];
|
||||
Uint32 pdc_mapped[MAX_COLORS];
|
||||
int pdc_fheight, pdc_fwidth, pdc_fthick, pdc_flastc;
|
||||
bool pdc_own_screen;
|
||||
|
||||
|
||||
@@ -14,11 +14,13 @@ PDCEX int pdc_font_size;
|
||||
PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
||||
PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
||||
|
||||
#define MAX_COLORS 768
|
||||
|
||||
extern SDL_Surface *pdc_tileback; /* used to regenerate the background
|
||||
of "transparent" cells */
|
||||
extern SDL_Color pdc_color[256]; /* colors for font palette */
|
||||
extern Uint32 pdc_mapped[256]; /* colors for FillRect(), as
|
||||
used in _highlight() */
|
||||
extern SDL_Color pdc_color[MAX_COLORS]; /* colors for font palette */
|
||||
extern Uint32 pdc_mapped[MAX_COLORS]; /* colors for FillRect(), as
|
||||
used in _highlight() */
|
||||
extern int pdc_fheight, pdc_fwidth; /* font height and width */
|
||||
extern int pdc_fthick; /* thickness for highlights and
|
||||
rendered ACS glyphs */
|
||||
|
||||
@@ -62,7 +62,7 @@ void PDC_set_title(const char *title)
|
||||
int PDC_set_blink(bool blinkon)
|
||||
{
|
||||
if (pdc_color_started)
|
||||
COLORS = 256;
|
||||
COLORS = MAX_COLORS;
|
||||
|
||||
if (blinkon)
|
||||
{
|
||||
|
||||
@@ -32,8 +32,8 @@ SDL_Surface *pdc_screen = NULL, *pdc_font = NULL, *pdc_icon = NULL,
|
||||
*pdc_back = NULL, *pdc_tileback = NULL;
|
||||
int pdc_sheight = 0, pdc_swidth = 0, pdc_yoffset = 0, pdc_xoffset = 0;
|
||||
|
||||
SDL_Color pdc_color[256];
|
||||
Uint32 pdc_mapped[256];
|
||||
SDL_Color pdc_color[MAX_COLORS];
|
||||
Uint32 pdc_mapped[MAX_COLORS];
|
||||
int pdc_fheight, pdc_fwidth, pdc_fthick, pdc_flastc;
|
||||
bool pdc_own_window;
|
||||
|
||||
|
||||
@@ -15,11 +15,13 @@ PDCEX SDL_Window *pdc_window;
|
||||
PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back;
|
||||
PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset;
|
||||
|
||||
#define MAX_COLORS 768
|
||||
|
||||
extern SDL_Surface *pdc_tileback; /* used to regenerate the background
|
||||
of "transparent" cells */
|
||||
extern SDL_Color pdc_color[256]; /* colors for font palette */
|
||||
extern Uint32 pdc_mapped[256]; /* colors for FillRect(), as
|
||||
used in _highlight() */
|
||||
extern SDL_Color pdc_color[MAX_COLORS]; /* colors for font palette */
|
||||
extern Uint32 pdc_mapped[MAX_COLORS]; /* colors for FillRect(), as
|
||||
used in _highlight() */
|
||||
extern int pdc_fheight, pdc_fwidth; /* font height and width */
|
||||
extern int pdc_fthick; /* thickness for highlights and
|
||||
rendered ACS glyphs */
|
||||
|
||||
@@ -62,7 +62,7 @@ void PDC_set_title(const char *title)
|
||||
int PDC_set_blink(bool blinkon)
|
||||
{
|
||||
if (pdc_color_started)
|
||||
COLORS = 256;
|
||||
COLORS = MAX_COLORS;
|
||||
|
||||
if (blinkon)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ void PDC_set_title(const char *title)
|
||||
int PDC_set_blink(bool blinkon)
|
||||
{
|
||||
if (pdc_color_started)
|
||||
COLORS = 256;
|
||||
COLORS = MAX_COLORS;
|
||||
|
||||
XCursesInstruct(blinkon ? CURSES_BLINK_ON : CURSES_BLINK_OFF);
|
||||
|
||||
|
||||
@@ -187,3 +187,5 @@ enum
|
||||
};
|
||||
|
||||
extern short *xc_atrtab;
|
||||
|
||||
#define MAX_COLORS 768
|
||||
|
||||
@@ -33,7 +33,6 @@ XCursesAppData xc_app_data;
|
||||
# define PDC_SCROLLBAR_TYPE float
|
||||
#endif
|
||||
|
||||
#define MAX_COLORS 256 /* maximum of "normal" colors */
|
||||
#define COLOR_CURSOR MAX_COLORS /* color of cursor */
|
||||
#define COLOR_BORDER MAX_COLORS + 1 /* color of border */
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ void PDC_set_title(const char *title)
|
||||
int PDC_set_blink(bool blinkon)
|
||||
{
|
||||
if (pdc_color_started)
|
||||
COLORS = 256;
|
||||
COLORS = MAX_COLORS;
|
||||
|
||||
XCursesInstruct(blinkon ? CURSES_BLINK_ON : CURSES_BLINK_OFF);
|
||||
|
||||
|
||||
@@ -176,3 +176,5 @@ enum
|
||||
extern short *xc_atrtab;
|
||||
|
||||
extern bool xc_resize_now;
|
||||
|
||||
#define MAX_COLORS 768
|
||||
|
||||
@@ -33,7 +33,6 @@ XCursesAppData xc_app_data;
|
||||
# define PDC_SCROLLBAR_TYPE float
|
||||
#endif
|
||||
|
||||
#define MAX_COLORS 256 /* maximum of "normal" colors */
|
||||
#define COLOR_CURSOR MAX_COLORS /* color of cursor */
|
||||
#define COLOR_BORDER MAX_COLORS + 1 /* color of border */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user