annotate TaskManager/Test/test_render/polygon_pack.h @ 224:ebfb9e389716

SceneGraph.cpp xmlcreate
author tkaito@nw0534.st.ie.u-ryukyu.ac.jp
date Tue, 10 Feb 2009 20:45:51 +0900
parents 204b03ca98f8
children a7ff29110474
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_POLYGON_PACK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_POLYGON_PACK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
164
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
4 #ifndef INCLUDED_TYPES
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
5 # include "types.h"
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
6 #endif
38cbb7aecc70 TilePtr は SPE で計算した方がいいと判断して変更。
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 109
diff changeset
7
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 #define MAX_SIZE_TRIANGLE 128
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 typedef struct VertexPack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 float x;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 float y;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 float z;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 float tex_x;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 float tex_y;
210
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
16 } VertexPack, *VertexPackPtr; // 20
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17
210
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
18 typedef struct TriTexInfo {
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
19 uint32 *addr;
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
20 int width;
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
21 int height;
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
22 int scale_max;
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
23 } TriangleTexInfo, *TriangleTexInfoPtr; // 16
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 typedef struct TrianglePack {
210
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
26 TriTexInfo tex_info;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 VertexPack ver1;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 VertexPack ver2;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 VertexPack ver3;
210
204b03ca98f8 fix DrawSpan
gongo@localhost.localdomain
parents: 174
diff changeset
30 } TrianglePack, *TrianglePackPtr;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 typedef struct PolygonPack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 struct PORIGON_info {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 int size;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 int light_pos[3];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37 int light_rgb[3];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 }info;
174
559b48b69b76 getScale()、getTapestry から、span->length に適切なテクスチャの選択に成功
gongo@localhost.localdomain
parents: 164
diff changeset
39
559b48b69b76 getScale()、getTapestry から、span->length に適切なテクスチャの選択に成功
gongo@localhost.localdomain
parents: 164
diff changeset
40 TrianglePack tri[MAX_SIZE_TRIANGLE];
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 PolygonPack* next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 void init(void) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 info.size = 0;
174
559b48b69b76 getScale()、getTapestry から、span->length に適切なテクスチャの選択に成功
gongo@localhost.localdomain
parents: 164
diff changeset
46 next = 0;
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 void clear(void) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 PolygonPack *q = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51 PolygonPack *q1 = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53 q = this->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 while (q) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
55 q1 = q->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56 delete(q);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57 q = q1;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
59 this->init();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
60 }
174
559b48b69b76 getScale()、getTapestry から、span->length に適切なテクスチャの選択に成功
gongo@localhost.localdomain
parents: 164
diff changeset
61 } PolygonPack, *PolygonPackPtr; // 4*7 + 76*128 + 4 = 9760
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
62
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
63 typedef struct PolygonPackList {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
64 int size;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
65 PolygonPack *list;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
66 } PolygonPackList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
67
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
68 #endif