Graphics: Fix some warnings

This commit is contained in:
Jérôme Leclercq 2021-09-13 23:35:46 +02:00
parent 7f6b61df53
commit 74534236ef
2 changed files with 9 additions and 7 deletions

View File

@ -44,7 +44,7 @@ namespace Nz
UInt32 distanceInt;
std::memcpy(&distanceInt, &distanceNear, sizeof(UInt32));
UInt64 distance = ~distanceInt; //< Reverse distance to have back to front
UInt64 distance = static_cast<UInt64>(~distanceInt); //< Reverse distance to have back to front
// Transparent RQ index:
// - Layer (8bits)

View File

@ -33,13 +33,15 @@ namespace Nz
for (std::size_t i = 0; i < maxQuadCount; ++i)
{
*indexPtr++ = i * 4 + 0;
*indexPtr++ = i * 4 + 1;
*indexPtr++ = i * 4 + 2;
UInt16 index = static_cast<UInt16>(i);
*indexPtr++ = i * 4 + 2;
*indexPtr++ = i * 4 + 1;
*indexPtr++ = i * 4 + 3;
*indexPtr++ = index * 4 + 0;
*indexPtr++ = index * 4 + 1;
*indexPtr++ = index * 4 + 2;
*indexPtr++ = index * 4 + 2;
*indexPtr++ = index * 4 + 1;
*indexPtr++ = index * 4 + 3;
}
m_indexBuffer->Fill(indices.data(), 0, indexCount * sizeof(UInt16));