From 914cc02464b8498514eb34c8b0fa6a9045636858 Mon Sep 17 00:00:00 2001 From: skyjake Date: Thu, 26 Jul 2012 14:25:42 +0300 Subject: [PATCH] Fixed|Dedicated Server: Fatal error from font subsystem In novideo mode there is no need to load fonts. --- .../engine/portable/src/render/busyvisual.c | 75 ++++++++++--------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/doomsday/engine/portable/src/render/busyvisual.c b/doomsday/engine/portable/src/render/busyvisual.c index f1d396749a..0e3963d5fe 100644 --- a/doomsday/engine/portable/src/render/busyvisual.c +++ b/doomsday/engine/portable/src/render/busyvisual.c @@ -102,43 +102,46 @@ void BusyVisual_PrepareResources(void) void BusyVisual_PrepareFont(void) { - /** - * @todo At the moment this is called from preBusySetup() so that the font - * is present throughout the busy mode during all the individual tasks. - * Previously the font was being prepared at the beginning of each task, - * but that was resulting in a rendering glitch where the font GL texture - * was not being properly drawn on screen during the first ~1 second of - * BusyVisual visibility. The exact cause was not determined, but it may be - * due to a conflict with the fonts being prepared from both the main - * thread and the worker thread, or because the GL deferring mechanism is - * interfering somehow. - */ - - // These must be real files in the base dir because virtual files haven't - // been loaded yet when the engine startup is done. - struct busyfont_s { - const char* name; - const char* path; - } static const fonts[] = { - { FN_SYSTEM_NAME":normal12", "}data/fonts/normal12.dfn" }, - { FN_SYSTEM_NAME":normal18", "}data/fonts/normal18.dfn" } - }; - int fontIdx = !(Window_Width(theWindow) > 640)? 0 : 1; - Uri* uri = Uri_NewWithPath2(fonts[fontIdx].name, RC_NULL); - font_t* font = R_CreateFontFromFile(uri, fonts[fontIdx].path); - Uri_Delete(uri); - - if(font) + if(!novideo) { - busyFont = Fonts_Id(font); - FR_SetFont(busyFont); - FR_LoadDefaultAttrib(); - busyFontHgt = FR_SingleLineHeight("Busy"); - } - else - { - busyFont = 0; - busyFontHgt = 0; + /** + * @todo At the moment this is called from preBusySetup() so that the font + * is present throughout the busy mode during all the individual tasks. + * Previously the font was being prepared at the beginning of each task, + * but that was resulting in a rendering glitch where the font GL texture + * was not being properly drawn on screen during the first ~1 second of + * BusyVisual visibility. The exact cause was not determined, but it may be + * due to a conflict with the fonts being prepared from both the main + * thread and the worker thread, or because the GL deferring mechanism is + * interfering somehow. + */ + + // These must be real files in the base dir because virtual files haven't + // been loaded yet when the engine startup is done. + static const struct busyfont_s { + const char* name; + const char* path; + } fonts[] = { + { FN_SYSTEM_NAME":normal12", "}data/fonts/normal12.dfn" }, + { FN_SYSTEM_NAME":normal18", "}data/fonts/normal18.dfn" } + }; + int fontIdx = !(Window_Width(theWindow) > 640)? 0 : 1; + Uri* uri = Uri_NewWithPath2(fonts[fontIdx].name, RC_NULL); + font_t* font = R_CreateFontFromFile(uri, fonts[fontIdx].path); + Uri_Delete(uri); + + if(font) + { + busyFont = Fonts_Id(font); + FR_SetFont(busyFont); + FR_LoadDefaultAttrib(); + busyFontHgt = FR_SingleLineHeight("Busy"); + } + else + { + busyFont = 0; + busyFontHgt = 0; + } } }