MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / colourizeEntity

Method colourizeEntity

source/render/RenderManager.cpp:1252–1269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1250}
1251
1252void 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
1271std::string RenderManager::colourizeMaterial(const std::string& materialName, const Seat* seat, bool markedForDigging, bool playerHasVision)
1272{

Callers

nothing calls this directly

Calls 1

setMaterialNameMethod · 0.80

Tested by

no test coverage detected