From b0bae62c30323ed42a68de341998e5dc722bb199 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 26 Mar 2014 20:58:58 +0000 Subject: refactor: Actually use MaptileStaticFile in RegionInfo rather than having both a public field and a get property --- OpenSim/Framework/RegionInfo.cs | 16 ++++++---------- .../Region/CoreModules/World/LegacyMap/MapImageModule.cs | 14 ++++++++++---- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index f71ee86..2390118 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -143,7 +143,6 @@ namespace OpenSim.Framework public string RemotingAddress; public UUID ScopeID = UUID.Zero; private UUID m_maptileStaticUUID = UUID.Zero; - public string m_maptileStaticFile; public uint WorldLocX = 0; public uint WorldLocY = 0; @@ -351,10 +350,7 @@ namespace OpenSim.Framework get { return m_maptileStaticUUID; } } - public string MaptileStaticFile - { - get { return m_maptileStaticFile; } - } + public string MaptileStaticFile { get; private set; } /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) @@ -723,7 +719,7 @@ namespace OpenSim.Framework config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); } - m_maptileStaticFile = config.GetString("MaptileStaticFile", String.Empty); + MaptileStaticFile = config.GetString("MaptileStaticFile", String.Empty); allKeys.Remove("MaptileStaticFile"); #endregion @@ -853,8 +849,8 @@ namespace OpenSim.Framework if (m_maptileStaticUUID != UUID.Zero) config.Set("MaptileStaticUUID", m_maptileStaticUUID.ToString()); - if (m_maptileStaticFile != String.Empty) - config.Set("MaptileStaticFile", m_maptileStaticFile); + if (MaptileStaticFile != String.Empty) + config.Set("MaptileStaticFile", MaptileStaticFile); } public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result) @@ -966,7 +962,7 @@ namespace OpenSim.Framework "UUID of a texture to use as the map for this region", m_maptileStaticUUID.ToString(), true); configMember.addConfigurationOption("region_static_mapfile", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Filename of a texture to use as the map for this region", m_maptileStaticFile, true); + "Filename of a texture to use as the map for this region", MaptileStaticFile, true); } public void loadConfigurationOptions() @@ -1116,7 +1112,7 @@ namespace OpenSim.Framework m_maptileStaticUUID = (UUID)configuration_result; break; case "region_static_mapfile": - m_maptileStaticFile = (string)configuration_result; + MaptileStaticFile = (string)configuration_result; break; } diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index 556b11f..b00620e 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs @@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap if (generateMaptiles) { - if (String.IsNullOrEmpty(m_scene.RegionInfo.m_maptileStaticFile)) + if (String.IsNullOrEmpty(m_scene.RegionInfo.MaptileStaticFile)) { if (textureTerrain) { @@ -122,15 +122,21 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap { try { - mapbmp = new Bitmap(m_scene.RegionInfo.m_maptileStaticFile); + mapbmp = new Bitmap(m_scene.RegionInfo.MaptileStaticFile); } catch (Exception e) { - m_log.ErrorFormat("[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", m_scene.RegionInfo.m_maptileStaticFile, m_scene.Name); + m_log.ErrorFormat( + "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", + m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); mapbmp = null; } - if (mapbmp != null) m_log.DebugFormat("[MAPTILE]: Static map image texture file {0} found for {1}", m_scene.RegionInfo.m_maptileStaticFile, m_scene.Name); + + if (mapbmp != null) + m_log.DebugFormat( + "[MAPTILE]: Static map image texture file {0} found for {1}", + m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); } } else -- cgit v1.1