* Modified, maybe-improved title. May need to be selectively reverted, but...

* To go with this, have the HUD fade in as the title goes away.
* After complaints, only do dogear gametype indicators on the voting screen for levels which don't match the prevailing gametype, and use thin font to intrude on the level pic less.
* Make the voting screen background a different graphic in battle.
* Improve behaviour of DrawDiag in GL.
This commit is contained in:
toaster 2018-06-28 19:07:04 +01:00
parent dcec24605e
commit a50a67b273
6 changed files with 105 additions and 71 deletions

View file

@ -292,9 +292,9 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
{
FSurfaceInfo Surf;
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff;
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[hudtrans];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[hudtrans];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[hudtrans];
else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel];
flags |= PF_Modulated;
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
@ -446,9 +446,9 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
{
FSurfaceInfo Surf;
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff;
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[hudtrans];
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[hudtrans];
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[hudtrans];
else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel];
flags |= PF_Modulated;
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
@ -911,7 +911,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
{
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh;
float fx, fy, fw, fh, fwait = 0;
if (wh < 0)
return; // consistency w/ software
@ -966,8 +966,11 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
if (fw <= 0 || fh <= 0)
return;
/*if (fx + fw > vid.width) -- oh gee oh boy oh shit
fw = (float)vid.width - fx;*/
if (fx + fw > vid.width)
{
fwait = fw - ((float)vid.width - fx);
fw = (float)vid.width - fx;
}
if (fy + fh > vid.height)
fh = (float)vid.height - fy;
@ -976,10 +979,11 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
fw = fw / (vid.width / 2);
fh = fh / (vid.height / 2);
v[0].x = v[2].x = v[3].x = fx;
v[1].x = fx + fw;
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
v[0].y = v[1].y = fy;
v[2].y = v[3].y = fy - fh;
v[3].y = fy - fh;
v[2].y = fy - fwait;
//Hurdler: do we still use this argb color? if not, we should remove it
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;

View file

@ -4091,6 +4091,13 @@ static void K_initKartHUD(void)
}
}
}
if (timeinmap > 113)
hudtrans = cv_translucenthud.value;
else if (timeinmap > 105)
hudtrans = ((((INT32)timeinmap) - 105)*cv_translucenthud.value)/(113-105);
else
hudtrans = 0;
}
INT32 K_calcSplitFlags(INT32 snapflags)
@ -4845,8 +4852,7 @@ static void K_drawKartMinimap(void)
patch_t *AutomapPic;
INT32 i = 0;
INT32 x, y;
const INT32 minimaptrans = ((10-cv_kartminimap.value)<<FF_TRANSSHIFT);
INT32 splitflags = V_SNAPTORIGHT|minimaptrans;
INT32 minimaptrans, splitflags = (splitscreen ? 0 : V_SNAPTORIGHT);
// Draw the HUD only when playing in a level.
// hu_stuff needs this, unlike st_stuff.
@ -4866,8 +4872,19 @@ static void K_drawKartMinimap(void)
x = MINI_X - (AutomapPic->width/2);
y = MINI_Y - (AutomapPic->height/2);
if (splitscreen)
splitflags = 0;
if (timeinmap > 105)
{
minimaptrans = (splitscreen ? 10 : cv_kartminimap.value);
if (timeinmap <= 113)
minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105);
if (!minimaptrans)
return;
}
else
return;
minimaptrans = ((10-minimaptrans)<<FF_TRANSSHIFT);
splitflags |= minimaptrans;
if (mirrormode)
V_DrawScaledPatch(x+(AutomapPic->width), y, splitflags|V_FLIP, AutomapPic);

View file

