aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-06-17 19:25:04 +0000
committerMW2007-06-17 19:25:04 +0000
commit99a308007c6c13dc13a2184eb34014de94d75ea8 (patch)
treeb696f870406953b7465313e9eda4210c94f85a38
parentEach Region will now generate a texture image of their terrain and this will ... (diff)
downloadopensim-SC_OLD-99a308007c6c13dc13a2184eb34014de94d75ea8.zip
opensim-SC_OLD-99a308007c6c13dc13a2184eb34014de94d75ea8.tar.gz
opensim-SC_OLD-99a308007c6c13dc13a2184eb34014de94d75ea8.tar.bz2
opensim-SC_OLD-99a308007c6c13dc13a2184eb34014de94d75ea8.tar.xz
Fixed inverted map texture problem.
Added(from trunk) the loading of terrain files defined in the region.xml files.
-rw-r--r--Common/OpenSim.Framework/Types/RegionInfo.cs27
-rw-r--r--OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs6
-rw-r--r--OpenSim/OpenSim.Region/Scenes/Scene.cs25
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs3
-rw-r--r--OpenSim/OpenSim/OpenSimMain.cs6
-rw-r--r--Prebuild/Prebuild.build7
-rw-r--r--Prebuild/Prebuild.sln3
-rw-r--r--bin/TerrainDatafiles/Alien/HOWTO.txt19
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld.bmpbin0 -> 1048630 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_0_0.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_0_0.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_0_1.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_0_1.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_0_2.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_0_2.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_1_0.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_1_0.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_1_1.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_1_1.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_1_2.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_1_2.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_2_0.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_2_0.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_2_1.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_2_1.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_2_2.bmpbin0 -> 262198 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_2_2.r32bin0 -> 262144 bytes
-rw-r--r--bin/TerrainDatafiles/Alien/alienworld_gray.bmpbin0 -> 786486 bytes
28 files changed, 88 insertions, 8 deletions
diff --git a/Common/OpenSim.Framework/Types/RegionInfo.cs b/Common/OpenSim.Framework/Types/RegionInfo.cs
index ad1399d..2c24327 100644
--- a/Common/OpenSim.Framework/Types/RegionInfo.cs
+++ b/Common/OpenSim.Framework/Types/RegionInfo.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text; 30using System.Text;
31using System.Globalization;
31using OpenSim.Framework.Interfaces; 32using OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Utilities; 33using OpenSim.Framework.Utilities;
33using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
@@ -178,6 +179,32 @@ namespace OpenSim.Framework.Types
178 this.IPListenAddr = attri; 179 this.IPListenAddr = attri;
179 } 180 }
180 } 181 }
182
183 attri = "";
184 attri = configData.GetAttribute("TerrainFile");
185 if (attri == "")
186 {
187 this.estateSettings.terrainFile = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Default Terrain File", "default.r32");
188 configData.SetAttribute("TerrainFile", this.estateSettings.terrainFile);
189 }
190 else
191 {
192 this.estateSettings.terrainFile = attri;
193 }
194
195 attri = "";
196 attri = configData.GetAttribute("TerrainMultiplier");
197 if (attri == "")
198 {
199 string re = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("GENERAL SETTING: Terrain Height Multiplier", "60.0");
200 this.estateSettings.terrainMultiplier = Convert.ToDouble(re, CultureInfo.InvariantCulture);
201 configData.SetAttribute("TerrainMultiplier", this.estateSettings.terrainMultiplier.ToString());
202 }
203 else
204 {
205 this.estateSettings.terrainMultiplier = Convert.ToDouble(attri);
206 }
207
181 attri = ""; 208 attri = "";
182 attri = configData.GetAttribute("MasterAvatarFirstName"); 209 attri = configData.GetAttribute("MasterAvatarFirstName");
183 if (attri == "") 210 if (attri == "")
diff --git a/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs b/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs
index 2293608..9b811ae 100644
--- a/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs
+++ b/OpenSim/OpenSim.LocalCommunications/CommunicationsLocal.cs
@@ -39,13 +39,13 @@ namespace OpenSim.LocalCommunications
39{ 39{
40 public class CommunicationsLocal : CommunicationsManager 40 public class CommunicationsLocal : CommunicationsManager
41 { 41 {
42 public LocalBackEndServices SandManager = new LocalBackEndServices(); 42 public LocalBackEndServices SandBoxManager = new LocalBackEndServices();
43 43
44 public CommunicationsLocal() 44 public CommunicationsLocal()
45 { 45 {
46 UserServer = null; 46 UserServer = null;
47 GridServer = SandManager; 47 GridServer = SandBoxManager;
48 InterRegion = SandManager; 48 InterRegion = SandBoxManager;
49 } 49 }
50 } 50 }
51} 51}
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs
index ca9a112..5744f1f 100644
--- a/OpenSim/OpenSim.Region/Scenes/Scene.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs
@@ -415,10 +415,31 @@ namespace OpenSim.Region.Scenes
415 float[] map = this.localStorage.LoadWorld(); 415 float[] map = this.localStorage.LoadWorld();
416 if (map == null) 416 if (map == null)
417 { 417 {
418 Console.WriteLine("creating new terrain"); 418 // Console.WriteLine("creating new terrain");
419 this.Terrain.hills(); 419 // this.Terrain.hills();
420 420
421 // this.localStorage.SaveMap(this.Terrain.getHeights1D()); 421 // this.localStorage.SaveMap(this.Terrain.getHeights1D());
422 if (string.IsNullOrEmpty(this.m_regInfo.estateSettings.terrainFile))
423 {
424 Console.WriteLine("No default terrain, procedurally generating...");
425 this.Terrain.hills();
426
427 // this.localStorage.SaveMap(this.Terrain.getHeights1D());
428 }
429 else
430 {
431 try
432 {
433 this.Terrain.loadFromFileF32(this.m_regInfo.estateSettings.terrainFile);
434 this.Terrain *= this.m_regInfo.estateSettings.terrainMultiplier;
435 }
436 catch
437 {
438 Console.WriteLine("Unable to load default terrain, procedurally generating instead...");
439 Terrain.hills();
440 }
441 // this.localStorage.SaveMap(this.Terrain.getHeights1D());
442 }
422 } 443 }
423 else 444 else
424 { 445 {
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
index e5831a0..fc4ca24 100644
--- a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
@@ -536,7 +536,7 @@ namespace OpenSim.Terrain
536 for (int y = 0; y < copy.h; y++) 536 for (int y = 0; y < copy.h; y++)
537 { 537 {
538 // 512 is the largest possible height before colours clamp 538 // 512 is the largest possible height before colours clamp
539 int colorindex = (int)(Math.Max(Math.Min(1.0, copy.get(copy.w -x, copy.h - y) / 512.0), 0.0) * pallete); 539 int colorindex = (int)(Math.Max(Math.Min(1.0, copy.get(copy.h - y, x) / 512.0), 0.0) * pallete);
540 bmp.SetPixel(x, y, colours[colorindex]); 540 bmp.SetPixel(x, y, colours[colorindex]);
541 } 541 }
542 } 542 }
@@ -549,6 +549,7 @@ namespace OpenSim.Terrain
549 { 549 {
550 Console.WriteLine("Failed generating terrain map: " + e.ToString()); 550 Console.WriteLine("Failed generating terrain map: " + e.ToString());
551 } 551 }
552
552 return imageData; 553 return imageData;
553 } 554 }
554 } 555 }
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index fb8511d..dddcaea 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -100,12 +100,14 @@ namespace OpenSim
100 100
101 ClientView.TerrainManager = new TerrainManager(new SecondLife()); 101 ClientView.TerrainManager = new TerrainManager(new SecondLife());
102 102
103 CommunicationsLocal sandboxCommunications = null;
103 if (m_sandbox) 104 if (m_sandbox)
104 { 105 {
105 this.SetupLocalGridServers(); 106 this.SetupLocalGridServers();
106 this.checkServer = new CheckSumServer(12036); 107 this.checkServer = new CheckSumServer(12036);
107 this.checkServer.ServerListener(); 108 this.checkServer.ServerListener();
108 this.commsManager = new CommunicationsLocal(); 109 sandboxCommunications = new CommunicationsLocal();
110 this.commsManager = sandboxCommunications;
109 } 111 }
110 else 112 else
111 { 113 {
@@ -132,7 +134,7 @@ namespace OpenSim
132 { 134 {
133 loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, false); 135 loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, false);
134 loginServer.Startup(); 136 loginServer.Startup();
135 loginServer.SetSessionHandler(((CommunicationsLocal)this.commsManager).SandManager.AddNewSession); 137 loginServer.SetSessionHandler(sandboxCommunications.SandBoxManager.AddNewSession);
136 //sandbox mode with loginserver not using accounts 138 //sandbox mode with loginserver not using accounts
137 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); 139 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
138 } 140 }
diff --git a/Prebuild/Prebuild.build b/Prebuild/Prebuild.build
index c6c4660..395fb31 100644
--- a/Prebuild/Prebuild.build
+++ b/Prebuild/Prebuild.build
@@ -12,6 +12,13 @@
12 <property name="build.debug" value="true" /> 12 <property name="build.debug" value="true" />
13 </target> 13 </target>
14 14
15 <property name="project.config" value="Release" />
16
17 <target name="Release" description="">
18 <property name="project.config" value="Release" />
19 <property name="build.debug" value="false" />
20 </target>
21
15 <target name="net-1.1" description="Sets framework to .NET 1.1"> 22 <target name="net-1.1" description="Sets framework to .NET 1.1">
16 <property name="nant.settings.currentframework" value="net-1.1" /> 23 <property name="nant.settings.currentframework" value="net-1.1" />
17 </target> 24 </target>
diff --git a/Prebuild/Prebuild.sln b/Prebuild/Prebuild.sln
index 440c8ba..449896b 100644
--- a/Prebuild/Prebuild.sln
+++ b/Prebuild/Prebuild.sln
@@ -5,10 +5,13 @@ EndProject
5Global 5Global
6 GlobalSection(SolutionConfigurationPlatforms) = preSolution 6 GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 Debug|Any CPU = Debug|Any CPU 7 Debug|Any CPU = Debug|Any CPU
8 Release|Any CPU = Release|Any CPU
8 EndGlobalSection 9 EndGlobalSection
9 GlobalSection(ProjectConfigurationPlatforms) = postSolution 10 GlobalSection(ProjectConfigurationPlatforms) = postSolution
10 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 11 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
11 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU 12 {92E80C1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
13 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
14 {92E80C1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
12 EndGlobalSection 15 EndGlobalSection
13 GlobalSection(SolutionProperties) = preSolution 16 GlobalSection(SolutionProperties) = preSolution
14 HideSolutionNode = FALSE 17 HideSolutionNode = FALSE
diff --git a/bin/TerrainDatafiles/Alien/HOWTO.txt b/bin/TerrainDatafiles/Alien/HOWTO.txt
new file mode 100644
index 0000000..00a65d7
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/HOWTO.txt
@@ -0,0 +1,19 @@
1Use the "terrain load" command to import these datafiles.
2They are stored as Float-32 arrays, use the F32 import type.
3
4These files are formatted on a scale of 0 to 1, they are designed for a range of 0..58.81
5use the 'multiply' command to multiply them by 58.81 to achieve correct height values.
6
7Example ------------------
8Region# : terrain load f32 c:\opensim\datafiles\output_x0_y0.r32
9Region# : terrain multiply 58.81
10
11
12
13 <AdamZaius> 0,0 - 1,0 - 2,0
14 <AdamZaius> 0,1 - 1,1 - 2,1
15 <AdamZaius> 0,2 - 1,2, 2,2
16
17
18for a 3x3 area on the grid
19
diff --git a/bin/TerrainDatafiles/Alien/alienworld.bmp b/bin/TerrainDatafiles/Alien/alienworld.bmp
new file mode 100644
index 0000000..0e2405e
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_0_0.bmp b/bin/TerrainDatafiles/Alien/alienworld_0_0.bmp
new file mode 100644
index 0000000..0a3afc0
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_0_0.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_0_0.r32 b/bin/TerrainDatafiles/Alien/alienworld_0_0.r32
new file mode 100644
index 0000000..299dc8c
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_0_0.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_0_1.bmp b/bin/TerrainDatafiles/Alien/alienworld_0_1.bmp
new file mode 100644
index 0000000..ec3b5d2
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_0_1.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_0_1.r32 b/bin/TerrainDatafiles/Alien/alienworld_0_1.r32
new file mode 100644
index 0000000..0dd41fc
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_0_1.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_0_2.bmp b/bin/TerrainDatafiles/Alien/alienworld_0_2.bmp
new file mode 100644
index 0000000..ce341e5
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_0_2.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_0_2.r32 b/bin/TerrainDatafiles/Alien/alienworld_0_2.r32
new file mode 100644
index 0000000..28df00a
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_0_2.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_1_0.bmp b/bin/TerrainDatafiles/Alien/alienworld_1_0.bmp
new file mode 100644
index 0000000..7fb3d96
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_1_0.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_1_0.r32 b/bin/TerrainDatafiles/Alien/alienworld_1_0.r32
new file mode 100644
index 0000000..99d5072
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_1_0.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_1_1.bmp b/bin/TerrainDatafiles/Alien/alienworld_1_1.bmp
new file mode 100644
index 0000000..bd5d31a
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_1_1.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_1_1.r32 b/bin/TerrainDatafiles/Alien/alienworld_1_1.r32
new file mode 100644
index 0000000..fdb3acf
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_1_1.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_1_2.bmp b/bin/TerrainDatafiles/Alien/alienworld_1_2.bmp
new file mode 100644
index 0000000..a5a719d
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_1_2.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_1_2.r32 b/bin/TerrainDatafiles/Alien/alienworld_1_2.r32
new file mode 100644
index 0000000..4e0155b
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_1_2.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_2_0.bmp b/bin/TerrainDatafiles/Alien/alienworld_2_0.bmp
new file mode 100644
index 0000000..a5c6792
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_2_0.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_2_0.r32 b/bin/TerrainDatafiles/Alien/alienworld_2_0.r32
new file mode 100644
index 0000000..0c12470
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_2_0.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_2_1.bmp b/bin/TerrainDatafiles/Alien/alienworld_2_1.bmp
new file mode 100644
index 0000000..e1f6376
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_2_1.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_2_1.r32 b/bin/TerrainDatafiles/Alien/alienworld_2_1.r32
new file mode 100644
index 0000000..96534b8
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_2_1.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_2_2.bmp b/bin/TerrainDatafiles/Alien/alienworld_2_2.bmp
new file mode 100644
index 0000000..eabdd93
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_2_2.bmp
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_2_2.r32 b/bin/TerrainDatafiles/Alien/alienworld_2_2.r32
new file mode 100644
index 0000000..20724c3
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_2_2.r32
Binary files differ
diff --git a/bin/TerrainDatafiles/Alien/alienworld_gray.bmp b/bin/TerrainDatafiles/Alien/alienworld_gray.bmp
new file mode 100644
index 0000000..9cc3699
--- /dev/null
+++ b/bin/TerrainDatafiles/Alien/alienworld_gray.bmp
Binary files differ