Skip to content

Commit 849aa39

Browse files
DXSDKMeshLoader: use FileWrapper::ReadWholeFile for data blob
1 parent dea4627 commit 849aa39

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

AssetLoader/src/DXSDKMeshLoader.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,11 @@ namespace Diligent
4343
//--------------------------------------------------------------------------------------
4444
bool DXSDKMesh::CreateFromFile(const char* szFileName)
4545
{
46-
FileWrapper File;
47-
File.Open(FileOpenAttribs{szFileName});
48-
if (!File)
49-
{
50-
LOG_ERROR("Failed to open SDK Mesh file ", szFileName);
46+
RefCntAutoPtr<IDataBlob> pFileData;
47+
if (!FileWrapper::ReadWholeFile(szFileName, &pFileData))
5148
return false;
52-
}
53-
54-
auto pFileData = DataBlobImpl::Create();
55-
File->Read(pFileData);
56-
57-
File.Close();
58-
59-
auto res = CreateFromMemory(pFileData->GetConstDataPtr<Uint8>(), static_cast<Uint32>(pFileData->GetSize()));
6049

61-
return res;
50+
return CreateFromMemory(pFileData->GetConstDataPtr<Uint8>(), static_cast<Uint32>(pFileData->GetSize()));
6251
}
6352

6453
void DXSDKMesh::ComputeBoundingBoxes()

0 commit comments

Comments
 (0)