Create V_DrawRightAlignedThinStringAtFixed() for new "thin-fixed-right" option in v.drawString()

These function names are starting to become rediculous...
This commit is contained in:
GoldenTails 2019-09-07 17:37:21 -05:00
parent d147a50e9b
commit cb5c90fc40
3 changed files with 14 additions and 0 deletions

View file

@ -122,6 +122,7 @@ enum align {
align_smallthin,
align_thin,
align_thinfixed,
align_thinfixedright,
align_thincenter,
align_thinright
};
@ -139,6 +140,7 @@ static const char *const align_opt[] = {
"small-thin",
"thin",
"thin-fixed",
"thin-fixed-right",
"thin-center",
"thin-right",
NULL};
@ -778,6 +780,9 @@ static int libd_drawString(lua_State *L)
case align_thinfixed:
V_DrawThinStringAtFixed(x, y, flags, str);
break;
case align_thinfixedright:
V_DrawRightAlignedThinStringAtFixed(x, y, flags, str);
break;
}
return 0;
}

View file

@ -2848,6 +2848,12 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str
}
}
void V_DrawRightAlignedThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string)
{
x -= V_ThinStringWidth(string, option)<<FRACBITS;
V_DrawThinStringAtFixed(x, y, option, string);
}
// Draws a tallnum. Replaces two functions in y_inter and st_stuff
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num)
{

View file

@ -222,7 +222,10 @@ void V_DrawCenteredStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char
void V_DrawRightAlignedStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string);
void V_DrawSmallStringAtFixed(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);
void V_DrawRightAlignedThinStringAtFixed(INT32 x, INT32 y, INT32 option, const char *string);
// Draw tall nums, used for menu, HUD, intermission
void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);