goat3d
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/chunk.h Sat Aug 17 23:51:24 2013 +0300 1.3 @@ -0,0 +1,64 @@ 1.4 +#ifndef CHUNK_H_ 1.5 +#define CHUNK_H_ 1.6 + 1.7 +enum { 1.8 + CNK_INVALID, // this shouldn't appear in files 1.9 + CNK_SCENE, // the root chunk 1.10 + 1.11 + // general purpose chunks 1.12 + CNK_INT, 1.13 + CNK_UINT, 1.14 + CNK_FLOAT, 1.15 + CNK_VEC3, 1.16 + CNK_VEC4, 1.17 + CNK_STRING, 1.18 + 1.19 + // --- first level chunks --- 1.20 + // children of CNK_SCENE 1.21 + CNK_ENV, // environmental parameters 1.22 + CNK_MTL_LIST, // material library 1.23 + CNK_MESH_LIST, // all the meshes hang under this chunk 1.24 + CNK_LIGHT_LIST, // likewise for lights 1.25 + CNK_CAMERA_LIST, // likewise for cameras 1.26 + CNK_NODE_LIST, // likewise for nodes 1.27 + CNK_ANIM_LIST, // all animations 1.28 + 1.29 + // --- second level chunks --- 1.30 + // children of CNK_ENV 1.31 + CNK_ENV_AMBIENT, // ambient color, contains a single CNK_VEC3 1.32 + CNK_ENV_FOG, 1.33 + 1.34 + // children of CNK_*_LIST 1.35 + CNK_MTL, 1.36 + CNK_MESH, 1.37 + CNK_LIGHT, 1.38 + CNK_CAMERA, 1.39 + CNK_NODE, 1.40 + 1.41 + // --- third level chunks --- 1.42 + // children of CNK_FOG 1.43 + CNK_FOG_COLOR, // fog color, contains a single CNK_VEC3 1.44 + CNK_FOG_EXP, // fog exponent, contains a single CNK_REAL 1.45 + 1.46 + // children of CNK_MTL 1.47 + CNK_MTL_ATTR, // material attribute, has a CNK_STRING for its name, 1.48 + // a CNK_MTL_ATTR_VAL, and optionally a CNK_MTL_ATTR_MAP 1.49 + // children of CNK_MTL_ATTR 1.50 + CNK_MTL_ATTR_VAL, // can have a single CNK_FLOAT, CNK_VEC3, or CNK_VEC4 1.51 + CNK_MTL_ATTR_MAP, // has a single CNK_STRING 1.52 + 1.53 + // children of CNK_MESH 1.54 + // TODO... 1.55 +}; 1.56 + 1.57 +struct ChunkHeader { 1.58 + uint32_t id; 1.59 + uint32_t size; 1.60 +}; 1.61 + 1.62 +struct Chunk { 1.63 + ChunkHeader hdr; 1.64 + char data[1]; 1.65 +}; 1.66 + 1.67 +#endif // CHUNK_H_