diff options
Diffstat (limited to 'src/libjin/graphics/fonts/je_texture_font.cpp')
-rw-r--r-- | src/libjin/graphics/fonts/je_texture_font.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libjin/graphics/fonts/je_texture_font.cpp b/src/libjin/graphics/fonts/je_texture_font.cpp index 7737f90..97f1f2f 100644 --- a/src/libjin/graphics/fonts/je_texture_font.cpp +++ b/src/libjin/graphics/fonts/je_texture_font.cpp @@ -25,15 +25,15 @@ namespace JinEngine Vector2<int> count(bitmap->getWidth() / cellw, bitmap->getHeight() / cellh); glyph.w = cellw; glyph.h = cellh; - for (int y = 0; y < count.row; ++y) + for (int y = 0; y < count.row(); ++y) { glyph.y = y * cellh; - for (int x = 0; x < count.colum; ++x) + for (int x = 0; x < count.colum(); ++x) { glyph.x = x * cellw; - if (x + y * count.colum >= codepoints.size()) + if (x + y * count.colum() >= codepoints.size()) return; - glyphs.insert(std::pair<Codepoint, TextureGlyph>(codepoints[x + y * count.colum], glyph)); + glyphs.insert(std::pair<Codepoint, TextureGlyph>(codepoints[x + y * count.colum()], glyph)); } } } @@ -135,15 +135,15 @@ namespace JinEngine // newline if (c == 0x0A) { - p.y += lineheight; - p.x = 0; + p.y() += lineheight; + p.x() = 0; continue; } if (c == 0x09) { // tab = 4*space unsigned cw = getCharWidth(0x20); - p.x += cw * 4; + p.x() += cw * 4; continue; } glyph = findGlyph(c); @@ -162,14 +162,14 @@ namespace JinEngine float w = getWidth(), h = getHeight(); float nx = glyph->x / w, ny = glyph->y / h; float nw = glyph->w / w, nh = glyph->h / h; - glyphvertices_push(p.x, p.y, nx, ny); - glyphvertices_push(p.x, p.y + glyph->h, nx, ny + nh); - glyphvertices_push(p.x + glyph->w, p.y + glyph->h, nx + nw, ny + nh); - glyphvertices_push(p.x + glyph->w, p.y, nx + nw, ny); - p.x += glyph->w + spacing; + glyphvertices_push(p.x(), p.y(), nx, ny); + glyphvertices_push(p.x(), p.y() + glyph->h, nx, ny + nh); + glyphvertices_push(p.x() + glyph->w, p.y() + glyph->h, nx + nw, ny + nh); + glyphvertices_push(p.x() + glyph->w, p.y(), nx + nw, ny); + p.x() += glyph->w + spacing; i += 4; } - getTextBox(text, &page->size.w, &page->size.h, lineheight, spacing); + getTextBox(text, &page->size.w(), &page->size.h(), lineheight, spacing); return page; } |