aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2013-11-05 21:33:02 -0800
committerRobert Adams2013-11-05 21:33:02 -0800
commitd0854e4ace64d105d06e2b6b4e342a34f6e7e44a (patch)
treea9a124613bfb0a6bd8c24024930a8f63ddcc8e90
parentMerge branch 'master' into varregion (diff)
downloadopensim-SC-d0854e4ace64d105d06e2b6b4e342a34f6e7e44a.zip
opensim-SC-d0854e4ace64d105d06e2b6b4e342a34f6e7e44a.tar.gz
opensim-SC-d0854e4ace64d105d06e2b6b4e342a34f6e7e44a.tar.bz2
opensim-SC-d0854e4ace64d105d06e2b6b4e342a34f6e7e44a.tar.xz
varregion: properly sense size of terrain heightmap and store as
compressed 2D database blob if a varregion.
-rw-r--r--OpenSim/Framework/TerrainData.cs19
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 }