mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
Fixed inverted map texture problem.
Added(from trunk) the loading of terrain files defined in the region.xml files.
This commit is contained in:
@@ -39,13 +39,13 @@ namespace OpenSim.LocalCommunications
|
||||
{
|
||||
public class CommunicationsLocal : CommunicationsManager
|
||||
{
|
||||
public LocalBackEndServices SandManager = new LocalBackEndServices();
|
||||
public LocalBackEndServices SandBoxManager = new LocalBackEndServices();
|
||||
|
||||
public CommunicationsLocal()
|
||||
{
|
||||
UserServer = null;
|
||||
GridServer = SandManager;
|
||||
InterRegion = SandManager;
|
||||
GridServer = SandBoxManager;
|
||||
InterRegion = SandBoxManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,10 +415,31 @@ namespace OpenSim.Region.Scenes
|
||||
float[] map = this.localStorage.LoadWorld();
|
||||
if (map == null)
|
||||
{
|
||||
Console.WriteLine("creating new terrain");
|
||||
this.Terrain.hills();
|
||||
// Console.WriteLine("creating new terrain");
|
||||
// this.Terrain.hills();
|
||||
|
||||
// this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
if (string.IsNullOrEmpty(this.m_regInfo.estateSettings.terrainFile))
|
||||
{
|
||||
Console.WriteLine("No default terrain, procedurally generating...");
|
||||
this.Terrain.hills();
|
||||
|
||||
// this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Terrain.loadFromFileF32(this.m_regInfo.estateSettings.terrainFile);
|
||||
this.Terrain *= this.m_regInfo.estateSettings.terrainMultiplier;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Unable to load default terrain, procedurally generating instead...");
|
||||
Terrain.hills();
|
||||
}
|
||||
// this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -536,7 +536,7 @@ namespace OpenSim.Terrain
|
||||
for (int y = 0; y < copy.h; y++)
|
||||
{
|
||||
// 512 is the largest possible height before colours clamp
|
||||
int colorindex = (int)(Math.Max(Math.Min(1.0, copy.get(copy.w -x, copy.h - y) / 512.0), 0.0) * pallete);
|
||||
int colorindex = (int)(Math.Max(Math.Min(1.0, copy.get(copy.h - y, x) / 512.0), 0.0) * pallete);
|
||||
bmp.SetPixel(x, y, colours[colorindex]);
|
||||
}
|
||||
}
|
||||
@@ -549,6 +549,7 @@ namespace OpenSim.Terrain
|
||||
{
|
||||
Console.WriteLine("Failed generating terrain map: " + e.ToString());
|
||||
}
|
||||
|
||||
return imageData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,12 +100,14 @@ namespace OpenSim
|
||||
|
||||
ClientView.TerrainManager = new TerrainManager(new SecondLife());
|
||||
|
||||
CommunicationsLocal sandboxCommunications = null;
|
||||
if (m_sandbox)
|
||||
{
|
||||
this.SetupLocalGridServers();
|
||||
this.checkServer = new CheckSumServer(12036);
|
||||
this.checkServer.ServerListener();
|
||||
this.commsManager = new CommunicationsLocal();
|
||||
sandboxCommunications = new CommunicationsLocal();
|
||||
this.commsManager = sandboxCommunications;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -132,7 +134,7 @@ namespace OpenSim
|
||||
{
|
||||
loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, false);
|
||||
loginServer.Startup();
|
||||
loginServer.SetSessionHandler(((CommunicationsLocal)this.commsManager).SandManager.AddNewSession);
|
||||
loginServer.SetSessionHandler(sandboxCommunications.SandBoxManager.AddNewSession);
|
||||
//sandbox mode with loginserver not using accounts
|
||||
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user