Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/test_render/SpanPack.h @ 126:7635f223fc7d
fix RGBA mask (bgr -> rgba)
author | gongo@charles.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Tue, 25 Nov 2008 11:37:57 +0900 |
parents | 5c194c71eca8 |
children | fc314f28b66e |
rev | line source |
---|---|
109 | 1 #ifndef INCLUDED_SPAN_PACK |
2 #define INCLUDED_SPAN_PACK | |
3 | |
4 #ifndef INCLUDED_SPAN | |
5 # include "Span.h" | |
6 #endif | |
7 | |
8 #define MAX_SIZE_SPAN 70 | |
9 | |
10 class SpanPack { | |
11 public: /* fields */ | |
12 struct SpanInfo { | |
13 int size; // 4 | |
14 int y_top; // 4 | |
15 int light_pos[3]; // 4*3 | |
16 int light_rgb[3]; // 4*3 | |
17 } info; // 32 | |
18 | |
19 Span span[MAX_SIZE_SPAN]; // 48*MAX_SIZE_SPAN = 3360 | |
20 SpanPack *next; // 4 | |
21 | |
22 int pad[3]; // 12 | |
23 | |
24 void init(int ytop) { | |
126
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
109
diff
changeset
|
25 this->info.size = 0; |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
109
diff
changeset
|
26 this->info.y_top = ytop; |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
109
diff
changeset
|
27 this->next = NULL; |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
109
diff
changeset
|
28 } |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
109
diff
changeset
|
29 |
7635f223fc7d
fix RGBA mask (bgr -> rgba)
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
109
diff
changeset
|
30 void reinit(int ytop) { |
109 | 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.size = 0; | |
43 this->info.y_top = ytop; | |
44 this->next = NULL; | |
45 } | |
46 }; | |
47 | |
48 typedef SpanPack* SpanPackPtr; | |
49 | |
50 #endif |