@@ -102,29 +102,16 @@ static void DumpColliderStatistics(CGameFont &font, PerformanceAlert *alert)
102102
103103void CStats::Show ()
104104{
105- {
106- float mem_count = float (Memory.stat_calls );
107- if (mem_count > fMem_calls )
108- fMem_calls = mem_count;
109- else
110- fMem_calls = 0 .9f *fMem_calls + 0 .1f *mem_count;
111- Memory.stat_calls = 0 ;
112- }
105+ float memCalls = float (Memory.stat_calls );
106+ if (memCalls > fMem_calls )
107+ fMem_calls = memCalls;
108+ else
109+ fMem_calls = 0 .9f *fMem_calls + 0 .1f *memCalls;
110+ Memory.stat_calls = 0 ;
113111 if (g_dedicated_server)
114112 return ;
115113 auto &font = *statsFont;
116114 auto engineTotal = Device.GetStats ().EngineTotal .result ;
117- int frm = 2000 ;
118- div_t ddd = div (Device.dwFrame , frm);
119- if (ddd.rem <frm/2 .0f )
120- {
121- font.SetColor (0xFFFFFFFF );
122- font.OutSet (0 , 0 );
123- font.OutNext (*eval_line_1);
124- font.OutNext (*eval_line_2);
125- font.OutNext (*eval_line_3);
126- font.OnRender ();
127- }
128115 const float fontBaseSize = 0 .01f ;
129116 PerformanceAlert alertInstance (fontBaseSize, {300 , 300 });
130117 auto alertPtr = g_bDisableRedText ? nullptr : &alertInstance;
@@ -169,21 +156,14 @@ void CStats::Show()
169156 pInput->DumpStatistics (font, alertPtr);
170157 font.OutSkip ();
171158#ifdef DEBUG_MEMORY_MANAGER
172- font.OutSkip ();
173159 font.OutNext (" str: cmp[%3d], dock[%3d], qpc[%3d]" , Memory.stat_strcmp , Memory.stat_strdock , CPU::qpc_counter);
174160 Memory.stat_strcmp = 0 ;
175161 Memory.stat_strdock = 0 ;
176162 CPU::qpc_counter = 0 ;
177- #else // DEBUG_MEMORY_MANAGER
178- font.OutSkip ();
163+ #else
179164 font.OutNext (" qpc[%3d]" , CPU::qpc_counter);
180165 CPU::qpc_counter = 0 ;
181- #endif // DEBUG_MEMORY_MANAGER
182- font.OutSkip ();
183- // process pureStats
184- font.OutSet (400 , 0 );
185- font.SetHeightI (fontBaseSize);
186- seqStats.Process (rp_Stats);
166+ #endif
187167 font.OnRender ();
188168 }
189169 if (psDeviceFlags.test (rsCameraPos))
@@ -196,43 +176,24 @@ void CStats::Show()
196176 font.OnRender ();
197177 }
198178#ifdef DEBUG
199- // Show errors
200179 if (!g_bDisableRedText && errors.size ())
201180 {
202181 font.SetColor (color_rgba (255 , 16 , 16 , 191 ));
203182 font.OutSet (200 , 0 );
204183 font.SetHeightI (fontBaseSize);
205- #if 0
206- for (u32 it = 0; it < errors.size(); it++)
207- font.OutNext("%s", errors[it].c_str());
208- #else
209184 for (u32 it = (u32 )_max (int (0 ), (int )errors.size () - g_ErrorLineCount); it < errors.size (); it++)
210185 font.OutNext (" %s" , errors[it].c_str ());
211- #endif
212186 font.OnRender ();
213187 }
214188#endif
215189}
216190
217191void CStats::OnDeviceCreate ()
218192{
219- g_bDisableRedText = strstr (Core.Params , " -xclsx" ) ? TRUE : FALSE ;
220-
221- // if (!strstr(Core.Params, "-dedicated"))
193+ g_bDisableRedText = !!strstr (Core.Params , " -xclsx" );
222194#ifndef DEDICATED_SERVER
223195 statsFont = xr_new<CGameFont>(" stat_font" , CGameFont::fsDeviceIndependent);
224196#endif
225-
226- if (!pSettings->section_exist (" evaluation" )
227- || !pSettings->line_exist (" evaluation" , " line1" )
228- || !pSettings->line_exist (" evaluation" , " line2" )
229- || !pSettings->line_exist (" evaluation" , " line3" ))
230- FATAL (" " );
231-
232- eval_line_1 = pSettings->r_string_wb (" evaluation" , " line1" );
233- eval_line_2 = pSettings->r_string_wb (" evaluation" , " line2" );
234- eval_line_3 = pSettings->r_string_wb (" evaluation" , " line3" );
235- //
236197#ifdef DEBUG
237198 if (!g_bDisableRedText)
238199 {
0 commit comments