From 5e6f7df89458070c6787b7be8f7f415bb3a00c92 Mon Sep 17 00:00:00 2001 From: Byurrer <byurrer@mail.ru> Date: Tue, 21 Nov 2017 13:03:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3=20=D0=B2=20sxrender=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20=D0=B1=D1=83=D1=84=D0=B5=D1=80=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BE=D1=87=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/sysconfig.cfg | 6 ++++- source/render/render_func.cpp | 4 +++- source/skyxengine.cpp | 45 ++++++++++++++++++++--------------- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/build/sysconfig.cfg b/build/sysconfig.cfg index 2e4ed61a7..d5ad9c7b9 100644 --- a/build/sysconfig.cfg +++ b/build/sysconfig.cfg @@ -24,7 +24,9 @@ bind f8 change_mode_window_abs cl_mode_editor 1 r_default_fov 1.046 -rs_stats 2 +r_stats 0 +r_win_width 1024 +r_win_height 768 pp_ssao 1 pp_bloom true @@ -53,6 +55,8 @@ r_s_max_miplevel 0 main_rain_density 1 main_thunderbolt true +g_time_speed 100 + spawn //cl_grab_cursor 0 diff --git a/source/render/render_func.cpp b/source/render/render_func.cpp index d332eefe0..9265f0e29 100644 --- a/source/render/render_func.cpp +++ b/source/render/render_func.cpp @@ -563,10 +563,12 @@ int SXRenderFunc::OutputDebugInfo(DWORD timeDelta, bool needGameTime, const char { FpsValue = (float)FrameCount / TimeElapsed; + debugstr[0] = 0; + if ((*r_stats) > 0) sprintf(debugstr, "FPS %.1f\n", FpsValue); - if (needGameTime) + if ((*r_stats) > 0 && needGameTime) { tm g_tm; time_t g_time = Core_TimeUnixCurrGet(Core_RIntGet(G_RI_INT_TIMER_GAME)); diff --git a/source/skyxengine.cpp b/source/skyxengine.cpp index d47e21fce..d9e3c9446 100644 --- a/source/skyxengine.cpp +++ b/source/skyxengine.cpp @@ -109,8 +109,29 @@ void SkyXEngine_Init(HWND hWnd3D, HWND hWndParent3D) if (!Core_0IsProcessRun("sxconsole.exe")) ShellExecute(0, "open", "sxconsole.exe", 0, Core_RStringGet(G_RI_STRING_PATH_EXE), SW_SHOWNORMAL); + + + Core_0Create("sxcore", false); + Core_Dbg_Set(SkyXEngine_PrintfLog); + Core_SetOutPtr(); + SkyXEngine_CreateLoadCVar(); + ID idTimerRender = Core_TimeAdd(); + ID idTimerGame = Core_TimeAdd(); + Core_RIntSet(G_RI_INT_TIMER_RENDER, idTimerRender); + Core_RIntSet(G_RI_INT_TIMER_GAME, idTimerGame); + + tm ct = { 0, 0, 10, 27, 5, 2030 - 1900, 0, 0, 0 }; + Core_TimeUnixStartSet(idTimerGame, mktime(&ct)); + + Core_TimeWorkingSet(idTimerRender, true); + Core_TimeWorkingSet(idTimerGame, true); + + Core_TimeSpeedSet(idTimerGame, 10); + + + static int *r_win_width = (int*)GET_PCVAR_INT("r_win_width"); static int *r_win_height = (int*)GET_PCVAR_INT("r_win_height"); static const bool *r_win_windowed = GET_PCVAR_BOOL("r_win_windowed"); @@ -133,28 +154,9 @@ void SkyXEngine_Init(HWND hWnd3D, HWND hWndParent3D) SSInput_0Create("sxinput", hWnd3DCurr, false); SSInput_Dbg_Set(SkyXEngine_PrintfLog); - Core_0Create("sxcore", false); - Core_Dbg_Set(SkyXEngine_PrintfLog); - Core_SetOutPtr(); - - ID idTimerRender = Core_TimeAdd(); - ID idTimerGame = Core_TimeAdd(); - Core_RIntSet(G_RI_INT_TIMER_RENDER, idTimerRender); - Core_RIntSet(G_RI_INT_TIMER_GAME, idTimerGame); - - tm ct = { 0, 0, 6, 27, 5, 2030 - 1900, 0, 0, 0 }; - Core_TimeUnixStartSet(idTimerGame, mktime(&ct)); - - Core_TimeWorkingSet(idTimerRender, true); - Core_TimeWorkingSet(idTimerGame, true); - - Core_TimeSpeedSet(idTimerGame, 10); - SSCore_0Create("sxsound", hWnd3DCurr, false); SSCore_Dbg_Set(SkyXEngine_PrintfLog); - - SGCore_0Create("sxgcore", hWnd3DCurr, *r_win_width, *r_win_height, *r_win_windowed, 0, false); SGCore_Dbg_Set(SkyXEngine_PrintfLog); @@ -395,6 +397,11 @@ void SkyXEngine_CreateLoadCVar() Core_0ConsoleExecCmd("exec ../sysconfig.cfg"); Core_0ConsoleExecCmd("exec ../userconfig.cfg"); + + Core_0ConsoleUpdate(); + + Core_0ConsoleExecCmd("exec ../sysconfig.cfg"); + Core_0ConsoleExecCmd("exec ../userconfig.cfg"); } LRESULT CALLBACK SkyXEngine_WndProc(HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) -- GitLab