aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-02-27 09:35:48 +0000
committerAdam Frisby2008-02-27 09:35:48 +0000
commit906404a14a9552a784c243ec83dbc2424cdd255b (patch)
treec4c5e124654e5b3898f48371a12fb80e88ac57b8 /OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
parentBackported MACOSX OS identifier into Prebuild. (diff)
downloadopensim-SC-906404a14a9552a784c243ec83dbc2424cdd255b.zip
opensim-SC-906404a14a9552a784c243ec83dbc2424cdd255b.tar.gz
opensim-SC-906404a14a9552a784c243ec83dbc2424cdd255b.tar.bz2
opensim-SC-906404a14a9552a784c243ec83dbc2424cdd255b.tar.xz
* Committing file loaders - forgot yesterday.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
new file mode 100644
index 0000000..d0f5d07
--- /dev/null
+++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs
@@ -0,0 +1,43 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.IO;
5using OpenSim.Region.Environment.Modules.Terrain;
6using OpenSim.Region.Environment.Interfaces;
7
8namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
9{
10 public class RAW32 : ITerrainLoader
11 {
12 #region ITerrainLoader Members
13
14 public ITerrainChannel LoadFile(string filename)
15 {
16 TerrainChannel retval = new TerrainChannel();
17
18 FileInfo file = new FileInfo(filename);
19 FileStream s = file.Open(FileMode.Open, FileAccess.Read);
20 BinaryReader bs = new BinaryReader(s);
21 int x, y;
22 for (y = 0; y < retval.Height; y++)
23 {
24 for (x = 0; x < retval.Width; x++)
25 {
26 retval[x, y] = bs.ReadSingle();
27 }
28 }
29
30 bs.Close();
31 s.Close();
32
33 return retval;
34 }
35
36 public void SaveFile(string filename)
37 {
38 throw new NotImplementedException();
39 }
40
41 #endregion
42 }
43}