mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
[ruamoko] Handle missing fonts correctly
Carrying on as if the missing font had been loaded leads to way too many issues for it to be a good thing (not that that really needs to be said). Fixes the segfaults in my test scene.
This commit is contained in:
parent
b1de1b8747
commit
9317ce7358
1 changed files with 5 additions and 1 deletions
|
@ -228,9 +228,13 @@ bi (Font_Load)
|
|||
const char *font_path = P_GSTRING (pr, 0);
|
||||
int font_size = P_INT (pr, 1);
|
||||
|
||||
R_INT (pr) = 0;
|
||||
|
||||
QFile *font_file = QFS_FOpenFile (font_path);
|
||||
font_t *font = Font_Load (font_file, font_size);
|
||||
if (font) {
|
||||
R_INT (pr) = alloc_font (res, font);
|
||||
}
|
||||
}
|
||||
|
||||
bi (Font_Free)
|
||||
|
|
Loading…
Reference in a new issue