use individual panel define as compute unit, kernel is now storage and loading unit
This commit is contained in:
@@ -36,7 +36,6 @@ namespace StgSharp.Timing
|
||||
{
|
||||
|
||||
private float _beginning, _ending;
|
||||
private Func<float, float> _timeRelatedCalculation;
|
||||
private TimeSpanProvider _timeProvider;
|
||||
|
||||
internal TimeFunction() { }
|
||||
@@ -44,7 +43,7 @@ namespace StgSharp.Timing
|
||||
public TimeFunction(TimeSpanProvider timeSpanProvider, Func<float, float> timeRelatedCalculation, float range)
|
||||
{
|
||||
_timeProvider = timeSpanProvider;
|
||||
_timeRelatedCalculation = timeRelatedCalculation;
|
||||
TimeRelatedCalculation = timeRelatedCalculation;
|
||||
if (timeSpanProvider == null) {
|
||||
return;
|
||||
}
|
||||
@@ -58,14 +57,7 @@ namespace StgSharp.Timing
|
||||
get => _timeProvider.CurrentSecond > _ending;
|
||||
}
|
||||
|
||||
public Func<float, float> TimeRelatedCalculation
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => _timeRelatedCalculation;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
set => _timeRelatedCalculation = value;
|
||||
}
|
||||
public Func<float, float> TimeRelatedCalculation { get; set; }
|
||||
|
||||
public static TimeFunction One
|
||||
{
|
||||
@@ -86,7 +78,7 @@ namespace StgSharp.Timing
|
||||
if (_timeProvider.CurrentSecond < _ending) {
|
||||
return 0;
|
||||
}
|
||||
return _timeRelatedCalculation(_timeProvider.CurrentSecond - _beginning);
|
||||
return TimeRelatedCalculation(_timeProvider.CurrentSecond - _beginning);
|
||||
}
|
||||
|
||||
public static TimeFunction Proportional(TimeSpanProvider time, float begin, float range)
|
||||
@@ -115,7 +107,7 @@ namespace StgSharp.Timing
|
||||
{
|
||||
float range = _ending - _beginning;
|
||||
return new TimeFunction(
|
||||
_timeProvider, p => _timeRelatedCalculation(range - p), range);
|
||||
_timeProvider, p => TimeRelatedCalculation(range - p), range);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user