annotate TaskManager/Test/test_render/scene_graph_pack.h @ 146:a98dbb81db5c draft

TileList の生成の修正
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Tue, 02 Dec 2008 14:12:01 +0900
parents 91c74dbc32e4
children dc7d10ae7460
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH_PACK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH_PACK
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
4 #ifndef INCLUDED_SCENE_GRAPH
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
5 # include "SceneGraph.h"
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
6 #endif
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
7
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 #define MAX_NODE 16
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 #define MAX_POLYGON 36
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 typedef struct SceneGraphNode {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 int size; // この Node で使ってるポリゴンの数、でいいのかな
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 float vertex[MAX_POLYGON*3];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 float texture[MAX_POLYGON*2];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 float obj_pos[4];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 float angle[4];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 float translation[16];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 long *tex_addr, tex_width, tex_height;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 int id;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 int move, interaction;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 int pn; // parent number?
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 SceneGraphNode *next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 int pad[3];
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
24 SceneGraphPtr self;
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
25 SceneGraphPtr tree;
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 void init(void) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 size = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 next = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
30 }
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
31
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
32 void finish(void) {
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
33 SceneGraphNode *p = this->next, *p1;
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
34
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
35 while (p) {
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
36 p1 = p->next;
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
37 free(p);
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
38 p = p1;
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
39 }
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
40 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41 }SceneGraphNode, *SceneGraphNodePtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 typedef struct SceneGraphInfo {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 int size;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 int pad[2];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 }SceneGraphInfo;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 typedef struct SceneGraphPack {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 SceneGraphInfo info;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 SceneGraphNode node[MAX_NODE];
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51 SceneGraphPack *next;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53 void init(void){
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 next = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
55 info.size = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57 for (int i = 0; i < MAX_NODE; i++) {
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58 node[i].size = 0;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
59 }
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
60 }
137
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
61
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
62 void finish(void) {
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
63 for (int i = 0; i < info.size; i++) {
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
64 node[i].finish();
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
65 }
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
66
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
67 next = 0;
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
68 info.size = 0;
91c74dbc32e4 SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
69 }
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
70 } SceneGraphPack, *SceneGraphPackPtr;
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
71
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
72 #endif