103 |
/* colour maps */ |
/* colour maps */ |
104 |
BOOL owncolmap = False; |
BOOL owncolmap = False; |
105 |
static Colormap xcolmap; |
static Colormap xcolmap; |
106 |
static uint32 *colmap; |
static uint32 *colmap = NULL; |
107 |
|
|
108 |
#define TRANSLATE(col) ( g_server_bpp != 8 ? translate_colour(col) : owncolmap ? col : translate_colour(colmap[col]) ) |
#define TRANSLATE(col) ( g_server_bpp != 8 ? translate_colour(col) : owncolmap ? col : translate_colour(colmap[col]) ) |
109 |
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); |
#define SET_FOREGROUND(col) XSetForeground(display, gc, TRANSLATE(col)); |
600 |
if (ownbackstore) |
if (ownbackstore) |
601 |
{ |
{ |
602 |
backstore = |
backstore = |
603 |
XCreatePixmap(display, RootWindowOfScreen(screen), g_width, g_height, depth); |
XCreatePixmap(display, RootWindowOfScreen(screen), g_width, g_height, |
604 |
|
depth); |
605 |
|
|
606 |
/* clear to prevent rubbish being exposed at startup */ |
/* clear to prevent rubbish being exposed at startup */ |
607 |
XSetForeground(display, gc, BlackPixelOfScreen(screen)); |
XSetForeground(display, gc, BlackPixelOfScreen(screen)); |
1348 |
ui_set_colourmap(HCOLOURMAP map) |
ui_set_colourmap(HCOLOURMAP map) |
1349 |
{ |
{ |
1350 |
if (!owncolmap) |
if (!owncolmap) |
1351 |
|
{ |
1352 |
|
if (colmap) |
1353 |
|
xfree(colmap); |
1354 |
|
|
1355 |
colmap = (uint32 *) map; |
colmap = (uint32 *) map; |
1356 |
|
} |
1357 |
else |
else |
1358 |
XSetWindowColormap(display, wnd, (Colormap) map); |
XSetWindowColormap(display, wnd, (Colormap) map); |
1359 |
} |
} |