00001 #ifndef INCLUDED_SPAN_PACK
00002 #define INCLUDED_SPAN_PACK
00003
00004 #ifndef INCLUDED_SPAN
00005 # include "Span.h"
00006 #endif
00007
00008 #define MAX_SIZE_SPAN 64
00009
00010 class SpanPack {
00011 public:
00012 struct SpanInfo {
00013 int start;
00014 int size;
00015 int y_top;
00016 int light_pos[3];
00017 int light_rgb[3];
00018 } info;
00019
00020 Span span[MAX_SIZE_SPAN];
00021 SpanPack *next;
00022
00023 int pad[2];
00024
00025 void init(int ytop) {
00026 this->info.start = 0;
00027 this->info.size = 0;
00028 this->info.y_top = ytop;
00029 this->next = NULL;
00030 }
00031
00032 void reinit(int ytop) {
00033 SpanPack* top = this;
00034 SpanPack* p;
00035 SpanPack* p1;
00036
00037 p = top->next;
00038 while (p != NULL) {
00039 p1 = p->next;
00040 free(p);
00041 p = p1;
00042 }
00043
00044 this->info.start = 0;
00045 this->info.size = 0;
00046 this->info.y_top = ytop;
00047 this->next = NULL;
00048 }
00049 };
00050
00051 typedef SpanPack* SpanPackPtr;
00052
00053 #endif