Added asserts.

This commit is contained in:
David Williams 2014-08-24 12:03:41 +02:00
parent 1fb82f40b3
commit 083c65ecd5

View File

@ -50,11 +50,13 @@ namespace PolyVox
ElementType operator()(uint32_t x, uint32_t y) const
{
POLYVOX_ASSERT((x < m_uWidth && y < m_uHeight), "Array access is out-of-range.");
return m_pData[y * m_uWidth + x];
}
ElementType& operator()(uint32_t x, uint32_t y)
{
POLYVOX_ASSERT((x < m_uWidth && y < m_uHeight), "Array access is out-of-range.");
return m_pData[y * m_uWidth + x];
}