rev |
line source |
nuclear@1
|
1 #ifndef CHUNK_H_
|
nuclear@1
|
2 #define CHUNK_H_
|
nuclear@1
|
3
|
nuclear@1
|
4 enum {
|
nuclear@1
|
5 CNK_INVALID, // this shouldn't appear in files
|
nuclear@1
|
6 CNK_SCENE, // the root chunk
|
nuclear@1
|
7
|
nuclear@1
|
8 // general purpose chunks
|
nuclear@1
|
9 CNK_INT,
|
nuclear@1
|
10 CNK_UINT,
|
nuclear@1
|
11 CNK_FLOAT,
|
nuclear@1
|
12 CNK_VEC3,
|
nuclear@1
|
13 CNK_VEC4,
|
nuclear@1
|
14 CNK_STRING,
|
nuclear@1
|
15
|
nuclear@1
|
16 // --- first level chunks ---
|
nuclear@1
|
17 // children of CNK_SCENE
|
nuclear@1
|
18 CNK_ENV, // environmental parameters
|
nuclear@1
|
19 CNK_MTL_LIST, // material library
|
nuclear@1
|
20 CNK_MESH_LIST, // all the meshes hang under this chunk
|
nuclear@1
|
21 CNK_LIGHT_LIST, // likewise for lights
|
nuclear@1
|
22 CNK_CAMERA_LIST, // likewise for cameras
|
nuclear@1
|
23 CNK_NODE_LIST, // likewise for nodes
|
nuclear@1
|
24 CNK_ANIM_LIST, // all animations
|
nuclear@1
|
25
|
nuclear@1
|
26 // --- second level chunks ---
|
nuclear@1
|
27 // children of CNK_ENV
|
nuclear@1
|
28 CNK_ENV_AMBIENT, // ambient color, contains a single CNK_VEC3
|
nuclear@1
|
29 CNK_ENV_FOG,
|
nuclear@1
|
30
|
nuclear@1
|
31 // children of CNK_*_LIST
|
nuclear@1
|
32 CNK_MTL,
|
nuclear@1
|
33 CNK_MESH,
|
nuclear@1
|
34 CNK_LIGHT,
|
nuclear@1
|
35 CNK_CAMERA,
|
nuclear@1
|
36 CNK_NODE,
|
nuclear@1
|
37
|
nuclear@1
|
38 // --- third level chunks ---
|
nuclear@1
|
39 // children of CNK_FOG
|
nuclear@1
|
40 CNK_FOG_COLOR, // fog color, contains a single CNK_VEC3
|
nuclear@1
|
41 CNK_FOG_EXP, // fog exponent, contains a single CNK_REAL
|
nuclear@1
|
42
|
nuclear@1
|
43 // children of CNK_MTL
|
nuclear@1
|
44 CNK_MTL_ATTR, // material attribute, has a CNK_STRING for its name,
|
nuclear@1
|
45 // a CNK_MTL_ATTR_VAL, and optionally a CNK_MTL_ATTR_MAP
|
nuclear@1
|
46 // children of CNK_MTL_ATTR
|
nuclear@1
|
47 CNK_MTL_ATTR_VAL, // can have a single CNK_FLOAT, CNK_VEC3, or CNK_VEC4
|
nuclear@1
|
48 CNK_MTL_ATTR_MAP, // has a single CNK_STRING
|
nuclear@1
|
49
|
nuclear@1
|
50 // children of CNK_MESH
|
nuclear@1
|
51 // TODO...
|
nuclear@1
|
52 };
|
nuclear@1
|
53
|
nuclear@1
|
54 struct ChunkHeader {
|
nuclear@1
|
55 uint32_t id;
|
nuclear@1
|
56 uint32_t size;
|
nuclear@1
|
57 };
|
nuclear@1
|
58
|
nuclear@1
|
59 struct Chunk {
|
nuclear@1
|
60 ChunkHeader hdr;
|
nuclear@1
|
61 char data[1];
|
nuclear@1
|
62 };
|
nuclear@1
|
63
|
nuclear@1
|
64 #endif // CHUNK_H_
|