Mercurial > hg > Game > Cerium
diff Renderer/Engine/polygon_pack.h @ 539:3bc98f6d31ff draft
Reorganization..
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 12 Oct 2009 09:39:35 +0900 |
parents | Renderer/test_render/polygon_pack.h@15bfacccde99 |
children | 63a08f3a468a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/polygon_pack.h Mon Oct 12 09:39:35 2009 +0900 @@ -0,0 +1,75 @@ +#ifndef INCLUDED_POLYGON_PACK +#define INCLUDED_POLYGON_PACK + +#include "types.h" + +#define MAX_SIZE_TRIANGLE 128 + +typedef struct VertexPack { + float x; + float y; + float z; + float tex_x; + float tex_y; +} VertexPack, *VertexPackPtr; // 20 + +typedef struct NormalPack { + float x; + float y; + float z; +} NormalPack, *NormalPackPtr; // 12 + +typedef struct TriTexInfo { + uint32 *addr; + int width; + int height; + int scale_max; +} TriangleTexInfo, *TriangleTexInfoPtr; // 16 + +typedef struct TrianglePack { + TriTexInfo tex_info; + VertexPack ver1; + VertexPack ver2; + VertexPack ver3; + NormalPack normal1; + NormalPack normal2; + NormalPack normal3; +} TrianglePack, *TrianglePackPtr; + + +typedef struct PolygonPack { + struct POLYGON_info { + int size; + int light_pos[3]; + int light_rgb[3]; + }info; + + TrianglePack tri[MAX_SIZE_TRIANGLE]; + + PolygonPack* next; + + void init(void) { + info.size = 0; + next = 0; + } + + void clear(void) { + PolygonPack *q = 0; + PolygonPack *q1 = 0; + + q = this->next; + while (q) { + q1 = q->next; + delete(q); + q = q1; + } + this->init(); + } +} PolygonPack, *PolygonPackPtr; // 4*7 + 76*128 + 4 = 9760 + +typedef struct PolygonPackList { + int size; + PolygonPack *list; +} PolygonPackList; + +#endif