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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #ifndef INCLUDED_SPAN_PACK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #define INCLUDED_SPAN_PACK
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #ifndef INCLUDED_SPAN
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 # include "Span.h"
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6 #endif
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 #define MAX_SIZE_SPAN 70
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 class SpanPack {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 public: /* fields */
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 struct SpanInfo {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 int size; // 4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 int y_top; // 4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 int light_pos[3]; // 4*3
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 int light_rgb[3]; // 4*3
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 } info; // 32
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 Span span[MAX_SIZE_SPAN]; // 48*MAX_SIZE_SPAN = 3360
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 SpanPack *next; // 4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 int pad[3]; // 12
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
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
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
31 /**
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
32 * かっこわるすぐる
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
33 */
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
34 SpanPack* top = this;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
35 SpanPack* p;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
36 SpanPack* p1;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
37
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
38 p = top->next;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
39 while (p != NULL) {
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
40 p1 = p->next;
141
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
41 for (int i = 0; i < p->info.size; i++) {
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
42 Span* span = &p->span[i];
146
2284efc89f63 TileList の生成の修正
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 141
diff changeset
43 span->reinit();
141
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
44 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
45 free(p);
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
46 p = p1;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
47 }
141
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
48
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
49 for (int i = 0; i < this->info.size; i++) {
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
50 Span* span = &this->span[i];
146
2284efc89f63 TileList の生成の修正
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 141
diff changeset
51 span->reinit();
141
fc314f28b66e TileList を作ろうとしたがに動かない。
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents: 126
diff changeset
52 }
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
53
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
54 this->info.size = 0;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
55 this->info.y_top = ytop;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
56 this->next = NULL;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
57 }
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
58 };
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
59
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
60 typedef SpanPack* SpanPackPtr;
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
61
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
62 #endif