-
Couldn't load subscription status.
- Fork 65
Description
There are 3 shaders in engine code that are sets from game assets
Daemon/src/engine/client/cl_main.cpp: cls.charSetShader = re.RegisterShader( "gfx/2d/bigchars", RSF_DEFAULT );
Daemon/src/engine/client/cl_main.cpp: cls.whiteShader = re.RegisterShader( "white", RSF_NOMIP );
Daemon/src/engine/client/cl_main.cpp: cls.consoleShader = re.RegisterShader( "console", RSF_DEFAULT );
The first one gfx/2d/bigchars looks to be a fallback if the ttf font is not found. Do we have to keep that? If the ttf found is not found it means both system font and game pack are missing, and if game pack is missing, the fallback will never be found. So, can we get rid of that?
Daemon/src/engine/client/cl_main.cpp
Lines 3054 to 3069 in 8c1c497
| // load character sets | |
| cls.charSetShader = re.RegisterShader( "gfx/2d/bigchars", RSF_DEFAULT ); | |
| cls.useLegacyConsoleFont = cls.useLegacyConsoleFace = true; | |
| // Register console font specified by cl_consoleFont, if any | |
| // filehandle is unused but forces FS_FOpenFileRead() to heed purecheck because it does not when filehandle is nullptr | |
| if ( cl_consoleFont->string[0] ) | |
| { | |
| if ( FS_FOpenFileRead( cl_consoleFont->string, &f, false ) >= 0 ) | |
| { | |
| re.RegisterFont( cl_consoleFont->string, nullptr, cl_consoleFontSize->integer, &cls.consoleFont ); | |
| cls.useLegacyConsoleFont = false; | |
| } | |
| FS_FCloseFile( f ); | |
| } |
The other ones are just shaders for pure white and pure black shaders:
white
{
cull none
{
map *white
blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbgen vertex
}
}console
{
nopicmip
nomipmaps
{
map gfx/colors/black
}
}The white one only relies on pure text, it can be embedded. The console one (black one) relies on a pure black textures, it can probably be generated at run time or we can probably embed a 1×1px xpm or something like that (it's currently a pure black 8×8 jpg)…
Note that both white and console shaders are redefined by the game code itself and game packages so they basically are fallbacks for when game code does not define them and when game packages are not there, so the purpose of fallback is entirely defeated: the fallback for missing game requires game packs (!!!).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status