| 1250 | } |
| 1251 | |
| 1252 | void RenderManager::colourizeEntity(Ogre::Entity *ent, const Seat* seat, bool markedForDigging, bool playerHasVision) |
| 1253 | { |
| 1254 | // Colorize the the textures |
| 1255 | // Loop over the sub entities in the mesh |
| 1256 | for (unsigned int i = 0; i < ent->getNumSubEntities(); ++i) |
| 1257 | { |
| 1258 | Ogre::SubEntity *tempSubEntity = ent->getSubEntity(i); |
| 1259 | |
| 1260 | std::string materialName = tempSubEntity->getMaterialName(); |
| 1261 | // If the material name have been modified, we restore the original name |
| 1262 | std::size_t index = materialName.find("##"); |
| 1263 | if(index != std::string::npos) |
| 1264 | materialName = materialName.substr(0, index); |
| 1265 | |
| 1266 | materialName = colourizeMaterial(materialName, seat, markedForDigging, playerHasVision); |
| 1267 | tempSubEntity->setMaterialName(materialName); |
| 1268 | } |
| 1269 | } |
| 1270 | |
| 1271 | std::string RenderManager::colourizeMaterial(const std::string& materialName, const Seat* seat, bool markedForDigging, bool playerHasVision) |
| 1272 | { |
nothing calls this directly
no test coverage detected