@@ -62,6 +62,8 @@ class SectionType(IntEnum):
62
62
STAGE = 0x0019
63
63
ASSET_ID = 0x001a
64
64
CHUNK_REFERENCE = 0x001b
65
+ MOVIE_AUDIO_CHUNK_REFERENCE = 0x06a4
66
+ MOVIE_VIDEO_CHUNK_REFERENCE = 0x06a5
65
67
ASSET_REFERENCE = 0x077b
66
68
BOUNDING_BOX = 0x001c
67
69
POLYGON = 0x001d
@@ -188,34 +190,28 @@ def _read_section(self, section_type, chunk):
188
190
assert_equal (duplicate_asset_id , self .id , 'asset ID' )
189
191
190
192
elif Asset .SectionType .CHUNK_REFERENCE == section_type : # SND, IMG, SPR, MOV, FON
191
- # READ THE CHUNK REFERENCES.
192
193
# These are references to the chunk(s) that hold the data for this asset.
193
194
# The references and the chunks have the following format "a501".
194
195
# There is no guarantee where these chunk(s) might actually be located:
195
196
# - They might be in the same RIFF subfile as this header,
196
197
# - They might be in a different RIFF subfile in the same CXT file,
197
198
# - They might be in a different CXT file entirely.
198
- if self .type == Asset .AssetType .MOVIE :
199
- # READ THE HEADER REFERENCE.
200
- header_reference = Datum (chunk ).d .chunk_id
201
- self .chunk_references .append (header_reference )
202
- # TODO: Find out what this is and why we have to skip it.
203
- self .unks .append ({hex (section_type ): Datum (chunk ).d })
204
-
205
- # READ THE AUDIO REFERENCE.
206
- audio_reference = Datum (chunk ).d .chunk_id
207
- self .chunk_references .append (audio_reference )
208
- # TODO: Find out what this is and why we have to skip it.
209
- self .unks .append ({hex (section_type ): Datum (chunk ).d })
210
-
211
- # READ THE VIDEO REFERENCE.
212
- video_reference = Datum (chunk ).d .chunk_id
213
- self .chunk_references .append (video_reference )
214
- # TODO: Find out what this is and why we have to skip it.
215
- else :
216
- # READ A SINGLE REFERENCE.
217
- chunk_reference = Datum (chunk ).d .chunk_id
218
- self .chunk_references .append (chunk_reference )
199
+ #
200
+ # Movies have three chunk references. This is just the first one;
201
+ # that contains header information; the other two, for audio and
202
+ # video, are the next two sections.
203
+ chunk_reference = Datum (chunk ).d .chunk_id
204
+ self .chunk_references .append (chunk_reference )
205
+
206
+ elif Asset .SectionType .MOVIE_AUDIO_CHUNK_REFERENCE == section_type :
207
+ # READ THE MOVIE AUDIO REFERENCE.
208
+ audio_reference = Datum (chunk ).d .chunk_id
209
+ self .chunk_references .append (audio_reference )
210
+
211
+ elif Asset .SectionType .MOVIE_VIDEO_CHUNK_REFERENCE == section_type :
212
+ # READ THE MOVIE VIDEO REFERENCE.
213
+ video_reference = Datum (chunk ).d .chunk_id
214
+ self .chunk_references .append (video_reference )
219
215
220
216
elif Asset .SectionType .BOUNDING_BOX == section_type : # STG, IMG, HSP, SPR, MOV, TXT, CAM, CVS
221
217
self .bounding_box = Datum (chunk ).d
0 commit comments