From 8a04c48cecebbae5aef897d371a5bdfdada9d4ac Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 27 Jan 2014 01:14:20 +0100 Subject: [PATCH] Reset skybox texture when loading track. --- src/graphics/irr_driver.cpp | 5 +++++ src/graphics/irr_driver.hpp | 1 + src/tracks/track.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 7afc81c41..6e97fb69e 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1171,6 +1171,11 @@ scene::ISceneNode *IrrDriver::addSkyBox(const std::vector texture[4], texture[5]); } // addSkyBox +void IrrDriver::suppressSkyBox() +{ + SkyboxTextures.clear(); +} + // ---------------------------------------------------------------------------- /** Adds a camera to the scene. */ diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 23e56cf99..77fbff2e2 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -272,6 +272,7 @@ public: int vert_res, float texture_percent, float sphere_percent); scene::ISceneNode *addSkyBox(const std::vector &texture_names); + void suppressSkyBox(); void removeNode(scene::ISceneNode *node); void removeMeshFromCache(scene::IMesh *mesh); void removeTexture(video::ITexture *t); diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index b3c454c36..a9f4df00c 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -1585,6 +1585,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id) // Sky dome and boxes support // -------------------------- + irr_driver->suppressSkyBox(); if(m_sky_type==SKY_DOME && m_sky_textures.size() > 0) { scene::ISceneNode *node = irr_driver->addSkyDome(m_sky_textures[0],