diff options
author | TomTheDragon | 2017-11-05 17:33:13 -0500 |
---|---|---|
committer | UbitUmarov | 2017-11-13 20:43:16 +0000 |
commit | 98f90f4eed231724f1105f19d9bc29cb23b3e5bf (patch) | |
tree | 3842b486087b5640256bbd15ac23a49ff9aabea2 /OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs | |
parent | mantis 8253: don't let attachments delete remove controls from viewers on cro... (diff) | |
download | opensim-SC_OLD-98f90f4eed231724f1105f19d9bc29cb23b3e5bf.zip opensim-SC_OLD-98f90f4eed231724f1105f19d9bc29cb23b3e5bf.tar.gz opensim-SC_OLD-98f90f4eed231724f1105f19d9bc29cb23b3e5bf.tar.bz2 opensim-SC_OLD-98f90f4eed231724f1105f19d9bc29cb23b3e5bf.tar.xz |
Changing map tile colors This change also allows setting the water color, as well as the 4 colors for textured map tiles.
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs index 4b3ee18..c71f5c0 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs | |||
@@ -130,21 +130,19 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
130 | // some hardcoded terrain UUIDs that work with SL 1.20 (the four default textures and "Blank"). | 130 | // some hardcoded terrain UUIDs that work with SL 1.20 (the four default textures and "Blank"). |
131 | // The color-values were choosen because they "look right" (at least to me) ;-) | 131 | // The color-values were choosen because they "look right" (at least to me) ;-) |
132 | private static readonly UUID defaultTerrainTexture1 = new UUID("0bc58228-74a0-7e83-89bc-5c23464bcec5"); | 132 | private static readonly UUID defaultTerrainTexture1 = new UUID("0bc58228-74a0-7e83-89bc-5c23464bcec5"); |
133 | private static readonly Color defaultColor1 = Color.FromArgb(165, 137, 118); | ||
134 | private static readonly UUID defaultTerrainTexture2 = new UUID("63338ede-0037-c4fd-855b-015d77112fc8"); | 133 | private static readonly UUID defaultTerrainTexture2 = new UUID("63338ede-0037-c4fd-855b-015d77112fc8"); |
135 | private static readonly Color defaultColor2 = Color.FromArgb(69, 89, 49); | ||
136 | private static readonly UUID defaultTerrainTexture3 = new UUID("303cd381-8560-7579-23f1-f0a880799740"); | 134 | private static readonly UUID defaultTerrainTexture3 = new UUID("303cd381-8560-7579-23f1-f0a880799740"); |
137 | private static readonly Color defaultColor3 = Color.FromArgb(162, 154, 141); | ||
138 | private static readonly UUID defaultTerrainTexture4 = new UUID("53a2f406-4895-1d13-d541-d2e3b86bc19c"); | 135 | private static readonly UUID defaultTerrainTexture4 = new UUID("53a2f406-4895-1d13-d541-d2e3b86bc19c"); |
139 | private static readonly Color defaultColor4 = Color.FromArgb(200, 200, 200); | ||
140 | |||
141 | private static readonly Color WATER_COLOR = Color.FromArgb(29, 71, 95); | ||
142 | 136 | ||
143 | #endregion | 137 | #endregion |
144 | 138 | ||
145 | |||
146 | private Scene m_scene; | 139 | private Scene m_scene; |
147 | // private IConfigSource m_config; // not used currently | 140 | private IConfigSource m_config; |
141 | private Color m_color_water; | ||
142 | private Color m_color_1; | ||
143 | private Color m_color_2; | ||
144 | private Color m_color_3; | ||
145 | private Color m_color_4; | ||
148 | 146 | ||
149 | // mapping from texture UUIDs to averaged color. This will contain 5-9 values, in general; new values are only | 147 | // mapping from texture UUIDs to averaged color. This will contain 5-9 values, in general; new values are only |
150 | // added when the terrain textures are changed in the estate dialog and a new map is generated (and will stay in | 148 | // added when the terrain textures are changed in the estate dialog and a new map is generated (and will stay in |
@@ -156,12 +154,21 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
156 | public void Initialise(Scene scene, IConfigSource source) | 154 | public void Initialise(Scene scene, IConfigSource source) |
157 | { | 155 | { |
158 | m_scene = scene; | 156 | m_scene = scene; |
159 | // m_config = source; // not used currently | 157 | m_config = source; |
158 | |||
159 | string[] configSections = new string[] { "Map", "Startup" }; | ||
160 | |||
161 | m_color_water = System.Drawing.ColorTranslator.FromHtml(Util.GetConfigVarFromSections<string>(m_config, "MapColorWater", configSections, "#1D475F")); | ||
162 | m_color_1 = System.Drawing.ColorTranslator.FromHtml(Util.GetConfigVarFromSections<string>(m_config, "MapColor1", configSections, "#A58976")); | ||
163 | m_color_2 = System.Drawing.ColorTranslator.FromHtml(Util.GetConfigVarFromSections<string>(m_config, "MapColor2", configSections, "#455931")); | ||
164 | m_color_3 = System.Drawing.ColorTranslator.FromHtml(Util.GetConfigVarFromSections<string>(m_config, "MapColor3", configSections, "#A29A8D")); | ||
165 | m_color_4 = System.Drawing.ColorTranslator.FromHtml(Util.GetConfigVarFromSections<string>(m_config, "MapColor4", configSections, "#C8C8C8")); | ||
166 | |||
160 | m_mapping = new Dictionary<UUID,Color>(); | 167 | m_mapping = new Dictionary<UUID,Color>(); |
161 | m_mapping.Add(defaultTerrainTexture1, defaultColor1); | 168 | m_mapping.Add(defaultTerrainTexture1, m_color_1); |
162 | m_mapping.Add(defaultTerrainTexture2, defaultColor2); | 169 | m_mapping.Add(defaultTerrainTexture2, m_color_2); |
163 | m_mapping.Add(defaultTerrainTexture3, defaultColor3); | 170 | m_mapping.Add(defaultTerrainTexture3, m_color_3); |
164 | m_mapping.Add(defaultTerrainTexture4, defaultColor4); | 171 | m_mapping.Add(defaultTerrainTexture4, m_color_4); |
165 | m_mapping.Add(Util.BLANK_TEXTURE_UUID, Color.White); | 172 | m_mapping.Add(Util.BLANK_TEXTURE_UUID, Color.White); |
166 | } | 173 | } |
167 | 174 | ||
@@ -298,10 +305,10 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
298 | RegionSettings settings = m_scene.RegionInfo.RegionSettings; | 305 | RegionSettings settings = m_scene.RegionInfo.RegionSettings; |
299 | 306 | ||
300 | // the four terrain colors as HSVs for interpolation | 307 | // the four terrain colors as HSVs for interpolation |
301 | HSV hsv1 = new HSV(computeAverageColor(settings.TerrainTexture1, defaultColor1)); | 308 | HSV hsv1 = new HSV(computeAverageColor(settings.TerrainTexture1, m_color_1)); |
302 | HSV hsv2 = new HSV(computeAverageColor(settings.TerrainTexture2, defaultColor2)); | 309 | HSV hsv2 = new HSV(computeAverageColor(settings.TerrainTexture2, m_color_2)); |
303 | HSV hsv3 = new HSV(computeAverageColor(settings.TerrainTexture3, defaultColor3)); | 310 | HSV hsv3 = new HSV(computeAverageColor(settings.TerrainTexture3, m_color_3)); |
304 | HSV hsv4 = new HSV(computeAverageColor(settings.TerrainTexture4, defaultColor4)); | 311 | HSV hsv4 = new HSV(computeAverageColor(settings.TerrainTexture4, m_color_4)); |
305 | 312 | ||
306 | float levelNElow = (float)settings.Elevation1NE; | 313 | float levelNElow = (float)settings.Elevation1NE; |
307 | float levelNEhigh = (float)settings.Elevation2NE; | 314 | float levelNEhigh = (float)settings.Elevation2NE; |
@@ -417,7 +424,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
417 | 424 | ||
418 | heightvalue = 100f - (heightvalue * 100f) / 19f; // 0 - 19 => 100 - 0 | 425 | heightvalue = 100f - (heightvalue * 100f) / 19f; // 0 - 19 => 100 - 0 |
419 | 426 | ||
420 | mapbmp.SetPixel(x, yr, WATER_COLOR); | 427 | mapbmp.SetPixel(x, yr, m_color_water); |
421 | } | 428 | } |
422 | } | 429 | } |
423 | } | 430 | } |