added console
This commit is contained in:
parent
bb8e75a2f5
commit
dab5735c80
3 changed files with 45 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System.Diagnostics;
|
||||
using Poe2Trade.Core;
|
||||
using Poe2Trade.Game;
|
||||
using Serilog;
|
||||
|
|
@ -174,15 +175,30 @@ public class NavigationExecutor : IDisposable
|
|||
/// </summary>
|
||||
public byte[]? ProcessFrame(MinimapDebugStage stage = MinimapDebugStage.WorldMap)
|
||||
{
|
||||
var sw = Stopwatch.StartNew();
|
||||
|
||||
var captureStart = sw.Elapsed.TotalMilliseconds;
|
||||
using var frame = _capture.CaptureFrame();
|
||||
var captureMs = sw.Elapsed.TotalMilliseconds - captureStart;
|
||||
|
||||
if (frame == null) return null;
|
||||
|
||||
var stitchStart = sw.Elapsed.TotalMilliseconds;
|
||||
var pos = _worldMap.MatchAndStitch(frame.ClassifiedMat, frame.WallMask);
|
||||
var stitchMs = sw.Elapsed.TotalMilliseconds - stitchStart;
|
||||
|
||||
var renderStart = sw.Elapsed.TotalMilliseconds;
|
||||
byte[]? result;
|
||||
if (stage == MinimapDebugStage.WorldMap)
|
||||
return _worldMap.GetViewportSnapshot(pos);
|
||||
result = _worldMap.GetViewportSnapshot(pos);
|
||||
else
|
||||
result = _capture.CaptureStage(stage);
|
||||
var renderMs = sw.Elapsed.TotalMilliseconds - renderStart;
|
||||
|
||||
return _capture.CaptureStage(stage);
|
||||
Log.Information("ProcessFrame: capture={Capture:F1}ms stitch={Stitch:F1}ms render={Render:F1}ms total={Total:F1}ms",
|
||||
captureMs, stitchMs, renderMs, sw.Elapsed.TotalMilliseconds);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void SaveDebugCapture() => _capture.SaveDebugCapture();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue