Skip to content

Commit e70fb25

Browse files
committed
Code cleanup
Signed-off-by: Matias N. Goldberg <[email protected]>
1 parent 44d2f8a commit e70fb25

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ogre2/src/Ogre2GpuRays.cc

+3-5
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ void Ogre2GpuRays::Destroy()
602602

603603
auto engine = Ogre2RenderEngine::Instance();
604604
auto ogreRoot = engine->OgreRoot();
605+
auto textureGpuManager = ogreRoot->getRenderSystem()->getTextureGpuManager();
605606

606607
Ogre::CompositorManager2 *ogreCompMgr = ogreRoot->getCompositorManager2();
607608

@@ -616,17 +617,15 @@ void Ogre2GpuRays::Destroy()
616617
}
617618
if (this->dataPtr->firstPassTextures[i])
618619
{
619-
ogreRoot->getRenderSystem()->getTextureGpuManager()->destroyTexture(
620-
this->dataPtr->firstPassTextures[i]);
620+
textureGpuManager->destroyTexture(this->dataPtr->firstPassTextures[i]);
621621
this->dataPtr->firstPassTextures[i] = nullptr;
622622
}
623623
}
624624

625625
// remove 2nd pass texture, material, compositor
626626
if (this->dataPtr->secondPassTexture)
627627
{
628-
ogreRoot->getRenderSystem()->getTextureGpuManager()->destroyTexture(
629-
this->dataPtr->secondPassTexture);
628+
textureGpuManager->destroyTexture(this->dataPtr->secondPassTexture);
630629
this->dataPtr->secondPassTexture = nullptr;
631630
}
632631

@@ -636,7 +635,6 @@ void Ogre2GpuRays::Destroy()
636635
this->dataPtr->ogreCompositorWorkspace2nd = nullptr;
637636
}
638637

639-
auto textureGpuManager = ogreRoot->getRenderSystem()->getTextureGpuManager();
640638
if (this->dataPtr->cubeUVTexture)
641639
{
642640
textureGpuManager->destroyTexture(this->dataPtr->cubeUVTexture);

0 commit comments

Comments
 (0)