X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_main.pas;h=3da02c2a7969c7b3dcba276fafe2e44dcce79b0e;hb=9615ae96661aed9886424c75479d322f555627a6;hp=ab6e1d8498b9de28c655539f2bf4c985c8a1a8c7;hpb=939a343cdc93545211b37de24e9d406bf54dcaf0;p=d2df-sdl.git diff --git a/src/game/g_main.pas b/src/game/g_main.pas index ab6e1d8..3da02c2 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -53,7 +53,6 @@ var implementation uses -{$INCLUDE ../nogl/noGLuses.inc} {$IFDEF ENABLE_HOLMES} g_holmes, sdlcarcass, fui_ctls, fui_wadread, fui_style, fui_gfx_gl, {$ENDIF} @@ -67,11 +66,11 @@ uses SDL2, {$ENDIF} wadreader, e_log, g_window, - e_graphics, e_input, g_game, g_console, g_gui, + r_graphics, e_input, g_game, g_console, g_gui, e_sound, g_options, g_sound, g_player, g_basic, g_weapons, SysUtils, g_triggers, MAPDEF, g_map, e_res, g_menu, g_language, g_net, g_touch, g_system, g_res_downloader, - conbuf, envvars, + conbuf, envvars, r_game, xparser; @@ -372,6 +371,11 @@ begin Inc(i); GameWADName := ParamStr(i); end; + '--config': + begin + Inc(i); + gConfigScript := ParamStr(i); + end; end; Inc(i) end; @@ -502,7 +506,6 @@ procedure Main(); {$IFDEF ENABLE_HOLMES} var flexloaded: Boolean; {$ENDIF} - var s: AnsiString; begin InitPath; InitPrep; @@ -511,9 +514,6 @@ begin g_Options_SetDefault; g_Options_SetDefaultVideo; - s := CONFIG_FILENAME; - if e_FindResource(ConfigDirs, s) = true then - g_Options_Read(s); g_Console_SysInit; if sys_SetDisplayMode(gRC_Width, gRC_Height, gBPP, gRC_FullScreen, gRC_Maximized) = False then raise Exception.Create('Failed to set videomode on startup.'); @@ -646,13 +646,22 @@ end; procedure Update (); begin + // remember old mobj positions, prepare for update + g_Game_PreUpdate(); + // server: receive client commands for new frame + // client: receive game state changes from server + if (NetMode = NET_SERVER) then g_Net_Host_Update() + else if (NetMode = NET_CLIENT) then g_Net_Client_Update(); + // think g_Game_Update(); + // server: send any accumulated outgoing data to clients + if NetMode = NET_SERVER then g_Net_Flush(); end; procedure Draw (); begin - g_Game_Draw(); + r_Game_Draw(); end;