diff --git a/src/font.cpp b/src/font.cpp index 1d18342e..af0af320 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -132,7 +132,7 @@ char const *Font::GetName() return data->name; } -void Font::Print(int x, int y, char const *str) +void Font::Print(int3 pos, char const *str) { if (data->img) return; @@ -148,21 +148,21 @@ void Font::Print(int x, int y, char const *str) if (ch != ' ') { glTexCoord2f(tx, ty + data->ty); - glVertex2f(x, y); + glVertex2f(pos.x, pos.y); glTexCoord2f(tx + data->tx, ty + data->ty); - glVertex2f(x + data->width, y); + glVertex2f(pos.x + data->width, pos.y); glTexCoord2f(tx + data->tx, ty); - glVertex2f(x + data->width, y + data->height); + glVertex2f(pos.x + data->width, pos.y + data->height); glTexCoord2f(tx, ty); - glVertex2f(x, y + data->height); + glVertex2f(pos.x, pos.y + data->height); } - x += data->width; + pos.x += data->width; } glEnd(); } -void Font::PrintBold(int x, int y, char const *str) +void Font::PrintBold(int3 pos, char const *str) { static struct { int dx, dy; float r, g, b; } tab[] = { @@ -183,7 +183,7 @@ void Font::PrintBold(int x, int y, char const *str) for (unsigned int i = 0; i < sizeof(tab) / sizeof(*tab); i++) { glColor3f(tab[i].r, tab[i].g, tab[i].b); - Print(x + tab[i].dx, y + tab[i].dy, str); + Print(pos + int3(tab[i].dx, tab[i].dy, 0), str); } glPopAttrib(); } diff --git a/src/font.h b/src/font.h index 7994bf66..371aa133 100644 --- a/src/font.h +++ b/src/font.h @@ -33,8 +33,8 @@ protected: public: /* New methods */ - void Print(int x, int y, char const *str); - void PrintBold(int x, int y, char const *str); + void Print(int3 pos, char const *str); + void PrintBold(int3 pos, char const *str); private: FontData *data; diff --git a/src/text.cpp b/src/text.cpp index a44c95e6..0f44ea47 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -65,7 +65,7 @@ void Text::TickDraw(float deltams) if (data->text) { Font *font = Forge::GetFont(data->font); - font->Print(data->pos.x, data->pos.y, data->text); + font->Print(data->pos, data->text); } }