diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 8353acbdc..e993a3107 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -526,6 +526,7 @@ consvar_t cv_nametagmaxplayers = {"nametagmaxplayers", "8", CV_SAVE, CV_Unsigned consvar_t cv_nametagmaxlenght = {"nametagmaxlenght", "12", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; //consvar_t cv_nametagscaling = {"nametagscaling", "160", CV_SAVE, nametagscaling_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_showownnametag = {"showownnametag", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_smallnametags = {"smallnametags", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t skinselectspin_cons_t[] = { {0, "Off"}, {1, "Slow"}, {2, "2"}, {3, "3"}, {4, "4"}, {5, "5"}, {6, "6"}, {7, "7"}, {8, "8"}, {9, "9"}, {10, "Fast"}, {SKINSELECTSPIN_PAIN, "Pain"}, {0, NULL}}; @@ -1149,6 +1150,7 @@ void D_RegisterClientCommands(void) //CV_RegisterVar(&cv_nametagscaling); CV_RegisterVar(&cv_nametagdist); CV_RegisterVar(&cv_showownnametag); + CV_RegisterVar(&cv_smallnametags); CV_RegisterVar(&cv_skinselectspin); @@ -1156,10 +1158,10 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_ps_thinkframe_page); CV_RegisterVar(&cv_ps_samplesize); CV_RegisterVar(&cv_ps_descriptor); - + //Value used to store last server player has joined CV_RegisterVar(&cv_lastserver); - + CV_RegisterVar(&cv_showallmaps); CV_RegisterVar(&cv_showmusicfilename); @@ -1169,8 +1171,8 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_speed); CV_RegisterVar(&cv_opflags); CV_RegisterVar(&cv_mapthingnum); -// CV_RegisterVar(&cv_grid); -// CV_RegisterVar(&cv_snapto); + //CV_RegisterVar(&cv_grid); + //CV_RegisterVar(&cv_snapto); // add cheat commands COM_AddCommand("noclip", Command_CheatNoClip_f); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 2df6499d9..36e4766a8 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -181,6 +181,7 @@ extern consvar_t cv_nametagmaxlenght; //extern consvar_t cv_nametagscaling; extern consvar_t cv_nametagdist; extern consvar_t cv_showownnametag; +extern consvar_t cv_smallnametags; #define SKINSELECTSPIN_PAIN 25 extern consvar_t cv_skinselectspin; diff --git a/src/k_kart.c b/src/k_kart.c index 32fdaca87..19349cfa8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8962,7 +8962,8 @@ static void K_drawNameTags(void) INT32 trans = 0; vector2_t pos; fixed_t st; - + int smol = 0; + if (!stplyr->mo || stplyr->spectator || splitscreen) return; @@ -8971,7 +8972,12 @@ static void K_drawNameTags(void) if (leveltime < starttime) goto showownnametag; - + + if (cv_smallnametags.value) + smol = (20<height/2; if (players[i].mo->eflags & MFE_VERTICALFLIP && !(players[i].pflags & PF_FLIPCAM)) pos.y += players[i].mo->height; - + if (encoremode) pos.x = (320<eflags & MFE_VERTICALFLIP && !(players[i].pflags & PF_FLIPCAM)) { - V_DrawFixedPatch(pos.x, pos.y-(3<mo->eflags & MFE_VERTICALFLIP && !(stplyr->pflags & PF_FLIPCAM)) - V_DrawFixedPatch(pos.x+((st+8)<mo->eflags & MFE_VERTICALFLIP && !(stplyr->pflags & PF_FLIPCAM)) + V_DrawFixedPatch(pos.x+((st+8)<mo->color]); - - if (!cv_nametagfacerank.value) - { - V_DrawStretchyFixedPatch(pos.x+(6<mo->color]); else { - V_DrawStretchyFixedPatch(pos.x+(6<skin], cm); + V_DrawFixedPatch(pos.x, pos.y+(10<mo->color]); + } + + if ((!cv_smallnametags.value) && nametaggfx) + { + if (!cv_nametagfacerank.value) + { + V_DrawStretchyFixedPatch(pos.x+(6<skin], cm); + } } } } @@ -10217,7 +10244,7 @@ void K_drawKartHUD(void) #endif K_drawKartItem(); - if (cv_nametag.value && nametaggfx) + if (cv_nametag.value) K_drawNameTags(); // If not splitscreen, draw... diff --git a/src/v_video.c b/src/v_video.c index 9815aaef4..ae1b50afe 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2273,6 +2273,88 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st } } +void V_DrawSmallStringAtFixedCM(fixed_t x, fixed_t y, INT32 option, const char *string, UINT8* colormap) +{ + fixed_t cx = x, cy = y; + INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; + const char *ch = string; + INT32 spacewidth = 2, charwidth = 0; + INT32 lowercase = (option & V_ALLOWLOWERCASE); + option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... + if (option & V_NOSCALESTART) + { + dupx = vid.dupx; + dupy = vid.dupy; + scrwidth = vid.width; + } + else + { + dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + scrwidth -= left; + } + if (option & V_NOSCALEPATCH) + scrwidth *= vid.dupx; + switch (option & V_SPACINGMASK) + { + case V_MONOSPACE: + spacewidth = 4; + /* FALLTHRU */ + case V_OLDSPACING: + charwidth = 4; + break; + case V_6WIDTHSPACE: + spacewidth = 3; + default: + break; + } + for (;;ch++) + { + if (!*ch) + break; + if (*ch & 0x80) //color parsing -x 2.16.09 + continue; + + if (*ch == '\n') + { + cx = x; + if (option & V_RETURN8) + cy += (4*dupy)<= HU_FONTSIZE || !hu_font[c]) + { + cx += (spacewidth * dupx)<width*(dupx/4); + } + else + w = hu_font[c]->width * dupx / 2; + if ((cx>>FRACBITS) > scrwidth) + break; + if ((cx>>FRACBITS)+left + w < 0) //left boundary check + { + cx += w<