diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index f28441cf359..73dbe9bc359 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -1139,7 +1139,8 @@ Bool WorldHeightMap::ParseBlendTileData(DataChunkInput &file, DataChunkInfo *inf } if (info->version >= K_BLEND_TILE_VERSION_7) { if (info->version==K_BLEND_TILE_VERSION_7) { - Int byteWidth = (m_width+1)/8; // previous incorrect length that got used to save the file. jba. [4/3/2003] + // previous incorrect length that got used to save the file. jba. [4/3/2003] + Int byteWidth = (m_width+1)/8; UnsignedByte *data = new UnsignedByte[m_height*byteWidth]; file.readArrayOfBytes((char*)data, m_height*byteWidth); for (j=0; jversion <= K_BLEND_TILE_VERSION_7) { + const Int retailRowCells = 8*((m_width+1)/8); + for (j=0; jversion == K_BLEND_TILE_VERSION_7) { + // The file holds the shared bits in the first cells of the next row. + setCliffState(i, j, getCliffState(i-retailRowCells, j+1)); + } else { + // The flags are computed column by column, so the last cells of a row are written last. + setCliffState(i-retailRowCells, j+1, getCliffState(i, j)); + } + } + } + } +#elif !RETAIL_COMPATIBLE_CRC + // Version 7 files have no bits for the last cells of a row, so they are computed from the heights. + if (info->version == K_BLEND_TILE_VERSION_7) { + const Int retailRowCells = 8*((m_width+1)/8); + for (j=0; j0 && m_numBitmapTiles<2048, ("Unlikely numBitmapTiles.")); m_numBlendedTiles = file.readInt();