Created
February 20, 2024 14:26
-
-
Save brecert/312fedeffe926fbfa1931d29ebfaea65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma endian big | |
#include <type/magic.pat> | |
#include <std/array.pat> | |
fn relative_to_parent(u128 offset) { | |
return addressof(parent) + offset; | |
}; | |
struct Header { | |
type::Magic<"PMPF">; | |
$ = relative_to_parent(0x10); | |
u16 object_count; | |
u16 route_count; | |
u16 point_count; | |
$ = relative_to_parent(0x40); | |
u32 object_data_offset; | |
u32 route_data_offset; | |
u32 point_data_offset; | |
}; | |
struct ObjectData { | |
u32 object_group_id; | |
u32 object_id; | |
float translation[3]; | |
float scale[3]; | |
std::Array<float, 3> transformation_matrix[3]; | |
u32; | |
u8 parameters[0x10] [[sealed]]; | |
}; | |
struct RouteData { | |
u16 point_count; | |
u32; | |
u16 route_group_id; | |
char route_name[]; | |
$ = relative_to_parent(0x1A); | |
u16 route_point_index; | |
u32; | |
}; | |
struct PointData { | |
float position[3]; | |
padding[8]; | |
}; | |
struct PMP { | |
Header header; | |
ObjectData object_data[header.object_count] @ header.object_data_offset; | |
RouteData route_data[header.route_count] @ header.route_data_offset; | |
PointData point_data[header.point_count] @ header.point_data_offset; | |
}; | |
PMP pmp @ 0x00; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment