109
|
1 #ifndef INCLUDED_POLYGON_PACK
|
|
2 #define INCLUDED_POLYGON_PACK
|
|
3
|
|
4 #define MAX_SIZE_TRIANGLE 128
|
|
5
|
|
6 typedef struct VertexPack {
|
|
7 float x;
|
|
8 float y;
|
|
9 float z;
|
|
10 float tex_x;
|
|
11 float tex_y;
|
|
12 }VertexPack, *VertexPackPtr;
|
|
13
|
|
14
|
|
15 typedef struct TrianglePack {
|
|
16 long *tex_addr, tex_width, tex_height;
|
|
17 VertexPack ver1;
|
|
18 VertexPack ver2;
|
|
19 VertexPack ver3;
|
|
20 } TrianglePack, *TrianglePackPtr;
|
|
21
|
|
22
|
|
23 typedef struct PolygonPack {
|
|
24 struct PORIGON_info {
|
|
25 int size;
|
|
26 int light_pos[3];
|
|
27 int light_rgb[3];
|
|
28 }info;
|
|
29 TrianglePack tri[MAX_SIZE_TRIANGLE]; // Variable length array
|
|
30
|
|
31 PolygonPack* next;
|
|
32
|
|
33 void init(void) {
|
|
34 info.size = 0;
|
|
35 next = 0;
|
|
36 }
|
|
37
|
|
38 void clear(void) {
|
|
39 PolygonPack *q = 0;
|
|
40 PolygonPack *q1 = 0;
|
|
41
|
|
42 q = this->next;
|
|
43 while (q) {
|
|
44 q1 = q->next;
|
|
45 delete(q);
|
|
46 q = q1;
|
|
47 }
|
|
48 this->init();
|
|
49 }
|
|
50 } PolygonPack, *PolygonPackPtr;
|
|
51
|
|
52 typedef struct PolygonPackList {
|
|
53 int size;
|
|
54 //PolygonPack *list[6];
|
|
55 PolygonPack *list;
|
|
56 } PolygonPackList;
|
|
57
|
|
58 #endif
|