Changeset View
Standalone View
source/renderer/Renderer.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | CStr CRendererStatsTable::GetCellText(size_t row, size_t col) | ||||
char buf[256]; | char buf[256]; | ||||
switch(row) | switch(row) | ||||
{ | { | ||||
case Row_DrawCalls: | case Row_DrawCalls: | ||||
if (col == 0) | if (col == 0) | ||||
return "# draw calls"; | return "# draw calls"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_DrawCalls); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_DrawCalls); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_TerrainTris: | case Row_TerrainTris: | ||||
if (col == 0) | if (col == 0) | ||||
return "# terrain tris"; | return "# terrain tris"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_TerrainTris); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_TerrainTris); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_WaterTris: | case Row_WaterTris: | ||||
if (col == 0) | if (col == 0) | ||||
return "# water tris"; | return "# water tris"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_WaterTris); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_WaterTris); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_ModelTris: | case Row_ModelTris: | ||||
if (col == 0) | if (col == 0) | ||||
return "# model tris"; | return "# model tris"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_ModelTris); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_ModelTris); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_OverlayTris: | case Row_OverlayTris: | ||||
if (col == 0) | if (col == 0) | ||||
return "# overlay tris"; | return "# overlay tris"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_OverlayTris); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_OverlayTris); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_BlendSplats: | case Row_BlendSplats: | ||||
if (col == 0) | if (col == 0) | ||||
return "# blend splats"; | return "# blend splats"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_BlendSplats); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_BlendSplats); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_Particles: | case Row_Particles: | ||||
if (col == 0) | if (col == 0) | ||||
return "# particles"; | return "# particles"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_Particles); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)Stats.m_Particles); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_VBReserved: | case Row_VBReserved: | ||||
if (col == 0) | if (col == 0) | ||||
return "VB reserved"; | return "VB reserved"; | ||||
sprintf_s(buf, sizeof(buf), "%lu kB", (unsigned long)g_VBMan.GetBytesReserved() / 1024); | sprintf_s(buf, sizeof(buf), "%lu kB", (unsigned long)g_VBMan.GetBytesReserved() / 1024); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_VBAllocated: | case Row_VBAllocated: | ||||
if (col == 0) | if (col == 0) | ||||
return "VB allocated"; | return "VB allocated"; | ||||
sprintf_s(buf, sizeof(buf), "%lu kB", (unsigned long)g_VBMan.GetBytesAllocated() / 1024); | sprintf_s(buf, sizeof(buf), "%lu kB", (unsigned long)g_VBMan.GetBytesAllocated() / 1024); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_TextureMemory: | case Row_TextureMemory: | ||||
if (col == 0) | if (col == 0) | ||||
return "textures uploaded"; | return "textures uploaded"; | ||||
sprintf_s(buf, sizeof(buf), "%lu kB", (unsigned long)g_Renderer.GetTextureManager().GetBytesUploaded() / 1024); | sprintf_s(buf, sizeof(buf), "%lu kB", (unsigned long)g_Renderer.GetTextureManager().GetBytesUploaded() / 1024); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
case Row_ShadersLoaded: | case Row_ShadersLoaded: | ||||
if (col == 0) | if (col == 0) | ||||
return "shader effects loaded"; | return "shader effects loaded"; | ||||
sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)g_Renderer.GetShaderManager().GetNumEffectsLoaded()); | sprintf_s(buf, sizeof(buf), "%lu", (unsigned long)g_Renderer.GetShaderManager().GetNumEffectsLoaded()); | ||||
return buf; | return buf; | ||||
Lint: CPPCheckBear (returnDanglingLifetime) Returning pointer to local variable 'buf' that will be invalid when returning. Lint: CPPCheckBear (returnDanglingLifetime): `Returning pointer to local variable 'buf' that will be invalid when returning.` | |||||
default: | default: | ||||
return "???"; | return "???"; | ||||
} | } | ||||
} | } | ||||
AbstractProfileTable* CRendererStatsTable::GetChild(size_t UNUSED(row)) | AbstractProfileTable* CRendererStatsTable::GetChild(size_t UNUSED(row)) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 367 Lines • ▼ Show 20 Lines | bool CRenderer::Open(int width, int height) | ||||
GLint bits; | GLint bits; | ||||
glGetIntegerv(GL_DEPTH_BITS,&bits); | glGetIntegerv(GL_DEPTH_BITS,&bits); | ||||
LOGMESSAGE("CRenderer::Open: depth bits %d",bits); | LOGMESSAGE("CRenderer::Open: depth bits %d",bits); | ||||
glGetIntegerv(GL_STENCIL_BITS,&bits); | glGetIntegerv(GL_STENCIL_BITS,&bits); | ||||
LOGMESSAGE("CRenderer::Open: stencil bits %d",bits); | LOGMESSAGE("CRenderer::Open: stencil bits %d",bits); | ||||
glGetIntegerv(GL_ALPHA_BITS,&bits); | glGetIntegerv(GL_ALPHA_BITS,&bits); | ||||
LOGMESSAGE("CRenderer::Open: alpha bits %d",bits); | LOGMESSAGE("CRenderer::Open: alpha bits %d",bits); | ||||
g_RenderingOptions.ReadConfig(); | |||||
// Validate the currently selected render path | // Validate the currently selected render path | ||||
SetRenderPath(g_RenderingOptions.GetRenderPath()); | SetRenderPath(g_RenderingOptions.GetRenderPath()); | ||||
RecomputeSystemShaderDefines(); | RecomputeSystemShaderDefines(); | ||||
// Let component renderers perform one-time initialization after graphics capabilities and | // Let component renderers perform one-time initialization after graphics capabilities and | ||||
// the shader path have been determined. | // the shader path have been determined. | ||||
m->overlayRenderer.Initialize(); | m->overlayRenderer.Initialize(); | ||||
▲ Show 20 Lines • Show All 1,352 Lines • Show Last 20 Lines |
Returning pointer to local variable 'buf' that will be invalid when returning.