283
|
1 #ifndef INCLUDED_SPAN_PACK
|
|
2 #define INCLUDED_SPAN_PACK
|
|
3
|
539
|
4 #include "Span.h"
|
283
|
5
|
|
6 #define MAX_SIZE_SPAN 64
|
|
7
|
|
8 class SpanPack {
|
|
9 public: /* fields */
|
|
10 struct SpanInfo {
|
|
11 int start;
|
|
12 int size;
|
|
13 int y_top;
|
|
14 int light_pos[3];
|
|
15 int light_rgb[3];
|
|
16 } info; // 36
|
|
17
|
|
18 Span span[MAX_SIZE_SPAN]; // 48*MAX_SIZE_SPAN = 3072
|
|
19 SpanPack *next; // 4
|
|
20
|
|
21 int pad[2]; // 8
|
|
22
|
|
23 void init(int ytop) {
|
|
24 this->info.start = 0;
|
|
25 this->info.size = 0;
|
|
26 this->info.y_top = ytop;
|
|
27 this->next = NULL;
|
|
28 }
|
|
29
|
|
30 void reinit(int ytop) {
|
|
31 SpanPack* top = this;
|
|
32 SpanPack* p;
|
|
33 SpanPack* p1;
|
|
34
|
|
35 p = top->next;
|
|
36 while (p != NULL) {
|
|
37 p1 = p->next;
|
|
38 free(p);
|
|
39 p = p1;
|
|
40 }
|
|
41
|
|
42 this->info.start = 0;
|
|
43 this->info.size = 0;
|
|
44 this->info.y_top = ytop;
|
|
45 this->next = NULL;
|
|
46 }
|
|
47 };
|
|
48
|
|
49 typedef SpanPack* SpanPackPtr;
|
|
50
|
|
51 #endif
|