Tabs -> spaces
parent
84e1fac7d7
commit
a7a45b5a55
|
@ -792,8 +792,8 @@ inline void TileGenerator::renderMapBlock(const unsigned_string &mapBlock, const
|
|||
}
|
||||
int imageX = getImageX(xBegin + x);
|
||||
if(m_drawAlpha) {
|
||||
col = Color(0,0,0,0);
|
||||
th = 0;
|
||||
col = Color(0,0,0,0);
|
||||
th = 0;
|
||||
}
|
||||
for (int y = maxY; y >= minY; --y) {
|
||||
int position = x + (y << 4) + (z << 8);
|
||||
|
@ -803,25 +803,25 @@ inline void TileGenerator::renderMapBlock(const unsigned_string &mapBlock, const
|
|||
}
|
||||
std::map<int, std::string>::iterator blockName = m_nameMap.find(content);
|
||||
if (blockName == m_nameMap.end())
|
||||
continue;
|
||||
continue;
|
||||
const string &name = blockName->second;
|
||||
ColorMap::const_iterator color = m_colors.find(name);
|
||||
if (color != m_colors.end()) {
|
||||
const Color c = color->second.to_color();
|
||||
if (m_drawAlpha) {
|
||||
if (col.a == 0)
|
||||
col = c;
|
||||
else
|
||||
col = mixColors(col, c);
|
||||
if(col.a == 0xFF) {
|
||||
m_image->tpixels[imageY][imageX] = color2int(col);
|
||||
m_blockPixelAttributes.attribute(15 - z, xBegin + x).thicken = th;
|
||||
} else {
|
||||
th = (th + color->second.t) / 2.0;
|
||||
continue;
|
||||
}
|
||||
if (col.a == 0)
|
||||
col = c;
|
||||
else
|
||||
col = mixColors(col, c);
|
||||
if(col.a == 0xFF) {
|
||||
m_image->tpixels[imageY][imageX] = color2int(col);
|
||||
m_blockPixelAttributes.attribute(15 - z, xBegin + x).thicken = th;
|
||||
} else {
|
||||
th = (th + color->second.t) / 2.0;
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
m_image->tpixels[imageY][imageX] = color2int(c);
|
||||
m_image->tpixels[imageY][imageX] = color2int(c);
|
||||
m_readedPixels[z] |= (1 << x);
|
||||
m_blockPixelAttributes.attribute(15 - z, xBegin + x).height = pos.y * 16 + y;
|
||||
} else {
|
||||
|
@ -855,7 +855,7 @@ inline void TileGenerator::renderShading(int zPos)
|
|||
d = 36;
|
||||
}
|
||||
if (m_drawAlpha)
|
||||
d = d * ((0xFF - m_blockPixelAttributes.attribute(z, x).thicken) / 255.0);
|
||||
d = d * ((0xFF - m_blockPixelAttributes.attribute(z, x).thicken) / 255.0);
|
||||
int sourceColor = m_image->tpixels[imageY][getImageX(x)] & 0xffffff;
|
||||
uint8_t r = (sourceColor & 0xff0000) >> 16;
|
||||
uint8_t g = (sourceColor & 0x00ff00) >> 8;
|
||||
|
|
|
@ -38,7 +38,7 @@ struct Color {
|
|||
};
|
||||
|
||||
struct ColorEntry {
|
||||
ColorEntry(): r(0), g(0), b(0), a(0), t(0) {};
|
||||
ColorEntry(): r(0), g(0), b(0), a(0), t(0) {};
|
||||
ColorEntry(uint8_t r, uint8_t g, uint8_t b, uint8_t a, uint8_t t): r(r), g(g), b(b), a(a), t(t) {};
|
||||
inline Color to_color() const { return Color(r, g, b, a); }
|
||||
uint8_t r;
|
||||
|
|
Loading…
Reference in New Issue