@ -755,23 +755,27 @@ static void ST_drawLevelTitle(void)
char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart
char *actnum = mapheaderinfo[gamemap-1]->actnum;
INT32 lvlttlxpos;
INT32 subttlxpos = BASEVIDWIDTH/2;
INT32 ttlnumxpos;
INT32 zonexpos;
INT32 dupcalc = (vid.width/vid.dupx);
UINT8 gtc = G_GetGametypeColor(gametype);
INT32 sub = 0;
INT32 lvlttly = 145;
INT32 zoney = 169;
INT32 lvlw;
INT32 lvlttly;
INT32 zoney;
if (!(timeinmap > 2 && timeinmap-3 < 110))
if (timeinmap > 113)
return;
if (strlen(actnum) > 0)
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)) - V_LevelNameWidth(actnum);
else
lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2));
lvlw = V_LevelNameWidth(lvlttl);
ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl);
if (strlen(zonttl) > 0)
if (strlen(actnum) > 0)
lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)) - V_LevelNameWidth(actnum);
else
lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2));
ttlnumxpos = lvlttlxpos + lvlw;
if (zonttl[0])
zonexpos = ttlnumxpos - V_LevelNameWidth(zonttl); // SRB2kart
else
zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE"));
@ -779,25 +783,29 @@ static void ST_drawLevelTitle(void)
if (lvlttlxpos < 0)
lvlttlxpos = 0;
// There's no consistent algorithm that can accurately define the old positions
// so I just ended up resorting to a single switct statement to define them
switch (timeinmap-3)
if (timeinmap > 105)
{
case 0: zoney = 200; lvlttly = 0; break;
case 1: zoney = 188; lvlttly = 12; break;
case 2: zoney = 176; lvlttly = 24; break;
case 3: zoney = 164; lvlttly = 36; break;
case 4: zoney = 152; lvlttly = 48; break;
case 5: zoney = 140; lvlttly = 60; break;
case 6: zoney = 128; lvlttly = 72; break;
case 105: zoney = 80; lvlttly = 104; break;
case 106: zoney = 56; lvlttly = 128; break;
case 107: zoney = 32; lvlttly = 152; break;
case 108: zoney = 8; lvlttly = 176; break;
case 109: zoney = 0; lvlttly = 200; break;
default: zoney = 104; lvlttly = 80; break;
INT32 count = (113 - (INT32)(timeinmap));
sub = dupcalc;
while (count-- > 0)
sub >>= 1;
sub = -sub;
}
{
dupcalc = (dupcalc - BASEVIDWIDTH)>>1;
INT32 h = lvlttly + V_LevelNameHeight(lvlttl) + 2;
V_DrawFill(sub - dupcalc, h+9, lvlttlxpos + lvlw + 1 - dupcalc, 2, 31);
V_DrawDiag(sub + lvlttlxpos + lvlw + 1, h, 11, 31);
V_DrawFill(sub - dupcalc, h, lvlttlxpos + lvlw - dupcalc, 10, gtc);
V_DrawDiag(sub + lvlttlxpos + lvlw, h, 10, gtc);
V_DrawString(sub + lvlttlxpos, h+1, V_ALLOWLOWERCASE, subttl);
}
ttlnumxpos += sub;
lvlttlxpos += sub;
zonexpos += sub;
if (strlen(actnum) > 0)
V_DrawLevelTitle(ttlnumxpos+12, zoney, 0, actnum);
@ -807,9 +815,6 @@ static void ST_drawLevelTitle(void)
V_DrawLevelTitle(zonexpos, zoney, 0, zonttl);
else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
V_DrawLevelTitle(zonexpos, zoney, 0, M_GetText("ZONE"));
if (lvlttly+48 < 200)
V_DrawCenteredString(subttlxpos, lvlttly+48, V_ALLOWLOWERCASE, subttl);
}
/*

View file

@ -305,6 +305,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3
//static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5};
UINT8 hudtrans = 0;
static const UINT8 *v_colormap = NULL;
static const UINT8 *v_translevel = NULL;
@ -359,11 +360,11 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT)))
{
if (alphalevel == 13)
alphalevel = hudminusalpha[cv_translucenthud.value];
alphalevel = hudminusalpha[hudtrans];
else if (alphalevel == 14)
alphalevel = 10 - cv_translucenthud.value;
alphalevel = 10 - hudtrans;
/*else if (alphalevel == 15)
alphalevel = hudplusalpha[cv_translucenthud.value];*/
alphalevel = hudplusalpha[hudtrans];*/
if (alphalevel >= 10)
return; // invis

View file

@ -43,6 +43,8 @@ const char *GetPalette(void);
extern RGBA_t *pLocalPalette;
extern UINT8 hudtrans;
// Retrieve the ARGB value from a palette color index
#define V_GetColor(color) (pLocalPalette[color&0xFF])

View file

