Skip to content

Instantly share code, notes, and snippets.

@x1nixmzeng
Created January 30, 2017 00:03
Show Gist options
  • Save x1nixmzeng/9bfbc521882a2c59588a53b0d82f5ea7 to your computer and use it in GitHub Desktop.
Save x1nixmzeng/9bfbc521882a2c59588a53b0d82f5ea7 to your computer and use it in GitHub Desktop.
Grabbed by the Ghoulies animation format
//--------------------------------------
//--- 010 Editor v5.0 Binary Template
//
// File: gbtg_anim.bt
// Author: wrs/x1nixmzeng
// Revision: 0.1
// Purpose: aid_anim_* parsing from
// "grabbed by the ghoulies"
//--------------------------------------
char Magic[4]; Assert(Magic=="MINA"); //'ANIM'
uint un<format=hex, hidden=true>; Assert(un==993911001);
float Duration; Assert(Duration>0.0f);
int OffsetData; //?
int zero; Assert(zero==0);
// min 1 bone required for animation
int BoneCount; Assert(BoneCount>0);
// still differs when file contents are identical
// will include time in its calculation !!
short s1__ignore; // not part of filesize - frames?
short s2; Assert(s2==0||s2==s1__ignore);
int flags<hidden=true>;
Assert((flags&0xff0000ff)==0x26000080);
Assert(flags==647890816 // 26 9E 07 80
|| flags==648415104 // 26 A6 07 80 human?
|| flags==649465216 // 26 b6 0D 80
|| flags==648678016 // 26 AA 0A 80
);
int block_a; Assert(block_a < FileSize());
int block_a_size; // ?
int block_b; Assert(block_b < FileSize());
Printf("Duration %.2fsec\n", Duration);
Printf("Bones %u\n", BoneCount);
Printf("Block1 %s\n", (block_a!=0)?"y":"n");
Printf("Block2 %s\n", (block_b!=0)?"y":"n");
FSeek(0x40);
ushort h1, h2;
ushort h3, h4;
float t<hidden=true>; Assert(t==1.0f);
// data is compressed or packed in some obsecure way
ubyte data[FileSize()-FTell()];
// data examples with 2 bones and very short anims
// 03 FC FC 00 7E FF 21 02 D8 FC B3 00 B3 00 B3 00
// 03 FC FC 00 00 00 2C 00 A2 FD B3 00 8C 00 B3 00
// 03 6C FC 00 51 FF C3 FE B3 00 B3 00 B3 00 00 00
// 03 6C FC 00 29 01 A5 FE B3 00 B3 00 B3 00 00 00
//Assert(FEof());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment