Explorar o código

reorganized code

vpenades %!s(int64=2) %!d(string=hai) anos
pai
achega
1db50c3bb4
Modificáronse 1 ficheiros con 10 adicións e 9 borrados
  1. 10 9
      src/SharpGLTF.Core/Memory/MemoryImage.cs

+ 10 - 9
src/SharpGLTF.Core/Memory/MemoryImage.cs

@@ -488,15 +488,6 @@ namespace SharpGLTF.Memory
         public readonly UInt32 LevelCount;
         public readonly UInt32 SupercompressionScheme;
 
-        public static unsafe bool TryGetHeader(IReadOnlyList<Byte> data, out Ktx2Header header)
-        {
-            if (!(data is Byte[] array)) array = data?.ToArray() ?? Array.Empty<Byte>();
-
-            if (data.Count < sizeof(Ktx2Header)) { header = default; return false; }
-            header = System.Runtime.InteropServices.MemoryMarshal.Cast<Byte, Ktx2Header>(array)[0];
-            return true;
-        }
-
         public bool IsValidHeader
         {
             get
@@ -507,6 +498,16 @@ namespace SharpGLTF.Memory
             }
         }
 
+        public static unsafe bool TryGetHeader(IReadOnlyList<Byte> data, out Ktx2Header header)
+        {
+            if (!(data is Byte[] array)) array = data?.ToArray() ?? Array.Empty<Byte>();
+
+            if (array.Length < sizeof(Ktx2Header)) { header = default; return false; }
+
+            header = System.Runtime.InteropServices.MemoryMarshal.Cast<Byte, Ktx2Header>(array)[0];
+            return true;
+        }        
+
         public static void Verify(IReadOnlyList<Byte> data, string paramName)
         {
             // https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu#ktx-v2-images-with-basis-universal-supercompression