set debug pixel

master
Christopher Latza 2020-06-10 22:04:56 +02:00
parent ab24cbc073
commit 4b787ca0e5
1 changed files with 5 additions and 5 deletions

View File

@ -2,6 +2,7 @@
using Mono.Addins; using Mono.Addins;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Region.CoreModules.World.LegacyMap;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.ScriptEngine.Interfaces; using OpenSim.Region.ScriptEngine.Interfaces;
@ -138,11 +139,14 @@ namespace OpenSim.Modules.PathFinding
{ {
Bitmap _map = new Bitmap((int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY); Bitmap _map = new Bitmap((int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY);
_map.SetPixel(0, 0, Color.White);
for (int X = 0; X < m_scene.RegionInfo.RegionSizeX; X++) for (int X = 0; X < m_scene.RegionInfo.RegionSizeX; X++)
{ {
for (int Y = 0; Y < m_scene.RegionInfo.RegionSizeY; Y++) for (int Y = 0; Y < m_scene.RegionInfo.RegionSizeY; Y++)
{ {
float baseheight = (float)m_scene.Heightmap[Y, X]; float baseheight = (float)m_scene.Heightmap[X, Y];
if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight) if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight)
_map.SetPixel(X, Y, Color.Blue); _map.SetPixel(X, Y, Color.Blue);
@ -152,13 +156,9 @@ namespace OpenSim.Modules.PathFinding
} }
} }
PathFindingSceneGenerator.DrawObjectVolume(m_scene, ref _map); PathFindingSceneGenerator.DrawObjectVolume(m_scene, ref _map);
_map.Save(imageName + ".png", ImageFormat.Png); _map.Save(imageName + ".png", ImageFormat.Png);
return;
} }
[ScriptInvocation] [ScriptInvocation]