comparison Renderer/DataPack/Test/SpanPack/polygonpack.h @ 11:587baff06cbc

Initial revision
author akira
date Thu, 07 Feb 2008 19:17:06 +0900
parents
children
comparison
equal deleted inserted replaced
10:7aa4c006e4be 11:587baff06cbc
1 #ifndef INCLUDE_POLYGON_PACK
2 #define INCLUDE_POLYGON_PACK
3
4
5 typedef struct vertex {
6 float x;
7 float y;
8 float z;
9 float tex_x;
10 float tex_y;
11 }Vertex, *Vertex_ptr;
12
13 typedef struct Triangle {
14 long *tex_addr, tex_width, tex_height;
15 Vertex ver1;
16 Vertex ver2;
17 Vertex ver3;
18 //float x1, y1, z1, tex_x1, tex_y1;
19 //float x2, y2, z2, tex_x2, tex_y2;
20 //float x3, y3, z3, tex_x3, tex_y3;
21 } TRIANGLEPACK, *TRIANGLEPACK_PTR;
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[16];
30 } POLYGONPACK,*POLYGONPACK_PTR;
31
32 typedef struct Span {
33 long tex_addr, tex_width, tex_height;
34 int x, y, length_x;
35 float start_z, end_z;
36 float tex_x1, tex_x2, tex_y1, tex_y2;
37 } SPAN, *SPNA_PTR;
38
39 typedef struct SpanPack {
40 struct PORIGON_INFO {
41 int size;
42 int light_pos[3];
43 int light_rgb[3];
44 } info;
45 SPAN span[16];
46 } SPANPACK, *SPANPACK_PTR;
47
48
49
50 class Polygon_Pack {
51 public:
52 int create_span(void *wbuf, void *rbuf);
53 void half_triangle(long *tex_addr,long tex_width,long tex_height,Vertex *vMin, Vertex *vMid, Vertex *vMid1);
54 };
55
56 #endif
57