Mercurial > hg > Members > kono > Cerium
comparison Renderer/test_render/polygon_pack.h @ 283:55ea4465b1a2
fix test_render
author | e065746@localhost.localdomain |
---|---|
date | Fri, 05 Jun 2009 16:49:12 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
282:ef061be0baff | 283:55ea4465b1a2 |
---|---|
1 #ifndef INCLUDED_POLYGON_PACK | |
2 #define INCLUDED_POLYGON_PACK | |
3 | |
4 #ifndef INCLUDED_TYPES | |
5 # include "types.h" | |
6 #endif | |
7 | |
8 #define MAX_SIZE_TRIANGLE 128 | |
9 | |
10 typedef struct VertexPack { | |
11 float x; | |
12 float y; | |
13 float z; | |
14 float tex_x; | |
15 float tex_y; | |
16 } VertexPack, *VertexPackPtr; // 20 | |
17 | |
18 typedef struct TriTexInfo { | |
19 uint32 *addr; | |
20 int width; | |
21 int height; | |
22 int scale_max; | |
23 } TriangleTexInfo, *TriangleTexInfoPtr; // 16 | |
24 | |
25 typedef struct TrianglePack { | |
26 TriTexInfo tex_info; | |
27 VertexPack ver1; | |
28 VertexPack ver2; | |
29 VertexPack ver3; | |
30 } TrianglePack, *TrianglePackPtr; | |
31 | |
32 | |
33 typedef struct PolygonPack { | |
34 struct PORIGON_info { | |
35 int size; | |
36 int light_pos[3]; | |
37 int light_rgb[3]; | |
38 }info; | |
39 | |
40 TrianglePack tri[MAX_SIZE_TRIANGLE]; | |
41 | |
42 PolygonPack* next; | |
43 | |
44 void init(void) { | |
45 info.size = 0; | |
46 next = 0; | |
47 } | |
48 | |
49 void clear(void) { | |
50 PolygonPack *q = 0; | |
51 PolygonPack *q1 = 0; | |
52 | |
53 q = this->next; | |
54 while (q) { | |
55 q1 = q->next; | |
56 delete(q); | |
57 q = q1; | |
58 } | |
59 this->init(); | |
60 } | |
61 } PolygonPack, *PolygonPackPtr; // 4*7 + 76*128 + 4 = 9760 | |
62 | |
63 typedef struct PolygonPackList { | |
64 int size; | |
65 PolygonPack *list; | |
66 } PolygonPackList; | |
67 | |
68 #endif |