terrain save-tile extensions Signed-off-by: Garmin Kawaguichi <garmin.kawaguichi@magalaxie.com>
Signed-off-by: Melanie <melanie@t-data.com>0.7.4.1
parent
e480e25d8b
commit
9a9923405a
|
@ -72,5 +72,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
return "BMP";
|
return "BMP";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public override bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,5 +57,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
return "GIF";
|
return "GIF";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public override bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,6 +177,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
return "SYS.DRAWING";
|
return "SYS.DRAWING";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public virtual bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Protected method, generates a grayscale bitmap
|
/// Protected method, generates a grayscale bitmap
|
||||||
/// image from a specified terrain channel.
|
/// image from a specified terrain channel.
|
||||||
|
|
|
@ -91,6 +91,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
return "JPEG";
|
return "JPEG";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private static Bitmap CreateBitmapFromMap(ITerrainChannel map)
|
private static Bitmap CreateBitmapFromMap(ITerrainChannel map)
|
||||||
{
|
{
|
||||||
Bitmap gradientmapLd = new Bitmap("defaultstripe.png");
|
Bitmap gradientmapLd = new Bitmap("defaultstripe.png");
|
||||||
|
|
|
@ -254,5 +254,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
return "LL/SL RAW";
|
return "LL/SL RAW";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,5 +57,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
return "PNG";
|
return "PNG";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public override bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,5 +173,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
return "RAW32";
|
return "RAW32";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,5 +57,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
{
|
{
|
||||||
return "TIFF";
|
return "TIFF";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,6 +323,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||||
return "Terragen";
|
return "Terragen";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns true if this extension is supported for terrain save-tile
|
||||||
|
public bool SupportsTileSave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// terragen SCAL floats need to be written intel ordered regardless of
|
/// terragen SCAL floats need to be written intel ordered regardless of
|
||||||
/// big or little endian system
|
/// big or little endian system
|
||||||
|
|
|
@ -32,6 +32,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
{
|
{
|
||||||
public interface ITerrainLoader
|
public interface ITerrainLoader
|
||||||
{
|
{
|
||||||
|
// Returns true if that extension can be used for terrain save-tile
|
||||||
|
// (Look into each file in Region.CoreModules.World.Terrain.FileLoaders)
|
||||||
|
bool SupportsTileSave();
|
||||||
|
|
||||||
string FileExtension { get; }
|
string FileExtension { get; }
|
||||||
ITerrainChannel LoadFile(string filename);
|
ITerrainChannel LoadFile(string filename);
|
||||||
ITerrainChannel LoadFile(string filename, int fileStartX, int fileStartY, int fileWidth, int fileHeight, int sectionWidth, int sectionHeight);
|
ITerrainChannel LoadFile(string filename, int fileStartX, int fileStartY, int fileWidth, int fileHeight, int sectionWidth, int sectionHeight);
|
||||||
|
|
|
@ -93,6 +93,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private string m_supportedFileExtensions = "";
|
private string m_supportedFileExtensions = "";
|
||||||
|
|
||||||
|
//For terrain save-tile file extensions
|
||||||
|
private string m_supportFileExtensionsForTileSave = "";
|
||||||
|
|
||||||
#region ICommandableModule Members
|
#region ICommandableModule Members
|
||||||
|
|
||||||
public ICommander CommandInterface
|
public ICommander CommandInterface
|
||||||
|
@ -148,11 +151,20 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
|
|
||||||
// Generate user-readable extensions list
|
// Generate user-readable extensions list
|
||||||
string supportedFilesSeparator = "";
|
string supportedFilesSeparator = "";
|
||||||
|
string supportedFilesSeparatorForTileSave = "";
|
||||||
|
|
||||||
|
m_supportFileExtensionsForTileSave = "";
|
||||||
foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
|
foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
|
||||||
{
|
{
|
||||||
m_supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")";
|
m_supportedFileExtensions += supportedFilesSeparator + loader.Key + " (" + loader.Value + ")";
|
||||||
supportedFilesSeparator = ", ";
|
supportedFilesSeparator = ", ";
|
||||||
|
|
||||||
|
//For terrain save-tile file extensions
|
||||||
|
if (loader.Value.SupportsTileSave() == true)
|
||||||
|
{
|
||||||
|
m_supportFileExtensionsForTileSave += supportedFilesSeparatorForTileSave + loader.Key + " (" + loader.Value + ")";
|
||||||
|
supportedFilesSeparatorForTileSave = ", ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,7 +601,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
// this region is included in the tile request
|
// this region is included in the tile request
|
||||||
foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
|
foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
|
||||||
{
|
{
|
||||||
if (filename.EndsWith(loader.Key))
|
if (filename.EndsWith(loader.Key) && loader.Value.SupportsTileSave())
|
||||||
{
|
{
|
||||||
lock (m_scene)
|
lock (m_scene)
|
||||||
{
|
{
|
||||||
|
@ -610,7 +622,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
|
|
||||||
MainConsole.Instance.OutputFormat(
|
MainConsole.Instance.OutputFormat(
|
||||||
"ERROR: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
|
"ERROR: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
|
||||||
m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
|
m_scene.RegionInfo.RegionName, filename, m_supportFileExtensionsForTileSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1192,7 +1204,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||||
new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file.");
|
new Command("save-tile", CommandIntentions.COMMAND_HAZARDOUS, InterfaceSaveTileFile, "Saves the current heightmap to the larger file.");
|
||||||
saveToTileCommand.AddArgument("filename",
|
saveToTileCommand.AddArgument("filename",
|
||||||
"The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " +
|
"The file you wish to save to, the file extension determines the loader to be used. Supported extensions include: " +
|
||||||
m_supportedFileExtensions, "String");
|
m_supportFileExtensionsForTileSave, "String");
|
||||||
saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer");
|
saveToTileCommand.AddArgument("file width", "The width of the file in tiles", "Integer");
|
||||||
saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
|
saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer");
|
||||||
saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
|
saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file",
|
||||||
|
|
Loading…
Reference in New Issue