From 9bd62dfe1308aacfa8a1bc257da81975d381e66e Mon Sep 17 00:00:00 2001 From: funto66 Date: Mon, 25 Jul 2011 22:21:17 +0000 Subject: [PATCH] Fixed sky color for tracks without sky domes/boxes when post-processing is enabled git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9356 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/irr_driver.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index b59e8a626..d024ff3e3 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1199,8 +1199,13 @@ void IrrDriver::update(float dt) bool back_buffer_clear = inRace && (world->getPhysics()->isDebug() || world->clearBackBuffer() ); - if (world != NULL) + if (inRace) { + // Start the RTT for post-processing. + // We do this before beginScene() because we want to capture the glClear() + // because of tracks that do not have skyboxes (generally add-on tracks) + m_post_processing.beginCapture(); + m_video_driver->beginScene(back_buffer_clear, true, world->getClearColor()); } @@ -1230,9 +1235,6 @@ void IrrDriver::update(float dt) if (inRace) { - // Start the RTT for post-processing - m_post_processing.beginCapture(); - irr_driver->getVideoDriver()->enableMaterial2D(); RaceGUIBase *rg = world->getRaceGUI();