diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/TerrainData.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/OpenSim/Framework/TerrainData.cs b/OpenSim/Framework/TerrainData.cs index 9c036ca..d5dad8f 100644 --- a/OpenSim/Framework/TerrainData.cs +++ b/OpenSim/Framework/TerrainData.cs | |||
@@ -168,9 +168,20 @@ namespace OpenSim.Framework | |||
168 | // The user wants something to store in the database. | 168 | // The user wants something to store in the database. |
169 | public override bool GetDatabaseBlob(out int DBRevisionCode, out Array blob) | 169 | public override bool GetDatabaseBlob(out int DBRevisionCode, out Array blob) |
170 | { | 170 | { |
171 | DBRevisionCode = (int)DBTerrainRevision.Legacy256; | 171 | bool ret = false; |
172 | blob = ToLegacyTerrainSerialization(); | 172 | if (SizeX == Constants.RegionSize && SizeY == Constants.RegionSize) |
173 | return false; | 173 | { |
174 | DBRevisionCode = (int)DBTerrainRevision.Legacy256; | ||
175 | blob = ToLegacyTerrainSerialization(); | ||
176 | ret = true; | ||
177 | } | ||
178 | else | ||
179 | { | ||
180 | DBRevisionCode = (int)DBTerrainRevision.Compressed2D; | ||
181 | blob = ToCompressedTerrainSerialization(); | ||
182 | ret = true; | ||
183 | } | ||
184 | return ret; | ||
174 | } | 185 | } |
175 | 186 | ||
176 | // TerrainData.CompressionFactor | 187 | // TerrainData.CompressionFactor |
@@ -391,7 +402,7 @@ namespace OpenSim.Framework | |||
391 | { | 402 | { |
392 | Int16 val = br.ReadInt16(); | 403 | Int16 val = br.ReadInt16(); |
393 | if (xx < SizeX && yy < SizeY) | 404 | if (xx < SizeX && yy < SizeY) |
394 | m_heightmap[xx, yy] = ToCompressedHeight(val); | 405 | m_heightmap[xx, yy] = val; |
395 | } | 406 | } |
396 | } | 407 | } |
397 | } | 408 | } |