Fix shading when pixels are sparse
This commit is contained in:
parent
22041a8603
commit
d3dcf310eb
@ -117,13 +117,13 @@ void PixelAttributes::renderShading(bool drawAlpha)
|
|||||||
}
|
}
|
||||||
if (!m_pixelAttributes[y][x].isNormalized())
|
if (!m_pixelAttributes[y][x].isNormalized())
|
||||||
m_pixelAttributes[y][x].normalize();
|
m_pixelAttributes[y][x].normalize();
|
||||||
if (!m_pixelAttributes[y][x].is_valid() || !m_pixelAttributes[y - 1][x].is_valid()) {
|
if (!m_pixelAttributes[y][x].is_valid()) {
|
||||||
if (x + 1 < m_width && !m_pixelAttributes[y][x + 1].isNormalized())
|
if (x + 1 < m_width && !m_pixelAttributes[y][x + 1].isNormalized())
|
||||||
m_pixelAttributes[y][x + 1].normalize();
|
m_pixelAttributes[y][x + 1].normalize();
|
||||||
x++;
|
x++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!m_pixelAttributes[y][x - 1].is_valid())
|
if (!m_pixelAttributes[y - 1][x].is_valid() || !m_pixelAttributes[y][x - 1].is_valid())
|
||||||
continue;
|
continue;
|
||||||
if (!m_pixelAttributes[y][x].m_a)
|
if (!m_pixelAttributes[y][x].m_a)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user