daily update on 20240514 by nitload youmu
This commit is contained in:
@@ -54,10 +54,18 @@ namespace StgSharp.Data
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public T Read<T>(int index) where T : struct
|
||||
#if NET8_0_OR_GREATER
|
||||
, INumber
|
||||
#else
|
||||
, IConvertible
|
||||
#endif
|
||||
|
||||
{
|
||||
fixed (Vector4* p = &vec)
|
||||
{
|
||||
#pragma warning disable CS8500
|
||||
return *(((T*)p) + index);
|
||||
#pragma warning restore CS8500
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,11 +88,15 @@ namespace StgSharp.Data
|
||||
public void Write<T>(int index, T value) where T : struct
|
||||
#if NET8_0_OR_GREATER
|
||||
, INumber
|
||||
#else
|
||||
,IConvertible
|
||||
#endif
|
||||
{
|
||||
fixed (Vector4* p = &vec)
|
||||
{
|
||||
#pragma warning disable CS8500
|
||||
*(((T*)p) + index) = value;
|
||||
#pragma warning restore CS8500
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user