From 0b05a60b201a29ccfca0bd982373b2e861c0fbf0 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sun, 11 Dec 2022 18:20:26 -0300 Subject: [PATCH] Code cleanup Signed-off-by: Matias N. Goldberg --- ogre2/src/Ogre2GpuRays.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ogre2/src/Ogre2GpuRays.cc b/ogre2/src/Ogre2GpuRays.cc index b1bb11fd2..24f796f13 100644 --- a/ogre2/src/Ogre2GpuRays.cc +++ b/ogre2/src/Ogre2GpuRays.cc @@ -602,6 +602,7 @@ void Ogre2GpuRays::Destroy() auto engine = Ogre2RenderEngine::Instance(); auto ogreRoot = engine->OgreRoot(); + auto textureGpuManager = ogreRoot->getRenderSystem()->getTextureGpuManager(); Ogre::CompositorManager2 *ogreCompMgr = ogreRoot->getCompositorManager2(); @@ -616,8 +617,7 @@ void Ogre2GpuRays::Destroy() } if (this->dataPtr->firstPassTextures[i]) { - ogreRoot->getRenderSystem()->getTextureGpuManager()->destroyTexture( - this->dataPtr->firstPassTextures[i]); + textureGpuManager->destroyTexture(this->dataPtr->firstPassTextures[i]); this->dataPtr->firstPassTextures[i] = nullptr; } } @@ -625,8 +625,7 @@ void Ogre2GpuRays::Destroy() // remove 2nd pass texture, material, compositor if (this->dataPtr->secondPassTexture) { - ogreRoot->getRenderSystem()->getTextureGpuManager()->destroyTexture( - this->dataPtr->secondPassTexture); + textureGpuManager->destroyTexture(this->dataPtr->secondPassTexture); this->dataPtr->secondPassTexture = nullptr; } @@ -636,7 +635,6 @@ void Ogre2GpuRays::Destroy() this->dataPtr->ogreCompositorWorkspace2nd = nullptr; } - auto textureGpuManager = ogreRoot->getRenderSystem()->getTextureGpuManager(); if (this->dataPtr->cubeUVTexture) { textureGpuManager->destroyTexture(this->dataPtr->cubeUVTexture);