Skip to content

Commit

Permalink
Fix drawing of transparent nodes without --drawalpha (fixes #41)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jan 5, 2017
1 parent 9503f76 commit d490cf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion TileGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit d490cf0

Please sign in to comment.