X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2FDoom2DF.lpr;h=1f7a19c87747133c9296084bd00821495bbbf72a;hp=268e281a029f8e05fefb378a13db5d7fd20b6117;hb=b07cc041c0c2cbb70ddddaddf81e3b03533d3ac8;hpb=fbb649f409620a55ae48f1bffd655c5a04489371 diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr index 268e281..1f7a19c 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 (); @@ -232,6 +230,7 @@ begin if (NetMode = NET_SERVER) then g_Net_Host_Update() else if (NetMode = NET_CLIENT) then g_Net_Client_Update(); // think + r_Render_Update; g_Game_Update(); // server: send any accumulated outgoing data to clients if NetMode = NET_SERVER then g_Net_Flush(); @@ -240,10 +239,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 +271,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 +296,7 @@ begin Frame := Time end else - sys_Delay(1); + Sleep(1); e_SoundUpdate(); end; @@ -914,6 +910,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 +938,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 +952,8 @@ end; {$IFDEF ENABLE_HOLMES} InitHolmes; {$ENDIF} + g_PlayerModel_LoadAll; + r_Render_Load; g_Game_Init; {$IFNDEF HEADLESS} g_Menu_Init; @@ -949,13 +966,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}