goat3d

view src/chunk.h @ 1:e46529a5d057

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