Fixing loading problem
+ ImHex Pattern Code
This commit is contained in:
parent
72d1bf3bfb
commit
37a249dc62
9 changed files with 179 additions and 41 deletions
71
utils/MapFile.hexpat
Normal file
71
utils/MapFile.hexpat
Normal file
|
@ -0,0 +1,71 @@
|
|||
#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 @$;
|
Loading…
Add table
Add a link
Reference in a new issue