**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.
This commit is contained in:
Adam Frisby
2008-03-30 09:03:38 +00:00
parent fd2caf5f16
commit fadd19f314
18 changed files with 691 additions and 63 deletions

View File

@@ -41,6 +41,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
throw new NotImplementedException();
}
public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h)
{
throw new NotImplementedException();
}
public override string ToString()
{
return "JPEG";
}
private Bitmap CreateBitmapFromMap(ITerrainChannel map)
{
Bitmap gradientmapLd = new Bitmap("defaultstripe.png");

View File

@@ -58,6 +58,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
return retval;
}
public override string ToString()
{
return "LL/SL RAW";
}
public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h)
{
throw new NotImplementedException();
}
public void SaveFile(string filename, ITerrainChannel map)
{
FileInfo file = new FileInfo(filename);

View File

@@ -57,6 +57,43 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
return retval;
}
public override string ToString()
{
return "RAW32";
}
public ITerrainChannel LoadFile(string filename, int fileStartX, int fileStartY, int fileWidth, int fileHeight, int sectionWidth, int sectionHeight)
{
TerrainChannel retval = new TerrainChannel(sectionWidth, sectionHeight);
FileInfo file = new FileInfo(filename);
FileStream s = file.Open(FileMode.Open, FileAccess.Read);
BinaryReader bs = new BinaryReader(s);
// Advance to our section of the file
if (fileStartY * sectionHeight > 0)
bs.ReadBytes(fileStartY * sectionHeight);
int x, y;
for (y = 0; y < retval.Height; y++)
{
// Advance the stream if we aren't at the start of the section in the file
if (fileStartX * sectionWidth > 0)
bs.ReadBytes(fileStartX * sectionHeight);
for (x = 0; x < retval.Width; x++)
{
// Read a strip and continue
retval[x, y] = bs.ReadSingle();
}
}
bs.Close();
s.Close();
return retval;
}
public void SaveFile(string filename, ITerrainChannel map)
{
FileInfo file = new FileInfo(filename);

View File

@@ -107,6 +107,16 @@ namespace OpenSim.Region.Environment.Modules.Terrain.FileLoaders
throw new NotImplementedException();
}
public override string ToString()
{
return "Terragen";
}
public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h)
{
throw new NotImplementedException();
}
#endregion
}
}