daily update on 20240828 by nitload youmu, autotexture added

This commit is contained in:
Nitload
2024-08-28 10:58:31 +08:00
parent d082071f2d
commit 1ee4e4a42f
586 changed files with 60910 additions and 123106 deletions
+29 -2
View File
@@ -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
}
}