mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-03-27 21:31:38 +00:00
client: use ttf fonts in menu
This commit is contained in:
parent
3578d4353d
commit
d91c4253e8
8 changed files with 26 additions and 80 deletions
|
@ -528,49 +528,33 @@ Menu_DrawStatusBar(const char *string)
|
|||
void
|
||||
Menu_DrawString(int x, int y, const char *string)
|
||||
{
|
||||
unsigned i;
|
||||
float scale = SCR_GetMenuScale();
|
||||
|
||||
for (i = 0; i < strlen(string); i++)
|
||||
{
|
||||
Draw_CharScaled(x + i * 8 * scale, y * scale, string[i], scale);
|
||||
}
|
||||
Draw_StringScaled(x, y * scale, scale, false, string);
|
||||
}
|
||||
|
||||
void
|
||||
Menu_DrawStringDark(int x, int y, const char *string)
|
||||
{
|
||||
unsigned i;
|
||||
float scale = SCR_GetMenuScale();
|
||||
|
||||
for (i = 0; i < strlen(string); i++)
|
||||
{
|
||||
Draw_CharScaled(x + i * 8 * scale, y * scale, string[i] + 128, scale);
|
||||
}
|
||||
Draw_StringScaled(x, y * scale, scale, true, string);
|
||||
}
|
||||
|
||||
void
|
||||
Menu_DrawStringR2L(int x, int y, const char *string)
|
||||
{
|
||||
unsigned i;
|
||||
float scale = SCR_GetMenuScale();
|
||||
|
||||
for (i = 0; i < strlen(string); i++)
|
||||
{
|
||||
Draw_CharScaled(x - i * 8 * scale, y * scale, string[strlen(string) - i - 1], scale);
|
||||
}
|
||||
Draw_StringScaled(x - 8 * scale * strlen(string), y * scale, scale, false, string);
|
||||
}
|
||||
|
||||
void
|
||||
Menu_DrawStringR2LDark(int x, int y, const char *string)
|
||||
{
|
||||
unsigned i;
|
||||
float scale = SCR_GetMenuScale();
|
||||
|
||||
for (i = 0; i < strlen(string); i++)
|
||||
{
|
||||
Draw_CharScaled(x - i * 8 * scale, y * scale, string[strlen(string) - i - 1] + 128, scale);
|
||||
}
|
||||
Draw_StringScaled(x - 8 * scale * strlen(string), y * scale, scale, true, string);
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
@ -229,15 +229,7 @@ RDraw_PicScaled(int x, int y, const char *pic, float factor, const char *alttext
|
|||
if (alttext && alttext[0])
|
||||
{
|
||||
/* Show alttext if provided */
|
||||
size_t l;
|
||||
int i;
|
||||
|
||||
l = strlen(alttext);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
RDraw_CharScaled(x + i * 8 * factor, y, alttext[i], factor);
|
||||
}
|
||||
|
||||
RDraw_StringScaled(x, y, factor, false, alttext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -272,15 +272,7 @@ GL3_Draw_PicScaled(int x, int y, const char *pic, float factor, const char *altt
|
|||
if (alttext && alttext[0])
|
||||
{
|
||||
/* Show alttext if provided */
|
||||
size_t l;
|
||||
int i;
|
||||
|
||||
l = strlen(alttext);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
GL3_Draw_CharScaled(x + i * 8 * factor, y, alttext[i], factor);
|
||||
}
|
||||
|
||||
GL3_Draw_StringScaled(x, y, factor, false, alttext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -270,14 +270,7 @@ GL4_Draw_PicScaled(int x, int y, const char *pic, float factor, const char *altt
|
|||
if (alttext && alttext[0])
|
||||
{
|
||||
/* Show alttext if provided */
|
||||
int l, i;
|
||||
|
||||
l = strlen(alttext);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
GL4_Draw_CharScaled(x + i * 8 * factor, y, alttext[i], factor);
|
||||
}
|
||||
|
||||
GL4_Draw_StringScaled(x, y, factor, false, alttext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -554,6 +554,7 @@ struct image_s *RE_Draw_FindPic (const char *name);
|
|||
|
||||
void RE_Draw_GetPicSize (int *w, int *h, const char *name);
|
||||
void RE_Draw_PicScaled (int x, int y, const char *name, float scale, const char *alttext);
|
||||
void RE_Draw_StringScaled(int x, int y, float scale, qboolean alt, const char *message);
|
||||
void RE_Draw_StretchPic (int x, int y, int w, int h, const char *name);
|
||||
void RE_Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte *data, int bits);
|
||||
void RE_Draw_CharScaled (int x, int y, int c, float scale);
|
||||
|
|
|
@ -374,6 +374,21 @@ RE_Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, const byte *d
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
RE_Draw_StringScaled(int x, int y, float scale, qboolean alt, const char *message)
|
||||
{
|
||||
int xor;
|
||||
|
||||
xor = alt ? 0x80 : 0;
|
||||
|
||||
while (*message)
|
||||
{
|
||||
RE_Draw_CharScaled(x * scale, y * scale, *message ^ xor, scale);
|
||||
x += 8 * scale;
|
||||
message ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_Pic
|
||||
|
@ -390,15 +405,7 @@ RE_Draw_PicScaled(int x, int y, const char *name, float scale, const char *altte
|
|||
if (alttext && alttext[0])
|
||||
{
|
||||
/* Show alttext if provided */
|
||||
size_t l;
|
||||
int i;
|
||||
|
||||
l = strlen(alttext);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
RE_Draw_CharScaled(x + i * 8 * scale, y, alttext[i], scale);
|
||||
}
|
||||
|
||||
RE_Draw_StringScaled(x, y, scale, false, alttext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1794,21 +1794,6 @@ RE_EndWorldRenderpass( void )
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
RE_Draw_StringScaled(int x, int y, float scale, qboolean alt, const char *message)
|
||||
{
|
||||
int xor;
|
||||
|
||||
xor = alt ? 0x80 : 0;
|
||||
|
||||
while (*message)
|
||||
{
|
||||
RE_Draw_CharScaled(x * scale, y * scale, *message ^ xor, scale);
|
||||
x += 8 * scale;
|
||||
message ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
GetRefAPI
|
||||
|
|
|
@ -220,15 +220,7 @@ RE_Draw_PicScaled(int x, int y, const char *name, float scale, const char *altte
|
|||
if (alttext && alttext[0])
|
||||
{
|
||||
/* Show alttext if provided */
|
||||
size_t l;
|
||||
int i;
|
||||
|
||||
l = strlen(alttext);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
RE_Draw_CharScaled(x + i * 8 * scale, y, alttext[i], scale);
|
||||
}
|
||||
|
||||
RE_Draw_StringScaled(x, y, scale, false, alttext);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -236,7 +228,7 @@ RE_Draw_PicScaled(int x, int y, const char *name, float scale, const char *altte
|
|||
return;
|
||||
}
|
||||
|
||||
RE_Draw_StretchPic(x, y, vk->width*scale, vk->height*scale, name);
|
||||
RE_Draw_StretchPic(x, y, vk->width * scale, vk->height * scale, name);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue