annotate TaskManager/Test/test_render/scene_graph_pack.h @ 174:559b48b69b76

getScale()、getTapestry から、span->length に適切なテクスチャの選択に成功
author gongo@localhost.localdomain
date Fri, 12 Dec 2008 12:23:20 +0900
parents 38cbb7aecc70
children 25c820b6060e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH_PACK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH_PACK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
137
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
4 #ifndef INCLUDED_SCENE_GRAPH
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
5 # include "SceneGraph.h"
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
6 #endif
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
7
164
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
8 #ifndef INCLUDED_TYPES
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
9 # include "types.h"
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
10 #endif
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
11
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 #define MAX_NODE 16
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 #define MAX_POLYGON 36
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 typedef struct SceneGraphNode {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 int size; // この Node で使ってるポリゴンの数、でいいのかな
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 float vertex[MAX_POLYGON*3];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 float texture[MAX_POLYGON*2];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 float obj_pos[4];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 float angle[4];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 float translation[16];
164
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
22 uint32 *tex_addr;
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 137
diff changeset
23 int tex_width, tex_height;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 int id;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 int move, interaction;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 int pn; // parent number?
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 SceneGraphNode *next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 int pad[3];
137
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
29 SceneGraphPtr self;
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
30 SceneGraphPtr tree;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32 void init(void) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 size = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 next = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 }
137
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
36
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
37 void finish(void) {
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
38 SceneGraphNode *p = this->next, *p1;
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
39
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
40 while (p) {
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
41 p1 = p->next;
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
42 free(p);
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
43 p = p1;
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
44 }
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
45 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 }SceneGraphNode, *SceneGraphNodePtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 typedef struct SceneGraphInfo {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 int size;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 int pad[2];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51 }SceneGraphInfo;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53 typedef struct SceneGraphPack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 SceneGraphInfo info;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
55 SceneGraphNode node[MAX_NODE];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56 SceneGraphPack *next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58 void init(void){
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
59 next = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
60 info.size = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
61
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
62 for (int i = 0; i < MAX_NODE; i++) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
63 node[i].size = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
64 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
65 }
137
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
66
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
67 void finish(void) {
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
68 for (int i = 0; i < info.size; i++) {
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
69 node[i].finish();
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
70 }
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
71
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
72 next = 0;
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
73 info.size = 0;
6cf991f28c6c SceneGraphPack の代わりに、今は SceneGraph をそのまま使う様に設定。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 123
diff changeset
74 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
75 } SceneGraphPack, *SceneGraphPackPtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
76
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
77 #endif