Graphics/TileMap: Fix material index rendering
This commit is contained in:
parent
4bf92457c5
commit
cdf9611080
|
|
@ -166,6 +166,7 @@ Nazara Engine:
|
|||
- Fixed SystemCursor_Move not showing up on Windows
|
||||
- Fixed Window movement constructor/assignation operator
|
||||
- Window::PushEvent is now public (useful for pushing external events ie. when using Qt or similar framework controlling window)
|
||||
- Fixed TileMap not rendering the right materials if it had no tile using some materials in-between
|
||||
|
||||
Nazara Development Kit:
|
||||
- Added ImageWidget (#139)
|
||||
|
|
|
|||
|
|
@ -27,14 +27,14 @@ namespace Nz
|
|||
{
|
||||
const VertexStruct_XYZ_Color_UV* vertices = reinterpret_cast<const VertexStruct_XYZ_Color_UV*>(instanceData.data.data());
|
||||
|
||||
std::size_t matCount = 0;
|
||||
std::size_t spriteCount = 0;
|
||||
for (const Layer& layer : m_layers)
|
||||
for (std::size_t layerIndex = 0; layerIndex < m_layers.size(); ++layerIndex)
|
||||
{
|
||||
const auto& layer = m_layers[layerIndex];
|
||||
if (layer.tiles.empty())
|
||||
continue;
|
||||
|
||||
renderQueue->AddSprites(instanceData.renderOrder, GetMaterial(matCount++), &vertices[4 * spriteCount], layer.tiles.size(), scissorRect);
|
||||
renderQueue->AddSprites(instanceData.renderOrder, GetMaterial(layerIndex), &vertices[4 * spriteCount], layer.tiles.size(), scissorRect);
|
||||
|
||||
spriteCount += layer.tiles.size();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue