handle highres portraits and statdisplay text more gracefully on low resolutions

below 640x400 the highres portraits become an absolute mess so itll now fallback to the lowres portraits
the statdisplay name text also became completely unreadable so itll use V_DrawThinString instead on low resolutions
This commit is contained in:
Alug committed 2025-04-10 21:16:15 +02:00
1 parent 1a28886ce2
commit dadde36ff6
4 files changed
+58 -48

No files matched your search

+17 -23
View File
@@ -169,7 +169,7 @@ char french_shiftxform[] =
31,
' ','$', //shift-!
'3', //shift-"
'#', '$', '%',
'#', '$', '%',
'1', //shift-&
'4', // shift-'
'5', // shift-(
@@ -179,7 +179,7 @@ char french_shiftxform[] =
'6', // shift--
'.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9',
'6', '7', '8', '9',
'/', // shitf-:
'.', // shift-;
'>', // shift-<
@@ -222,7 +222,7 @@ char french_altgrxform[] =
'|', //altg--
'.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9',
'6', '7', '8', '9',
':', ';', '<',
'}', //altgr-=
'>', '?', '@',
@@ -1140,7 +1140,7 @@ void HU_Ticker(void)
}
if (cechotimer > 0) --cechotimer;
// Animate the desynch dots
if (hu_resynching
#ifdef SATURNPAK
@@ -2434,7 +2434,7 @@ void HU_drawPlayerPing(INT32 x, INT32 y, INT32 pnum, INT32 flags)
if (measureid == 1)
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
if (cv_pingicon.value)
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
@@ -2563,24 +2563,19 @@ static inline void HU_DrawSpectatorTicker(void)
if (cv_showspecstuff.value)
{
if (players[i].mo)
player_t *player;
player = &players[i];
if (player->mo && player->mo->color)
{
player_t *p;
p = &players[i];
const UINT8 *colormap = R_GetTranslationColormap(player->skin, player->mo->color, GTC_CACHE);
if (player->mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, player->mo->color, GTC_CACHE);
if (players[i].mo->color)
{
const UINT8 *colormap;
if (players[i].mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, players[i].mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(players[i].skin, players[i].mo->color, GTC_CACHE);
if (cv_highresportrait.value)
V_DrawSmallMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceWant(p), colormap);
else
V_DrawMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceRank(p), colormap);
}
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceWant(player), colormap);
else
V_DrawMappedPatch((templength - duptweak), height+10, V_TRANSLUCENT, R_GetSkinFaceRank(player), colormap);
}
if ((netgame && i != serverplayer) || (cv_mindelay.value && P_IsLocalPlayer(&players[i])))
@@ -2595,7 +2590,6 @@ static inline void HU_DrawSpectatorTicker(void)
}
}
//
// HU_DrawRankings
//
@@ -2781,7 +2775,7 @@ void HU_DoCEcho(const char *msg)
{
if (!cv_cechotoggle.value)
return
I_OutputMsg("%s\n", msg); // print to log
#pragma GCC diagnostic push
+35 -20
View File
@@ -814,6 +814,16 @@ static UINT8 K_GetSpeedometerStyle(void)
return SPEEDO_VANILLA;
}
static boolean K_IsHighResolution(void)
{
return (vid.width >= 640 && vid.height >= 400);
}
boolean K_UseHighResPortraits(void)
{
return (cv_highresportrait.value && K_IsHighResolution());
}
//}
//{ SRB2kart Net Variables
@@ -8669,10 +8679,17 @@ static void K_drawKartStats(void)
if (!splitscreen)
{
// Skin name
V_DrawSmallString(x+20, y+12, flags|V_ALLOWLOWERCASE|V_SkinColorToHighlightcolor(stplyr->skincolor), fakeskin->realname);
if (K_IsHighResolution()) // V_DrawSmallString becomes a mess at low resolutions lel
{
V_DrawSmallString(x+20, y+12, flags|V_ALLOWLOWERCASE|V_SkinColorToHighlightcolor(stplyr->skincolor), fakeskin->realname);
}
else
{
V_DrawThinString(x+20, y+7, flags|V_ALLOWLOWERCASE|V_SkinColorToHighlightcolor(stplyr->skincolor), fakeskin->realname);
}
// Icon and stats
if (cv_highresportrait.value)
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch(x, y, flags, R_GetSkinFaceWant(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
else
V_DrawMappedPatch(x, y, flags, R_GetSkinFaceRank(stplyr), R_GetLocalTranslationColormap(fakeskin, fakeskin, stplyr->skincolor, GTC_CACHE, stplyr->skinlocal));
@@ -9439,39 +9456,37 @@ static boolean K_drawKartPositionFaces(void)
for (; i < ranklines; i++)
{
player_t *player;
player = &players[rankplayer[i]];
if (!playeringame[rankplayer[i]])
continue;
if (players[rankplayer[i]].spectator)
if (player->spectator)
continue;
if (!players[rankplayer[i]].mo)
if (!player->mo)
continue;
const UINT8 mocolor = players[rankplayer[i]].mo->color;
const UINT8 mocolor = player->mo->color;
bumperx = FACE_X+19;
if (mocolor)
{
player_t *p;
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, mocolor, GTC_CACHE);
if (players[rankplayer[i]].mo->colorized)
colormap = R_GetTranslationColormap(player->skin, mocolor, GTC_CACHE);
if (player->mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, mocolor, GTC_CACHE);
p = &players[rankplayer[i]];
if (cv_highresportrait.value)
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceWant(p), colormap);
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceWant(player), colormap);
else
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceRank(p), colormap);
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceRank(player), colormap);
if (LUA_HudEnabled(hud_battlebumpers))
{
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] > 0)
{
V_DrawMappedPatch(bumperx-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_tinybumper[0], colormap);
for (j = 1; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
for (j = 1; j < player->kartstuff[k_bumper]; j++)
{
bumperx += 5;
V_DrawMappedPatch(bumperx, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_tinybumper[1], colormap);
@@ -9483,11 +9498,11 @@ static boolean K_drawKartPositionFaces(void)
if (i == strank)
V_DrawScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_facehighlight[(leveltime / 4) % 8]);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
V_DrawScaledPatch(FACE_X-4, Y-3, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
{
INT32 pos = players[rankplayer[i]].kartstuff[k_position];
INT32 pos = player->kartstuff[k_position];
if (pos < 0 || pos > MAXPLAYERS)
pos = 0;
// Draws the little number over the face
@@ -9553,7 +9568,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
else
colormap = R_GetTranslationColormap(player->skin, player->mo->color, GTC_CACHE);
if (cv_highresportrait.value)
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch(x, y-4, 0, R_GetSkinFaceWant(player), colormap);
else
V_DrawMappedPatch(x, y-4, 0, R_GetSkinFaceRank(player), colormap);
+1
View File
@@ -21,6 +21,7 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, bo
UINT8 K_GetKartColorByName(const char *name);
UINT8 K_GetHudColor(void);
boolean K_UseColorHud(void);
boolean K_UseHighResPortraits(void);
void K_RegisterServerKartStuff(void);
void K_RegisterClientKartStuff(void);
+5 -5
View File
@@ -412,11 +412,11 @@ static void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 x, INT32 hilicol)
patch_t *faceprefix = NULL;
if (!player->skinlocal)
faceprefix = (cv_highresportrait.value ? facewantprefix[skinnum] : facerankprefix[skinnum]);
faceprefix = (K_UseHighResPortraits() ? facewantprefix[skinnum] : facerankprefix[skinnum]);
else
faceprefix = (cv_highresportrait.value ? localfacewantprefix[skinnum] : localfacerankprefix[skinnum]);
faceprefix = (K_UseHighResPortraits() ? localfacewantprefix[skinnum] : localfacerankprefix[skinnum]);
if (cv_highresportrait.value)
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch(x + 16, y - 4, 0, faceprefix, colormap);
else
V_DrawMappedPatch(x + 16, y - 4, 0, faceprefix, colormap);
@@ -513,7 +513,7 @@ void Y_IntermissionDrawer(void)
return;
if (cv_betainterscreen.value == 1
#ifdef HWRENDER
#ifdef HWRENDER
|| (rendermode == render_opengl && cv_glscreentextures.value != 2) // use the neato kart bg for intermission on disabled screen textures
#endif
)
@@ -1178,7 +1178,7 @@ void Y_VoteDrawer(void)
if (players[i].skincolor)
{
UINT8 *colormap = R_GetTranslationColormap(players[i].skin, players[i].skincolor, GTC_CACHE);
if (cv_highresportrait.value)
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch(x+24, y+9, V_SNAPTOLEFT, (players[i].skinlocal ? localfacewantprefix : facewantprefix)[((players[i].localskin) ? players[i].localskin-1 : players[i].skin)], colormap);
else
V_DrawMappedPatch(x+24, y+9, V_SNAPTOLEFT, (players[i].skinlocal ? localfacerankprefix : facerankprefix)[((players[i].localskin) ? players[i].localskin-1 : players[i].skin)], colormap);