]> git.xonotic.org Git - xonotic/gmqcc.git/blob - propsal.txt
gitattributes for whitespace
[xonotic/gmqcc.git] / propsal.txt
1 This is a propsal to extend the progs.dat file format without breaking
2 backwards compatability.  Currently the progs file format header has a
3 description simaler to this:
4
5 struct {
6     uint32_t     version;
7     uint32_t     crc16;
8     ....
9     uint32_t     entfield;
10 }
11
12 The obvious notable issue here is version and crc16 are larger than they
13 essentially need to be, if we made version and crc16 both uint16_t we can
14 give ourselfs 32 bytes (2x16) to store additional data that can be used
15 to make smaller progs.dat files.
16
17 I propose a new structual layout like this:
18 struct {
19     uint16_t     version;
20     uint16_t     flags;   /* contains a skip field */
21     uint16_t     crc16;
22     uint16_t     skip;    /* skiped globals        */
23     ....
24     uint32_t     entfield;
25 }
26
27 about 45% of globals are zero, if we could order them at the top of the
28 globals array we can essentially use the skip field to specify how much
29 zero globals the engine would have to populate (instead of being stored
30 in the actual file itself) flags can specify if the progs.dat file skiped
31 globals on the write of the progs.dat file.
32
33 Of course only one bit in the flags would have to be set to specify if the
34 file contains a skip field.  Which lends itself to the fact that flags could
35 later be extended for other things.