@ -2187,7 +2187,7 @@ void Y_VoteDrawer(void)
{
char str[40];
patch_t *pic;
UINT8 sizeadd = selected[i], j, color, gtc = levelinfo[i].gtc;
UINT8 sizeadd = selected[i], j, color;
if (i == 3)
{
@ -2262,17 +2262,14 @@ void Y_VoteDrawer(void)
V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, pic);
V_DrawRightAlignedThinString(BASEVIDWIDTH-20, 40+y, V_SNAPTORIGHT, str);
{
INT32 w = 0;
if (levelinfo[i].gts)
{
w = V_StringWidth(levelinfo[i].gts, V_SNAPTORIGHT)+2;
V_DrawFill(BASEVIDWIDTH-100, y+9, w+1, 2, V_SNAPTORIGHT|31);
V_DrawFill(BASEVIDWIDTH-100, y, w, 10, V_SNAPTORIGHT|gtc);
V_DrawString(BASEVIDWIDTH-99, y+1, V_SNAPTORIGHT, levelinfo[i].gts);
}
V_DrawDiag(BASEVIDWIDTH-100+w+1, y, 11, V_SNAPTORIGHT|31);
V_DrawDiag(BASEVIDWIDTH-100+w, y, 10, V_SNAPTORIGHT|gtc);
INT32 w = V_ThinStringWidth(levelinfo[i].gts, V_SNAPTORIGHT)+1;
V_DrawFill(BASEVIDWIDTH-100, y+10, w+1, 2, V_SNAPTORIGHT|31);
V_DrawFill(BASEVIDWIDTH-100, y, w, 11, V_SNAPTORIGHT|levelinfo[i].gtc);
V_DrawDiag(BASEVIDWIDTH-100+w+1, y, 12, V_SNAPTORIGHT|31);
V_DrawDiag(BASEVIDWIDTH-100+w, y, 11, V_SNAPTORIGHT|levelinfo[i].gtc);
V_DrawThinString(BASEVIDWIDTH-99, y+1, V_SNAPTORIGHT, levelinfo[i].gts);
}
y += 50;
@ -2280,8 +2277,11 @@ void Y_VoteDrawer(void)
else
{
V_DrawTinyScaledPatch(BASEVIDWIDTH-60, y, V_SNAPTORIGHT, pic);
if (levelinfo[i].gts)
{
V_DrawDiag(BASEVIDWIDTH-60, y, 8, V_SNAPTORIGHT|31);
V_DrawDiag(BASEVIDWIDTH-60, y, 6, V_SNAPTORIGHT|gtc);
V_DrawDiag(BASEVIDWIDTH-60, y, 6, V_SNAPTORIGHT|levelinfo[i].gtc);
}
y += 25;
}
@ -2299,7 +2299,6 @@ void Y_VoteDrawer(void)
if ((playeringame[i] && !players[i].spectator) && votes[i] != -1)
{
patch_t *pic;
UINT8 gtc = levelinfo[votes[i]].gtc;
if (votes[i] == 3 && (i != pickedvote || voteendtic == -1))
pic = randomlvl;
@ -2316,8 +2315,11 @@ void Y_VoteDrawer(void)
}
V_DrawTinyScaledPatch(x, y, V_SNAPTOLEFT, pic);
if (levelinfo[votes[i]].gts)
{
V_DrawDiag(x, y, 8, V_SNAPTOLEFT|31);
V_DrawDiag(x, y, 6, V_SNAPTOLEFT|gtc);
V_DrawDiag(x, y, 6, V_SNAPTOLEFT|levelinfo[votes[i]].gtc);
}
if (players[i].skincolor == 0)
V_DrawSmallScaledPatch(x+24, y+9, V_SNAPTOLEFT, faceprefix[players[i].skin]);
@ -2552,8 +2554,8 @@ void Y_StartVote(void)
I_Error("voteendtic is dirty");
#endif
widebgpatch = W_CachePatchName("INTERSCW", PU_STATIC);
bgpatch = W_CachePatchName("INTERSCR", PU_STATIC);
widebgpatch = W_CachePatchName(((gametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_STATIC);
bgpatch = W_CachePatchName(((gametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_STATIC);
cursor = W_CachePatchName("M_CURSOR", PU_STATIC);
cursor1 = W_CachePatchName("P1CURSOR", PU_STATIC);
cursor2 = W_CachePatchName("P2CURSOR", PU_STATIC);
@ -2615,13 +2617,16 @@ void Y_StartVote(void)
levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0';
// set up the gtc and gts
levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]);
levelinfo[i].gts = NULL;
if (i == 2 && votelevels[i][1] != votelevels[0][1])
{
levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]);
for (j = 0; gametype_cons_t[j].strvalue; j++)
{
if (gametype_cons_t[j].value == votelevels[i][1])
levelinfo[i].gts = gametype_cons_t[j].strvalue;
}
}
// set up the pic
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1)));