Fixed inverted map texture problem.

Added(from trunk) the loading of terrain files defined in the region.xml files.
Sugilite
MW 2007-06-17 19:25:04 +00:00
parent ef494fdf9c
commit 99a308007c
28 changed files with 88 additions and 8 deletions

View File

@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Console;
@ -178,6 +179,32 @@ namespace OpenSim.Framework.Types
this.IPListenAddr = attri;
}
}
attri = "";
attri = configData.GetAttribute("TerrainFile");
if (attri == "")
{
this.estateSettings.terrainFile = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32");
configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile);
}
else
{
this.estateSettings.terrainFile = attri;
}
attri = "";
attri = configData.GetAttribute("TerrainMultiplier");
if (attri == "")
{
string re = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0");
this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture);
configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString());
}
else
{
this.estateSettings.terrainMultiplier = Convert.ToDouble(attri);
}
attri = "";
attri = configData.GetAttribute("MasterAvatarFirstName");
if (attri == "")

View File

@ -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;
}
}
}

View File

@ -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
{

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -12,6 +12,13 @@
<property name="build.debug" value="true" />
</target>
<property name="project.config" value="Release" />
<target name="Release" description="">
<property name="project.config" value="Release" />
<property name="build.debug" value="false" />
</target>
<target name="net-1.1" description="Sets framework to .NET 1.1">
<property name="nant.settings.currentframework" value="net-1.1" />
</target>

View File

@ -5,10 +5,13 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,19 @@
Use the "terrain load" command to import these datafiles.
They are stored as Float-32 arrays, use the F32 import type.
These files are formatted on a scale of 0 to 1, they are designed for a range of 0..58.81
use the 'multiply' command to multiply them by 58.81 to achieve correct height values.
Example ------------------
Region# : terrain load f32 c:\opensim\datafiles\output_x0_y0.r32
Region# : terrain multiply 58.81
<AdamZaius> 0,0 - 1,0 - 2,0
<AdamZaius> 0,1 - 1,1 - 2,1
<AdamZaius> 0,2 - 1,2, 2,2
for a 3x3 area on the grid

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB