diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index 84c8b3598..645f6793e 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -47,6 +47,7 @@ #include "utils/log.hpp" #include "utils/profiler.hpp" #include "stkscenemanager.hpp" +#include "items/powerup_manager.hpp" #include "../../lib/irrlicht/source/Irrlicht/CSceneManager.h" #include "../../lib/irrlicht/source/Irrlicht/os.h" @@ -62,6 +63,27 @@ void IrrDriver::renderGLSL(float dt) Track *track = world->getTrack(); + for (unsigned i = 0; i < PowerupManager::POWERUP_MAX; i++) + { + scene::IMesh *mesh = powerup_manager->m_all_meshes[i]; + if (!mesh) + continue; + for (unsigned j = 0; j < mesh->getMeshBufferCount(); j++) + { + scene::IMeshBuffer *mb = mesh->getMeshBuffer(j); + if (!mb) + continue; + for (unsigned k = 0; k < 4; k++) + { + video::ITexture *tex = mb->getMaterial().getTexture(k); + if (!tex) + continue; + compressTexture(tex, true); + } + } + } + + // Overrides video::SOverrideMaterial &overridemat = m_video_driver->getOverrideMaterial(); overridemat.EnablePasses = scene::ESNRP_SOLID | scene::ESNRP_TRANSPARENT; diff --git a/src/items/powerup_manager.hpp b/src/items/powerup_manager.hpp index ec6ce3c7c..4bb3d69d5 100644 --- a/src/items/powerup_manager.hpp +++ b/src/items/powerup_manager.hpp @@ -115,9 +115,11 @@ private: /** Last time the bouncing ball was collected */ float m_rubber_ball_collect_time; +public: /** The mesh for each model (if the powerup has a model), e.g. a switch has none. */ irr::scene::IMesh *m_all_meshes[POWERUP_MAX]; +private: /** Size of the corresponding mesh. */ btVector3 m_all_extends[POWERUP_MAX];