X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2FDoom2DF.lpr;h=71e8d71caff2fd725d3572df45ea646eab81b81a;hb=7f57e4b195f1a553c5bb01638cc7d9908c992c88;hp=268e281a029f8e05fefb378a13db5d7fd20b6117;hpb=fbb649f409620a55ae48f1bffd655c5a04489371;p=d2df-sdl.git diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr index 268e281..71e8d71 100644 --- a/src/game/Doom2DF.lpr +++ b/src/game/Doom2DF.lpr @@ -152,6 +152,7 @@ uses g_touch in 'sdl2/g_touch.pas', {$ENDIF} + r_animations in 'opengl/r_animations.pas', r_console in 'opengl/r_console.pas', r_game in 'opengl/r_game.pas', r_gfx in 'opengl/r_gfx.pas', @@ -163,10 +164,11 @@ uses r_panel in 'opengl/r_panel.pas', r_player in 'opengl/r_player.pas', r_playermodel in 'opengl/r_playermodel.pas', + r_render in 'opengl/r_render.pas', r_texture in 'opengl/r_texture.pas', + r_textures in 'opengl/r_textures.pas', r_weapons in 'opengl/r_weapons.pas', r_window in 'opengl/r_window.pas', - r_render in 'opengl/r_render.pas', {$IFDEF USE_FMOD} fmod in '../lib/FMOD/fmod.pas', @@ -216,11 +218,7 @@ uses binPath: AnsiString = ''; forceBinDir: Boolean = False; - wLoadingQuit: Boolean = false; - Time, Time_Delta, Time_Old: Int64; - Frame: Int64; - flag: Boolean = false; - + Time_Old: Int64; NoSound: Boolean; procedure Update (); @@ -240,10 +238,13 @@ end; function ProcessMessage (): Boolean; var i, t: Integer; + flag: Boolean; + Time, Time_Delta: Int64; + Frame: Int64; begin result := sys_HandleInput(); - Time := sys_GetTicks(); + Time := GetTickCount64(); Time_Delta := Time-Time_Old; flag := false; @@ -269,12 +270,6 @@ begin g_Map_ProfilersEnd(); g_Mons_ProfilersEnd(); - if wLoadingQuit then - begin - g_Game_Free(); - g_Game_Quit(); - end; - if (gExit = EXIT_QUIT) then begin result := true; @@ -300,7 +295,7 @@ begin Frame := Time end else - sys_Delay(1); + Sleep(1); e_SoundUpdate(); end; @@ -914,6 +909,24 @@ end; end; {$ENDIF} + procedure ScreenResize (w, h: Integer); + begin + r_Render_Resize(w, h); + {$IFDEF ENABLE_HOLMES} + fuiScrWdt := w; + fuiScrHgt := h; + {$ENDIF} + g_Game_SetupScreenSize; + {$IFNDEF ANDROID} + (* This will fix menu reset on keyboard showing *) + g_Menu_Reset; + {$ENDIF} + //g_Game_ClearLoading; + {$IFDEF ENABLE_HOLMES} + if assigned(oglInitCB) then oglInitCB; + {$ENDIF} + end; + procedure Startup; begin Randomize; @@ -924,6 +937,7 @@ end; e_InitSoundSystem(NoSound); sys_Init; sys_CharPress := @CharPress; (* install hook *) + sys_ScreenResize := @ScreenResize; (* install hook *) g_Options_SetDefault; g_Options_SetDefaultVideo; g_Console_Initialize; @@ -937,6 +951,8 @@ end; {$IFDEF ENABLE_HOLMES} InitHolmes; {$ENDIF} + g_PlayerModel_LoadAll; + r_Render_Load; g_Game_Init; {$IFNDEF HEADLESS} g_Menu_Init; @@ -949,13 +965,14 @@ end; if (not gGameOn) and gAskLanguage then g_Menu_AskLanguage; {$ENDIF} - Time_Old := sys_GetTicks(); + Time_Old := GetTickCount64(); while not ProcessMessage() do begin end; g_Console_WriteGameConfig; {$IFNDEF HEADLESS} g_GUI_Destroy; g_Menu_Free; {$ENDIF} + r_Render_Free; {$IFDEF ENABLE_HOLMES} FreeHolmes; {$ENDIF}