daily update on 20240613 by nitload youmu[4

This commit is contained in:
Nitload
2024-06-14 05:30:19 +08:00
parent be6c2e6b92
commit 7fb220c523
50 changed files with 991 additions and 700 deletions
+16 -14
View File
@@ -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;
}
}
}