Added metadata skipping.

This commit is contained in:
Miroslav Bendík 2012-08-24 12:10:26 +02:00
parent 6743984e16
commit feb945b1f9

View File

@ -263,7 +263,24 @@ void TileGenerator::renderMap()
dataOffset = 2;
}
size_t processed;
zlibDecompress(data + dataOffset, length - dataOffset, &processed);
string mapData = zlibDecompress(data + dataOffset, length - dataOffset, &processed);
dataOffset += processed;
string mapMetadata = zlibDecompress(data + dataOffset, length - dataOffset, &processed);
if (version <= 21) {
dataOffset += 2;
}
if (version == 23) {
dataOffset += 1;
}
if (version == 24) {
uint8_t ver = data[dataOffset + 1];
dataOffset++;
if (ver == 1) {
int num = int(data[dataOffset + 1]) * 256 + data[dataOffset + 2];
dataOffset += 10 * num + 2;
}
}
}
}
}