colysis/utils/MapFile.hexpat
n0ffie 37a249dc62 Fixing loading problem
+ ImHex Pattern Code
2025-03-18 21:55:08 +01:00

71 lines
No EOL
983 B
Text

#pragma endian little
struct Version {
u8 major;
u8 minor;
u8 patch;
};
bitfield OptionFlags {
bool CustomeTilemap : 1;
};
struct TilemapInfo {
};
struct Options {
OptionFlags flags;
if (flags.CustomeTilemap) {
u32 filepath_length;
char filepath[filepath_length];
TilemapInfo info;
}
};
struct SpecialData {
u32 data;
};
struct Tile {
u32 type;
if (type == 0) {
SpecialData special;
}
}[[single_color]];
struct Map
{
u32 width;
u32 height;
u32 specials;
Tile tiles[width * height];
};
struct Spawn {
u32 x,y;
}[[single_color]];
struct EnemySpawns {
u32 count;
Spawn spawns[count];
};
import std.io as io;
char magic[4] @$;
if (magic != "CYMF") {
io::warning("Magic does not match: \"" + magic + "\"; Expected: \"CYMF\"");
}
Version version @$ [[single_color]];
Options options @$;
Map map @$;
Spawn player @$ [[single_color]];
EnemySpawns enemies @$;