1
1
mirror of https://github.com/wader/fq.git synced 2024-09-11 20:07:11 +03:00

Merge pull request #766 from Ronsor/moc3-fix

moc3: Fix minor bugs
This commit is contained in:
Mattias Wadman 2023-09-19 07:21:22 +02:00 committed by GitHub
commit fdadc37d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 21 deletions

View File

@ -330,10 +330,10 @@ type sectionOffsetTable struct {
blendShapeKeyformBindings struct {
parameterBindingSourcesIndices int64
blendShapeConstraintIndexSourcesBeginIndices int64
blendShapeConstraintIndexSourcesCounts int64
keyformSourcesBlendShapeIndices int64
keyformSourcesBlendShapeCounts int64
blendShapeConstraintIndexSourcesBeginIndices int64
blendShapeConstraintIndexSourcesCounts int64
}
blendShapesWarpDeformers struct {
@ -657,10 +657,10 @@ func decodeMOC3(d *decode.D) any {
d.FieldStruct("blend_shape_keyform_bindings", func(d *decode.D) {
sectionOffsets.blendShapeKeyformBindings.parameterBindingSourcesIndices = int64(d.FieldU32("parameter_binding_sources_indices", scalar.UintHex))
sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesBeginIndices = int64(d.FieldU32("blend_shape_constraint_index_sources_begin_indices", scalar.UintHex))
sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesCounts = int64(d.FieldU32("blend_shape_constraint_index_sources_counts", scalar.UintHex))
sectionOffsets.blendShapeKeyformBindings.keyformSourcesBlendShapeIndices = int64(d.FieldU32("keyform_sources_blend_shape_indices", scalar.UintHex))
sectionOffsets.blendShapeKeyformBindings.keyformSourcesBlendShapeCounts = int64(d.FieldU32("keyform_sources_blend_shape_counts", scalar.UintHex))
sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesBeginIndices = int64(d.FieldU32("blend_shape_constraint_index_sources_begin_indices", scalar.UintHex))
sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesCounts = int64(d.FieldU32("blend_shape_constraint_index_sources_counts", scalar.UintHex))
})
d.FieldStruct("blend_shapes_warp_deformers", func(d *decode.D) {
@ -759,9 +759,9 @@ func decodeMOC3(d *decode.D) any {
countInfo.drawOrderGroupObjects = int64(d.FieldU32("draw_order_group_objects"))
countInfo.glue = int64(d.FieldU32("glue"))
countInfo.glueInfo = int64(d.FieldU32("glue_info"))
countInfo.glueKeyforms = int64(d.FieldU32("glue_keyforms"))
if version >= moc3Version4_02_00 {
countInfo.glueKeyforms = int64(d.FieldU32("glue_keyforms"))
countInfo.keyformMultiplyColors = int64(d.FieldU32("keyform_multiply_colors"))
countInfo.keyformScreenColors = int64(d.FieldU32("keyform_screen_colors"))
countInfo.blendShapeParameterBindings = int64(d.FieldU32("blend_shape_parameter_bindings"))
@ -1297,17 +1297,17 @@ func decodeMOC3(d *decode.D) any {
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.parameterBindingSourcesIndices * 8)
fieldAlignedNArray(d, "parameter_binding_sources_indices", count, func(d *decode.D) { d.FieldS32("index") })
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesBeginIndices * 8)
fieldAlignedNArray(d, "blend_shape_constraint_index_sources_begin_indices", count, func(d *decode.D) { d.FieldS32("index") })
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesCounts * 8)
fieldAlignedNArray(d, "blend_shape_constraint_index_sources_counts", count, func(d *decode.D) { d.FieldS32("count") })
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.keyformSourcesBlendShapeIndices * 8)
fieldAlignedNArray(d, "keyform_sources_blend_shape_indices", count, func(d *decode.D) { d.FieldS32("index") })
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.keyformSourcesBlendShapeCounts * 8)
fieldAlignedNArray(d, "keyform_sources_blend_shape_counts", count, func(d *decode.D) { d.FieldS32("count") })
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesBeginIndices * 8)
fieldAlignedNArray(d, "blend_shape_constraint_index_sources_begin_indices", count, func(d *decode.D) { d.FieldS32("index") })
d.SeekAbs(sectionOffsets.blendShapeKeyformBindings.blendShapeConstraintIndexSourcesCounts * 8)
fieldAlignedNArray(d, "blend_shape_constraint_index_sources_counts", count, func(d *decode.D) { d.FieldS32("count") })
})
d.FieldStruct("blend_shapes_warp_deformers", func(d *decode.D) {

View File

@ -160,10 +160,10 @@ $ fq 'dv({array_truncate: 3, display_bytes: 4})' archchan_sdk5.moc3
0x00210| c0 23 0d 00| .#..| base_key_indices: 0xd23c0 0x21c-0x21f.7 (4)
| | | blend_shape_keyform_bindings{}: 0x220-0x233.7 (20)
0x00220|c0 23 0d 00 |.#.. | parameter_binding_sources_indices: 0xd23c0 0x220-0x223.7 (4)
0x00220| c0 23 0d 00 | .#.. | blend_shape_constraint_index_sources_begin_indices: 0xd23c0 0x224-0x227.7 (4)
0x00220| c0 23 0d 00 | .#.. | blend_shape_constraint_index_sources_counts: 0xd23c0 0x228-0x22b.7 (4)
0x00220| c0 23 0d 00| .#..| keyform_sources_blend_shape_indices: 0xd23c0 0x22c-0x22f.7 (4)
0x00230|c0 23 0d 00 |.#.. | keyform_sources_blend_shape_counts: 0xd23c0 0x230-0x233.7 (4)
0x00220| c0 23 0d 00 | .#.. | keyform_sources_blend_shape_indices: 0xd23c0 0x224-0x227.7 (4)
0x00220| c0 23 0d 00 | .#.. | keyform_sources_blend_shape_counts: 0xd23c0 0x228-0x22b.7 (4)
0x00220| c0 23 0d 00| .#..| blend_shape_constraint_index_sources_begin_indices: 0xd23c0 0x22c-0x22f.7 (4)
0x00230|c0 23 0d 00 |.#.. | blend_shape_constraint_index_sources_counts: 0xd23c0 0x230-0x233.7 (4)
| | | blend_shapes_warp_deformers{}: 0x234-0x23f.7 (12)
0x00230| c0 23 0d 00 | .#.. | target_indices: 0xd23c0 0x234-0x237.7 (4)
0x00230| c0 23 0d 00 | .#.. | blend_shape_keyform_binding_sources_begin_indices: 0xd23c0 0x238-0x23b.7 (4)
@ -1113,18 +1113,18 @@ $ fq 'dv({array_truncate: 3, display_bytes: 4})' archchan_sdk5.moc3
| | | parameter_binding_sources_indices{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | blend_shape_constraint_index_sources_begin_indices{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | blend_shape_constraint_index_sources_counts{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | keyform_sources_blend_shape_indices{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | keyform_sources_blend_shape_counts{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | blend_shape_constraint_index_sources_begin_indices{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | blend_shape_constraint_index_sources_counts{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)
| | | padding: raw bits 0xd23c0-NA (0)
| | | blend_shapes_warp_deformers{}: 0xd23c0-NA (0)
| | | target_indices{}: 0xd23c0-NA (0)
| | | array[0:0]: 0xd23c0-NA (0)