varregion: properly sense size of terrain heightmap and store as
compressed 2D database blob if a varregion.varregion
							parent
							
								
									c931b16c1f
								
							
						
					
					
						commit
						d0854e4ace
					
				|  | @ -167,10 +167,21 @@ namespace OpenSim.Framework | ||||||
|         // TerrainData.GetDatabaseBlob |         // TerrainData.GetDatabaseBlob | ||||||
|         // The user wants something to store in the database. |         // The user wants something to store in the database. | ||||||
|         public override bool GetDatabaseBlob(out int DBRevisionCode, out Array blob) |         public override bool GetDatabaseBlob(out int DBRevisionCode, out Array blob) | ||||||
|  |         { | ||||||
|  |             bool ret = false; | ||||||
|  |             if (SizeX == Constants.RegionSize && SizeY == Constants.RegionSize) | ||||||
|             { |             { | ||||||
|                 DBRevisionCode = (int)DBTerrainRevision.Legacy256; |                 DBRevisionCode = (int)DBTerrainRevision.Legacy256; | ||||||
|                 blob = ToLegacyTerrainSerialization(); |                 blob = ToLegacyTerrainSerialization(); | ||||||
|             return false; |                 ret = true; | ||||||
|  |             } | ||||||
|  |             else | ||||||
|  |             { | ||||||
|  |                 DBRevisionCode = (int)DBTerrainRevision.Compressed2D; | ||||||
|  |                 blob = ToCompressedTerrainSerialization(); | ||||||
|  |                 ret = true; | ||||||
|  |             } | ||||||
|  |             return ret; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // TerrainData.CompressionFactor |         // TerrainData.CompressionFactor | ||||||
|  | @ -391,7 +402,7 @@ namespace OpenSim.Framework | ||||||
|                         { |                         { | ||||||
|                             Int16 val = br.ReadInt16(); |                             Int16 val = br.ReadInt16(); | ||||||
|                             if (xx < SizeX && yy < SizeY) |                             if (xx < SizeX && yy < SizeY) | ||||||
|                                 m_heightmap[xx, yy] = ToCompressedHeight(val); |                                 m_heightmap[xx, yy] = val; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Robert Adams
						Robert Adams