From 88b273bc719b5d462069bdfce5782c5dcaf97596 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 13 Feb 2009 16:43:20 +0000 Subject: * refactor: Move export map function to world map module from scene --- OpenSim/Region/Framework/Scenes/Scene.cs | 54 +------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ffe0b81..7cce3b6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -851,15 +851,14 @@ namespace OpenSim.Region.Framework.Scenes UpdateEvents(); if (m_frame % m_update_backup == 0) - { UpdateStorageBackup(); - } if (m_frame % m_update_terrain == 0) UpdateTerrain(); if (m_frame % m_update_land == 0) UpdateLand(); + otherMS = Environment.TickCount - otherMS; // if (m_frame%m_update_avatars == 0) // UpdateInWorldTime(); @@ -1052,57 +1051,6 @@ namespace OpenSim.Region.Framework.Scenes #region Load Terrain - public void ExportWorldMap(string fileName) - { - List mapBlocks = - m_sceneGridService.RequestNeighbourMapBlocks((int)(RegionInfo.RegionLocX - 9), - (int)(RegionInfo.RegionLocY - 9), - (int)(RegionInfo.RegionLocX + 9), - (int)(RegionInfo.RegionLocY + 9)); - List textures = new List(); - List bitImages = new List(); - - foreach (MapBlockData mapBlock in mapBlocks) - { - AssetBase texAsset = AssetCache.GetAsset(mapBlock.MapImageId, true); - - if (texAsset != null) - { - textures.Add(texAsset); - } - else - { - texAsset = AssetCache.GetAsset(mapBlock.MapImageId, true); - if (texAsset != null) - { - textures.Add(texAsset); - } - } - } - - foreach (AssetBase asset in textures) - { - ManagedImage managedImage; - Image image; - - if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) - bitImages.Add(image); - } - - Bitmap mapTexture = new Bitmap(2560, 2560); - Graphics g = Graphics.FromImage(mapTexture); - SolidBrush sea = new SolidBrush(Color.DarkBlue); - g.FillRectangle(sea, 0, 0, 2560, 2560); - - for (int i = 0; i < mapBlocks.Count; i++) - { - ushort x = (ushort)((mapBlocks[i].X - RegionInfo.RegionLocX) + 10); - ushort y = (ushort)((mapBlocks[i].Y - RegionInfo.RegionLocY) + 10); - g.DrawImage(bitImages[i], (x * 128), (y * 128), 128, 128); - } - mapTexture.Save(fileName, ImageFormat.Jpeg); - } - public void SaveTerrain() { m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); -- cgit v1.1