diff --git a/src/st_stuff.c b/src/st_stuff.c index 9632ba31ef544b3336df5849a1d782b127f3cb46..959075eedfc692c449e053a5d3b9c6c27cb9b384 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -505,10 +505,10 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedThinString(320, 8+lowh, VFLAGS|V_REDMAP, "SOME INFO NOT VISIBLE");\ return;\ }\ - V_DrawRightAlignedFontString(320, height, 8, 12, VFLAGS, textscale, str, hu_font);\ + V_DrawRightAlignedFontString(320, height, 8, 12, VFLAGS, textscale, textscale, str, hu_font);\ height += h; -#define V_DrawDebugFlag(f, str) V_DrawRightAlignedFontString(width, height, 8, 12, VFLAGS|f, textscale, str, hu_font);\ +#define V_DrawDebugFlag(f, str) V_DrawRightAlignedFontString(width, height, 8, 12, VFLAGS|f, textscale, textscale, str, hu_font);\ width -= w if (cv_debug & DBG_MEMORY) diff --git a/src/v_video.c b/src/v_video.c index b82d4c54b1b3898adfc38c4a855e95e1f4df1ade..e06b987884650dea33287aaad663cefb3136f1f3 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2143,24 +2143,24 @@ char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string) // Draw a string, using a supplied font and scale. // NOTE: The text is centered for screens larger than the base width. -void V_DrawFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font) +void V_DrawFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font) { - V_DrawFontStringAtFixed((fixed_t)x<<FRACBITS, (fixed_t)y<<FRACBITS, width, height, option, scale, string, font); + V_DrawFontStringAtFixed((fixed_t)x<<FRACBITS, (fixed_t)y<<FRACBITS, width, height, option, pscale, vscale, string, font); } -void V_DrawCenteredFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font) +void V_DrawCenteredFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font) { - V_DrawCenteredFontStringAtFixed((fixed_t)x<<FRACBITS, (fixed_t)y<<FRACBITS, width, height, option, scale, string, font); + V_DrawCenteredFontStringAtFixed((fixed_t)x<<FRACBITS, (fixed_t)y<<FRACBITS, width, height, option, pscale, vscale, string, font); } -void V_DrawRightAlignedFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font) +void V_DrawRightAlignedFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font) { - V_DrawRightAlignedFontStringAtFixed((fixed_t)x<<FRACBITS, (fixed_t)y<<FRACBITS, width, height, option, scale, string, font); + V_DrawRightAlignedFontStringAtFixed((fixed_t)x<<FRACBITS, (fixed_t)y<<FRACBITS, width, height, option, pscale, vscale, string, font); } // Write a string, using a supplied font and scale, at fixed_t coordinates. // NOTE: The text is centered for screens larger than the base width. -void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font) +void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font) { fixed_t cx = x, cy = y; INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; @@ -2179,7 +2179,8 @@ void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, IN } else { - dupx = dupy = scale; + dupx = pscale; + dupy = vscale; scrwidth = FixedDiv(vid.width<<FRACBITS, vid.dupx); left = (scrwidth - (BASEVIDWIDTH << FRACBITS))/2; scrwidth -= left; @@ -2252,22 +2253,22 @@ void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, IN continue; } - V_DrawFixedPatch(cx + center, cy, scale, option, font[c], V_GetStringColormap(charflags)); + V_DrawStretchyFixedPatch(cx + center, cy, pscale, vscale, option, font[c], V_GetStringColormap(charflags)); cx += w; } } -void V_DrawCenteredFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font) +void V_DrawCenteredFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font) { - x -= (V_FontStringWidth(string, option, width, font)*scale)/2; - V_DrawFontStringAtFixed(x, y, width, height, option, scale, string, font); + x -= (V_FontStringWidth(string, option, width, font)*pscale)/2; + V_DrawFontStringAtFixed(x, y, width, height, option, pscale, vscale, string, font); } -void V_DrawRightAlignedFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font) +void V_DrawRightAlignedFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font) { - x -= V_FontStringWidth(string, option, width, font)*scale; - V_DrawFontStringAtFixed(x, y, width, height, option, scale, string, font); + x -= V_FontStringWidth(string, option, width, font)*pscale; + V_DrawFontStringAtFixed(x, y, width, height, option, pscale, vscale, string, font); } // Draws a tallnum. Replaces two functions in y_inter and st_stuff diff --git a/src/v_video.h b/src/v_video.h index c94ec43dc1c760a7ac344d0b832b4e626b793b6a..acc2841beadb22d77104976b2d0382ece3fb2b45 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -210,48 +210,48 @@ char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string); UINT8 *V_GetStringColormap(INT32 colorflags); // Draw a string, using a supplied font and scale. -void V_DrawFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font); -void V_DrawCenteredFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font); -void V_DrawRightAlignedFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font); +void V_DrawFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font); +void V_DrawCenteredFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font); +void V_DrawRightAlignedFontString(INT32 x, INT32 y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font); // Draw a string, using a supplied font and scale, at fixed_t coordinates. -void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font); -void V_DrawCenteredFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font); -void V_DrawRightAlignedFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t scale, const char *string, patch_t **font); +void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font); +void V_DrawCenteredFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font); +void V_DrawRightAlignedFontStringAtFixed(fixed_t x, fixed_t y, INT32 width, INT32 height, INT32 option, fixed_t pscale, fixed_t vscale, const char *string, patch_t **font); // width = "average" character width (divided by 2 for space width), height = distance between two lines. TODO: incorporate these in the supplied font, somehow // Defines for old string drawers. // draw a string using the hu_font -#define V_DrawString(x,y,o,str) V_DrawFontString(x,y,8,12,o,FRACUNIT,str,hu_font) -#define V_DrawCenteredString(x,y,o,str) V_DrawCenteredFontString(x,y,8,12,o,FRACUNIT,str,hu_font) -#define V_DrawRightAlignedString(x,y,o,str) V_DrawRightAlignedFontString(x,y,8,12,o,FRACUNIT,str,hu_font) +#define V_DrawString(x,y,o,str) V_DrawFontString(x,y,8,12,o,FRACUNIT,FRACUNIT,str,hu_font) +#define V_DrawCenteredString(x,y,o,str) V_DrawCenteredFontString(x,y,8,12,o,FRACUNIT,FRACUNIT,str,hu_font) +#define V_DrawRightAlignedString(x,y,o,str) V_DrawRightAlignedFontString(x,y,8,12,o,FRACUNIT,FRACUNIT,str,hu_font) // draw a string using the hu_font, 0.5x scale -#define V_DrawSmallString(x,y,o,str) V_DrawFontString(x,y,8,12,o,FRACUNIT/2,str,hu_font) -#define V_DrawCenteredSmallString(x,y,o,str) V_DrawCenteredFontString(x,y,8,12,o,FRACUNIT/2,str,hu_font) -#define V_DrawRightAlignedSmallString(x,y,o,str) V_DrawRightAlignedFontString(x,y,8,12,o,FRACUNIT/2,str,hu_font) +#define V_DrawSmallString(x,y,o,str) V_DrawFontString(x,y,8,12,o,FRACUNIT/2,FRACUNIT/2,str,hu_font) +#define V_DrawCenteredSmallString(x,y,o,str) V_DrawCenteredFontString(x,y,8,12,o,FRACUNIT/2,FRACUNIT/2,str,hu_font) +#define V_DrawRightAlignedSmallString(x,y,o,str) V_DrawRightAlignedFontString(x,y,8,12,o,FRACUNIT/2,FRACUNIT/2,str,hu_font) // Write a string using the tny_font -#define V_DrawThinString(x,y,o,str) V_DrawFontString(x,y,5,12,o,FRACUNIT,str,tny_font) -#define V_DrawCenteredThinString(x,y,o,str) V_DrawCenteredFontString(x,y,5,12,o,FRACUNIT,str,tny_font) -#define V_DrawRightAlignedThinString(x,y,o,str) V_DrawRightAlignedFontString(x,y,5,12,o,FRACUNIT,str,tny_font) +#define V_DrawThinString(x,y,o,str) V_DrawFontString(x,y,5,12,o,FRACUNIT,FRACUNIT,str,tny_font) +#define V_DrawCenteredThinString(x,y,o,str) V_DrawCenteredFontString(x,y,5,12,o,FRACUNIT,FRACUNIT,str,tny_font) +#define V_DrawRightAlignedThinString(x,y,o,str) V_DrawRightAlignedFontString(x,y,5,12,o,FRACUNIT,FRACUNIT,str,tny_font) // draw a string using the tny_font, 0.5x scale -#define V_DrawSmallThinString(x,y,o,str) V_DrawFontString(x,y,5,12,o,FRACUNIT/2,str,tny_font) -#define V_DrawCenteredSmallThinString(x,y,o,str) V_DrawCenteredFontString(x,y,5,12,o,FRACUNIT/2,str,tny_font) -#define V_DrawRightAlignedSmallThinString(x,y,o,str) V_DrawRightAlignedFontString(x,y,5,12,o,FRACUNIT/2,str,tny_font) +#define V_DrawSmallThinString(x,y,o,str) V_DrawFontString(x,y,5,12,o,FRACUNIT/2,FRACUNIT/2,str,tny_font) +#define V_DrawCenteredSmallThinString(x,y,o,str) V_DrawCenteredFontString(x,y,5,12,o,FRACUNIT/2,FRACUNIT/2,str,tny_font) +#define V_DrawRightAlignedSmallThinString(x,y,o,str) V_DrawRightAlignedFontString(x,y,5,12,o,FRACUNIT/2,FRACUNIT/2,str,tny_font) // draw a string using the hu_font at fixed_t coordinates -#define V_DrawStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,8,12,o,FRACUNIT,str,hu_font) -#define V_DrawCenteredStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,8,12,o,FRACUNIT,str,hu_font) -#define V_DrawRightAlignedStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,8,12,o,FRACUNIT,str,hu_font) +#define V_DrawStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,8,12,o,FRACUNIT,FRACUNIT,str,hu_font) +#define V_DrawCenteredStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,8,12,o,FRACUNIT,FRACUNIT,str,hu_font) +#define V_DrawRightAlignedStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,8,12,o,FRACUNIT,FRACUNIT,str,hu_font) // draw a string using the hu_font at fixed_t coordinates, 0.5x scale -#define V_DrawSmallStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,8,12,o,FRACUNIT/2,str,hu_font) -#define V_DrawCenteredSmallStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,8,12,o,FRACUNIT/2,str,hu_font) -#define V_DrawRightAlignedSmallStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,8,12,o,FRACUNIT/2,str,hu_font) +#define V_DrawSmallStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,8,12,o,FRACUNIT/2,FRACUNIT/2,str,hu_font) +#define V_DrawCenteredSmallStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,8,12,o,FRACUNIT/2,FRACUNIT/2,str,hu_font) +#define V_DrawRightAlignedSmallStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,8,12,o,FRACUNIT/2,FRACUNIT/2,str,hu_font) // draw a string using the tny_font at fixed_t coordinates -#define V_DrawThinStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,5,12,o,FRACUNIT,str,tny_font) -#define V_DrawCenteredThinStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,5,12,o,FRACUNIT,str,tny_font) -#define V_DrawRightAlignedThinStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,5,12,o,FRACUNIT,str,tny_font) +#define V_DrawThinStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,5,12,o,FRACUNIT,FRACUNIT,str,tny_font) +#define V_DrawCenteredThinStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,5,12,o,FRACUNIT,FRACUNIT,str,tny_font) +#define V_DrawRightAlignedThinStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,5,12,o,FRACUNIT,FRACUNIT,str,tny_font) // draw a string using the tny_font at fixed_t coordinates, 0.5x scale -#define V_DrawSmallThinStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,5,12,o,FRACUNIT/2,str,tny_font) -#define V_DrawCenteredSmallThinStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,5,12,o,FRACUNIT/2,str,tny_font) -#define V_DrawRightAlignedSmallThinStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,5,12,o,FRACUNIT/2,str,tny_font) +#define V_DrawSmallThinStringAtFixed(x,y,o,str) V_DrawFontStringAtFixed(x,y,5,12,o,FRACUNIT/2,FRACUNIT/2,str,tny_font) +#define V_DrawCenteredSmallThinStringAtFixed(x,y,o,str) V_DrawCenteredFontStringAtFixed(x,y,5,12,o,FRACUNIT/2,FRACUNIT/2,str,tny_font) +#define V_DrawRightAlignedSmallThinStringAtFixed(x,y,o,str) V_DrawRightAlignedFontStringAtFixed(x,y,5,12,o,FRACUNIT/2,FRACUNIT/2,str,tny_font) // Draw tall nums, used for menu, HUD, intermission void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num);