| 284 | } |
| 285 | |
| 286 | MeshMaterial* MeshMaterial::createWithFilename(std::string_view path) |
| 287 | { |
| 288 | auto validfilename = FileUtils::getInstance()->fullPathForFilename(path); |
| 289 | if (!validfilename.empty()) |
| 290 | { |
| 291 | auto it = _materials.find(validfilename); |
| 292 | if (it != _materials.end()) |
| 293 | return (MeshMaterial*)it->second->clone(); |
| 294 | |
| 295 | auto material = new MeshMaterial(); |
| 296 | if (material->initWithFile(path)) |
| 297 | { |
| 298 | material->_type = MeshMaterial::MaterialType::CUSTOM; |
| 299 | _materials[validfilename] = material; |
| 300 | |
| 301 | return (MeshMaterial*)material->clone(); |
| 302 | } |
| 303 | AX_SAFE_DELETE(material); |
| 304 | } |
| 305 | return nullptr; |
| 306 | } |
| 307 | |
| 308 | MeshMaterial* MeshMaterial::createWithProgramState(backend::ProgramState* programState) |
| 309 | { |
nothing calls this directly
no test coverage detected