Commit 5e6f7df8 authored by Byurrrer's avatar Byurrrer

поправил баг в sxrender при переполнении буфера отладочного сообщения

parent f879112c
......@@ -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
......@@ -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));
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment