diff options
author | Adam Frisby | 2008-02-27 09:35:48 +0000 |
---|---|---|
committer | Adam Frisby | 2008-02-27 09:35:48 +0000 |
commit | 906404a14a9552a784c243ec83dbc2424cdd255b (patch) | |
tree | c4c5e124654e5b3898f48371a12fb80e88ac57b8 /OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs | |
parent | Backported MACOSX OS identifier into Prebuild. (diff) | |
download | opensim-SC_OLD-906404a14a9552a784c243ec83dbc2424cdd255b.zip opensim-SC_OLD-906404a14a9552a784c243ec83dbc2424cdd255b.tar.gz opensim-SC_OLD-906404a14a9552a784c243ec83dbc2424cdd255b.tar.bz2 opensim-SC_OLD-906404a14a9552a784c243ec83dbc2424cdd255b.tar.xz |
* Committing file loaders - forgot yesterday.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs | 43 |
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.IO; | ||
5 | using OpenSim.Region.Environment.Modules.Terrain; | ||
6 | using OpenSim.Region.Environment.Interfaces; | ||
7 | |||
8 | namespace 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 | } | ||