From e3236c0fbd7331e9aa5b23d3bc236241ae634412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20=C5=9Apiewak?= Date: Mon, 5 Aug 2024 15:43:28 +0200 Subject: [PATCH] Revert "Add ToUint64 for big endian numbers" This reverts commit 681e82dd3f738ba8400996d3802b2172efd66cf2. --- ArcFormats/DxLib/HuffmanDecoder.cs | 5 ++--- GameRes/Utility.cs | 17 ++++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/ArcFormats/DxLib/HuffmanDecoder.cs b/ArcFormats/DxLib/HuffmanDecoder.cs index 4ab50dcd..11f61d86 100644 --- a/ArcFormats/DxLib/HuffmanDecoder.cs +++ b/ArcFormats/DxLib/HuffmanDecoder.cs @@ -45,7 +45,7 @@ namespace GameRes.Formats.DxLib public int ParentNode; // index of parent node. public int[] ChildNode; //two children nodes, -1 if not existent. - internal DXA8HuffmanNode() + DXA8HuffmanNode() { bitArray = new byte[32]; ChildNode = new int[2]; @@ -96,7 +96,6 @@ namespace GameRes.Formats.DxLib for (int i=0; i(TArray value, int index) where TArray : IList + public static uint ToUInt32 (TArray value, int index) where TArray : IList { - return (uint)(value[index] << 24 | value[index + 1] << 16 | value[index + 2] << 8 | value[index + 3]); + return (uint)(value[index] << 24 | value[index+1] << 16 | value[index+2] << 8 | value[index+3]); } - public static int ToInt32(TArray value, int index) where TArray : IList + public static int ToInt32 (TArray value, int index) where TArray : IList { - return (int)ToUInt32(value, index); - } - public static ulong ToUInt64(TArray value, int index) where TArray : IList - { - return (ulong)(value[index]<<56|value[index+1]<<48|value[index+2]<<40|value[index+3]<<32|value[index+4] << 24 | value[index + 5] << 16 | value[index + 6] << 8 | value[index + 7]); - } - - public static long ToInt64(TArray value, int index) where TArray : IList - { - return (long)ToUInt64(value, index); + return (int)ToUInt32 (value, index); } public static void Pack (ushort value, byte[] buf, int index)