00001 #ifndef INCLUDED_POLYGON_PACK
00002 #define INCLUDED_POLYGON_PACK
00003
00004 #ifndef INCLUDED_TYPES
00005 # include "types.h"
00006 #endif
00007
00008 #define MAX_SIZE_TRIANGLE 128
00009
00010 typedef struct VertexPack {
00011 float x;
00012 float y;
00013 float z;
00014 float tex_x;
00015 float tex_y;
00016 } VertexPack, *VertexPackPtr;
00017
00018 typedef struct TriTexInfo {
00019 uint32 *addr;
00020 int width;
00021 int height;
00022 int scale_max;
00023 } TriangleTexInfo, *TriangleTexInfoPtr;
00024
00025 typedef struct TrianglePack {
00026 TriTexInfo tex_info;
00027 VertexPack ver1;
00028 VertexPack ver2;
00029 VertexPack ver3;
00030 } TrianglePack, *TrianglePackPtr;
00031
00032
00033 typedef struct PolygonPack {
00034 struct PORIGON_info {
00035 int size;
00036 int light_pos[3];
00037 int light_rgb[3];
00038 }info;
00039
00040 TrianglePack tri[MAX_SIZE_TRIANGLE];
00041
00042 PolygonPack* next;
00043
00044 void init(void) {
00045 info.size = 0;
00046 next = 0;
00047 }
00048
00049 void clear(void) {
00050 PolygonPack *q = 0;
00051 PolygonPack *q1 = 0;
00052
00053 q = this->next;
00054 while (q) {
00055 q1 = q->next;
00056 delete(q);
00057 q = q1;
00058 }
00059 this->init();
00060 }
00061 } PolygonPack, *PolygonPackPtr;
00062
00063 typedef struct PolygonPackList {
00064 int size;
00065 PolygonPack *list;
00066 } PolygonPackList;
00067
00068 #endif