| 442 | // Load mesh data from binary asset content, and place it on the GPU |
| 443 | // |
| 444 | bool MeshAsset::LoadFromMemory(std::vector<uint8> const& data) |
| 445 | { |
| 446 | std::string const extension = core::FileUtil::ExtractExtension(GetName()); |
| 447 | MeshDataContainer* meshContainer = nullptr; |
| 448 | |
| 449 | meshContainer = LoadAssimp(data, extension); |
| 450 | if (meshContainer == nullptr) |
| 451 | { |
| 452 | LOG("MeshAsset::LoadFromMemory > Failed to load mesh asset!", core::LogLevel::Warning); |
| 453 | return false; |
| 454 | } |
| 455 | |
| 456 | if (meshContainer->m_Name.empty()) |
| 457 | { |
| 458 | meshContainer->m_Name = GetName(); |
| 459 | } |
| 460 | |
| 461 | m_Data = new MeshData(meshContainer); |
| 462 | |
| 463 | SafeDelete(meshContainer); |
| 464 | return true; |
| 465 | } |
| 466 | |
| 467 | //--------------------------------- |
| 468 | // MeshAsset::LoadAssimp |
nothing calls this directly
no test coverage detected