mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Software: Make constants char_width and char_height private in RasterFont
This commit is contained in:
@ -161,7 +161,7 @@ void RasterFont::printString(const char *s, double x, double y, double z)
|
||||
void RasterFont::printCenteredString(const char *s, double y, int screen_width, double z)
|
||||
{
|
||||
int length = (int)strlen(s);
|
||||
int x = (int)(screen_width/2.0 - (length/2.0)*char_width);
|
||||
int x = (int)(screen_width/2.0 - (length/2.0) * CHAR_WIDTH);
|
||||
printString(s, x, y, z);
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
|
||||
{
|
||||
*t = 0;
|
||||
printString(temp, x, y, z);
|
||||
y -= char_height * 2.0f / bbHeight;
|
||||
y -= CHAR_HEIGHT * 2.0f / bbHeight;
|
||||
x = start_x;
|
||||
t = temp;
|
||||
}
|
||||
@ -187,12 +187,12 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
|
||||
}
|
||||
else if (*text == '\t')
|
||||
{
|
||||
//todo: add tabs every something like 4*char_width
|
||||
//todo: add tabs every something like 4 * CHAR_WIDTH
|
||||
*t = 0;
|
||||
int cpos = (int)strlen(temp);
|
||||
int newpos = (cpos + 4) & (~3);
|
||||
printString(temp, x, y, z);
|
||||
x = start_x + (char_width*newpos) * 2.0f / bbWidth;
|
||||
x = start_x + (CHAR_WIDTH * newpos) * 2.0f / bbWidth;
|
||||
t = temp;
|
||||
*t++ = ' ';
|
||||
}
|
||||
|
Reference in New Issue
Block a user