File: DATAFILE

package info (click to toggle)
luola 1.2.6.dfsg-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,436 kB
  • ctags: 1,425
  • sloc: ansic: 16,705; sh: 3,025; makefile: 203
file content (33 lines) | stat: -rw-r--r-- 996 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Luola datafile format ver 1.0
-----------------------------

This is a generic datafile used by Luola.

Header format
-------------

/* Initial headers, tells what this file is */
(Uint8*4)	Header magic to identify this as a luola datafile ("LDAT")
(Uint8)		Major version number of the datafile (0x01)
(Uint8)		Minor version number of the datafile (0x00)
(Uint16)	Number of items in catalog

/* Catalog headers, tells what is in this file */
/* This header is made out of blocks like this */
(Uint8)		file identifier string length
(uint8)*len	file identifier string
(Uint16)	index number
(Uint32)	position of file inside this one
(Uint32)	length of the file

Explanations
------------

The major version number of the file changes when backwards compatability
is broken.

The data header block loops for all the entries stored in the file.
The files are looked up by the IDs assigned to them.
You can also store an array of files under the same ID.
(Usefull for storing sprites of an animation)