Fix uninitialised member value

This commit is contained in:
Benau 2016-03-30 10:58:21 +08:00
parent 932365cee3
commit a3265d5c15
3 changed files with 15 additions and 14 deletions

View File

@ -131,7 +131,8 @@ IrrDriver::IrrDriver()
m_lightviz = m_shadowviz = m_distortviz = m_rsm = m_rh = m_gi = false;
m_boundingboxesviz = false;
m_last_light_bucket_distance = 0;
memset(object_count, 0, sizeof(object_count));
memset(m_object_count, 0, sizeof(m_object_count));
memset(m_poly_count, 0, sizeof(m_poly_count));
} // IrrDriver
// ----------------------------------------------------------------------------
@ -188,12 +189,12 @@ STKRenderingPass IrrDriver::getPhase() const
void IrrDriver::IncreaseObjectCount()
{
object_count[m_phase]++;
m_object_count[m_phase]++;
}
void IrrDriver::IncreasePolyCount(unsigned Polys)
{
poly_count[m_phase] += Polys;
m_poly_count[m_phase] += Polys;
}
core::array<video::IRenderTarget> &IrrDriver::getMainSetup()
@ -1889,13 +1890,13 @@ void IrrDriver::displayFPS()
{
fpsString = _("FPS: %d/%d/%d - PolyCount: %d Solid, "
"%d Shadows - LightDist : %d",
min, fps, max, poly_count[SOLID_NORMAL_AND_DEPTH_PASS],
poly_count[SHADOW_PASS], m_last_light_bucket_distance);
poly_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
poly_count[SHADOW_PASS] = 0;
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
object_count[TRANSPARENT_PASS] = 0;
min, fps, max, m_poly_count[SOLID_NORMAL_AND_DEPTH_PASS],
m_poly_count[SHADOW_PASS], m_last_light_bucket_distance);
m_poly_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
m_poly_count[SHADOW_PASS] = 0;
m_object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
m_object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
m_object_count[TRANSPARENT_PASS] = 0;
}
else
fpsString = _("FPS: %d/%d/%d - %d KTris", min, fps, max, (int)roundf(kilotris));

View File

@ -286,8 +286,8 @@ private:
bool m_boundingboxesviz;
/** Performance stats */
unsigned m_last_light_bucket_distance;
unsigned object_count[PASS_COUNT];
unsigned poly_count[PASS_COUNT];
unsigned m_object_count[PASS_COUNT];
unsigned m_poly_count[PASS_COUNT];
u32 m_renderpass;
class STKMeshSceneNode *m_sun_interposer;
core::vector3df m_sun_direction;

View File

@ -855,8 +855,8 @@ PROFILER_POP_CPU_MARKER();
}
}
PROFILER_POP_CPU_MARKER();
poly_count[SOLID_NORMAL_AND_DEPTH_PASS] += SolidPoly;
poly_count[SHADOW_PASS] += ShadowPoly;
m_poly_count[SOLID_NORMAL_AND_DEPTH_PASS] += SolidPoly;
m_poly_count[SHADOW_PASS] += ShadowPoly;
if (CVS->supportsAsyncInstanceUpload())
glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);