| 1025 | } |
| 1026 | |
| 1027 | void TerrainBlock::removeMaterial( U32 index ) |
| 1028 | { |
| 1029 | // Cannot delete if only one layer. |
| 1030 | if ( mFile->mMaterials.size() == 1 ) |
| 1031 | return; |
| 1032 | |
| 1033 | mFile->mMaterials.erase( index ); |
| 1034 | mFile->_initMaterialInstMapping(); |
| 1035 | |
| 1036 | for ( S32 i = 0; i < mFile->mLayerMap.size(); i++ ) |
| 1037 | { |
| 1038 | if ( mFile->mLayerMap[i] >= index && |
| 1039 | mFile->mLayerMap[i] != 0 ) |
| 1040 | { |
| 1041 | mFile->mLayerMap[i]--; |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | mDetailsDirty = true; |
| 1046 | mLayerTexDirty = true; |
| 1047 | } |
| 1048 | |
| 1049 | void TerrainBlock::updateMaterial( U32 index, const String &name ) |
| 1050 | { |
no test coverage detected