* Added ability to set default terrain to a file in region config. If unable to open, terrain will be procedurally generated instead. (also needs testing.). Default file must be in R32 format. Use "terrain save f32 default.r32" on the region console to make a default file you can use.
parent
0ede8140e7
commit
7a2abbb848
|
@ -175,6 +175,24 @@ namespace OpenSim
|
|||
{
|
||||
this.IPListenAddr = attri;
|
||||
}
|
||||
|
||||
// Terrain Default File
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("TerrainFile");
|
||||
if (attri == "")
|
||||
{
|
||||
this.TerrainFile = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Terrain file default", "default.r32");
|
||||
configData.SetAttribute("TerrainFile", this.TerrainFile);
|
||||
}
|
||||
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("TerrainMultiplier");
|
||||
if (attri == "")
|
||||
{
|
||||
this.TerrainMultiplier = Convert.ToDouble(OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Terrain multiplier", "60.0"));
|
||||
configData.SetAttribute("TerrainMultiplier", this.TerrainMultiplier.ToString());
|
||||
}
|
||||
|
||||
|
||||
if (!isSandbox)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,29 @@ namespace OpenSim
|
|||
public int IPListenPort;
|
||||
public string IPListenAddr;
|
||||
|
||||
// Region Information
|
||||
public LLUUID TerrainBase0 = new LLUUID(); // Insert default here
|
||||
public LLUUID TerrainBase1 = new LLUUID();
|
||||
public LLUUID TerrainBase2 = new LLUUID();
|
||||
public LLUUID TerrainBase3 = new LLUUID();
|
||||
public LLUUID TerrainDetail0 = new LLUUID();
|
||||
public LLUUID TerrainDetail1 = new LLUUID();
|
||||
public LLUUID TerrainDetail2 = new LLUUID();
|
||||
public LLUUID TerrainDetail3 = new LLUUID();
|
||||
public float TerrainStartHeight00 = 0.0f;
|
||||
public float TerrainStartHeight01 = 0.0f;
|
||||
public float TerrainStartHeight10 = 0.0f;
|
||||
public float TerrainStartHeight11 = 0.0f;
|
||||
public float TerrainHeightRange00 = 40.0f;
|
||||
public float TerrainHeightRange01 = 40.0f;
|
||||
public float TerrainHeightRange10 = 40.0f;
|
||||
public float TerrainHeightRange11 = 40.0f;
|
||||
|
||||
// Terrain Default (Must be in F32 Format!)
|
||||
public string TerrainFile = "default.r32";
|
||||
public double TerrainMultiplier = 60.0;
|
||||
|
||||
|
||||
public RegionInfoBase()
|
||||
{
|
||||
|
||||
|
|
|
@ -417,10 +417,27 @@ namespace OpenSim.world
|
|||
float[] map = this.localStorage.LoadWorld();
|
||||
if (map == null)
|
||||
{
|
||||
Console.WriteLine("creating new terrain");
|
||||
this.Terrain.hills();
|
||||
if (string.IsNullOrEmpty(this.m_regInfo.TerrainFile))
|
||||
{
|
||||
Console.WriteLine("No default terrain, procedurally generating...");
|
||||
this.Terrain.hills();
|
||||
|
||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Terrain.loadFromFileF32(this.m_regInfo.TerrainFile);
|
||||
this.Terrain *= this.m_regInfo.TerrainMultiplier;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("Unable to load default terrain (" + e.ToString() + "), procedurally generating instead...");
|
||||
Terrain.hills();
|
||||
}
|
||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue