Graphics: try to fix some coverity reported issues.

This commit is contained in:
Vincent Lejeune 2014-02-02 21:05:57 +01:00
parent 9595884354
commit deb6883a67
6 changed files with 28 additions and 8 deletions

View File

@ -78,6 +78,23 @@ ParticleSystemProxy::ParticleSystemProxy(bool createDefaultEmitter,
glGenVertexArrays(1, &current_rendering_vao); glGenVertexArrays(1, &current_rendering_vao);
glGenVertexArrays(1, &non_current_rendering_vao); glGenVertexArrays(1, &non_current_rendering_vao);
size_increase_factor = 0.; size_increase_factor = 0.;
// We set these later but avoid coverity report them
heighmapbuffer = 0;
heightmaptexture = 0;
current_simulation_vao = 0;
non_currenthm__simulation_vao = 0;
current_hm_simulation_vao = 0;
current_rendering_flip_vao = 0;
non_current_rendering_flip_vao = 0;
has_height_map = false;
flip = false;
track_x = 0;
track_z = 0;
track_x_len = 0;
track_z_len = 0;
texture = 0;
if (quad_vertex_buffer) if (quad_vertex_buffer)
return; return;
static const GLfloat quad_vertex[] = { static const GLfloat quad_vertex[] = {

View File

@ -1520,7 +1520,9 @@ void IrrDriver::displayFPS()
{ {
sprintf(buffer, "FPS: %i/%i/%i - Objects (P1:%d P2:%d T:%d) KTris - LightDst : ~%d", sprintf(buffer, "FPS: %i/%i/%i - Objects (P1:%d P2:%d T:%d) KTris - 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); 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] = object_count[SOLID_NORMAL_AND_DEPTH_PASS] = object_count[TRANSPARENT_PASS] = 0; object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
object_count[TRANSPARENT_PASS] = 0;
} }
else else
{ {

View File

@ -66,8 +66,6 @@ public:
protected: protected:
static core::aabbox3df box; static core::aabbox3df box;
class ScreenQuad *sq;
//float m_radius; //float m_radius;
float m_color[3]; float m_color[3];
float m_energy; float m_energy;

View File

@ -57,7 +57,11 @@ PostProcessing::PostProcessing(IVideoDriver* video_driver)
io::IReadFile *areamap = irr_driver->getDevice()->getFileSystem()-> io::IReadFile *areamap = irr_driver->getDevice()->getFileSystem()->
createMemoryReadFile((void *) AreaMap33, sizeof(AreaMap33), createMemoryReadFile((void *) AreaMap33, sizeof(AreaMap33),
"AreaMap33", false); "AreaMap33", false);
if (!areamap) Log::fatal("postprocessing", "Failed to load the areamap"); if (!areamap)
{
Log::fatal("postprocessing", "Failed to load the areamap");
return;
}
m_areamap = irr_driver->getVideoDriver()->getTexture(areamap); m_areamap = irr_driver->getVideoDriver()->getTexture(areamap);
areamap->drop(); areamap->drop();

View File

@ -42,7 +42,7 @@ using namespace core;
// The rain manager // The rain manager
Rain::Rain(Camera *camera, irr::scene::ISceneNode* parent) Rain::Rain(Camera *camera, irr::scene::ISceneNode* parent) : m_thunder_sound(0)
{ {
m_lightning = camera->getIndex()==0; m_lightning = camera->getIndex()==0;

View File

@ -106,9 +106,8 @@ void STKAnimatedMesh::render()
} }
else else
{ {
#ifdef _DEBUG Log::error("animated mesh", "Animated Mesh returned no mesh to render.");
os::Printer::log("Animated Mesh returned no mesh to render.", Mesh->getDebugName(), ELL_WARNING); return;
#endif
} }
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);