Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/test_render/Tapestry.h @ 236:c7abab87697a
fix
author | gongo@localhost.localdomain |
---|---|
date | Sun, 29 Mar 2009 22:03:16 +0900 |
parents | d734af296d38 |
children | a8fcb4431c76 |
rev | line source |
---|---|
117 | 1 #ifndef INCLUDED_TAPESTRY |
2 #define INCLUDED_TAPESTRY | |
3 | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
4 #ifndef INCLUDED_TYPES |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
5 # include "types.h" |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
6 #endif |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
7 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
8 #ifndef INCLUDED_VIEWER_TYPES |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
9 # include "viewer_types.h" |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
10 #endif |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
11 |
117 | 12 /** |
13 * image file name と tapestry DB の binary tree | |
14 * | |
15 * // PPE | |
16 * main memory の tapestry DB (Array) | |
17 * tapestry DB への accessor | |
18 * | |
19 * TapestryPtr getTapestry(int TapestryID); | |
20 * TilePtr getTile(TapestryPtr tapsetry, int tx, int ty, int scale); | |
21 * | |
22 * SPE が生成する tapestry List (in CreateSpan) | |
23 * (no texture image) | |
24 * @in TapestryDBPtr, Tapestry ID, x, y, tx, ty, px, py | |
25 * x, y : polygon の中の平面座標 | |
26 * tx, ty : texture の座標 | |
27 * px, py : texture の分割数 | |
28 * | |
29 * @out (TilePtr, tix1, tiy1, tix2, tiy2)* | |
30 * | |
31 * | |
32 * SPE に渡す tapestry List | |
33 * @in Tile | |
34 * | |
35 * // SPE | |
36 * SPE 内部での tapestry DB (Hash) | |
37 * TapestryID, scale, TilePtr, Tile | |
38 * | |
39 * | |
40 * SPE 内部での tapestry DB への accessor | |
41 * TileEntryPtr getTile(int TapestryID, int tx, int ty, int scale); | |
42 * | |
43 * if (TileEntry == NULL) { | |
44 * DMA read | |
45 * } | |
46 * | |
47 * | |
48 * Rendering | |
49 * 1pass Zbuffer と Texture の有無の判定 | |
50 * if (zbuffer ok) { | |
51 * if (texture ある) { | |
52 * zbuffer 、linebunf に書き込む | |
53 * } else { | |
54 * texture の load list に加える | |
55 * zbuffer だけ更新しておく | |
56 * } | |
57 * } else { | |
58 * 無視 | |
59 * } | |
60 * | |
61 * 1pass で texture が一杯になったら、中断して | |
62 * ここまでのを書き込んどけ | |
63 * | |
64 * | |
65 * 2pass rgb の書き込み | |
66 * | |
67 * if (zbuffer の値が自分と一緒) { | |
68 * read した texture みて | |
69 * 書き込め! | |
70 * } | |
71 * | |
72 */ | |
73 struct texture_block { | |
74 | |
75 }; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
76 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
77 typedef struct { |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
78 uint32 pixel[TEXTURE_BLOCK_SIZE]; // 8*8 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
79 uint32 *texture_addr; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
80 int pad[3]; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
81 } Tile, *TilePtr; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
82 |
193 | 83 #define MAX_TILE 128 |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
84 |
176 | 85 /** |
86 * TileList 中の Tile の追い出しは、現在 FIFO で実装している | |
87 */ | |
173 | 88 class TileList { |
89 public: | |
90 int curIndex; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
91 int pad[3]; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
92 Tile tile[MAX_TILE]; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
93 |
173 | 94 TileList(void) { |
95 curIndex = 0; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
96 } |
173 | 97 |
98 /** | |
176 | 99 * 次に扱う tile を取得する |
100 * | |
101 * @return tile | |
102 * | |
173 | 103 * tile[] をリングバスっぽく扱うことで |
104 * FIFO を実現することに。 | |
105 */ | |
106 TilePtr nextTile(void) { | |
107 TilePtr t = &tile[curIndex]; | |
108 curIndex = (curIndex + 1) % MAX_TILE; | |
109 return t; | |
110 } | |
111 | |
176 | 112 /** |
113 * TileList のクリア | |
210 | 114 * //tile 自体は clear する必要は無い |
115 * あるかもしれない | |
176 | 116 */ |
173 | 117 void clear(void) { |
118 curIndex = 0; | |
119 } | |
120 }; | |
121 | |
122 typedef TileList* TileListPtr; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
123 |
118 | 124 #endif |