Fix GNW color indexes
This commit is contained in:
parent
3a17818ceb
commit
8414effc04
|
@ -549,9 +549,9 @@ void windowDrawText(int win, const char* str, int width, int x, int y, int color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color & 0xFF00) {
|
if ((color & 0xFF00) != 0) {
|
||||||
int t = (color & 0xFF00) >> 8;
|
int colorIndex = (color & 0xFF) - 1;
|
||||||
textColor = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[t]];
|
textColor = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[colorIndex]];
|
||||||
} else {
|
} else {
|
||||||
textColor = color;
|
textColor = color;
|
||||||
}
|
}
|
||||||
|
@ -582,9 +582,9 @@ void windowDrawLine(int win, int left, int top, int right, int bottom, int color
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color & 0xFF00) {
|
if ((color & 0xFF00) != 0) {
|
||||||
int t = (color & 0xFF00) >> 8;
|
int colorIndex = (color & 0xFF) - 1;
|
||||||
color = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[t]];
|
color = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[colorIndex]];
|
||||||
}
|
}
|
||||||
|
|
||||||
bufferDrawLine(window->buffer, window->width, left, top, right, bottom, color);
|
bufferDrawLine(window->buffer, window->width, left, top, right, bottom, color);
|
||||||
|
@ -604,8 +604,8 @@ void windowDrawRect(int win, int left, int top, int right, int bottom, int color
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((color & 0xFF00) != 0) {
|
if ((color & 0xFF00) != 0) {
|
||||||
int v1 = (color & 0xFF00) >> 8;
|
int colorIndex = (color & 0xFF) - 1;
|
||||||
color = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[v1]];
|
color = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[colorIndex]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (right < left) {
|
if (right < left) {
|
||||||
|
@ -643,8 +643,8 @@ void windowFill(int win, int x, int y, int width, int height, int color)
|
||||||
color = _colorTable[_GNW_wcolor[0]] & 0xFF;
|
color = _colorTable[_GNW_wcolor[0]] & 0xFF;
|
||||||
}
|
}
|
||||||
} else if ((color & 0xFF00) != 0) {
|
} else if ((color & 0xFF00) != 0) {
|
||||||
int v1 = (color & 0xFF00) >> 8;
|
int colorIndex = (color & 0xFF) - 1;
|
||||||
color = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[v1]];
|
color = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[colorIndex]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (color < 256) {
|
if (color < 256) {
|
||||||
|
|
|
@ -645,9 +645,8 @@ int _win_msg(const char* string, int x, int y, int color)
|
||||||
|
|
||||||
int textColor;
|
int textColor;
|
||||||
if ((color & 0xFF00) != 0) {
|
if ((color & 0xFF00) != 0) {
|
||||||
int index = (color & 0xFF) - 1;
|
int colorIndex = (color & 0xFF) - 1;
|
||||||
textColor = _colorTable[_GNW_wcolor[index]];
|
textColor = (color & ~0xFFFF) | _colorTable[_GNW_wcolor[colorIndex]];
|
||||||
textColor |= color & ~0xFFFF;
|
|
||||||
} else {
|
} else {
|
||||||
textColor = color;
|
textColor = color;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue