Skip to content
Permalink
Browse files

Don't let an undocumented texture setting affect fonts

This is one of those commits where I'm not really sure what's going on,
but it seems that we probably don't want to apply this gl texture filter
setting (GL_LINEAR) to glyph textures.  Specifically, this was (no idea
why) causing local tiles colour_bars to not render properly, as reported
by dolemite99 in:
https://crawl.develz.org/tavern/viewtopic.php?f=9&t=25131
  • Loading branch information...
rawlins committed Feb 21, 2018
1 parent d711f93 commit 54792a9cdb834fec5b08a29d5f2fdbe2cd939987
Showing with 4 additions and 0 deletions.
  1. +4 −0 crawl-ref/source/fontwrapper-ft.cc
@@ -19,6 +19,7 @@
#include "tilefont.h"
#include "tilesdl.h"
#include "unicode.h"
#include "unwind.h"

// maximum number of unique glyphs that can be rendered with this font at once; e.g. 4096, 256, 36
#define MAX_GLYPHS 256
@@ -137,6 +138,7 @@ bool FTFontWrapper::configure_font()
4 * m_ft_width * m_ft_height);

// initialise empty texture of correct size
unwind_bool noscaling(Options.tile_filter_scaling, false);
m_tex.load_texture(nullptr, m_ft_width, m_ft_height, MIPMAP_NONE);

m_glyphs.clear();
@@ -157,6 +159,7 @@ bool FTFontWrapper::configure_font()
pixels[idx + 2] = 255;
pixels[idx + 3] = 255;
}

bool success = m_tex.load_texture(pixels, charsz.x, charsz.y,
MIPMAP_NONE, 0, 0);
ASSERT(success);
@@ -294,6 +297,7 @@ void FTFontWrapper::load_glyph(unsigned int c, char32_t uchar)
}
}

unwind_bool noscaling(Options.tile_filter_scaling, false);
bool success = m_tex.load_texture(pixels, charsz.x, charsz.y,
MIPMAP_NONE,
(c % GLYPHS_PER_ROWCOL) * charsz.x,

0 comments on commit 54792a9

Please sign in to comment.
You can’t perform that action at this time.