Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
trs:cutseq [2017/02/02 19:56] – ↷ Page moved from opentomb:trs:cutseq to trs:cutseq stohrendorf | trs:cutseq [2017/11/17 11:21] (current) – stohrendorf | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
+ | |||
====== CUTSEQ file format (TR4-TR5) ====== | ====== CUTSEQ file format (TR4-TR5) ====== | ||
+ | |||
+ | //Original reverse-engineering work by sapper// | ||
===== Overview ===== | ===== Overview ===== | ||
- | The '' | + | The '' |
===== Layout ===== | ===== Layout ===== | ||
<code cpp> | <code cpp> | ||
- | struct | + | struct |
+ | { | ||
+ | uint8_t header[8]; // "(C) DEL!", for Derek Leigh-Gilchrist | ||
+ | CutsceneHeader cutscenes[N]; | ||
+ | uint8_t padding[]; // Empty space between header and data | ||
+ | uint8_t cutsceneData[]; | ||
+ | } | ||
+ | |||
+ | struct CutsceneHeader // 8 bytes | ||
+ | { | ||
+ | uint32_t offset; // Offset relative to start of file | ||
+ | uint32_t size; // Size in bytes | ||
+ | } | ||
+ | |||
+ | struct CutsceneData | ||
+ | { | ||
+ | uint16_t numActors; // Actor 1 is always Lara (slot ID 0) | ||
+ | uint16_t numFrames; | ||
+ | int32_t originX; // Origin coordinates are in TR world coordinates | ||
+ | int32_t originY; // Negative Y is up | ||
+ | int32_t originZ; | ||
+ | int32_t audioTrackIndex; | ||
+ | uint32_t cameraDataOffset; | ||
+ | ActorSlotHeader actors[numActors]; | ||
+ | CameraData cameraData; | ||
+ | uint8_t padding[]; | ||
+ | uint8_t actorData[]; | ||
+ | uint8_t padding[]; | ||
+ | } | ||
+ | |||
+ | struct ActorSlotHeader // 8 bytes | ||
+ | { | ||
+ | uint32_t dataOffset; | ||
+ | uint16_t slotNumber; // TR model slot ID number | ||
+ | uint16_t numNodes; // Same as number of meshes in model | ||
+ | } | ||
+ | |||
+ | struct CameraData | ||
+ | { | ||
+ | PositionHeader targetHeader; | ||
+ | PositionHeader cameraHeader; | ||
+ | PackedCoord targetPosition; | ||
+ | PackedCoord cameraPosition; | ||
+ | } | ||
+ | |||
+ | struct ActorData | ||
+ | { | ||
+ | MeshHeader meshes[NumNodes]; | ||
+ | MeshData meshData[NumNodes]; | ||
+ | } | ||
+ | |||
+ | struct MeshData | ||
+ | { | ||
+ | PackedCoord positionData; | ||
+ | PackedCoord rotationData; | ||
+ | } | ||
+ | |||
+ | struct PositionHeader // 14 bytes | ||
+ | { | ||
+ | | ||
+ | | ||
+ | | ||
+ | uint16_t axisBitsizes; | ||
+ | uint16_t numValuesX; | ||
+ | uint16_t numValuesY; | ||
+ | uint16_t numValuesZ; | ||
+ | } | ||
+ | |||
+ | struct RotationHeader // 14 bytes | ||
+ | { | ||
+ | // 1024 = 360 degrees | ||
+ | int16_t startX; | ||
+ | int16_t startY; | ||
+ | int16_t startZ; | ||
+ | uint16_t axisBitsizes; | ||
+ | uint16_t numValuesX; | ||
+ | uint16_t numValuesY; | ||
+ | uint16_t numValuesZ; | ||
+ | } | ||
+ | |||
+ | struct PackedCoord // (variable length) | ||
{ | { | ||
- | uint8_t DEL[8]; // "(C) DEL!", for Derek Leigh-Gilchrist | + | |
- | cutscene_header Cutscenes[N]; | + | dynamic |
- | uint8_t Padding[]; // Empty space between header and data | + | dynamic |
- | uint8_t CutsceneData[]; | + | |
- | + | ||
- | struct cutscene_header // 8 bytes | + | |
- | { | + | |
- | uint32_t Offset; // Offset relative to start of file | + | |
- | uint32_t Size; // Size in bytes | + | |
- | } | + | |
- | + | ||
- | struct cutscene_data | + | |
- | { | + | |
- | | + | |
- | | + | |
- | int32_t OriginX; // Origin coordinates are in TR world coordinates | + | |
- | int32_t OriginY; // Negative Y is up | + | |
- | int32_t OriginZ; | + | |
- | int32_t AudioTrackIndex; | + | |
- | | + | |
- | actor_slot_header Actors[NumActors]; | + | |
- | camera_data CameraData; | + | |
- | uint8_t Padding[]; | + | |
- | uint8_t ActorData[]; | + | |
- | uint8_t Padding[]; | + | |
- | } | + | |
- | + | ||
- | struct actor_slot_header // 8 bytes | + | |
- | { | + | |
- | uint32_t DataOffset; | + | |
- | uint16_t SlotNumber; // TR model slot ID number | + | |
- | uint16_t NumNodes; // Same as number of meshes in model | + | |
- | } | + | |
- | + | ||
- | struct camera_data | + | |
- | { | + | |
- | position_header TargetHeader; | + | |
- | position_header CameraHeader; | + | |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | struct actor_data | + | |
- | { | + | |
- | mesh_header Meshes[NumNodes]; | + | |
- | mesh_data MeshData[NumNodes]; | + | |
- | } | + | |
- | + | ||
- | struct mesh_data | + | |
- | { | + | |
- | packed_coord PositionData; | + | |
- | packed_coord RotationData; | + | |
- | } | + | |
- | + | ||
- | struct position_header // 14 bytes | + | |
- | { | + | |
- | | + | |
- | | + | |
- | | + | |
- | uint16_t AxisBitsizes; | + | |
- | uint16_t NumValuesX; | + | |
- | uint16_t NumValuesY; | + | |
- | uint16_t NumValuesZ; | + | |
- | } | + | |
- | + | ||
- | struct rotation_header // 14 bytes | + | |
- | { | + | |
- | // 1024 = 360 degrees | + | |
- | | + | |
- | | + | |
- | | + | |
- | uint16_t AxisBitsizes; | + | |
- | uint16_t NumValuesX; | + | |
- | uint16_t NumValuesY; | + | |
- | uint16_t NumValuesZ; | + | |
- | } | + | |
- | + | ||
- | struct packed_coord // (variable length) | + | |
- | { | + | |
- | | + | |
- | dynamic | + | |
- | dynamic | + | |
- | } | + | |
} | } | ||
</ | </ |