Mercurial > hg > Game > Cerium
diff Renderer/DataPack/Test/SpanPack/polygonpack.h @ 11:587baff06cbc
Initial revision
author | akira |
---|---|
date | Thu, 07 Feb 2008 19:17:06 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/DataPack/Test/SpanPack/polygonpack.h Thu Feb 07 19:17:06 2008 +0900 @@ -0,0 +1,57 @@ +#ifndef INCLUDE_POLYGON_PACK +#define INCLUDE_POLYGON_PACK + + +typedef struct vertex { + float x; + float y; + float z; + float tex_x; + float tex_y; +}Vertex, *Vertex_ptr; + +typedef struct Triangle { + long *tex_addr, tex_width, tex_height; + Vertex ver1; + Vertex ver2; + Vertex ver3; + //float x1, y1, z1, tex_x1, tex_y1; + //float x2, y2, z2, tex_x2, tex_y2; + //float x3, y3, z3, tex_x3, tex_y3; +} TRIANGLEPACK, *TRIANGLEPACK_PTR; + +typedef struct PolygonPack { + struct PORIGON_INFO { + int size; + int light_pos[3]; + int light_rgb[3]; + }info; + TRIANGLEPACK tri[16]; +} POLYGONPACK,*POLYGONPACK_PTR; + +typedef struct Span { + long tex_addr, tex_width, tex_height; + int x, y, length_x; + float start_z, end_z; + float tex_x1, tex_x2, tex_y1, tex_y2; +} SPAN, *SPNA_PTR; + +typedef struct SpanPack { + struct PORIGON_INFO { + int size; + int light_pos[3]; + int light_rgb[3]; + } info; + SPAN span[16]; +} SPANPACK, *SPANPACK_PTR; + + + +class Polygon_Pack { + public: + int create_span(void *wbuf, void *rbuf); + void half_triangle(long *tex_addr,long tex_width,long tex_height,Vertex *vMin, Vertex *vMid, Vertex *vMid1); +}; + +#endif +