about summary refs log tree commit diff
path: root/src/engine/snapshot.h
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-05-24 20:54:08 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-05-24 20:54:08 +0000
commit82023866ab4c7483652e9d4605290e39ced3bec3 (patch)
treecbff99cb472b4434d18e8e1fe3c556ca194096a6 /src/engine/snapshot.h
parent34e3df396630e9bb271ea8965869d23260900a7d (diff)
downloadzcatch-82023866ab4c7483652e9d4605290e39ced3bec3.tar.gz
zcatch-82023866ab4c7483652e9d4605290e39ced3bec3.zip
large change. moved around all source. splitted server and client into separate files
Diffstat (limited to 'src/engine/snapshot.h')
-rw-r--r--src/engine/snapshot.h19
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]); };
+};
+