#ifndef __NEWER_RANDTILES_H #define __NEWER_RANDTILES_H #include class RandomTileData { enum Type { CHECK_NONE = 0, CHECK_HORZ = 1, CHECK_VERT = 2, CHECK_BOTH = 3 }; class Entry { u8 startTile, endTile; u8 count, type; u32 dataOffset; u8 *getData() { return ((u8*)this) + dataOffset; } }; class Section { u32 nameHash; u32 nameOffset; u32 entryCount; Entry entries[1]; // variable size const char *getName() { return ((char*)this) + nameOffset; } }; u32 magic; u32 sectionCount; u32 offsets[1]; // variable size Section *getSection(int id) { return (Section*)(((char*)this) + offsets[id]); } Section *getSection(char *name); }; u32 djb2(u8 *str); #endif