aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Terrain
diff options
context:
space:
mode:
authorMagnuz Binder2015-01-28 11:32:43 +0100
committerJustin Clark-Casey (justincc)2015-02-28 00:26:58 +0000
commitfad4d4dc5525133032116eebc62dbe423fb22b57 (patch)
treeaa5053d7b1fe65c1f03114620651ae1f87fc299c /OpenSim/Region/CoreModules/World/Terrain
parentComment out now unused and not properly working private SP.m_leftButtonDown w... (diff)
downloadopensim-SC-fad4d4dc5525133032116eebc62dbe423fb22b57.zip
opensim-SC-fad4d4dc5525133032116eebc62dbe423fb22b57.tar.gz
opensim-SC-fad4d4dc5525133032116eebc62dbe423fb22b57.tar.bz2
opensim-SC-fad4d4dc5525133032116eebc62dbe423fb22b57.tar.xz
Permit loading of LLRAW files bigger than 256x256 by calculating size based on file size rather than assuming 256x256, same as for RAW32.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain')
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
index 62d232e..ce93a180 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
@@ -147,7 +147,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
147 147
148 public ITerrainChannel LoadStream(Stream s) 148 public ITerrainChannel LoadStream(Stream s)
149 { 149 {
150 TerrainChannel retval = new TerrainChannel(); 150 // The raw format doesn't contain any dimension information.
151 // Guess the square dimensions by using the length of the raw file.
152 double dimension = Math.Sqrt((double)(s.Length / 13));
153 // Regions are always multiples of 256.
154 int trimmedDimension = (int)dimension - ((int)dimension % (int)Constants.RegionSize);
155 if (trimmedDimension < Constants.RegionSize)
156 trimmedDimension = (int)Constants.RegionSize;
157
158 TerrainChannel retval = new TerrainChannel(trimmedDimension, trimmedDimension);
151 159
152 BinaryReader bs = new BinaryReader(s); 160 BinaryReader bs = new BinaryReader(s);
153 int y; 161 int y;