MCPcopy Create free account
hub / github.com/Illation/ETEngine / LoadFromMemory

Method LoadFromMemory

Engine/source/EtRendering/GraphicsTypes/Mesh.cpp:444–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442// Load mesh data from binary asset content, and place it on the GPU
443//
444bool 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

Callers

nothing calls this directly

Calls 1

SafeDeleteFunction · 0.85

Tested by

no test coverage detected