mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Create V_DrawRightAlignedSmallStringAtFixed() for new "small-fixed-right" option in v.drawString()
This commit is contained in:
parent
f7085fc171
commit
5f56d19a43
3 changed files with 13 additions and 0 deletions
|
@ -117,6 +117,7 @@ enum align {
|
|||
align_fixedright,
|
||||
align_small,
|
||||
align_smallfixed,
|
||||
align_smallfixedright,
|
||||
align_smallcenter,
|
||||
align_smallright,
|
||||
align_smallthin,
|
||||
|
@ -136,6 +137,7 @@ static const char *const align_opt[] = {
|
|||
"fixed-right",
|
||||
"small",
|
||||
"small-fixed",
|
||||
"small-fixed-right",
|
||||
"small-center",
|
||||
"small-right",
|
||||
"small-thin",
|
||||
|
@ -760,6 +762,9 @@ static int libd_drawString(lua_State *L)
|
|||
case align_smallfixed:
|
||||
V_DrawSmallStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallfixedright:
|
||||
V_DrawRightAlignedSmallStringAtFixed(x, y, flags, str);
|
||||
break;
|
||||
case align_smallcenter:
|
||||
V_DrawCenteredSmallString(x, y, flags, str);
|
||||
break;
|
||||
|
|
|
@ -2746,6 +2746,12 @@ void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *st
|
|||
}
|
||||
}
|
||||
|
||||
void V_DrawRightAlignedSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
||||
{
|
||||
x -= V_SmallStringWidth(string, option)<<FRACBITS;
|
||||
V_DrawSmallStringAtFixed(x, y, option, string);
|
||||
}
|
||||
|
||||
// Draws a thin string at a fixed_t location.
|
||||
void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
||||
{
|
||||
|
|
|
@ -221,7 +221,9 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
|
|||
void V_DrawCenteredStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
void V_DrawRightAlignedStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
|
||||
// draw a string using the hu_font at fixed_t coordinates, 0.5x scale
|
||||
void V_DrawSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
void V_DrawRightAlignedSmallStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
|
||||
|
||||
// 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);
|
||||
|
|
Loading…
Reference in a new issue