aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ExportSerialiser/SerialiseTerrain.cs
blob: 0c79999a53dba49290392993892bd16b5d442159 (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
    }
}