mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +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
53ae2fe223
commit
25c51e8711
1 changed files with 5 additions and 1 deletions
|
@ -223,9 +223,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 (Passage_New)
|
||||
|
|
Loading…
Reference in a new issue