Mercurial > hg > Game > Cerium
diff Renderer/Engine/SpanPack.h @ 539:3bc98f6d31ff draft
Reorganization..
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 12 Oct 2009 09:39:35 +0900 |
parents | Renderer/test_render/SpanPack.h@15bfacccde99 |
children | 8917aff8629c |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/SpanPack.h Mon Oct 12 09:39:35 2009 +0900 @@ -0,0 +1,51 @@ +#ifndef INCLUDED_SPAN_PACK +#define INCLUDED_SPAN_PACK + +#include "Span.h" + +#define MAX_SIZE_SPAN 64 + +class SpanPack { +public: /* fields */ + struct SpanInfo { + int start; + int size; + int y_top; + int light_pos[3]; + int light_rgb[3]; + } info; // 36 + + Span span[MAX_SIZE_SPAN]; // 48*MAX_SIZE_SPAN = 3072 + SpanPack *next; // 4 + + int pad[2]; // 8 + + void init(int ytop) { + this->info.start = 0; + this->info.size = 0; + this->info.y_top = ytop; + this->next = NULL; + } + + void reinit(int ytop) { + SpanPack* top = this; + SpanPack* p; + SpanPack* p1; + + p = top->next; + while (p != NULL) { + p1 = p->next; + free(p); + p = p1; + } + + this->info.start = 0; + this->info.size = 0; + this->info.y_top = ytop; + this->next = NULL; + } +}; + +typedef SpanPack* SpanPackPtr; + +#endif