mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Create V_DrawCenteredThinStringAtFixed() for new "thin-fixed-center" option in v.drawString()
This commit is contained in:
parent
f1655d32f5
commit
f7085fc171
3 changed files with 12 additions and 0 deletions
|
@ -122,6 +122,7 @@ enum align {
|
|||
align_smallthin,
|
||||
align_thin,
|
||||
align_thinfixed,
|
||||
align_thinfixedcenter,
|
||||
align_thinfixedright,
|
||||
align_thincenter,
|
||||
align_thinright
|
||||
|
@ -140,6 +141,7 @@ static const char *const align_opt[] = {
|
|||
"small-thin",
|
||||
"thin",
|
||||
"thin-fixed",
|
||||
"thin-fixed-center",
|
||||
"thin-fixed-right",
|
||||
"thin-center",
|
||||
"thin-right",
|
||||
|
@ -780,6 +782,9 @@ static int libd_drawString(lua_State *L)
|
|||
case align_thinfixed:
|
||||
V_DrawThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_thinfixedcenter:
|
||||
V_DrawCenteredThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_thinfixedright:
|
||||
V_DrawRightAlignedThinStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
|
|
|
@ -2848,6 +2848,12 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str
|
|||
}
|
||||
}
|
||||
|
||||
void V_DrawCenteredThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
||||
{
|
||||
x -= (V_ThinStringWidth(string, option) / 2)<<FRACBITS;
|
||||
V_DrawThinStringAtFixed(x, y, option, string);
|
||||
}
|
||||
|
||||
void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
||||
{
|
||||
x -= V_ThinStringWidth(string, option)<<FRACBITS;
|
||||
|
|
|
@ -225,6 +225,7 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st
|
|||
|
||||
// draw a string using the tny_font at fixed_t coordinates
|
||||
void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
void V_DrawCenteredThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
|
||||
// Draw tall nums, used for menu, HUD, intermission
|
||||
|
|
Loading…
Reference in a new issue