Mercurial > hg > Game > Cerium
comparison TaskManager/Test/test_render/scene_graph_pack.h @ 137:91c74dbc32e4 draft
SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
author | gongo@gendarme.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 28 Nov 2008 10:07:48 +0900 |
parents | e9e12e2088bd |
children | dc7d10ae7460 |
comparison
equal
deleted
inserted
replaced
136:ba896af69945 | 137:91c74dbc32e4 |
---|---|
1 #ifndef INCLUDED_SCENE_GRAPH_PACK | 1 #ifndef INCLUDED_SCENE_GRAPH_PACK |
2 #define INCLUDED_SCENE_GRAPH_PACK | 2 #define INCLUDED_SCENE_GRAPH_PACK |
3 | |
4 #ifndef INCLUDED_SCENE_GRAPH | |
5 # include "SceneGraph.h" | |
6 #endif | |
3 | 7 |
4 #define MAX_NODE 16 | 8 #define MAX_NODE 16 |
5 #define MAX_POLYGON 36 | 9 #define MAX_POLYGON 36 |
6 | 10 |
7 typedef struct SceneGraphNode { | 11 typedef struct SceneGraphNode { |
15 int id; | 19 int id; |
16 int move, interaction; | 20 int move, interaction; |
17 int pn; // parent number? | 21 int pn; // parent number? |
18 SceneGraphNode *next; | 22 SceneGraphNode *next; |
19 int pad[3]; | 23 int pad[3]; |
24 SceneGraphPtr self; | |
25 SceneGraphPtr tree; | |
20 | 26 |
21 void init(void) { | 27 void init(void) { |
22 size = 0; | 28 size = 0; |
23 next = 0; | 29 next = 0; |
30 } | |
31 | |
32 void finish(void) { | |
33 SceneGraphNode *p = this->next, *p1; | |
34 | |
35 while (p) { | |
36 p1 = p->next; | |
37 free(p); | |
38 p = p1; | |
39 } | |
24 } | 40 } |
25 }SceneGraphNode, *SceneGraphNodePtr; | 41 }SceneGraphNode, *SceneGraphNodePtr; |
26 | 42 |
27 typedef struct SceneGraphInfo { | 43 typedef struct SceneGraphInfo { |
28 int size; | 44 int size; |
40 | 56 |
41 for (int i = 0; i < MAX_NODE; i++) { | 57 for (int i = 0; i < MAX_NODE; i++) { |
42 node[i].size = 0; | 58 node[i].size = 0; |
43 } | 59 } |
44 } | 60 } |
61 | |
62 void finish(void) { | |
63 for (int i = 0; i < info.size; i++) { | |
64 node[i].finish(); | |
65 } | |
66 | |
67 next = 0; | |
68 info.size = 0; | |
69 } | |
45 } SceneGraphPack, *SceneGraphPackPtr; | 70 } SceneGraphPack, *SceneGraphPackPtr; |
46 | 71 |
47 #endif | 72 #endif |