From: Ketmar Dark Date: Wed, 4 Oct 2017 18:57:52 +0000 (+0300) Subject: "flexui.wad" is not required now X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=dcddacd6f339e310c23663bd7e0b6ec7733ccf0f;p=d2df-sdl.git "flexui.wad" is not required now --- diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas index 0b5c00d..c3c29df 100644 --- a/src/game/g_holmes.pas +++ b/src/game/g_holmes.pas @@ -1084,7 +1084,7 @@ procedure plrDebugDraw (); if showMonsInfo then begin //fillRect(mx-4, my-7*8-6, 110, 7*8+6, 0, 0, 94, 250); - hlmContext.font := 'msx'; + hlmContext.font := 'msx6'; hlmContext.color := TGxRGBA.Create(255, 127, 0); hlmContext.darkenRect(mx-4, my-7*hlmContext.charWidth(' ')-6, 110, 7*hlmContext.charWidth(' ')+6, 128); @@ -1149,7 +1149,7 @@ procedure plrDebugDraw (); tts: AnsiString; tx: Integer; begin - hlmContext.font := 'msx'; + hlmContext.font := 'msx6'; hlmContext.color := TGxRGBA.Create(255, 0, 255, 96); hlmContext.fillRect(trig.x, trig.y, trig.width, trig.height); tts := trigType2Str(trig.TriggerType); @@ -1308,7 +1308,7 @@ begin if showMapCurPos then begin gxSetContext(hlmContext); - hlmContext.font := 'dos'; + hlmContext.font := 'win8'; hlmContext.color := TGxRGBA.Create(255, 255, 0); hlmContext.drawText(4, gWinSizeY-10, Format('mappos:(%d,%d)', [pmsCurMapX, pmsCurMapY])); gxSetContext(nil); diff --git a/src/game/g_main.pas b/src/game/g_main.pas index 7de7825..b5a2284 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -52,6 +52,9 @@ var procedure Main(); var sdlflags: LongWord; +{$IFNDEF HEADLESS} + flexloaded: Boolean; +{$ENDIF} begin e_InitWritelnDriver(); @@ -101,39 +104,48 @@ begin {$ENDIF} {$IFNDEF HEADLESS} + flexloaded := true; if not fuiAddWad('flexui.wad') then begin if not fuiAddWad('./data/flexui.wad') then fuiAddWad('./flexui.wad'); end; - g_holmes_imfunctional := true; - try - e_LogWriteln('FlexUI: loading stylesheet...'); - uiLoadStyles('flexui/widgets.wgs'); - except on e: TParserException do - begin - writeln('ERROR at (', e.tokLine, ',', e.tokCol, '): ', e.message); - //raise; - end; - else - begin - //raise; - end; - end; try fuiGfxLoadFont('win8', 'flexui/fonts/win8.fuifont'); fuiGfxLoadFont('win14', 'flexui/fonts/win14.fuifont'); fuiGfxLoadFont('win16', 'flexui/fonts/win16.fuifont'); - g_holmes_imfunctional := false; + fuiGfxLoadFont('dos8', 'flexui/fonts/dos8.fuifont'); + fuiGfxLoadFont('msx6', 'flexui/fonts/msx6.fuifont'); except on e: Exception do begin writeln('ERROR loading FlexUI fonts'); + flexloaded := false; //raise; end; else begin + flexloaded := false; //raise; end; end; + if (flexloaded) then + begin + try + e_LogWriteln('FlexUI: loading stylesheet...'); + uiLoadStyles('flexui/widgets.wgs'); + except on e: TParserException do + begin + writeln('ERROR at (', e.tokLine, ',', e.tokCol, '): ', e.message); + //raise; + flexloaded := false; + end; + else + begin + //raise; + flexloaded := false; + end; + end; + end; + g_holmes_imfunctional := not flexloaded; {$ENDIF} e_WriteLog('Entering SDLMain', TMsgType.Notify); diff --git a/src/game/g_window.pas b/src/game/g_window.pas index dbf50d3..80e63fd 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -767,8 +767,11 @@ begin {$IFDEF HEADLESS} e_NoGraphics := true; {$ELSE} - uiInitialize(); - uiContext.font := 'win14'; + if (not g_holmes_imfunctional) then + begin + uiInitialize(); + uiContext.font := 'win14'; + end; {$ENDIF} idx := 1;