Add a comment to clarify a magical formula

This commit is contained in:
Rogier 2015-06-07 20:30:56 +02:00
parent 5e7f7c74c0
commit 4e6ee97936

View File

@ -1303,6 +1303,8 @@ void TileGenerator::scalePixelRows(PixelAttributes &pixelAttributes, PixelAttrib
void TileGenerator::pushPixelRows(PixelAttributes &pixelAttributes, int zPosLimit) { void TileGenerator::pushPixelRows(PixelAttributes &pixelAttributes, int zPosLimit) {
if (m_shading) if (m_shading)
// Make shading less pronounced when map is scaled down
// (the formula for the emphasis parameter was determined (tuned) experimentally...)
pixelAttributes.renderShading(m_scaleFactor < 3 ? 1 : 1 / sqrt(m_scaleFactor), m_drawAlpha); pixelAttributes.renderShading(m_scaleFactor < 3 ? 1 : 1 / sqrt(m_scaleFactor), m_drawAlpha);
int y; int y;
for (y = pixelAttributes.getNextY(); y <= pixelAttributes.getLastY() && y < (worldBlockZ2StoredY(m_zMin - 1) + m_mapYEndNodeOffset) / m_scaleFactor; y++) { for (y = pixelAttributes.getNextY(); y <= pixelAttributes.getLastY() && y < (worldBlockZ2StoredY(m_zMin - 1) + m_mapYEndNodeOffset) / m_scaleFactor; y++) {