[fix time]time service now stopps properly
This commit is contained in:
@@ -177,7 +177,11 @@ namespace StgSharp.Mathematics.Graphic
|
||||
InternalYaw();
|
||||
}
|
||||
|
||||
public void SetViewRange(Radius fovRadius, Vec2 size, Vec2 offset, (float front, float back) depthRange)
|
||||
public void SetViewRange(
|
||||
Radius fovRadius,
|
||||
Vec2 size,
|
||||
Vec2 offset,
|
||||
(float front, float back) depthRange)
|
||||
{
|
||||
float
|
||||
distance = _target.GetLength(),
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace StgSharp
|
||||
{
|
||||
if (!_subscribers[i].OnSpanTick(elapsedTicks))
|
||||
{
|
||||
Console.WriteLine("removed");
|
||||
// Console.WriteLine("removed");
|
||||
_subscribers.RemoveAt(i);
|
||||
i--; // adjust index after removal
|
||||
}
|
||||
|
||||
@@ -146,15 +146,7 @@ namespace StgSharp.Common.Timing
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override bool EndsAt(long currentTick)
|
||||
{
|
||||
if (currentTick >= EndingTick)
|
||||
{
|
||||
Console.WriteLine("Ended");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override bool EndsAt(long currentTick) => currentTick >= EndingTick;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override bool IsNextFrameReady(long currentTick)
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace StgSharp.Timing
|
||||
// mark provider as ended so external users can observe terminal state
|
||||
Volatile.Write(ref _endedFlag, 1);
|
||||
s_unusedID.Push(TokenID);
|
||||
_event.Dispose();
|
||||
_event.Set();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,9 @@ namespace StgSharp.Timing
|
||||
while (true)
|
||||
{
|
||||
int cur = Volatile.Read(ref _pendingSpans);
|
||||
if (cur == 0) {
|
||||
if (cur == 0)
|
||||
{
|
||||
_event.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +209,8 @@ namespace StgSharp.Timing
|
||||
{
|
||||
// mark ended due to sequence timeout, then dispose
|
||||
Volatile.Write(ref _endedFlag, 1);
|
||||
Console.WriteLine("Time span ended.");
|
||||
|
||||
// Console.WriteLine("Time span ended.");
|
||||
Dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -92,12 +92,10 @@ namespace StgSharp
|
||||
// Configure a simple sequence:
|
||||
// initial slice = 0.5s, total = 5s, growth multiplier = 2, min slice = 0.75s
|
||||
TimeSequence seq =
|
||||
/*
|
||||
TimeSequence.CreateLogarithmic(initialSliceSeconds:0.5,
|
||||
totalSeconds:5.0,
|
||||
growthMultiplier:2.0,
|
||||
minSliceSeconds:0.75);
|
||||
/**/
|
||||
TimeSequence.CreateLogarithmic(initialSliceSeconds:0.5, totalSeconds:5.0,
|
||||
growthMultiplier:2.0, minSliceSeconds:0.75);
|
||||
/*
|
||||
TimeSequence.CreateLinear(5, 1);
|
||||
/**/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user