diff options
Diffstat (limited to 'src/engine/snapshot.h')
| -rw-r--r-- | src/engine/snapshot.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/engine/snapshot.h b/src/engine/snapshot.h new file mode 100644 index 00000000..9d803486 --- /dev/null +++ b/src/engine/snapshot.h @@ -0,0 +1,19 @@ + +struct snapshot +{ + int num_items; + int offsets[1]; + + struct item + { + int type_and_id; + char data[1]; + + int type() { return type_and_id>>16; } + int id() { return type_and_id&(0xffff); } + }; + + char *data_start() { return (char *)&offsets[num_items]; } + item *get_item(int index) { return (item *)(data_start() + offsets[index]); }; +}; + |