diff options
| -rw-r--r-- | swt.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -50,6 +50,7 @@ typedef struct { /* function prototypes */ +ushort sixd_to_8bit(int x); static void setup(); static void cleanup(); static void run(); @@ -155,7 +156,6 @@ void wclipcopy() { void wdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) { - draw_rect( win.canvas, ox * win.fontcache->box.width, @@ -178,7 +178,7 @@ void wdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) { cy * win.fontcache->box.height, win.fontcache->box.width, win.fontcache->box.height, - colors[g.bg] + colors[g.fg] ); draw_char( win.canvas, @@ -186,7 +186,7 @@ void wdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) { g.u, cx * win.fontcache->box.width, cy * win.fontcache->box.height + win.fontcache->fontsize, - colors[g.fg] + colors[g.bg] ); } @@ -237,6 +237,7 @@ sixd_to_8bit(int x) void wloadcols() { int i; + int c; for (i = 0; i < sizeof(colors) / sizeof(uint32_t); ++i) { if (colors[i] == 0) { @@ -244,6 +245,10 @@ void wloadcols() { colors[i] = sixd_to_8bit(((i - 16) / 36) % 6) << 16 | sixd_to_8bit(((i - 16) / 6) % 6) << 8 | sixd_to_8bit(((i - 16) / 1) % 6); + } else { + c = 0x08 + 0x0a * (i - (6 * 6 * 6 * 6 + 16)); + c &= 0xff; + colors[i] = (c << 16) | (c << 8) | c; } } |