X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2FDoom2DF.lpr;h=51d0cb9617414851a7056e02e85ddeca90aa284e;hb=0592c8529428165e2523e0cb054bff29e297777a;hp=4d4edc34d03d854e0091387e3f92fdb7a8dd469a;hpb=fe1782e13a7cf88bbbefdc8191b18271ee858985;p=d2df-sdl.git diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr index 4d4edc3..51d0cb9 100644 --- a/src/game/Doom2DF.lpr +++ b/src/game/Doom2DF.lpr @@ -144,7 +144,7 @@ uses g_playermodel in 'g_playermodel.pas', g_saveload in 'g_saveload.pas', g_sound in 'g_sound.pas', - g_textures in 'g_textures.pas', + g_animations in 'g_animations.pas', g_triggers in 'g_triggers.pas', g_weapons in 'g_weapons.pas', g_window in 'g_window.pas', @@ -161,33 +161,55 @@ uses {$ENDIF} {$ENDIF} -{$IFDEF ENABLE_RENDER} - {$I ../shared/vampimg.inc} - r_animations in 'opengl/r_animations.pas', - r_console in 'opengl/r_console.pas', - r_game in 'opengl/r_game.pas', - {$IFDEF ENABLE_GFX} - r_gfx in 'opengl/r_gfx.pas', - {$ENDIF} - r_graphics in 'opengl/r_graphics.pas', - r_items in 'opengl/r_items.pas', - r_map in 'opengl/r_map.pas', - r_monsters in 'opengl/r_monsters.pas', - r_netmaster in 'opengl/r_netmaster.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', - {$IFDEF ENABLE_TOUCH} - r_touch in 'opengl/r_touch.pas', - {$ENDIF} {$IFDEF ENABLE_MENU} g_gui in 'g_gui.pas', g_menu in 'g_menu.pas', {$ENDIF} + +{$IFDEF ENABLE_RENDER} + {$IF DEFINED(USE_OPENGL) OR DEFINED(USE_GLES1) OR DEFINED(USE_GLSTUB)} + {$I ../shared/vampimg.inc} + r_animations in 'opengl/r_animations.pas', + r_console in 'opengl/r_console.pas', + r_game in 'opengl/r_game.pas', + {$IFDEF ENABLE_GFX} + r_gfx in 'opengl/r_gfx.pas', + {$ENDIF} + r_graphics in 'opengl/r_graphics.pas', + r_items in 'opengl/r_items.pas', + r_map in 'opengl/r_map.pas', + r_monsters in 'opengl/r_monsters.pas', + r_netmaster in 'opengl/r_netmaster.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', + {$IFDEF ENABLE_TOUCH} + r_touch in 'opengl/r_touch.pas', + {$ENDIF} + {$IFDEF ENABLE_MENU} + r_gui in 'opengl/r_gui.pas', + {$ENDIF} + {$ELSEIF DEFINED(USE_STUBRENDER)} + r_render in 'renders/stub/r_render.pas', + {$ELSEIF DEFINED(USE_NEWGL)} + {$I ../shared/vampimg.inc} + r_render in 'renders/opengl/r_render.pas', + r_atlas in 'renders/opengl/r_atlas.pas', + r_textures in 'renders/opengl/r_textures.pas', + r_draw in 'renders/opengl/r_draw.pas', + r_map in 'renders/opengl/r_map.pas', + r_fonts in 'renders/opengl/r_fonts.pas', + r_common in 'renders/opengl/r_common.pas', + r_console in 'renders/opengl/r_console.pas', + r_gui in 'renders/opengl/r_gui.pas', + r_loadscreen in 'renders/opengl/r_loadscreen.pas', + {$ELSE} + {$FATAL render driver not selected} + {$ENDIF} {$ENDIF} {$IFDEF USE_FMOD} @@ -322,9 +344,6 @@ begin {$IFDEF ENABLE_RENDER} r_Render_Draw; {$ENDIF} - {$IFDEF ENABLE_SYSTEM} - sys_Repaint; - {$ENDIF} Frame := Time end else @@ -993,6 +1012,26 @@ end; {$ENDIF} end; + procedure ProcessLoading; + var update: Boolean; + begin + {$IFDEF ENABLE_SYSTEM} + update := sys_HandleInput() = False; + {$ELSE} + update := True; + {$ENDIF} + if update then + begin + e_SoundUpdate; + // TODO: At the moment, I left here only host network processing, because the client code must + // handle network events on its own. Otherwise separate network cases that use different calls to + // enet_host_service() WILL lose their packets (for example, resource downloading). So they have + // to handle everything by themselves. But in general, this MUST be removed completely, since + // updating the window should never affect the network. Use single enet_host_service(), period. + if NetMode = NET_SERVER then g_Net_Host_Update(); + end + end; + procedure Startup; begin Randomize; @@ -1017,6 +1056,11 @@ end; DebugOptions; g_Net_InitLowLevel; // TODO init serverlist + {$IFDEF ENABLE_RENDER} + r_Render_SetProcessLoadingCallback(@ProcessLoading); + {$ENDIF} + g_Game_SetLoadingText(Format('Doom 2D: Forever %s', [GAME_VERSION]), 0, False); + g_Game_SetLoadingText('', 0, False); {$IFDEF ENABLE_HOLMES} InitHolmes; {$ENDIF} @@ -1029,7 +1073,6 @@ end; g_Game_Init; {$IFDEF ENABLE_MENU} g_Menu_Init; - g_GUI_Init; {$ENDIF} g_Game_Process_Params; // TODO reload GAME textures @@ -1040,6 +1083,9 @@ end; {$ENDIF} Time_Old := GetTickCount64(); while not ProcessMessage() do begin end; + {$IFDEF ENABLE_RENDER} + r_Render_SetProcessLoadingCallback(nil); + {$ENDIF} g_Console_WriteGameConfig; {$IFDEF ENABLE_MENU} g_GUI_Destroy;