diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Terrain/FileLoaders')
4 files changed, 67 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs index f2bdde7..d6430cd 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs | |||
@@ -41,6 +41,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders | |||
41 | throw new NotImplementedException(); | 41 | throw new NotImplementedException(); |
42 | } | 42 | } |
43 | 43 | ||
44 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) | ||
45 | { | ||
46 | throw new NotImplementedException(); | ||
47 | } | ||
48 | |||
49 | public override string ToString() | ||
50 | { | ||
51 | return "JPEG"; | ||
52 | } | ||
53 | |||
44 | private Bitmap CreateBitmapFromMap(ITerrainChannel map) | 54 | private Bitmap CreateBitmapFromMap(ITerrainChannel map) |
45 | { | 55 | { |
46 | Bitmap gradientmapLd = new Bitmap("defaultstripe.png"); | 56 | Bitmap gradientmapLd = new Bitmap("defaultstripe.png"); |
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/LLRAW.cs index 2d7d94f..7436dc5 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/LLRAW.cs | |||
@@ -58,6 +58,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders | |||
58 | return retval; | 58 | return retval; |
59 | } | 59 | } |
60 | 60 | ||
61 | public override string ToString() | ||
62 | { | ||
63 | return "LL/SL RAW"; | ||
64 | } | ||
65 | |||
66 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) | ||
67 | { | ||
68 | throw new NotImplementedException(); | ||
69 | } | ||
70 | |||
61 | public void SaveFile(string filename, ITerrainChannel map) | 71 | public void SaveFile(string filename, ITerrainChannel map) |
62 | { | 72 | { |
63 | FileInfo file = new FileInfo(filename); | 73 | FileInfo file = new FileInfo(filename); |
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs index ba430b7..fc81376 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs | |||
@@ -57,6 +57,43 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders | |||
57 | return retval; | 57 | return retval; |
58 | } | 58 | } |
59 | 59 | ||
60 | public override string ToString() | ||
61 | { | ||
62 | return "RAW32"; | ||
63 | } | ||
64 | |||
65 | public ITerrainChannel LoadFile(string filename, int fileStartX, int fileStartY, int fileWidth, int fileHeight, int sectionWidth, int sectionHeight) | ||
66 | { | ||
67 | TerrainChannel retval = new TerrainChannel(sectionWidth, sectionHeight); | ||
68 | |||
69 | FileInfo file = new FileInfo(filename); | ||
70 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); | ||
71 | BinaryReader bs = new BinaryReader(s); | ||
72 | |||
73 | // Advance to our section of the file | ||
74 | if (fileStartY * sectionHeight > 0) | ||
75 | bs.ReadBytes(fileStartY * sectionHeight); | ||
76 | |||
77 | int x, y; | ||
78 | for (y = 0; y < retval.Height; y++) | ||
79 | { | ||
80 | // Advance the stream if we aren't at the start of the section in the file | ||
81 | if (fileStartX * sectionWidth > 0) | ||
82 | bs.ReadBytes(fileStartX * sectionHeight); | ||
83 | |||
84 | for (x = 0; x < retval.Width; x++) | ||
85 | { | ||
86 | // Read a strip and continue | ||
87 | retval[x, y] = bs.ReadSingle(); | ||
88 | } | ||
89 | } | ||
90 | |||
91 | bs.Close(); | ||
92 | s.Close(); | ||
93 | |||
94 | return retval; | ||
95 | } | ||
96 | |||
60 | public void SaveFile(string filename, ITerrainChannel map) | 97 | public void SaveFile(string filename, ITerrainChannel map) |
61 | { | 98 | { |
62 | FileInfo file = new FileInfo(filename); | 99 | FileInfo file = new FileInfo(filename); |
diff --git a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/Terragen.cs b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/Terragen.cs index e136397..6a3c354 100644 --- a/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/Terragen.cs +++ b/OpenSim/Region/Environment/Modules/Terrain/FileLoaders/Terragen.cs | |||
@@ -107,6 +107,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders | |||
107 | throw new NotImplementedException(); | 107 | throw new NotImplementedException(); |
108 | } | 108 | } |
109 | 109 | ||
110 | public override string ToString() | ||
111 | { | ||
112 | return "Terragen"; | ||
113 | } | ||
114 | |||
115 | public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) | ||
116 | { | ||
117 | throw new NotImplementedException(); | ||
118 | } | ||
119 | |||
110 | #endregion | 120 | #endregion |
111 | } | 121 | } |
112 | } | 122 | } |