annotate Renderer/Engine/SpanPack.h @ 1143:786e800abfb4 draft

minor fix
author Yutaka_Kinjyo
date Sat, 19 Feb 2011 01:59:14 +0900
parents 3bc98f6d31ff
children 8917aff8629c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCLUDED_SPAN_PACK
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_SPAN_PACK
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include "Span.h"
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
5
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
6 #define MAX_SIZE_SPAN 64
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
7
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
8 class SpanPack {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
9 public: /* fields */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
10 struct SpanInfo {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
11 int start;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
12 int size;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
13 int y_top;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
14 int light_pos[3];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
15 int light_rgb[3];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
16 } info; // 36
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18 Span span[MAX_SIZE_SPAN]; // 48*MAX_SIZE_SPAN = 3072
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 SpanPack *next; // 4
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
21 int pad[2]; // 8
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
22
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
23 void init(int ytop) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
24 this->info.start = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
25 this->info.size = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 this->info.y_top = ytop;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
27 this->next = NULL;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
28 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
29
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
30 void reinit(int ytop) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 SpanPack* top = this;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 SpanPack* p;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 SpanPack* p1;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 p = top->next;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36 while (p != NULL) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37 p1 = p->next;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38 free(p);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39 p = p1;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
42 this->info.start = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
43 this->info.size = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
44 this->info.y_top = ytop;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
45 this->next = NULL;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
46 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
47 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
48
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
49 typedef SpanPack* SpanPackPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
50
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
51 #endif