Fix crashes and add a hunk I forgot

This commit is contained in:
Vincent Lejeune 2014-06-05 01:34:12 +02:00
parent 5f1413e140
commit 219bfbca93
2 changed files with 2 additions and 2 deletions

View File

@ -1023,7 +1023,7 @@ void IrrDriver::renderLights(unsigned pointlightcount)
irr_driver->getSceneManager()->setAmbientLight(SColor(0, 0, 0, 0));
// Render sunlight if and only if track supports shadow
if (World::getWorld()->getTrack()->hasShadows())
if (World::getWorld() && World::getWorld()->getTrack()->hasShadows())
{
if (UserConfigParams::m_shadows)
m_post_processing->renderShadowedSunlight(sun_ortho_matrix, m_rtts->getShadowDepthTex());

View File

@ -179,7 +179,7 @@ void ModelViewWidget::update(float delta)
std::vector<IrrDriver::GlowData> glows;
irr_driver->computeCameraMatrix(m_camera, 512, 512);
irr_driver->renderScene(m_camera, glows, GUIEngine::getLatestDt(), false, true);
irr_driver->renderScene(m_camera, 0, glows, GUIEngine::getLatestDt(), false, true);
m_frame_buffer = irr_driver->getPostProcessing()->render(m_camera);
glViewport(0, 0, UserConfigParams::m_width, UserConfigParams::m_height);