aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs
blob: 155256b426baee01e1a5828ab3707476ac51b7fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using OpenSim.Region.Environment.Modules.Terrain;
using OpenSim.Region.Environment.Scenes;

namespace OpenSim.Region.Environment.Modules.ExportSerialiser
{
    class SerialiseTerrain : IFileSerialiser
    {
        #region IFileSerialiser Members

        public string WriteToFile(Scene scene, string dir)
        {
            ITerrainLoader fileSystemExporter = new Terrain.FileLoaders.RAW32();
            string targetFileName = dir + "heightmap.r32";

            lock (scene.Heightmap)
            {
                fileSystemExporter.SaveFile(targetFileName, scene.Heightmap);
            }

            return "heightmap.r32";
        }

        #endregion
    }
}