diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs b/OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs new file mode 100644 index 0000000..2076490 --- /dev/null +++ b/OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Drawing; | ||
4 | using libsecondlife; | ||
5 | using Nini.Config; | ||
6 | using OpenSim.Framework; | ||
7 | using OpenSim.Region.Environment.Interfaces; | ||
8 | using OpenSim.Region.Environment.Scenes; | ||
9 | using OpenSim.Region.Environment.Modules.ModuleFramework; | ||
10 | using OpenSim.Region.Environment.Modules.Terrain; | ||
11 | |||
12 | namespace OpenSim.Region.Environment.Modules.ExportSerialiser | ||
13 | { | ||
14 | class SerialiseTerrain : IFileSerialiser | ||
15 | { | ||
16 | #region IFileSerialiser Members | ||
17 | |||
18 | public string WriteToFile(Scene scene, string dir) | ||
19 | { | ||
20 | ITerrainLoader fileSystemExporter = new Terrain.FileLoaders.RAW32(); | ||
21 | string targetFileName = dir + "heightmap.r32"; | ||
22 | |||
23 | lock (scene.Heightmap) | ||
24 | { | ||
25 | fileSystemExporter.SaveFile(targetFileName, scene.Heightmap); | ||
26 | } | ||
27 | |||
28 | return "heightmap.r32"; | ||
29 | } | ||
30 | |||
31 | #endregion | ||
32 | } | ||
33 | } | ||