mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Removed the font texture linear magnification support as it caused various rendering artifacts.
This commit is contained in:
parent
9d46625739
commit
b6dc0bd72c
|
@ -587,12 +587,12 @@ bool Font::FontTexture::findEmpty(const glm::ivec2& size, glm::ivec2& cursor_out
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Font::FontTexture::initTexture(bool linearMagnification)
|
void Font::FontTexture::initTexture()
|
||||||
{
|
{
|
||||||
assert(textureId == 0);
|
assert(textureId == 0);
|
||||||
textureId = Renderer::getInstance()->createTexture(Renderer::TextureType::RED, true,
|
textureId =
|
||||||
linearMagnification, false, false,
|
Renderer::getInstance()->createTexture(Renderer::TextureType::RED, true, false, false,
|
||||||
textureSize.x, textureSize.y, nullptr);
|
false, textureSize.x, textureSize.y, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Font::FontTexture::deinitTexture()
|
void Font::FontTexture::deinitTexture()
|
||||||
|
@ -624,7 +624,7 @@ void Font::rebuildTextures()
|
||||||
{
|
{
|
||||||
// Recreate OpenGL textures.
|
// Recreate OpenGL textures.
|
||||||
for (auto it = mTextures.begin(); it != mTextures.end(); ++it)
|
for (auto it = mTextures.begin(); it != mTextures.end(); ++it)
|
||||||
it->initTexture(mSize > MIN_SIZE_LINEAR_MAGNIFICATION);
|
it->initTexture();
|
||||||
|
|
||||||
// Re-upload the texture data.
|
// Re-upload the texture data.
|
||||||
for (auto it = mGlyphMap.cbegin(); it != mGlyphMap.cend(); ++it) {
|
for (auto it = mGlyphMap.cbegin(); it != mGlyphMap.cend(); ++it) {
|
||||||
|
@ -679,7 +679,7 @@ void Font::getTextureForNewGlyph(const glm::ivec2& glyphSize,
|
||||||
|
|
||||||
mTextures.push_back(FontTexture(mSize));
|
mTextures.push_back(FontTexture(mSize));
|
||||||
tex_out = &mTextures.back();
|
tex_out = &mTextures.back();
|
||||||
tex_out->initTexture(mSize > MIN_SIZE_LINEAR_MAGNIFICATION);
|
tex_out->initTexture();
|
||||||
|
|
||||||
bool ok = tex_out->findEmpty(glyphSize, cursor_out);
|
bool ok = tex_out->findEmpty(glyphSize, cursor_out);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
|
|
|
@ -31,8 +31,6 @@ class TextCache;
|
||||||
std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth())))
|
std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth())))
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#define MIN_SIZE_LINEAR_MAGNIFICATION 30
|
|
||||||
|
|
||||||
#define FONT_PATH_LIGHT ":/fonts/Akrobat-Regular.ttf"
|
#define FONT_PATH_LIGHT ":/fonts/Akrobat-Regular.ttf"
|
||||||
#define FONT_PATH_REGULAR ":/fonts/Akrobat-SemiBold.ttf"
|
#define FONT_PATH_REGULAR ":/fonts/Akrobat-SemiBold.ttf"
|
||||||
#define FONT_PATH_BOLD ":/fonts/Akrobat-Bold.ttf"
|
#define FONT_PATH_BOLD ":/fonts/Akrobat-Bold.ttf"
|
||||||
|
@ -133,7 +131,7 @@ private:
|
||||||
// You must call initTexture() after creating a FontTexture to get a textureId.
|
// You must call initTexture() after creating a FontTexture to get a textureId.
|
||||||
// Initializes the OpenGL texture according to this FontTexture's settings,
|
// Initializes the OpenGL texture according to this FontTexture's settings,
|
||||||
// updating textureId.
|
// updating textureId.
|
||||||
void initTexture(bool linearMagnification);
|
void initTexture();
|
||||||
|
|
||||||
// Deinitializes the OpenGL texture if any exists, is automatically called
|
// Deinitializes the OpenGL texture if any exists, is automatically called
|
||||||
// in the destructor.
|
// in the destructor.
|
||||||
|
|
Loading…
Reference in a new issue