From 167e9ad9eed6d210a9783ed5eac98c2f4ede601b Mon Sep 17 00:00:00 2001 From: Steven Franklin Date: Wed, 30 Oct 2024 14:26:51 -0500 Subject: [PATCH] minor fixes --- src/mercury_engine_data_structures/formats/bmsstoc.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mercury_engine_data_structures/formats/bmsstoc.py b/src/mercury_engine_data_structures/formats/bmsstoc.py index 930dc0d..8534046 100644 --- a/src/mercury_engine_data_structures/formats/bmsstoc.py +++ b/src/mercury_engine_data_structures/formats/bmsstoc.py @@ -12,11 +12,11 @@ Int32ul, Int64ul, PaddedString, - PrefixedArray, Rebuild, Struct, ) +from mercury_engine_data_structures.common_types import make_vector from mercury_engine_data_structures.formats.base_resource import BaseResource from mercury_engine_data_structures.formats.property_enum import PropertyEnum from mercury_engine_data_structures.game_check import Game @@ -41,8 +41,7 @@ class FileTypeEnum(enum.Enum): "wav_name" / PropertyEnum, "file_id" / FileId, "warc_index" / Int32ul, # index of the WARC listed in BFSAR (starts offset from 0) - "idx" / Rebuild(Int32ul, lambda ctx: ctx._index), # 0 to max wave archives - Check(construct.this._index == construct.this.idx), + "idx" / Rebuild(Int32ul, construct.this._index), # 0 to max wave archives Const(0, Int32ul), Const(0, Int32ul), Const(0, Int32ul), @@ -74,9 +73,9 @@ class FileTypeEnum(enum.Enum): ) BMSSTOC = Struct( - "wave_archives" / PrefixedArray(Int32ul, WaveArchiveData), - "sound_streams" / PrefixedArray(Int32ul, SoundStreams), - "groups" / PrefixedArray(Int32ul, GroupData), + "wave_archives" / make_vector(WaveArchiveData), + "sound_streams" / make_vector(SoundStreams), + "groups" / make_vector(GroupData), construct.Terminated, )