Use hardcoded values for m_max_frames

Some compiler fails to load default values of UserConfigParams
during static initialization
This commit is contained in:
Benau 2018-08-05 13:14:22 +08:00
parent e711f20edb
commit c58ac1b111
2 changed files with 4 additions and 6 deletions

View File

@ -680,10 +680,6 @@ namespace UserConfigParams
/** True if graphical profiler should be displayed */
PARAM_PREFIX bool m_profiler_enabled PARAM_DEFAULT( false );
/** How many seconds worth of data the circular profile buffer
* can store. */
PARAM_PREFIX float m_profiler_buffer_duration PARAM_DEFAULT(20.0f);
// ---- Networking
PARAM_PREFIX StringToUIntUserConfigParam m_stun_list
PARAM_DEFAULT(StringToUIntUserConfigParam("stun_list",

View File

@ -82,8 +82,10 @@ Profiler::Profiler()
m_time_between_sync = 0.0;
m_freeze_state = UNFROZEN;
m_max_frames = int( UserConfigParams::m_profiler_buffer_duration
* UserConfigParams::m_max_fps );
// When initializing profile class during static initialization
// UserConfigParams::m_max_fps may not be properly initialized with default
// value, so we use hard-coded default value
m_max_frames = 20 * 120;
m_current_frame = 0;
m_has_wrapped_around = false;