aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Terrain/FileLoaders
diff options
context:
space:
mode:
authorAdam Frisby2008-03-30 09:03:38 +0000
committerAdam Frisby2008-03-30 09:03:38 +0000
commitfadd19f3140107d7c09e7a82a97dfb490146ccb9 (patch)
tree3ce4581ef1af79d451f0b24ce50128f09482f386 /OpenSim/Region/Environment/Modules/Terrain/FileLoaders
parentThis update has good news and bad news, first the bad. (diff)
downloadopensim-SC_OLD-fadd19f3140107d7c09e7a82a97dfb490146ccb9.zip
opensim-SC_OLD-fadd19f3140107d7c09e7a82a97dfb490146ccb9.tar.gz
opensim-SC_OLD-fadd19f3140107d7c09e7a82a97dfb490146ccb9.tar.bz2
opensim-SC_OLD-fadd19f3140107d7c09e7a82a97dfb490146ccb9.tar.xz
**Big ass update warning**
* Renamed plugin console message, to send a message to a plugin, use either "plugin <message>", or any unrecognised message will be sent ("plugin" sends explicitly) This replaces the old "script <message>". * Terrain commands - "terrain <command>" now works again. "Script terrain <command>" does not. Many of the commands have now been reimplemented, eg load-tile. However some have new syntax. * New console command handler, you can now use things like "terrain help" or "terrain save help". See TerrainModule.cs for an example of how to use the new "Commander" class. * Commander class - advanced processing of console input and also enables a script API to be generated from registered console commands.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Terrain/FileLoaders')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FileLoaders/JPEG.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FileLoaders/LLRAW.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FileLoaders/RAW32.cs37
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/FileLoaders/Terragen.cs10
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}