Minor improvements

This commit is contained in:
Lynix
2024-01-29 18:34:46 +01:00
parent 0191256493
commit 2b88f50c21
19 changed files with 34 additions and 41 deletions

View File

@@ -43,7 +43,7 @@ namespace Nz
inline auto LinearSlicedSprite::GetSection(std::size_t sectionIndex) const -> const Section&
{
NazaraAssert(sectionIndex < m_sectionCount, "out of range section");
NazaraAssertFmt(sectionIndex < m_sectionCount, "section index ouf of range ({0} >= {1})", sectionIndex, m_sectionCount);
return m_sections[sectionIndex];
}
@@ -71,7 +71,7 @@ namespace Nz
inline void LinearSlicedSprite::RemoveSection(std::size_t sectionIndex)
{
NazaraAssert(sectionIndex < m_sectionCount, "out of range section");
NazaraAssertFmt(sectionIndex < m_sectionCount, "section index ouf of range ({0} >= {1})", sectionIndex, m_sectionCount);
if (m_sectionCount >= sectionIndex + 1)
std::move(m_sections.begin() + sectionIndex + 1, m_sections.begin() + m_sectionCount, m_sections.begin() + sectionIndex);
@@ -102,7 +102,7 @@ namespace Nz
inline void LinearSlicedSprite::SetSection(std::size_t sectionIndex, float size, float textureCoord)
{
NazaraAssert(sectionIndex < m_sectionCount, "out of range section");
NazaraAssertFmt(sectionIndex < m_sectionCount, "section index ouf of range ({0} >= {1})", sectionIndex, m_sectionCount);
auto& section = m_sections[sectionIndex];
section.size = size;
@@ -113,7 +113,7 @@ namespace Nz
inline void LinearSlicedSprite::SetSectionSize(std::size_t sectionIndex, float size)
{
NazaraAssert(sectionIndex < m_sectionCount, "out of range section");
NazaraAssertFmt(sectionIndex < m_sectionCount, "section index ouf of range ({0} >= {1})", sectionIndex, m_sectionCount);
auto& section = m_sections[sectionIndex];
section.size = size;
@@ -123,7 +123,7 @@ namespace Nz
inline void LinearSlicedSprite::SetSectionTextureCoord(std::size_t sectionIndex, float textureCoord)
{
NazaraAssert(sectionIndex < m_sectionCount, "out of range section");
NazaraAssertFmt(sectionIndex < m_sectionCount, "section index ouf of range ({0} >= {1})", sectionIndex, m_sectionCount);
auto& section = m_sections[sectionIndex];
section.textureCoord = textureCoord;
@@ -133,7 +133,7 @@ namespace Nz
inline void LinearSlicedSprite::SetSize(float size)
{
NazaraAssert(size >= 0.f, "size must be positive");
NazaraAssertFmt(size >= 0.f, "size must be positive (got {0})", size);
m_size = size;