From adb56a46f49127911a2df169c86f2cdfde034966 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 11 Apr 2007 05:19:27 +0000 Subject: Major ass changes to terrain (now uses libTerrain-BSD!) and all-round improvements to code quality. Terrain saving/loading may work now (running through setHeights1D and getHeights1D before DB4o) **WARNING: UNTESTED** --- OpenSim.RegionServer/world/Avatar.cs | 4 ++-- OpenSim.RegionServer/world/World.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim.RegionServer/world') diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs index f507797..843c3af 100644 --- a/OpenSim.RegionServer/world/Avatar.cs +++ b/OpenSim.RegionServer/world/Avatar.cs @@ -44,7 +44,7 @@ namespace OpenSim.world OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); ControllingClient = TheClient; localid = 8880000 + (this.m_world._localNumber++); - Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain.map[(int)Pos.X, (int)Pos.Y] + 1.0f); + Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain[(int)Pos.X, (int)Pos.Y] + 1.0f); visualParams = new byte[218]; for (int i = 0; i < 218; i++) { @@ -332,7 +332,7 @@ namespace OpenSim.world public override void LandRenegerated() { - Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain.map[(int)Pos.X, (int)Pos.Y] + 50.0f); + Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain[(int)Pos.X, (int)Pos.Y] + 50.0f); } } diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs index 580804a..c7c57d1 100644 --- a/OpenSim.RegionServer/world/World.cs +++ b/OpenSim.RegionServer/world/World.cs @@ -198,7 +198,7 @@ namespace OpenSim.world { this.phyScene.SetTerrain(Terrain.getHeights1D()); } - this.localStorage.SaveMap(this.Terrain.map); + this.localStorage.SaveMap(this.Terrain.getHeights1D()); foreach (SimClient client in m_clientThreads.Values) { @@ -213,12 +213,12 @@ namespace OpenSim.world public void RegenerateTerrain(float[,] newMap) { - this.Terrain.map = newMap; + this.Terrain.setHeights2D(newMap); lock (this.LockPhysicsEngine) { this.phyScene.SetTerrain(this.Terrain.getHeights1D()); } - this.localStorage.SaveMap(this.Terrain.map); + this.localStorage.SaveMap(this.Terrain.getHeights1D()); foreach (SimClient client in m_clientThreads.Values) { @@ -239,7 +239,7 @@ namespace OpenSim.world { this.phyScene.SetTerrain(this.Terrain.getHeights1D()); } - this.localStorage.SaveMap(this.Terrain.map); + this.localStorage.SaveMap(this.Terrain.getHeights1D()); foreach (SimClient client in m_clientThreads.Values) { @@ -252,7 +252,7 @@ namespace OpenSim.world public void LoadWorldMap() { - float[,] map = this.localStorage.LoadWorld(); + float[] map = this.localStorage.LoadWorld(); if (map == null) { this.Terrain.hills(); @@ -260,7 +260,7 @@ namespace OpenSim.world } else { - this.Terrain.map = map; + this.Terrain.setHeights1D(map); } } -- cgit v1.1