Przeglądaj źródła

Move Archive data definitions into ResourceArchive.h

Daniele Bartolini 13 lat temu
rodzic
commit
5c68e0a635
1 zmienionych plików z 18 dodań i 1 usunięć
  1. 18 1
      src/ResourceArchive.h

+ 18 - 1
src/ResourceArchive.h

@@ -30,6 +30,24 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 {
 
+const uint32_t ARCHIVE_VERSION	= 1;	// Version of the archive
+
+struct ArchiveHeader
+{
+	uint32_t	version;			// The version number of the archive
+	uint32_t	entries_count;		// Number of resource entries in the archive
+	uint32_t	checksum;			// MD5 checksum of the archive
+	uint8_t		padding[64];		// Padding for additional data
+};
+
+struct ArchiveEntry
+{
+	uint32_t	name;				// Name of the resource (fnv1a hash)
+	uint32_t	type;				// Type of the resource (fnv1a hash)
+	uint64_t	offset;				// First byte of the resource (as absolute offset)
+	uint32_t	size;				// Size of the resource data (in bytes)
+};
+
 class Filesystem;
 class FileStream;
 
@@ -37,7 +55,6 @@ class ResourceArchive
 {
 public:
 
-							ResourceArchive(Filesystem& fs) {}
 	virtual					~ResourceArchive() {}
 
 	virtual FileStream*		find(ResourceId name) = 0;