mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
* Add new console text colours - sky, purple, aqua, peridot, azure, brown, rosy, and invert.
* Remove redundant check from V_DrawFadeScreen(). * Clean up potential endless sound source in Race HUD.
This commit is contained in:
parent
7018ce925b
commit
33d5baa2aa
6 changed files with 88 additions and 53 deletions
|
@ -226,13 +226,9 @@ static void CONS_Bind_f(void)
|
|||
// Font colormap colors
|
||||
// TODO: This could probably be improved somehow...
|
||||
// These colormaps are 99% identical, with just a few changed bytes
|
||||
UINT8 *yellowmap;
|
||||
UINT8 *purplemap;
|
||||
UINT8 *lgreenmap;
|
||||
UINT8 *bluemap;
|
||||
UINT8 *graymap;
|
||||
UINT8 *redmap;
|
||||
UINT8 *orangemap;
|
||||
// This could EASILY be handled by modifying a centralised colormap
|
||||
// for software depending on the prior state - but yknow, OpenGL...
|
||||
UINT8 *yellowmap, *magentamap, *lgreenmap, *bluemap, *graymap, *redmap, *orangemap, *skymap, *purplemap, *aquamap, *peridotmap, *azuremap, *brownmap, *rosymap, *invertmap;
|
||||
|
||||
// Console BG color
|
||||
UINT8 *consolebgmap = NULL;
|
||||
|
@ -280,45 +276,55 @@ static void CONS_backcolor_Change(void)
|
|||
static void CON_SetupColormaps(void)
|
||||
{
|
||||
INT32 i;
|
||||
UINT8 *memorysrc = (UINT8 *)Z_Malloc((256*15), PU_STATIC, NULL);
|
||||
|
||||
yellowmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
graymap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
purplemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
lgreenmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
bluemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
redmap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
orangemap = (UINT8 *)Z_Malloc(256, PU_STATIC, NULL);
|
||||
magentamap = memorysrc;
|
||||
yellowmap = (magentamap+256);
|
||||
lgreenmap = (yellowmap+256);
|
||||
bluemap = (lgreenmap+256);
|
||||
redmap = (bluemap+256);
|
||||
graymap = (redmap+256);
|
||||
orangemap = (graymap+256);
|
||||
skymap = (orangemap+256);
|
||||
purplemap = (skymap+256);
|
||||
aquamap = (purplemap+256);
|
||||
peridotmap = (aquamap+256);
|
||||
azuremap = (peridotmap+256);
|
||||
brownmap = (azuremap+256);
|
||||
rosymap = (brownmap+256);
|
||||
invertmap = (rosymap+256);
|
||||
|
||||
// setup the other colormaps, for console text
|
||||
|
||||
// these don't need to be aligned, unless you convert the
|
||||
// V_DrawMappedPatch() into optimised asm.
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
yellowmap[i] = (UINT8)i; // remap each color to itself...
|
||||
graymap[i] = (UINT8)i;
|
||||
purplemap[i] = (UINT8)i;
|
||||
lgreenmap[i] = (UINT8)i;
|
||||
bluemap[i] = (UINT8)i;
|
||||
redmap[i] = (UINT8)i;
|
||||
orangemap[i] = (UINT8)i;
|
||||
}
|
||||
for (i = 0; i < (256*15); i++, ++memorysrc)
|
||||
*memorysrc = (UINT8)(i & 0xFF); // remap each color to itself...
|
||||
|
||||
yellowmap[3] = (UINT8)73;
|
||||
yellowmap[9] = (UINT8)66;
|
||||
purplemap[3] = (UINT8)184;
|
||||
purplemap[9] = (UINT8)186;
|
||||
lgreenmap[3] = (UINT8)98;
|
||||
lgreenmap[9] = (UINT8)106;
|
||||
bluemap[3] = (UINT8)147;
|
||||
bluemap[9] = (UINT8)158;
|
||||
graymap[3] = (UINT8)10;
|
||||
graymap[9] = (UINT8)15;
|
||||
redmap[3] = (UINT8)210;
|
||||
redmap[9] = (UINT8)32;
|
||||
orangemap[3] = (UINT8)52;
|
||||
orangemap[9] = (UINT8)57;
|
||||
#define colset(map, a, b, c) \
|
||||
map[1] = (UINT8)a;\
|
||||
map[3] = (UINT8)b;\
|
||||
map[9] = (UINT8)c
|
||||
|
||||
colset(magentamap, 177, 178, 184);
|
||||
colset(yellowmap, 82, 73, 66);
|
||||
colset(lgreenmap, 97, 98, 106);
|
||||
colset(bluemap, 146, 147, 155);
|
||||
colset(redmap, 210, 32, 39);
|
||||
colset(graymap, 8, 10, 15);
|
||||
colset(orangemap, 51, 52, 57);
|
||||
colset(skymap, 129, 130, 133);
|
||||
colset(purplemap, 160, 161, 163);
|
||||
colset(aquamap, 120, 121, 123);
|
||||
colset(peridotmap, 88, 188, 190);
|
||||
colset(azuremap, 144, 145, 170);
|
||||
colset(brownmap, 219, 221, 224);
|
||||
colset(rosymap, 200, 201, 203);
|
||||
colset(invertmap, 27, 26, 22);
|
||||
invertmap[26] = (UINT8)3;
|
||||
|
||||
#undef colset
|
||||
|
||||
// Init back colormap
|
||||
CON_SetupBackColormap();
|
||||
|
|
|
@ -34,7 +34,7 @@ extern UINT32 con_scalefactor; // console text scale factor
|
|||
|
||||
extern consvar_t cons_backcolor;
|
||||
|
||||
extern UINT8 *yellowmap, *purplemap, *lgreenmap, *bluemap, *graymap, *redmap, *orangemap;
|
||||
extern UINT8 *yellowmap, *magentamap, *lgreenmap, *bluemap, *graymap, *redmap, *orangemap, *skymap, *purplemap, *aquamap, *peridotmap, *azuremap, *brownmap, *rosymap, *invertmap;
|
||||
|
||||
// Console bg color (auto updated to match)
|
||||
extern UINT8 *consolebgmap;
|
||||
|
|
|
@ -7311,13 +7311,21 @@ struct {
|
|||
{"V_6WIDTHSPACE",V_6WIDTHSPACE},
|
||||
{"V_OLDSPACING",V_OLDSPACING},
|
||||
{"V_MONOSPACE",V_MONOSPACE},
|
||||
{"V_PURPLEMAP",V_PURPLEMAP},
|
||||
{"V_MAGENTAMAP",V_MAGENTAMAP},
|
||||
{"V_YELLOWMAP",V_YELLOWMAP},
|
||||
{"V_GREENMAP",V_GREENMAP},
|
||||
{"V_BLUEMAP",V_BLUEMAP},
|
||||
{"V_REDMAP",V_REDMAP},
|
||||
{"V_GRAYMAP",V_GRAYMAP},
|
||||
{"V_ORANGEMAP",V_ORANGEMAP},
|
||||
{"V_SKYMAP",V_SKYMAP},
|
||||
{"V_PURPLEMAP",V_PURPLEMAP},
|
||||
{"V_AQUAMAP",V_AQUAMAP},
|
||||
{"V_PERIDOTMAP",V_PERIDOTMAP},
|
||||
{"V_AZUREMAP",V_AZUREMAP},
|
||||
{"V_BROWNMAP",V_BROWNMAP},
|
||||
{"V_ROSYMAP",V_ROSYMAP},
|
||||
{"V_INVERTMAP",V_INVERTMAP},
|
||||
{"V_TRANSLUCENT",V_TRANSLUCENT},
|
||||
{"V_10TRANS",V_10TRANS},
|
||||
{"V_20TRANS",V_20TRANS},
|
||||
|
|
|
@ -1684,7 +1684,7 @@ static inline void ST_drawRaceHUD(void)
|
|||
if (bounce < 3)
|
||||
{
|
||||
height -= (2 - bounce);
|
||||
if (!bounce)
|
||||
if (!(P_AutoPause() || paused) && !bounce)
|
||||
S_StartSound(0, ((racenum == racego) ? sfx_s3kad : sfx_s3ka7));
|
||||
}
|
||||
V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(racenum->width))/2), (INT32)(SCZ(height)), V_NOSCALESTART|V_PERPLAYER, racenum);
|
||||
|
|
|
@ -1329,9 +1329,6 @@ void V_DrawPatchFill(patch_t *pat)
|
|||
//
|
||||
void V_DrawFadeScreen(UINT16 color, UINT8 strength)
|
||||
{
|
||||
if (!strength)
|
||||
return;
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode != render_soft && rendermode != render_none)
|
||||
{
|
||||
|
@ -1395,20 +1392,36 @@ static const UINT8 *V_GetStringColormap(INT32 colorflags)
|
|||
{
|
||||
switch ((colorflags & V_CHARCOLORMASK) >> V_CHARCOLORSHIFT)
|
||||
{
|
||||
case 1: // 0x81, purple
|
||||
return purplemap;
|
||||
case 2: // 0x82, yellow
|
||||
case 1: // 0x81, magenta
|
||||
return magentamap;
|
||||
case 2: // 0x82, yellow
|
||||
return yellowmap;
|
||||
case 3: // 0x83, lgreen
|
||||
case 3: // 0x83, lgreen
|
||||
return lgreenmap;
|
||||
case 4: // 0x84, blue
|
||||
case 4: // 0x84, blue
|
||||
return bluemap;
|
||||
case 5: // 0x85, red
|
||||
case 5: // 0x85, red
|
||||
return redmap;
|
||||
case 6: // 0x86, gray
|
||||
case 6: // 0x86, gray
|
||||
return graymap;
|
||||
case 7: // 0x87, orange
|
||||
case 7: // 0x87, orange
|
||||
return orangemap;
|
||||
case 8: // 0x88, sky
|
||||
return skymap;
|
||||
case 9: // 0x89, purple
|
||||
return purplemap;
|
||||
case 10: // 0x8A, aqua
|
||||
return aquamap;
|
||||
case 11: // 0x8B, peridot
|
||||
return peridotmap;
|
||||
case 12: // 0x8C, azure
|
||||
return azuremap;
|
||||
case 13: // 0x8D, brown
|
||||
return brownmap;
|
||||
case 14: // 0x8E, rosy
|
||||
return rosymap;
|
||||
case 15: // 0x8F, invert
|
||||
return invertmap;
|
||||
default: // reset
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -73,13 +73,21 @@ extern RGBA_t *pMasterPalette;
|
|||
#define V_CHARCOLORSHIFT 12
|
||||
#define V_CHARCOLORMASK 0x0000F000
|
||||
// for simplicity's sake, shortcuts to specific colors
|
||||
#define V_PURPLEMAP 0x00001000
|
||||
#define V_MAGENTAMAP 0x00001000
|
||||
#define V_YELLOWMAP 0x00002000
|
||||
#define V_GREENMAP 0x00003000
|
||||
#define V_BLUEMAP 0x00004000
|
||||
#define V_REDMAP 0x00005000
|
||||
#define V_GRAYMAP 0x00006000
|
||||
#define V_ORANGEMAP 0x00007000
|
||||
#define V_SKYMAP 0x00008000
|
||||
#define V_PURPLEMAP 0x00009000
|
||||
#define V_AQUAMAP 0x0000A000
|
||||
#define V_PERIDOTMAP 0x0000B000
|
||||
#define V_AZUREMAP 0x0000C000
|
||||
#define V_BROWNMAP 0x0000D000
|
||||
#define V_ROSYMAP 0x0000E000
|
||||
#define V_INVERTMAP 0x0000F000
|
||||
|
||||
// use bits 17-20 for alpha transparency
|
||||
#define V_ALPHASHIFT 16
|
||||
|
|
Loading…
Reference in a new issue