From 7fcffa3a3a231a77d00bf2ec1772f0914073d28f Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 29 Mar 2008 17:18:47 +0000 Subject: Re-enabled terrain texture generation for the world map. Adam can clean up/ sort it out when he gets time. Most likely doesn't really work in grid mode as the generated textures are marked as temporary and I don't think they are updated to the asset server. We have to either live with these textures being sent to the asset server, and manually clean them out from time to time or wait until there is some asset management system in place. Also currently the texture is only generated at region startup, it is not updated after terraforming. --- OpenSim/Region/Environment/Scenes/Scene.cs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index b8a4831..c07f718 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -946,6 +946,7 @@ namespace OpenSim.Region.Environment.Scenes { Heightmap = new Modules.Terrain.TerrainChannel(map); } + } catch (Exception e) { @@ -981,19 +982,23 @@ namespace OpenSim.Region.Environment.Scenes public void CreateTerrainTexture(bool temporary) { //TODOADAM: Move this to TerrainModule - /* + //create a texture asset of the terrain - byte[] data = Terrain.WriteJpegImage("defaultstripe.png"); - m_regInfo.EstateSettings.terrainImageID = LLUUID.Random(); - AssetBase asset = new AssetBase(); - asset.FullID = m_regInfo.EstateSettings.terrainImageID; - asset.Data = data; - asset.Name = "terrainImage"; - asset.Description = RegionInfo.RegionName; - asset.Type = 0; - asset.Temporary = temporary; - AssetCache.AddAsset(asset); - */ + ITerrainTemp terrain = RequestModuleInterface(); + if (terrain != null) + { + byte[] data = terrain.WriteJpegImage("defaultstripe.png"); + m_regInfo.EstateSettings.terrainImageID = LLUUID.Random(); + AssetBase asset = new AssetBase(); + asset.FullID = m_regInfo.EstateSettings.terrainImageID; + asset.Data = data; + asset.Name = "terrainImage"; + asset.Description = RegionInfo.RegionName; + asset.Type = 0; + asset.Temporary = temporary; + AssetCache.AddAsset(asset); + } + } #endregion -- cgit v1.1