diff options
author | UbitUmarov | 2015-09-07 08:06:41 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-07 08:06:41 +0100 |
commit | abd664045307fde0cf81144b54e64a364c0e5786 (patch) | |
tree | b4543f40d81457b44285f7652e38c2383c401bd0 /OpenSim | |
parent | restore terrain modifiers, left out earlier bc of merge errors, (untested) (diff) | |
download | opensim-SC_OLD-abd664045307fde0cf81144b54e64a364c0e5786.zip opensim-SC_OLD-abd664045307fde0cf81144b54e64a364c0e5786.tar.gz opensim-SC_OLD-abd664045307fde0cf81144b54e64a364c0e5786.tar.bz2 opensim-SC_OLD-abd664045307fde0cf81144b54e64a364c0e5786.tar.xz |
allocate llRAW LookupHeightTable on demand and release it, saving a few 512KB of memory
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index be1fb24..59994e4 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs | |||
@@ -57,6 +57,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
57 | 57 | ||
58 | public LLRAW() | 58 | public LLRAW() |
59 | { | 59 | { |
60 | } | ||
61 | |||
62 | private void BuildLookupHeightTable() | ||
63 | { | ||
60 | LookupHeightTable = new HeightmapLookupValue[256 * 256]; | 64 | LookupHeightTable = new HeightmapLookupValue[256 * 256]; |
61 | 65 | ||
62 | for (int i = 0; i < 256; i++) | 66 | for (int i = 0; i < 256; i++) |
@@ -186,6 +190,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
186 | 190 | ||
187 | public void SaveStream(Stream s, ITerrainChannel map) | 191 | public void SaveStream(Stream s, ITerrainChannel map) |
188 | { | 192 | { |
193 | if (LookupHeightTable == null) | ||
194 | BuildLookupHeightTable(); | ||
195 | |||
189 | using (BinaryWriter binStream = new BinaryWriter(s)) | 196 | using (BinaryWriter binStream = new BinaryWriter(s)) |
190 | { | 197 | { |
191 | // Output the calculated raw | 198 | // Output the calculated raw |
@@ -241,6 +248,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
241 | } | 248 | } |
242 | } | 249 | } |
243 | } | 250 | } |
251 | LookupHeightTable = null; | ||
244 | } | 252 | } |
245 | 253 | ||
246 | public string FileExtension | 254 | public string FileExtension |