add to thread

master
Christopher Latza 2020-06-10 18:03:33 +02:00
parent 7737270894
commit a1ca6409dd
1 changed files with 17 additions and 4 deletions

View File

@ -7,11 +7,13 @@ using OpenSim.Region.Framework.Scenes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Timers;
[assembly: Addin("BasicPathFindingModule", "0.1")]
@ -131,26 +133,37 @@ namespace OpenSim.Modules.PathFinding
return false;
}
[ScriptInvocation]
public string osCreateNewPathFindingScene(UUID hostID, UUID scriptID)
private void createTestImage()
{
Bitmap _map = new Bitmap((int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY);
for (int X = 0; X <= m_scene.RegionInfo.RegionSizeX; X++)
{
m_log.Info("X: " + X);
for (int Y = 0; Y <= m_scene.RegionInfo.RegionSizeY; Y++)
{
m_log.Info("Y: " + Y);
_map.SetPixel(X, Y, Color.Green);
float baseheight = (float)m_scene.Heightmap[X, Y];
if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight)
_map.SetPixel(X, Y, Color.Red);
//if (checkIsPositionBlockedByObjekts(new LSL_Vector(X, Y, 0)) == true)
//_map.SetPixel(X, Y, Color.Yellow);
//_map.SetPixel(X, Y, Color.Yellow);
}
}
_map.Save("debug.png");
_map.Save("debug.png", ImageFormat.Png);
}
[ScriptInvocation]
public string osCreateNewPathFindingScene(UUID hostID, UUID scriptID)
{
(new Thread(delegate () { createTestImage(); })).Start();
return "";
}