Removing the default case from the renderer

This commit is contained in:
Sam Gateau 2017-06-27 14:24:34 +02:00
parent 7687bdc060
commit 76dae279cf

View file

@ -54,13 +54,11 @@ BackgroundStage::BackgroundPointer BackgroundStage::removeBackground(Index index
void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) { void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext, const Inputs& inputs) {
const auto& lightingModel = inputs; const auto& lightingModel = inputs;
if (!lightingModel->isBackgroundEnabled()) { if (!lightingModel->isBackgroundEnabled()) {
return; return;
} }
// Background rendering decision // Background rendering decision
auto backgroundStage = renderContext->_scene->getStage<BackgroundStage>(); auto backgroundStage = renderContext->_scene->getStage<BackgroundStage>();
model::SunSkyStagePointer background; model::SunSkyStagePointer background;
@ -71,10 +69,7 @@ void DrawBackgroundStage::run(const render::RenderContextPointer& renderContext,
if (background) { if (background) {
skybox = background->getSkybox(); skybox = background->getSkybox();
} }
} else {
skybox = backgroundStage->getBackground(0)->getSkybox();
} }
/* auto backgroundMode = skyStage->getBackgroundMode(); /* auto backgroundMode = skyStage->getBackgroundMode();
switch (backgroundMode) { switch (backgroundMode) {