From 87b07c19ef3612c9f330770ea3e0eb066f062284 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 18 Nov 2007 12:04:21 +0000 Subject: Added "export-map " console command to the region server that will export a jpg image of the world map covering a 20 X 20 regions area centred on the current active region (ie the one set with change-region). While this should work in grid mode (if using the grid asset server and if my last commit did fix the world map), you might need to call the "export-map" command then wait a little while (60 seconds?) and then call it again so that you make sure the region has got all the texture assets from the asset server. --- OpenSim/Region/Environment/Scenes/Scene.cs | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 1400e60..bc4fa3c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -470,6 +470,48 @@ namespace OpenSim.Region.Environment.Scenes #region Load Terrain + public void ExportWorldMap(string fileName) + { + List mapBlocks = this.CommsManager.GridService.RequestNeighbourMapBlocks((int)(this.RegionInfo.RegionLocX - 9), (int)(this.RegionInfo.RegionLocY - 9), (int)(this.RegionInfo.RegionLocX + 9), (int)(this.RegionInfo.RegionLocY + 9)); + List textures = new List(); + List bitImages = new List(); + + foreach (MapBlockData mapBlock in mapBlocks) + { + AssetBase texAsset = this.AssetCache.GetAsset(mapBlock.MapImageId, true); + + if (texAsset != null) + { + textures.Add(texAsset); + } + else + { + texAsset = this.AssetCache.GetAsset(mapBlock.MapImageId, true); + if (texAsset != null) + { + textures.Add(texAsset); + } + } + } + + foreach(AssetBase asset in textures) + { + System.Drawing.Image image= OpenJPEGNet.OpenJPEG.DecodeToImage(asset.Data); + bitImages.Add(image); + } + + System.Drawing.Bitmap mapTexture = new System.Drawing.Bitmap(2560, 2560); + System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(mapTexture); + + for(int i =0; i /// Loads the World heightmap /// -- cgit v1.1