| 233 | } |
| 234 | |
| 235 | void TSShapeInstance::setMaterialList( TSMaterialList *matList ) |
| 236 | { |
| 237 | // get rid of old list |
| 238 | if ( mOwnMaterialList ) |
| 239 | delete mMaterialList; |
| 240 | |
| 241 | mMaterialList = matList; |
| 242 | mOwnMaterialList = false; |
| 243 | |
| 244 | // If the material list is already be mapped then |
| 245 | // don't bother doing the initializing a second time. |
| 246 | // Note: only check the last material instance as this will catch both |
| 247 | // uninitialised lists, as well as initialised lists that have had new |
| 248 | // materials appended |
| 249 | if ( mMaterialList && !mMaterialList->getMaterialInst( mMaterialList->size()-1 ) ) |
| 250 | { |
| 251 | mMaterialList->setTextureLookupPath( mShapeResource.getPath().getPath() ); |
| 252 | mMaterialList->mapMaterials(); |
| 253 | Material::sAllowTextureTargetAssignment = true; |
| 254 | initMaterialList(); |
| 255 | Material::sAllowTextureTargetAssignment = false; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | void TSShapeInstance::cloneMaterialList( const FeatureSet *features ) |
| 260 | { |
no test coverage detected