Last active
July 11, 2020 22:54
-
-
Save rindeal/4daabb3bd0a5cd570528081ce8bee1ce to your computer and use it in GitHub Desktop.
Structure/format defintion of a .res file archive (`Geometry.res` and `Textures.res`) from the game "The I of The Dragon" for use in "Hex Editor Neo" software
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
#include <stddefs.h> | |
#pragma byte_order(LittleEndian) | |
#pragma pack(1) | |
struct String | |
{ | |
uint32 len; | |
char str[len]; | |
}; | |
#pragma pack(1) | |
struct ResHeader | |
{ | |
uint32 nrof_entries; | |
$assert(nrof_entries > 0); | |
}; | |
struct ResEntryData; | |
#pragma pack(1) | |
struct ResEntry | |
{ | |
String name; | |
uint32 offset as ResEntryData*; | |
uint32 size; | |
}; | |
#pragma pack(16) | |
struct ResEntryData | |
{ | |
BYTE data[size]; | |
}; | |
#pragma pack(1) | |
public struct ResFile | |
{ | |
ResHeader header; | |
ResEntry entries[header.nrof_entries]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment