aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteRegionData.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-02 18:31:08 -0700
committerJohn Hurliman2009-10-02 18:31:08 -0700
commit387e9f7a7faeb412054383080afc3507a1522746 (patch)
tree522470dd28074f7e114547476968942c05e866aa /OpenSim/Data/SQLite/SQLiteRegionData.cs
parentMerge branch 'diva-textures-osgrid' of ssh://opensimulator.org/var/git/opensi... (diff)
downloadopensim-SC_OLD-387e9f7a7faeb412054383080afc3507a1522746.zip
opensim-SC_OLD-387e9f7a7faeb412054383080afc3507a1522746.tar.gz
opensim-SC_OLD-387e9f7a7faeb412054383080afc3507a1522746.tar.bz2
opensim-SC_OLD-387e9f7a7faeb412054383080afc3507a1522746.tar.xz
* Creates Util.UTF8 and switches some references of Encoding.UTF8 to Util.UTF8 (not all references were switched since not all OpenSim libraries reference OpenSim.Framework)
* Shrinks the largest in-memory object, the LLRAW.HeightmapLookupValue struct (only used for exporting to LLRAW terrain files), to the minimum possible size. This seems to have the odd side effect of cutting the size of the two double[256,256] terrain objects in half. Possibly an alignment optimization?
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteRegionData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index ea076fe..a3ae6ea 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -581,13 +581,17 @@ namespace OpenSim.Data.SQLite
581 if (row.Read()) 581 if (row.Read())
582 { 582 {
583 // TODO: put this into a function 583 // TODO: put this into a function
584 MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); 584 using (MemoryStream str = new MemoryStream((byte[])row["Heightfield"]))
585 BinaryReader br = new BinaryReader(str);
586 for (int x = 0; x < (int)Constants.RegionSize; x++)
587 { 585 {
588 for (int y = 0; y < (int)Constants.RegionSize; y++) 586 using (BinaryReader br = new BinaryReader(str))
589 { 587 {
590 terret[x, y] = br.ReadDouble(); 588 for (int x = 0; x < (int)Constants.RegionSize; x++)
589 {
590 for (int y = 0; y < (int)Constants.RegionSize; y++)
591 {
592 terret[x, y] = br.ReadDouble();
593 }
594 }
591 } 595 }
592 } 596 }
593 rev = (int) row["Revision"]; 597 rev = (int) row["Revision"];