mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
OSD: make plain display (osdtextmode=1) colorized, too.
git-svn-id: https://svn.eduke32.com/eduke32@4137 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
37d8cbedcc
commit
d4c2749b94
1 changed files with 16 additions and 7 deletions
|
@ -440,13 +440,17 @@ static void _internal_drawosdstr(int32_t x, int32_t y, const char *ch, int32_t l
|
|||
char st[1024];
|
||||
|
||||
UNREFERENCED_PARAMETER(shade);
|
||||
UNREFERENCED_PARAMETER(pal);
|
||||
|
||||
if (len>1023) len=1023;
|
||||
Bmemcpy(st,ch,len);
|
||||
st[len]=0;
|
||||
|
||||
printext256(4+(x<<3),4+(y<<3), white, -1, st, 0);
|
||||
OSD_GetShadePal(ch, &shade, &pal);
|
||||
|
||||
{
|
||||
int32_t colidx = white >= 0 ? palookup[(uint8_t)pal][white] : white;
|
||||
printext256(4+(x<<3),4+(y<<3), colidx, -1, st, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void _internal_drawosdcursor(int32_t x, int32_t y, int32_t type, int32_t lastkeypress)
|
||||
|
@ -464,13 +468,18 @@ static void _internal_drawosdcursor(int32_t x, int32_t y, int32_t type, int32_t
|
|||
}
|
||||
|
||||
{
|
||||
int32_t i, j, k;
|
||||
// find the palette index closest to white
|
||||
k=0;
|
||||
int32_t i, k;
|
||||
// Find the palette index closest to Duke3D's brightest blue
|
||||
// "foreground" color. (Index 79, or the last column of the 5th row,
|
||||
// if the palette is laid out in a 16x16 pattern.)
|
||||
k = INT32_MAX;
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
j = ((int32_t)curpalette[i].r)+((int32_t)curpalette[i].g)+((int32_t)curpalette[i].b);
|
||||
if (j > k) { k = j; white = i; }
|
||||
int32_t j =
|
||||
klabs(curpalette[i].r - 4*47) +
|
||||
klabs(curpalette[i].g - 4*55) +
|
||||
klabs(curpalette[i].b - 4*63);
|
||||
if (j < k) { k = j; white = i; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue