Enabled linear interpolation for font texture minifications.

This commit is contained in:
Leon Styhre 2022-09-02 21:03:19 +02:00
parent a1027c2580
commit 9b1fb95865

View file

@ -21,6 +21,7 @@ std::map<std::pair<std::string, int>, std::weak_ptr<Font>> Font::sFontMap;
Font::Font(int size, const std::string& path) Font::Font(int size, const std::string& path)
: mRenderer {Renderer::getInstance()} : mRenderer {Renderer::getInstance()}
, mSize(size) , mSize(size)
, mMaxGlyphHeight {0}
, mPath(path) , mPath(path)
{ {
if (mSize < 9) { if (mSize < 9) {
@ -32,8 +33,6 @@ Font::Font(int size, const std::string& path)
LOG(LogWarning) << "Requested font size too large, changing to maximum supported size"; LOG(LogWarning) << "Requested font size too large, changing to maximum supported size";
} }
mMaxGlyphHeight = 0;
if (!sLibrary) if (!sLibrary)
initLibrary(); initLibrary();
@ -592,7 +591,7 @@ void Font::FontTexture::initTexture()
{ {
assert(textureId == 0); assert(textureId == 0);
textureId = Renderer::getInstance()->createTexture( textureId = Renderer::getInstance()->createTexture(
Renderer::TextureType::RED, false, false, false, textureSize.x, textureSize.y, nullptr); Renderer::TextureType::RED, true, false, false, textureSize.x, textureSize.y, nullptr);
} }
void Font::FontTexture::deinitTexture() void Font::FontTexture::deinitTexture()