struct2Fill.nControllerId = readlong bstream #unsigned --uint32 --//!< Unique controller ID (crc32 of the bone name).
struct2Fill.numRotationKeys = readshort bstream #unsigned --uint16 --//!< Number of rotation keys stored within this chunk.
struct2Fill.numPositionKeys = readshort bstream #unsigned --uint16 --//!< Number of position keys stored within this chunk.
struct2Fill.RotationFormat = readbyte bstream #unsigned --uint8 --//!< Format identifier of the rotation value keys (see: ECompressionInformation enumeration type).
struct2Fill.RotationTimeFormat = readbyte bstream #unsigned --uint8 --//!< Format identifier of the rotation time keys (see: EKeyTimesFormat enumeration type).
struct2Fill.PositionFormat = readbyte bstream #unsigned --uint8 --//!< Format identifier of the position value keys (see: ECompressionInformation enumeration type).
struct2Fill.PositionKeysInfo = readbyte bstream #unsigned --uint8 --//!< Specifies which time key array is used by the position component (eKeyTimeRotation, eKeyTimePosition).
struct2Fill.PositionTimeFormat = readbyte bstream #unsigned --uint8 --//!< Format of identifier the position time keys (see: EKeyTimesFormat enumeration type). May not be used depending on the value of PositionKeysInfo.
struct2Fill.TracksAligned = readbyte bstream #unsigned --uint8 --//!< If set to nonzero, signals that all key arrays are padded to a 4-byte boundary.
),
fn read_CHUNK_GAHCAF \
bstream: \
fileHeader: \
struct2read: =
(
for i=1 to ::g_CAF_CHUNKTABLE_FILE_CONSTANTS[1].nChunkTable_entries do
(
if struct2read.ChunkType[1][i] == 0x0007 AND \
struct2read.ChunkType[2][i] == 0xAAFC then
(
fseek bstream struct2read.FileOffset[1][i] #seek_set --jump to offset
if struct2read.ChunkVersion[1][i] == 0x0971 then --if Ox0971
(
local struct2Fill = CHUNK_GAHCAF_INFO()
local A = readshort bstream #unsigned --should be 0x0007
local B = readshort bstream #unsigned --should be 0xAAFC
local C = readshort bstream --should be 0x0971
local D = readshort bstream --usually 0x0000 unknown --we do not check for this as we do not know what it is
local F = readlong bstream #unsigned
local ID = 0
if fileHeader.version == 0x0745 then
(
ID = readlong bstream --chunk ID --//new in version 0x0745
--confirm we are on the right chunk
if A == 0x0007 AND \
B == 0xAAFC AND \
C == 0x0971 AND \
ID == struct2read.ChunkID[1][i] AND \
F == struct2read.FileOffset[1][i] then
(
--Store the Chunk ID
struct2fill.chunkID = ID
fill_CAF_struct \
bstream:bstream \
struct2Fill:&struct2Fill
Append ::g_CHUNK_GAHCAF_INFO struct2Fill
)
)
)
)
else if struct2read.ChunkType[1][i] == 0x0002 AND \
struct2read.ChunkType[2][i] == 0xAAFC then
(
fseek bstream struct2read.FileOffset[1][i] #seek_set --jump to offset
if struct2read.ChunkVersion[1][i] == 0x0925 then --if 0x0925
(
local struct2Fill = MotionParams905()
local A = readshort bstream #unsigned --should be 0x0002
local B = readshort bstream #unsigned --should be 0xAAFC
local C = readshort bstream --should be 0x0925
local D = readshort bstream --usually 0x0000 unknown --we do not check for this as we do not know what it is
local F = readlong bstream #unsigned
local ID = 0
if fileHeader.version == 0x0745 then
(
ID = readlong bstream --chunk ID --//new in version 0x0745
--confirm we are on the right chunk
if A == 0x0002 AND \
B == 0xAAFC AND \
C == 0x0925 AND \
ID == struct2read.ChunkID[1][i] AND \
F == struct2read.FileOffset[1][i] then
(
--Store the Chunk ID
struct2fill.chunkID = ID
fill_CAF_MotionParams905 \
bstream:bstream \
struct2Fill:&struct2Fill
Append ::g_MotionParams905 struct2Fill
)
)
)
)
else if struct2read.ChunkType[1][i] == 0x0009 AND \
struct2read.ChunkType[2][i] == 0xAAFC then
(
fseek bstream struct2read.FileOffset[1][i] #seek_set --jump to offset
if struct2read.ChunkVersion[1][i] == 0x0001 then --if 0x0829
(
local struct2Fill = ChunkType_BspTreeData()
local A = readshort bstream #unsigned --should be 0x0009
local B = readshort bstream #unsigned --should be 0xAAFC
local C = readshort bstream --should be 0x0001
local D = readshort bstream --usually 0x0000 unknown --we do not check for this as we do not know what it is
local F = readlong bstream #unsigned
local ID = 0
if fileHeader.version == 0x0745 then
(
ID = readlong bstream --chunk ID --//new in version 0x0745