From b3f7ab6784d8a41f96abb4b76f9dd250e2f91061 Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 2 Nov 2015 05:48:28 +0400 Subject: [PATCH] (PakOpener): changed index offset type to avoid casts. --- ArcFormats/GsPack/ArcGsPack.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ArcFormats/GsPack/ArcGsPack.cs b/ArcFormats/GsPack/ArcGsPack.cs index 7b007849..e4636c7b 100644 --- a/ArcFormats/GsPack/ArcGsPack.cs +++ b/ArcFormats/GsPack/ArcGsPack.cs @@ -62,7 +62,7 @@ namespace GameRes.Formats.Gs return null; uint crypt_key = file.View.ReadUInt32 (0x38); long data_offset = file.View.ReadUInt32 (0x40); - uint index_offset = file.View.ReadUInt32 (0x44); + int index_offset = file.View.ReadInt32 (0x44); int entry_size = version_major < 5 ? 0x48 : 0x68; int unpacked_size = count * entry_size; byte[] packed_index = new byte[index_size]; @@ -80,15 +80,15 @@ namespace GameRes.Formats.Gs var dir = new List (count); for (int i = 0; i < count; ++i) { - string name = Binary.GetCString (index, (int)index_offset, 0x40); + string name = Binary.GetCString (index, index_offset, 0x40); if (0 != name.Length) { - long offset = data_offset + LittleEndian.ToUInt32 (index, (int)index_offset+0x40); + long offset = data_offset + LittleEndian.ToUInt32 (index, index_offset+0x40); var entry = AutoEntry.Create (file, offset, name); - entry.Size = LittleEndian.ToUInt32 (index, (int)index_offset+0x44); + entry.Size = LittleEndian.ToUInt32 (index, index_offset+0x44); dir.Add (entry); } - index_offset += (uint)entry_size; + index_offset += entry_size; } return new ArcFile (file, this, dir); }