Skip to content

Commit d490cf0

Browse files
committedJan 5, 2017
Fix drawing of transparent nodes without --drawalpha (fixes #41)
1 parent 9503f76 commit d490cf0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

Diff for: ‎Image.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ struct Color {
99
Color() : r(0), g(0), b(0), a(0) {};
1010
Color(u8 r, u8 g, u8 b) : r(r), g(g), b(b), a(255) {};
1111
Color(u8 r, u8 g, u8 b, u8 a) : r(r), g(g), b(b), a(a) {};
12+
inline Color noAlpha() const { return Color(r, g, b); }
13+
1214
u8 r, g, b, a;
1315
};
1416

Diff for: ‎TileGenerator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ void TileGenerator::renderMapBlock(const ustring &mapBlock, const BlockPos &pos,
526526
continue;
527527
}
528528
} else {
529-
setZoomed(imageX, imageY, c);
529+
setZoomed(imageX, imageY, c.noAlpha());
530530
m_readPixels[z] |= (1 << x);
531531
}
532532
if(!(m_readInfo[z] & (1 << x))) {

0 commit comments

Comments
 (0)
Please sign in to comment.