Added sorting of blocks.

This commit is contained in:
Miroslav Bendík
2012-08-24 11:01:48 +02:00
parent 0b9adc95b7
commit 231f48c529
2 changed files with 38 additions and 3 deletions

View File

@ -235,9 +235,22 @@ void TileGenerator::renderMap()
}
std::list<int> zlist = getZValueList();
for (std::list<int>::iterator position = zlist.begin(); position != zlist.end(); ++position) {
int zPos = *position;
getBlocksOnZ(zPos, statement);
for (std::list<int>::iterator zPosition = zlist.begin(); zPosition != zlist.end(); ++zPosition) {
int zPos = *zPosition;
map<int, BlockList> blocks = getBlocksOnZ(zPos, statement);
for (std::list<std::pair<int, int> >::const_iterator position = m_positions.begin(); position != m_positions.end(); ++position) {
if (position->second != zPos) {
continue;
}
int xPos = position->first;
blocks[xPos].sort();
const BlockList &blockStack = blocks[xPos];
for (BlockList::const_iterator it = blockStack.begin(); it != blockStack.end(); ++it) {
std::cout << it->first.y << std::endl;
}
std::cout << "---" << std::endl;
}
}
}