Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/test_render/SpanPack.h @ 146:2284efc89f63
TileList の生成の修正
author | gongo@gendarme.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Tue, 02 Dec 2008 14:12:01 +0900 |
parents | fc314f28b66e |
children | 5cde66c926b4 |
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) { |
141 | 31 /** |
32 * かっこわるすぐる | |
33 */ | |
109 | 34 SpanPack* top = this; |
35 SpanPack* p; | |
36 SpanPack* p1; | |
37 | |
38 p = top->next; | |
39 while (p != NULL) { | |
40 p1 = p->next; | |
141 | 41 for (int i = 0; i < p->info.size; i++) { |
42 Span* span = &p->span[i]; | |
146 | 43 span->reinit(); |
141 | 44 } |
109 | 45 free(p); |
46 p = p1; | |
47 } | |
141 | 48 |
49 for (int i = 0; i < this->info.size; i++) { | |
50 Span* span = &this->span[i]; | |
146 | 51 span->reinit(); |
141 | 52 } |
109 | 53 |
54 this->info.size = 0; | |
55 this->info.y_top = ytop; | |
56 this->next = NULL; | |
57 } | |
58 }; | |
59 | |
60 typedef SpanPack* SpanPackPtr; | |
61 | |
62 #endif |