mirror of
https://github.com/st3fan/ewm.git
synced 2026-04-20 17:18:49 +00:00
Fixes #102 Colors in hires mode are incorrect
This commit is contained in:
@@ -180,10 +180,10 @@ static uint16_t hgr_line_offsets[192] = {
|
||||
|
||||
static SDL_Color hgr_colors[16] = {
|
||||
{ 0, 0, 0, 0 }, // 0 Black
|
||||
{ 0, 0, 204, 0 }, // 1 Blue
|
||||
{ 128, 0, 128, 0 }, // 2 Purple
|
||||
{ 0, 100, 0, 0 }, // 3 Green
|
||||
{ 0, 100, 0, 0 }, // 4 Red
|
||||
{ 0, 150, 255, 0 }, // 1 Light Blue
|
||||
{ 255, 64, 255, 0 }, // 2 Purple
|
||||
{ 0, 249, 0, 0 }, // 3 Green
|
||||
{ 255, 147, 0, 0 }, // 4 Orange
|
||||
{ 255, 255, 255, 0 } // 5 White
|
||||
};
|
||||
|
||||
@@ -225,7 +225,7 @@ static void inline scr_render_hgr_line_color(struct scr_t *scr, int line, uint16
|
||||
}
|
||||
} else {
|
||||
if (c & 0x80) {
|
||||
pixels[x] = 4; // Red
|
||||
pixels[x] = 4; // Orange
|
||||
} else {
|
||||
pixels[x] = 3; // Green
|
||||
}
|
||||
@@ -245,6 +245,14 @@ static void inline scr_render_hgr_line_color(struct scr_t *scr, int line, uint16
|
||||
}
|
||||
}
|
||||
|
||||
// Fill black pixels with same neighbours
|
||||
|
||||
for (int i = 0; i < (280-1); i++) {
|
||||
if (pixels[i] == pixels[i+2] && pixels[i] != 0) {
|
||||
pixels[i+1] = pixels[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Now draw them
|
||||
|
||||
for (x = 0; x < 280; x++) {
|
||||
|
||||
Reference in New Issue
Block a user