Graphics/SpriteChainRenderer: Fix single sprite data over multiple vertex buffers
This commit is contained in:
@@ -141,6 +141,8 @@ namespace Nz
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::size_t remainingQuads = spriteChain.GetSpriteCount();
|
std::size_t remainingQuads = spriteChain.GetSpriteCount();
|
||||||
|
const UInt8* spriteData = static_cast<const UInt8*>(spriteChain.GetSpriteData());
|
||||||
|
|
||||||
while (remainingQuads > 0)
|
while (remainingQuads > 0)
|
||||||
{
|
{
|
||||||
if (!currentAllocation)
|
if (!currentAllocation)
|
||||||
@@ -210,8 +212,9 @@ namespace Nz
|
|||||||
std::size_t copiedQuadCount = std::min(maxQuads, remainingQuads);
|
std::size_t copiedQuadCount = std::min(maxQuads, remainingQuads);
|
||||||
std::size_t copiedSize = 4 * copiedQuadCount * stride;
|
std::size_t copiedSize = 4 * copiedQuadCount * stride;
|
||||||
|
|
||||||
std::memcpy(currentAllocationMemPtr, spriteChain.GetSpriteData(), copiedSize);
|
std::memcpy(currentAllocationMemPtr, spriteData, copiedSize);
|
||||||
currentAllocationMemPtr += copiedSize;
|
currentAllocationMemPtr += copiedSize;
|
||||||
|
spriteData += copiedSize;
|
||||||
|
|
||||||
firstQuadIndex += copiedQuadCount;
|
firstQuadIndex += copiedQuadCount;
|
||||||
currentDrawCall->quadCount += copiedQuadCount;
|
currentDrawCall->quadCount += copiedQuadCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user