void MovableTextOverlayAttributes::setMaterialName(const Ogre::String & materialName) { if (mMaterialName != materialName) { if (mMaterialName.length()) Ogre::MaterialManager::getSingletonPtr()->getByName(mMaterialName).getPointer()->unload(); mMaterialName = materialName; if (mMaterialName.length()) { Ogre::Material *mpMaterial = dynamic_cast<Ogre::Material*>(Ogre::MaterialManager::getSingletonPtr()->getByName(mMaterialName).getPointer()); if (!mpMaterial) Ogre::Exception(Ogre::Exception::ERR_ITEM_NOT_FOUND, "Could not find font " + materialName, "MovableTextOverlay::setMaterialName"); mpMaterial->load(); } } }