Repository navigation
tr_font: no need for file extension - #1803
Conversation
|
It might be good to use a name that can't conflict with / is distinct from normal file names. Like for the RmlUi font textures we have |
|
That's doable. I guess it was named like this because in the past it could be a generated image in the pk3. There are comments about it. But it was tied to some limitations we don't have if I'm right. |
|
I discovered that |
OK, that makes some sense, it's fine as is. |
Actually no, the code is confusing but it doesn't look like there would be any way to use an image from a pak instead of rendering using Freetype. I think I changed that behavior recently; before it might have been possible to do an image lookup for that function. But that could only happen after the glyph was already rendered with Freetype. It seems clearly wrong to render something and then discard it so I prevented that lookup from happening. |
|
I believe we have no reason to load such file from pk3/dpk anymore, so I'm OK with making the name using some internal naming scheme, but then we must clean-up anything about loading such file from the VFS. |
OK, if you find anything to clean up go ahead. Regarding pre-rasterized fonts I'm only aware of the code loading |
Not only our builtin image detector doesn't check for paths starting with |
|
But is the image generated by |
A shader is created using the image and the shader handle is stored. |
34fbd0b to
18bb78f
Compare
|
So now, with latest patch, instead of being named |
|
|
||
| Com_sprintf( fileName, sizeof( fileName ), "%s_%i_%i_%i", font->name, chunk, page, font->pointSize ); | ||
| std::string fontName = font->name; | ||
| std::replace( fontName.begin(), fontName.end(), '/', '_'); |
There was a problem hiding this comment.
Replacing characters seems pointless
There was a problem hiding this comment.
It's true we can now use / in those names (even if that looks ugly), so I removed the character substitution.
18bb78f to
4ef54b2
Compare
|
LGTM |
I did it for log æsthetics, but it fixes
testshader fonts/unifont_0_0_32as an unexpected side effect.We always use an explicit format as
internalFormateverywhere else.