Skip to content

Instantly share code, notes, and snippets.

@youarebritish
Created February 10, 2018 07:15
Show Gist options
  • Save youarebritish/014633a757f8647d03e5861b3182f27c to your computer and use it in GitHub Desktop.
Save youarebritish/014633a757f8647d03e5861b3182f27c to your computer and use it in GitHub Desktop.
010 Editor template for parsing frt files
//------------------------------------------------
//--- 010 Editor v7.0.2 Binary Template
//
// File: frt.bt (TppRouteSet)
// Version: 1.0
//------------------------------------------------
LittleEndian();
struct Header
{
char ROUT[4] <hidden = true>;
ushort version;
ushort routeIdCount;
uint routeIdsOffset;
uint routeDefinitionsOffset;
uint routeNodesOffset;
uint routeEventTablesOffset;
uint routeNodeEventsOffset;
uint routeIds[header.routeIdCount];
} header;
struct RouteDefinition
{
uint nodeOffset;
uint edgeOffset;
uint eventOffset;
ushort numNodes;
ushort numEvents;
} routeDefinitions[header.routeIdCount];
struct RouteNode
{
float x;
float y;
float z;
} routeNodes[(header.routeEventTablesOffset - header.routeNodesOffset)/sizeof(RouteNode)];
struct RouteNodeEventTable
{
ushort nodeEventCount;
ushort edgeEventIndex;
} routeNodeEventTables[(header.routeNodeEventsOffset - header.routeEventTablesOffset)/sizeof(RouteNodeEventTable)];
struct RouteNodeEvent
{
uint type;
int params[10];
char snippet[4];
} routeNodeEvents[(FileSize() - header.routeNodeEventsOffset)/sizeof(RouteNodeEvent)];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment