daily update on 20240828 by nitload youmu, autotexture added
This commit is contained in:
@@ -32,6 +32,7 @@ using StgSharp.Math;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -43,8 +44,9 @@ using System.Text;
|
||||
namespace StgSharp.Data
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 16)]
|
||||
public unsafe struct M128:IMemoryType
|
||||
public unsafe struct M128 : IMemoryType
|
||||
{
|
||||
|
||||
[FieldOffset(0)] internal Vector4 vec;
|
||||
|
||||
internal M128(Vector4 v)
|
||||
@@ -52,6 +54,20 @@ namespace StgSharp.Data
|
||||
vec = v;
|
||||
}
|
||||
|
||||
public override bool Equals([NotNullWhen(true)] object obj)
|
||||
{
|
||||
if (obj is not M128 other)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return this == other;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return vec.GetHashCode();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public T Read<T>(int index) where T : struct
|
||||
#if NET8_0_OR_GREATER
|
||||
@@ -89,7 +105,7 @@ namespace StgSharp.Data
|
||||
#if NET8_0_OR_GREATER
|
||||
, INumber
|
||||
#else
|
||||
,IConvertible
|
||||
, IConvertible
|
||||
#endif
|
||||
{
|
||||
fixed (Vector4* p = &vec)
|
||||
@@ -100,7 +116,17 @@ namespace StgSharp.Data
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(M128 left, M128 right)
|
||||
{
|
||||
return left.vec == right.vec;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(M128 left, M128 right)
|
||||
{
|
||||
return left.vec != right.vec;
|
||||
}
|
||||
|
||||
#if NET5_0_OR_GREATER
|
||||
|
||||
@@ -165,5 +191,6 @@ namespace StgSharp.Data
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user