Rendering Z blocks in reverse order.

This commit is contained in:
Miroslav Bendík 2012-09-01 13:34:27 +02:00
parent b9e40ed972
commit 6dff561ec0
2 changed files with 5 additions and 4 deletions

View File

@ -14,19 +14,19 @@ using namespace std;
PixelAttributes::PixelAttributes()
{
m_blockPixelAttributes.resize(18); // 16px + 2px gradient calculation
m_blockPixelAttributes.resize(17); // 16px + 1px gradient calculation
}
void PixelAttributes::setWidth(int width)
{
for (size_t i = 0; i < 18; ++i) {
for (size_t i = 0; i < 17; ++i) {
m_blockPixelAttributes[i].resize(width + 2); // Width + 1 px gradient calculation on both sides
}
}
void PixelAttributes::scroll()
{
m_blockPixelAttributes[17] = m_blockPixelAttributes[1];
m_blockPixelAttributes[0] = m_blockPixelAttributes[16];
for (size_t i = 1; i < 17; ++i) {
fill(m_blockPixelAttributes[i].begin(), m_blockPixelAttributes[i].end(), PixelAttribute());
}

View File

@ -484,7 +484,7 @@ inline void TileGenerator::renderMapBlock(const std::string &mapBlock, const Blo
inline void TileGenerator::renderShading(int zPos)
{
int zBegin = (m_zMax - zPos) * 16;
for (int z = 1; z < 17; ++z) {
for (int z = 0; z < 16; ++z) {
int imageY = zBegin + z;
if (imageY >= m_mapHeight) {
continue;
@ -607,6 +607,7 @@ inline std::list<int> TileGenerator::getZValueList() const
}
zlist.sort();
zlist.unique();
zlist.reverse();
return zlist;
}