Fix drawing of transparent nodes without --drawalpha (fixes #41)

This commit is contained in:
sfan5 2017-01-05 23:37:21 +01:00
parent 9503f76805
commit d490cf0a31
2 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,8 @@ struct Color {
Color() : r(0), g(0), b(0), a(0) {};
Color(u8 r, u8 g, u8 b) : r(r), g(g), b(b), a(255) {};
Color(u8 r, u8 g, u8 b, u8 a) : r(r), g(g), b(b), a(a) {};
inline Color noAlpha() const { return Color(r, g, b); }
u8 r, g, b, a;
};

View File

@ -526,7 +526,7 @@ void TileGenerator::renderMapBlock(const ustring &mapBlock, const BlockPos &pos,
continue;
}
} else {
setZoomed(imageX, imageY, c);
setZoomed(imageX, imageY, c.noAlpha());
m_readPixels[z] |= (1 << x);
}
if(!(m_readInfo[z] & (1 << x))) {