Mercurial > hg > Game > Cerium
view TaskManager/Test/test_render/SpanPack.h @ 141:56db76a03294 draft
TileList を作ろうとしたがに動かない。
今はTileList 無しver
author | gongo@charles.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Sat, 29 Nov 2008 01:18:32 +0900 |
parents | 74d0a70f60e9 |
children | a98dbb81db5c |
line wrap: on
line source
#ifndef INCLUDED_SPAN_PACK #define INCLUDED_SPAN_PACK #ifndef INCLUDED_SPAN # include "Span.h" #endif #define MAX_SIZE_SPAN 70 class SpanPack { public: /* fields */ struct SpanInfo { int size; // 4 int y_top; // 4 int light_pos[3]; // 4*3 int light_rgb[3]; // 4*3 } info; // 32 Span span[MAX_SIZE_SPAN]; // 48*MAX_SIZE_SPAN = 3360 SpanPack *next; // 4 int pad[3]; // 12 void init(int ytop) { 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; for (int i = 0; i < p->info.size; i++) { Span* span = &p->span[i]; TileInfoListPtr tlist = span->tilelist; TileInfoListPtr t; while (tlist) { t = tlist->next; free(tlist); tlist = t; } } free(p); p = p1; } for (int i = 0; i < this->info.size; i++) { Span* span = &this->span[i]; TileInfoListPtr tlist = span->tilelist; TileInfoListPtr t; while (tlist) { t = tlist->next; free(tlist); tlist = t; } } this->info.size = 0; this->info.y_top = ytop; this->next = NULL; } }; typedef SpanPack* SpanPackPtr; #endif