X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_main.pas;h=45432615c04762ff01a513553de4f9b7822043af;hb=7f50d798c193f8a57a3c736c81615ef932915e9a;hp=222002baa53a1a312be411a51bcc1a3f6253431a;hpb=724d5405f0f3fe166b931b1b8b5745b2eb340651;p=d2df-sdl.git diff --git a/src/game/g_main.pas b/src/game/g_main.pas index 222002b..4543261 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -38,7 +38,7 @@ implementation uses {$INCLUDE ../nogl/noGLuses.inc} {$IFDEF ENABLE_HOLMES} - g_holmes, fui_wadread, fui_style, fui_gfx_gl, + g_holmes, sdlcarcass, fui_ctls, fui_wadread, fui_style, fui_gfx_gl, {$ENDIF} wadreader, e_log, g_window, e_graphics, e_input, g_game, g_console, g_gui, @@ -53,10 +53,8 @@ var charbuff: packed array [0..15] of AnsiChar; procedure Main(); -var - sdlflags: LongWord; -{$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)} - flexloaded: Boolean; +{$IFDEF ENABLE_HOLMES} + var flexloaded: Boolean; {$ENDIF} begin e_InitWritelnDriver(); @@ -84,22 +82,17 @@ begin {$ENDIF} e_WriteToStdOut := False; //{$IFDEF HEADLESS}True;{$ELSE}False;{$ENDIF} - e_WriteLog('Init Input', TMsgType.Notify); e_InitInput; - e_WriteLog('Read config file', TMsgType.Notify); + sys_Init; g_Options_Read(GameDir + '/' + CONFIG_FILENAME); - g_Console_SysInit; - - //GetSystemDefaultLCID() + if sys_SetDisplayMode(gScreenWidth, gScreenHeight, gBPP, gFullScreen) = False then + raise Exception.Create('Failed to set videomode on startup.'); - //e_WriteLog('Read language file', MSG_NOTIFY); - //g_Language_Load(DataDir + gLanguage + '.txt'); + g_Console_SysInit; e_WriteLog(gLanguage, TMsgType.Notify); g_Language_Set(gLanguage); - sys_Init; - {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)} flexloaded := true; if not fuiAddWad('flexui.wad') then @@ -143,15 +136,27 @@ begin end; end; g_holmes_imfunctional := not flexloaded; + + if (not g_holmes_imfunctional) then + begin + uiInitialize(); + uiContext.font := 'win14'; + end; + + if assigned(oglInitCB) then oglInitCB; {$ENDIF} //g_Res_CreateDatabases(); // it will be done before connecting to the server for the first time e_WriteLog('Entering SDLMain', TMsgType.Notify); -{$WARNINGS OFF} - SDLMain(); -{$WARNINGS ON} + {$WARNINGS OFF} + SDLMain(); + {$WARNINGS ON} + + {$IFDEF ENABLE_HOLMES} + if assigned(oglDeinitCB) then oglDeinitCB; + {$ENDIF} sys_Final; end; @@ -199,12 +204,12 @@ begin e_WriteLog('Releasing engine', TMsgType.Notify); e_ReleaseEngine(); - e_WriteLog('Releasing Input', TMsgType.Notify); + e_WriteLog('Releasing input', TMsgType.Notify); e_ReleaseInput(); if not gNoSound then begin - e_WriteLog('Releasing FMOD', TMsgType.Notify); + e_WriteLog('Releasing sound', TMsgType.Notify); e_ReleaseSoundSystem(); end; end;