Anp3 insertion

This commit is contained in:
Mc-muffin
2024-09-20 01:29:10 -05:00
parent efee619bf4
commit efd22ef175
3 changed files with 19 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ class Pak:
def __init__(self) -> None:
self.type = -1
self.align = False
self.files = []
self.files: list[pak_file] = []
@staticmethod
def from_path(path, type) -> "Pak":

View File

@@ -26,6 +26,7 @@ class Scpk:
self.map: bytes = b""
self._map_comp_type = 0
self.chars: dict[int, Pak] = dict()
self.char_ids: list[int] = list()
self.rsce: bytes = b""
self._rsce_comp_type = 0
self.unk_file: bytes = b""
@@ -63,12 +64,11 @@ class Scpk:
if flags & CHR_FLAG:
f.seek(cursor)
total_chars = f.read_uint16()
char_ids = []
for _ in range(total_chars):
char_ids.append(f.read_uint16())
self.char_ids.append(f.read_uint16())
cursor += sizes.pop(0)
for id in char_ids:
for id in self.char_ids:
size = sizes.pop(0)
self.chars[id] = Pak.from_path(f.read_at(cursor, size), 1)
cursor += size