daily update on 20240613 by nitload youmu[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[D[C[4
This commit is contained in:
@@ -130,12 +130,6 @@ namespace StgSharp
|
||||
/// </summary>
|
||||
public static TimeSourceProviderBase DefaultProvider => StgSharpTime.OnlyInstance;
|
||||
|
||||
public Action FrameUpdateMissCallback
|
||||
{
|
||||
get => _frameUpdateMissCallback;
|
||||
set => _frameUpdateMissCallback = value;
|
||||
}
|
||||
|
||||
public double SpanLength
|
||||
{
|
||||
get => (_spanLength * 1.0) / (1000L * 1000L);
|
||||
@@ -176,18 +170,20 @@ namespace StgSharp
|
||||
|
||||
internal bool CheckTime(long microseconds)
|
||||
{
|
||||
//Console.Write("1 ");
|
||||
if (microseconds - _spanBegin < _spanLength)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//Console.Write("2 ");
|
||||
_spanBegin = microseconds;
|
||||
timeSpanCount++;
|
||||
|
||||
//Console.Write("3 ");
|
||||
if (_refreshCallback != null)
|
||||
{
|
||||
_refreshCallback();
|
||||
}
|
||||
//Console.Write("4 ");
|
||||
if (_refreshSemaphore.CurrentCount == 0)
|
||||
{
|
||||
_refreshSemaphore.Release();
|
||||
@@ -199,17 +195,23 @@ namespace StgSharp
|
||||
_frameUpdateMissCallback();
|
||||
}
|
||||
}
|
||||
if (timeSpanCount > _maxSpanCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
//Console.Write("5 ");
|
||||
//Console.WriteLine( $"{timeSpanCount}\n" );
|
||||
return timeSpanCount < _maxSpanCount;
|
||||
}
|
||||
|
||||
public static implicit operator int(TimeSpanProvider provider)
|
||||
{
|
||||
return provider.timeSpanCount.Value;
|
||||
if (provider == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return provider.ToInt32();
|
||||
}
|
||||
|
||||
public int ToInt32()
|
||||
{
|
||||
return (int)timeSpanCount.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user