aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-03-03 08:35:59 +0000
committerAdam Frisby2008-03-03 08:35:59 +0000
commitc5d1f87cd202663f2f26ca90a973d9763070dda3 (patch)
treeb1941867d13d1d3b29b46483e6b58cba536c72ca /OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
parent* Applying Ahzz's profile patch. Thanks Ahzz! (diff)
downloadopensim-SC-c5d1f87cd202663f2f26ca90a973d9763070dda3.zip
opensim-SC-c5d1f87cd202663f2f26ca90a973d9763070dda3.tar.gz
opensim-SC-c5d1f87cd202663f2f26ca90a973d9763070dda3.tar.bz2
opensim-SC-c5d1f87cd202663f2f26ca90a973d9763070dda3.tar.xz
* Removed and sorted using clauses in a number of files.
* Cleaned up ITerrainChannel * Implemented Raise, Lower, Smooth, Flatten, Noise Terrain Paint Brushes * Implemented Raise, Lower, Smooth, Flatten, Noise Terrain Fill Brushes * Implemented Export functionality for RAW32 terrain loader * Implemented Import/Export for SLRAW terrain loader * Implemented Export for JPEG terrain loader
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs50
1 files changed, 44 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
index bf716c5..d69d62a 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
@@ -1,8 +1,32 @@
1using System; 1/*
2using System.Collections.Generic; 2* Copyright (c) Contributors, http://opensimulator.org/
3using System.Text; 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
4using System.IO; 29using System.IO;
5using OpenSim.Region.Environment.Modules.Terrain;
6using OpenSim.Region.Environment.Interfaces; 30using OpenSim.Region.Environment.Interfaces;
7 31
8namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders 32namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
@@ -33,9 +57,23 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
33 return retval; 57 return retval;
34 } 58 }
35 59
36 public void SaveFile(string filename) 60 public void SaveFile(string filename, ITerrainChannel map)
37 { 61 {
38 throw new NotImplementedException(); 62 FileInfo file = new FileInfo(filename);
63 FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write);
64 BinaryWriter bs = new BinaryWriter(s);
65
66 int x, y;
67 for (y = 0; y < h; y++)
68 {
69 for (x = 0; x < w; x++)
70 {
71 bs.Write((float)map[x, y]);
72 }
73 }
74
75 bs.Close();
76 s.Close();
39 } 77 }
40 78
41 #endregion 79 #endregion