mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
Console_Load: allow to run without external font assets available
This commit is contained in:
parent
036cc00332
commit
f7c9088695
1 changed files with 9 additions and 3 deletions
|
@ -260,10 +260,16 @@ SYMBOL_INTERNAL void DrawConsole(struct Game* game) {
|
|||
}
|
||||
|
||||
SYMBOL_INTERNAL void Console_Load(struct Game* game) {
|
||||
game->_priv.font_console = al_load_ttf_font(GetDataFilePath(game, "fonts/DejaVuSansMono.ttf"), (int)(game->clip_rect.h * 0.025), 0);
|
||||
if (game->clip_rect.h * 0.025 >= 16) {
|
||||
game->_priv.font_bsod = al_load_ttf_font(GetDataFilePath(game, "fonts/PerfectDOSVGA437.ttf"), 16 * ((game->clip_rect.h > 1080) ? 2 : 1), 0);
|
||||
if (FindDataFilePath(game, "fonts/DejaVuSansMono.ttf")) {
|
||||
game->_priv.font_console = al_load_ttf_font(GetDataFilePath(game, "fonts/DejaVuSansMono.ttf"), (int)(game->clip_rect.h * 0.025), 0);
|
||||
} else {
|
||||
PrintConsole(game, "Could not load console font - using built-in fallback.");
|
||||
game->_priv.font_console = al_create_builtin_font();
|
||||
}
|
||||
|
||||
if (FindDataFilePath(game, "fonts/PerfectDOSVGA437.ttf") && game->clip_rect.h * 0.025 >= 16) {
|
||||
game->_priv.font_bsod = al_load_ttf_font(GetDataFilePath(game, "fonts/PerfectDOSVGA437.ttf"), 16 * ((game->clip_rect.h > 1080) ? 2 : 1), 0);
|
||||
} else if (FindDataFilePath(game, "fonts/DejaVuSansMono.ttf")) {
|
||||
game->_priv.font_bsod = al_load_ttf_font(GetDataFilePath(game, "fonts/DejaVuSansMono.ttf"), (int)(game->clip_rect.h * 0.025), 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue