From: DeaDDooMER Date: Fri, 30 Aug 2019 17:49:27 +0000 (+0300) Subject: disable menu handling in headless version X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=fe124e7198cf5515dc005ed363c7989e19228134;p=d2df-sdl.git disable menu handling in headless version --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index e6429bc..df45196 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -1342,8 +1342,10 @@ begin g_Sound_CreateWADEx('MUSIC_ROUNDMUS', GameWAD+':MUSIC\ROUNDMUS', True, True); g_Sound_CreateWADEx('MUSIC_STDENDMUS', GameWAD+':MUSIC\ENDMUS', True); +{$IFNDEF HEADLESS} g_Game_SetLoadingText(_lc[I_LOAD_MENUS], 0, False); g_Menu_Init(); +{$ENDIF} gMusic := TMusic.Create(); gMusic.SetByName('MUSIC_MENU'); @@ -2174,7 +2176,9 @@ begin //e_WriteLog('Read language file', MSG_NOTIFY); //g_Language_Load(DataDir + gLanguage + '.txt'); g_Language_Set(gLanguage); +{$IFNDEF HEADLESS} g_Menu_Reset(); +{$ENDIF} gLanguageChange := False; end; end; @@ -4037,7 +4041,9 @@ begin g_ActiveWindow.Draw(); end; +{$IFNDEF HEADLESS} g_Console_Draw(); +{$ENDIF} if g_debug_Sounds and gGameOn then begin @@ -4073,7 +4079,9 @@ begin g_PlayerModel_FreeData(); g_Texture_DeleteAll(); g_Frames_DeleteAll(); +{$IFNDEF HEADLESS} //g_Menu_Free(); //k8: this segfaults after resolution change; who cares? +{$ENDIF} if NetInitDone then g_Net_Free; diff --git a/src/game/g_main.pas b/src/game/g_main.pas index 2f68e2e..c3741bc 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -477,9 +477,12 @@ end; procedure KeyPress (K: Word); +{$IFNDEF HEADLESS} var Msg: g_gui.TMessage; +{$ENDIF} begin +{$IFNDEF HEADLESS} case K of VK_ESCAPE: // : begin @@ -552,6 +555,7 @@ begin end; end; end; +{$ENDIF} end; diff --git a/src/game/g_window.pas b/src/game/g_window.pas index d703ea2..b8d0921 100644 --- a/src/game/g_window.pas +++ b/src/game/g_window.pas @@ -823,6 +823,7 @@ begin end; end; +{$IFNDEF HEADLESS} if forceUpdate then begin DrawMenuBackground('INTER'); @@ -832,6 +833,7 @@ begin g_Console_Draw(True); SwapBuffers(); end; +{$ENDIF} end; e_SoundUpdate(); @@ -1177,8 +1179,10 @@ begin // Êîìàíäíàÿ ñòðîêà if (ParamCount > 0) then g_Game_Process_Params(); +{$IFNDEF HEADLESS} // Çàïðîñ ÿçûêà if (not gGameOn) and gAskLanguage then g_Menu_AskLanguage(); +{$ENDIF} e_WriteLog('Entering the main loop', TMsgType.Notify);