Refactor raw data ReadSttream and WriteStream to have easier to use API with more features

This commit is contained in:
Wojciech Figat
2022-10-12 11:22:20 +02:00
parent 09e50bb0e1
commit ff34c7cc9b
18 changed files with 448 additions and 277 deletions

View File

@@ -289,7 +289,7 @@ bool SkinnedMesh::DownloadDataCPU(MeshBufferType type, BytesContainer& result, i
stream.ReadUint32(&maxVertexIndex);
uint32 blendShapeVertices;
stream.ReadUint32(&blendShapeVertices);
auto blendShapeVerticesData = stream.Read<byte>(blendShapeVertices * sizeof(BlendShapeVertex));
auto blendShapeVerticesData = stream.Move<byte>(blendShapeVertices * sizeof(BlendShapeVertex));
}
uint32 indicesCount = triangles * 3;
bool use16BitIndexBuffer = indicesCount <= MAX_uint16;
@@ -299,8 +299,8 @@ bool SkinnedMesh::DownloadDataCPU(MeshBufferType type, BytesContainer& result, i
LOG(Error, "Invalid mesh data.");
return true;
}
auto vb0 = stream.Read<VB0SkinnedElementType>(vertices);
auto ib = stream.Read<byte>(indicesCount * ibStride);
auto vb0 = stream.Move<VB0SkinnedElementType>(vertices);
auto ib = stream.Move<byte>(indicesCount * ibStride);
if (i != _index)
continue;