Give the input display HUD translucency

This commit is contained in:
James R 2020-01-03 16:15:15 -08:00
parent 7d4b9c2d33
commit 487b36420d

View file

@ -977,9 +977,13 @@ static void ST_drawInput(void)
const INT32 accent = V_SNAPTOLEFT|V_SNAPTOBOTTOM|(stplyr->skincolor ? Color_Index[stplyr->skincolor-1][4] : 0);
INT32 col;
UINT8 offs;
int translucency;
INT32 x = hudinfo[HUD_LIVES].x, y = hudinfo[HUD_LIVES].y;
if (!( translucency = st_translucency ))/* nothing to see here */
return;
if (stplyr->powers[pw_carry] == CR_NIGHTSMODE)
y -= 16;
@ -987,34 +991,34 @@ static void ST_drawInput(void)
return;
// O backing
V_DrawFill(x, y-1, 16, 16, hudinfo[HUD_LIVES].f|20);
V_DrawFill(x, y+15, 16, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFillMaybeFade(x, y-1, 16, 16, hudinfo[HUD_LIVES].f|20, translucency);
V_DrawFillMaybeFade(x, y+15, 16, 1, hudinfo[HUD_LIVES].f|29, translucency);
if (cv_showinputjoy.value) // joystick render!
{
/*V_DrawFill(x , y , 16, 1, hudinfo[HUD_LIVES].f|16);
V_DrawFill(x , y+15, 16, 1, hudinfo[HUD_LIVES].f|16);
V_DrawFill(x , y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16);
V_DrawFill(x+15, y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16); -- red's outline*/
/*V_DrawFillMaybeFade(x , y , 16, 1, hudinfo[HUD_LIVES].f|16, translucency);
V_DrawFillMaybeFade(x , y+15, 16, 1, hudinfo[HUD_LIVES].f|16, translucency);
V_DrawFillMaybeFade(x , y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16, translucency);
V_DrawFillMaybeFade(x+15, y+ 1, 1, 14, hudinfo[HUD_LIVES].f|16, translucency); -- red's outline*/
if (stplyr->cmd.sidemove || stplyr->cmd.forwardmove)
{
// joystick hole
V_DrawFill(x+5, y+4, 6, 6, hudinfo[HUD_LIVES].f|29);
V_DrawFillMaybeFade(x+5, y+4, 6, 6, hudinfo[HUD_LIVES].f|29, translucency);
// joystick top
V_DrawFill(x+3+stplyr->cmd.sidemove/12,
V_DrawFillMaybeFade(x+3+stplyr->cmd.sidemove/12,
y+2-stplyr->cmd.forwardmove/12,
10, 10, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+3+stplyr->cmd.sidemove/9,
10, 10, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+3+stplyr->cmd.sidemove/9,
y+1-stplyr->cmd.forwardmove/9,
10, 10, accent);
10, 10, accent, translucency);
}
else
{
// just a limited, greyed out joystick top
V_DrawFill(x+3, y+11, 10, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+3,
V_DrawFillMaybeFade(x+3, y+11, 10, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+3,
y+1,
10, 10, hudinfo[HUD_LIVES].f|16);
10, 10, hudinfo[HUD_LIVES].f|16, translucency);
}
}
else // arrows!
@ -1029,13 +1033,13 @@ static void ST_drawInput(void)
{
offs = 1;
col = hudinfo[HUD_LIVES].f|16;
V_DrawFill(x- 2, y+10, 6, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+ 4, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+ 5, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFillMaybeFade(x- 2, y+10, 6, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+ 4, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+ 5, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
}
V_DrawFill(x- 2, y+ 5-offs, 6, 6, col);
V_DrawFill(x+ 4, y+ 6-offs, 1, 4, col);
V_DrawFill(x+ 5, y+ 7-offs, 1, 2, col);
V_DrawFillMaybeFade(x- 2, y+ 5-offs, 6, 6, col, translucency);
V_DrawFillMaybeFade(x+ 4, y+ 6-offs, 1, 4, col, translucency);
V_DrawFillMaybeFade(x+ 5, y+ 7-offs, 1, 2, col, translucency);
// ^
if (stplyr->cmd.forwardmove > 0)
@ -1047,15 +1051,15 @@ static void ST_drawInput(void)
{
offs = 1;
col = hudinfo[HUD_LIVES].f|16;
V_DrawFill(x+ 5, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+ 6, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+ 7, y+ 5, 2, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+ 9, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+10, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFillMaybeFade(x+ 5, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+ 6, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+ 7, y+ 5, 2, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+ 9, y+ 4, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+10, y+ 3, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
}
V_DrawFill(x+ 5, y- 2-offs, 6, 6, col);
V_DrawFill(x+ 6, y+ 4-offs, 4, 1, col);
V_DrawFill(x+ 7, y+ 5-offs, 2, 1, col);
V_DrawFillMaybeFade(x+ 5, y- 2-offs, 6, 6, col, translucency);
V_DrawFillMaybeFade(x+ 6, y+ 4-offs, 4, 1, col, translucency);
V_DrawFillMaybeFade(x+ 7, y+ 5-offs, 2, 1, col, translucency);
// >
if (stplyr->cmd.sidemove > 0)
@ -1067,13 +1071,13 @@ static void ST_drawInput(void)
{
offs = 1;
col = hudinfo[HUD_LIVES].f|16;
V_DrawFill(x+12, y+10, 6, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+11, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFill(x+10, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFillMaybeFade(x+12, y+10, 6, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+11, y+ 9, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
V_DrawFillMaybeFade(x+10, y+ 8, 1, 1, hudinfo[HUD_LIVES].f|29, translucency);
}
V_DrawFill(x+12, y+ 5-offs, 6, 6, col);
V_DrawFill(x+11, y+ 6-offs, 1, 4, col);
V_DrawFill(x+10, y+ 7-offs, 1, 2, col);
V_DrawFillMaybeFade(x+12, y+ 5-offs, 6, 6, col, translucency);
V_DrawFillMaybeFade(x+11, y+ 6-offs, 1, 4, col, translucency);
V_DrawFillMaybeFade(x+10, y+ 7-offs, 1, 2, col, translucency);
// v
if (stplyr->cmd.forwardmove < 0)
@ -1085,11 +1089,11 @@ static void ST_drawInput(void)
{
offs = 1;
col = hudinfo[HUD_LIVES].f|16;
V_DrawFill(x+ 5, y+17, 6, 1, hudinfo[HUD_LIVES].f|29);
V_DrawFillMaybeFade(x+ 5, y+17, 6, 1, hudinfo[HUD_LIVES].f|29, translucency);
}
V_DrawFill(x+ 5, y+12-offs, 6, 6, col);
V_DrawFill(x+ 6, y+11-offs, 4, 1, col);
V_DrawFill(x+ 7, y+10-offs, 2, 1, col);
V_DrawFillMaybeFade(x+ 5, y+12-offs, 6, 6, col, translucency);
V_DrawFillMaybeFade(x+ 6, y+11-offs, 4, 1, col, translucency);
V_DrawFillMaybeFade(x+ 7, y+10-offs, 2, 1, col, translucency);
}
#define drawbutt(xoffs, yoffs, butt, symb)\
@ -1102,15 +1106,15 @@ static void ST_drawInput(void)
{\
offs = 1;\
col = hudinfo[HUD_LIVES].f|16;\
V_DrawFill(x+16+(xoffs), y+9+(yoffs), 10, 1, hudinfo[HUD_LIVES].f|29);\
V_DrawFillMaybeFade(x+16+(xoffs), y+9+(yoffs), 10, 1, hudinfo[HUD_LIVES].f|29, translucency);\
}\
V_DrawFill(x+16+(xoffs), y+(yoffs)-offs, 10, 10, col);\
V_DrawFillMaybeFade(x+16+(xoffs), y+(yoffs)-offs, 10, 10, col, translucency);\
V_DrawCharacter(x+16+1+(xoffs), y+1+(yoffs)-offs, hudinfo[HUD_LIVES].f|symb, false)
drawbutt( 4,-3, BT_JUMP, 'J');
drawbutt(15,-3, BT_USE, 'S');
V_DrawFill(x+16+4, y+8, 21, 10, hudinfo[HUD_LIVES].f|20); // sundial backing
V_DrawFillMaybeFade(x+16+4, y+8, 21, 10, hudinfo[HUD_LIVES].f|20, translucency); // sundial backing
if (stplyr->mo)
{
UINT8 i, precision;
@ -1123,18 +1127,18 @@ static void ST_drawInput(void)
ycomp = 3;
if (ycomp > 0)
V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (behind)
V_DrawFillMaybeFade(x+16+13-xcomp, y+11-ycomp, 3, 3, accent, translucency); // point (behind)
precision = max(3, abs(xcomp));
for (i = 0; i < precision; i++) // line
{
V_DrawFill(x+16+14-(i*xcomp)/precision,
V_DrawFillMaybeFade(x+16+14-(i*xcomp)/precision,
y+12-(i*ycomp)/precision,
1, 1, hudinfo[HUD_LIVES].f|16);
1, 1, hudinfo[HUD_LIVES].f|16, translucency);
}
if (ycomp <= 0)
V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (in front)
V_DrawFillMaybeFade(x+16+13-xcomp, y+11-ycomp, 3, 3, accent, translucency); // point (in front)
}
#undef drawbutt