annotate TaskManager/Test/test_render/polygon_pack.h @ 146:2284efc89f63

TileList の生成の修正
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Tue, 02 Dec 2008 14:12:01 +0900
parents 5c194c71eca8
children 38cbb7aecc70
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
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #define MAX_SIZE_TRIANGLE 128
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6 typedef struct VertexPack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7 float x;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 float y;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 float z;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 float tex_x;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 float tex_y;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 }VertexPack, *VertexPackPtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 typedef struct TrianglePack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 long *tex_addr, tex_width, tex_height;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 VertexPack ver1;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 VertexPack ver2;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 VertexPack ver3;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 } TrianglePack, *TrianglePackPtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 typedef struct PolygonPack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 struct PORIGON_info {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 int size;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26 int light_pos[3];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
27 int light_rgb[3];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
28 }info;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
29 TrianglePack tri[MAX_SIZE_TRIANGLE]; // Variable length array
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
30
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
31 PolygonPack* next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
33 void init(void) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 info.size = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 next = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 void clear(void) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 PolygonPack *q = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 PolygonPack *q1 = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
41
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
42 q = this->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
43 while (q) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
44 q1 = q->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 delete(q);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 q = q1;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
48 this->init();
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
49 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
50 } PolygonPack, *PolygonPackPtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
51
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
52 typedef struct PolygonPackList {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53 int size;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 //PolygonPack *list[6];
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
55 PolygonPack *list;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56 } PolygonPackList;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58 #endif