Permit loading of LLRAW files bigger than 256x256 by calculating size based on file size rather than assuming 256x256, same as for RAW32.
parent
59d6d03909
commit
fad4d4dc55
|
@ -147,7 +147,15 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
|
|
||||||
public ITerrainChannel LoadStream(Stream s)
|
public ITerrainChannel LoadStream(Stream s)
|
||||||
{
|
{
|
||||||
TerrainChannel retval = new TerrainChannel();
|
// The raw format doesn't contain any dimension information.
|
||||||
|
// Guess the square dimensions by using the length of the raw file.
|
||||||
|
double dimension = Math.Sqrt((double)(s.Length / 13));
|
||||||
|
// Regions are always multiples of 256.
|
||||||
|
int trimmedDimension = (int)dimension - ((int)dimension % (int)Constants.RegionSize);
|
||||||
|
if (trimmedDimension < Constants.RegionSize)
|
||||||
|
trimmedDimension = (int)Constants.RegionSize;
|
||||||
|
|
||||||
|
TerrainChannel retval = new TerrainChannel(trimmedDimension, trimmedDimension);
|
||||||
|
|
||||||
BinaryReader bs = new BinaryReader(s);
|
BinaryReader bs = new BinaryReader(s);
|
||||||
int y;
|
int y;
|
||||||
|
|
Loading…
Reference in New Issue