Fix up r_showfields 3 a little, to make it easier to see which props are which.

This commit is contained in:
Shpoike 2021-05-03 03:19:08 +01:00
parent 93ee065acf
commit 45ffcb91f4
2 changed files with 11 additions and 8 deletions

View File

@ -240,8 +240,13 @@ void Draw_FunStringWidthFont(struct font_s *font, float x, float y, const void *
w = Font_Decode(w, &codeflags, &codepoint);
fw += Font_CharWidth(codeflags, codepoint);
}
if (rightalign == 2)
{
if (rightalign == 3)
{ //center the text (ignoring width info)
px -= fw/2;
width = fw;
}
else if (rightalign == 2)
{ //center the text (left align when too long)
if (fw < width)
{
px += (width-fw)/2;
@ -249,7 +254,7 @@ void Draw_FunStringWidthFont(struct font_s *font, float x, float y, const void *
}
}
else
{
{ //right align the text if shorter than specified width..
px += width;
if (fw > width)
fw = width;

View File

@ -2051,7 +2051,7 @@ void R_DrawNameTags(void)
if (body)
{
// Q_snprintfz(fname, sizeof(fname), "<default shader>");
str = va("^2%s^7\n%s%s\n{%s\n", fname, ruleset_allow_shaders.ival?"":CON_ERROR"WARNING: ruleset_allow_shaders disables external shaders"CON_DEFAULT"\n", surf->texinfo->texture->name, body);
str = va("^2%s^7\n%s%s\n{\n%s\n", fname, ruleset_allow_shaders.ival?"":CON_ERROR"WARNING: ruleset_allow_shaders disables external shaders"CON_DEFAULT"\n", surf->texinfo->texture->name, ((*body=='\n')?body+1:body));
Z_Free(body);
}
else
@ -2145,10 +2145,9 @@ void R_DrawNameTags(void)
entstr = state->model->name;
if (entstr)
{
vec2_t scale = {8,8};
x = screenspace[0]*r_refdef.vrect.width+r_refdef.vrect.x;
y = (1-screenspace[1])*r_refdef.vrect.height+r_refdef.vrect.y;
R_DrawTextField(x, y, vid.width - x, vid.height - y, entstr, CON_WHITEMASK, CPRINT_TALIGN, font_default, scale);
Draw_FunStringWidth(x, y, entstr, 0, 3, false);
}
}
}
@ -2170,10 +2169,9 @@ void R_DrawNameTags(void)
entstr = state->model->name;
if (entstr)
{
vec2_t scale = {8,8};
x = screenspace[0]*r_refdef.vrect.width+r_refdef.vrect.x;
y = (1-screenspace[1])*r_refdef.vrect.height+r_refdef.vrect.y;
R_DrawTextField(x, y, vid.width - x, vid.height - y, entstr, CON_WHITEMASK, CPRINT_TALIGN, font_default, scale);
Draw_FunStringWidth(x, y, entstr, 0, 3, false);
}
}
}