GRIM: Fix scaling text on different aspect ratios with OpenGL
This commit is contained in:
parent
8e992bb5c4
commit
42bbcc6ddb
1 changed files with 5 additions and 4 deletions
|
@ -1121,7 +1121,8 @@ void GfxOpenGL::drawTextObject(const TextObject *text) {
|
||||||
const FontUserData *userData = (const FontUserData *)font->getUserData();
|
const FontUserData *userData = (const FontUserData *)font->getUserData();
|
||||||
if (!userData)
|
if (!userData)
|
||||||
error("Could not get font userdata");
|
error("Could not get font userdata");
|
||||||
float size = userData->size * _scaleW;
|
float sizeW = userData->size * _scaleW;
|
||||||
|
float sizeH = userData->size * _scaleH;
|
||||||
GLuint texture = userData->texture;
|
GLuint texture = userData->texture;
|
||||||
const Common::String *lines = text->getLines();
|
const Common::String *lines = text->getLines();
|
||||||
int numLines = text->getNumLines();
|
int numLines = text->getNumLines();
|
||||||
|
@ -1145,11 +1146,11 @@ void GfxOpenGL::drawTextObject(const TextObject *text) {
|
||||||
glTexCoord2f(cx, cy);
|
glTexCoord2f(cx, cy);
|
||||||
glVertex2f(z, w);
|
glVertex2f(z, w);
|
||||||
glTexCoord2f(cx + width, cy);
|
glTexCoord2f(cx + width, cy);
|
||||||
glVertex2f(z + size, w);
|
glVertex2f(z + sizeW, w);
|
||||||
glTexCoord2f(cx + width, cy + width);
|
glTexCoord2f(cx + width, cy + width);
|
||||||
glVertex2f(z + size, w + size);
|
glVertex2f(z + sizeW, w + sizeH);
|
||||||
glTexCoord2f(cx, cy + width);
|
glTexCoord2f(cx, cy + width);
|
||||||
glVertex2f(z, w + size);
|
glVertex2f(z, w + sizeH);
|
||||||
glEnd();
|
glEnd();
|
||||||
x += font->getCharWidth(character);
|
x += font->getCharWidth(character);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue