Fix move on unitialised values in displayFPS

This commit is contained in:
Daniel Butum 2014-07-03 17:22:00 +03:00
parent 926f5fc641
commit efac42f746
3 changed files with 16 additions and 9 deletions

View File

@ -110,8 +110,8 @@ IrrDriver::IrrDriver()
m_post_processing = NULL;
m_wind = new Wind();
m_mipviz = m_wireframe = m_normals = m_ssaoviz = \
m_lightviz = m_shadowviz = m_distortviz = m_rsm = m_rh = m_gi = 0;
SkyboxCubeMap = 0;
m_lightviz = m_shadowviz = m_distortviz = m_rsm = m_rh = m_gi = false;
SkyboxCubeMap = m_last_light_bucket_distance = 0;
} // IrrDriver
// ----------------------------------------------------------------------------
@ -1657,8 +1657,14 @@ void IrrDriver::displayFPS()
if (UserConfigParams::m_artist_debug_mode)
{
sprintf(buffer, "FPS: %i/%i/%i - Objects (P1:%d P2:%d T:%d) - LightDst : ~%d",
min, fps, max, object_count[SOLID_NORMAL_AND_DEPTH_PASS], object_count[SOLID_NORMAL_AND_DEPTH_PASS], object_count[TRANSPARENT_PASS], m_last_light_bucket_distance);
sprintf(
buffer, "FPS: %i/%i/%i - Objects (P1:%d P2:%d T:%d) - LightDst : ~%d",
min, fps, max,
object_count[SOLID_NORMAL_AND_DEPTH_PASS],
object_count[SOLID_NORMAL_AND_DEPTH_PASS],
object_count[TRANSPARENT_PASS],
m_last_light_bucket_distance
);
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
object_count[TRANSPARENT_PASS] = 0;

View File

@ -338,7 +338,7 @@ private:
bool m_distortviz;
/** Performance stats */
unsigned m_last_light_bucket_distance;
unsigned object_count[PASS_COUNT];
unsigned object_count[PASS_COUNT] = {};
u32 m_renderpass;
u32 m_lensflare_query;
bool m_query_issued;

View File

@ -74,15 +74,16 @@ bool DeviceManager::initialize()
}
const int keyboard_amount = m_keyboard_configs.size();
for (int n=0; n<keyboard_amount; n++)
for (int n = 0; n < keyboard_amount; n++)
{
m_keyboards.push_back(new KeyboardDevice(m_keyboard_configs.get(n)));
}
if(UserConfigParams::logMisc())
Log::info("Device manager","Initializing gamepad support.");
Log::info("Device manager","Initializing gamepad support.");
irr_driver->getDevice()->activateJoysticks(m_irrlicht_gamepads);
int num_gamepads = m_irrlicht_gamepads.size();
if(UserConfigParams::logMisc())
{
@ -90,8 +91,6 @@ bool DeviceManager::initialize()
num_gamepads);
}
// Create GamePadDevice for each physical gamepad and find a GamepadConfig to match
for (int id = 0; id < num_gamepads; id++)
{
@ -112,6 +111,7 @@ bool DeviceManager::initialize()
{
Log::info("Device manager","#%d: %s detected...", id, name.c_str());
}
// Returns true if new configuration was created
if (getConfigForGamepad(id, name, &gamepadConfig) == true)
{
@ -135,6 +135,7 @@ bool DeviceManager::initialize()
} // end for
if (created) serialize();
return created;
} // initialize