Mercurial > hg > Members > kono > Cerium
annotate TaskManager/Test/test_render/Tapestry.h @ 173:56be4a6e5513
add scale
author | gongo@localhost.localdomain |
---|---|
date | Thu, 11 Dec 2008 20:17:01 +0900 |
parents | c8b868871dce |
children | 08e2bb36639b |
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 }; | |
118 | 76 #if 0 |
117 | 77 struct TileList { |
78 TilePtr tile; | |
79 int tix1, tiy1, tix2, tiy2; | |
80 }; | |
81 #endif | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
82 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
83 typedef struct { |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
84 uint32 pixel[TEXTURE_BLOCK_SIZE]; // 8*8 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
85 uint32 *texture_addr; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
86 int pad[3]; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
87 } Tile, *TilePtr; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
88 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
89 #define MAX_TILE 100 |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
90 |
173 | 91 class TileList { |
92 public: | |
93 int curIndex; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
94 int pad[3]; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
95 Tile tile[MAX_TILE]; |
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
96 |
173 | 97 TileList(void) { |
98 curIndex = 0; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
99 } |
173 | 100 |
101 /** | |
102 * tile[] をリングバスっぽく扱うことで | |
103 * FIFO を実現することに。 | |
104 */ | |
105 TilePtr nextTile(void) { | |
106 TilePtr t = &tile[curIndex]; | |
107 curIndex = (curIndex + 1) % MAX_TILE; | |
108 return t; | |
109 } | |
110 | |
111 void clear(void) { | |
112 curIndex = 0; | |
113 } | |
114 }; | |
115 | |
116 typedef TileList* TileListPtr; | |
167
c8b868871dce
DrawSpan で使う Tile の Hash の扱いは class TileHash を生成する事に。
gongo@localhost.localdomain
parents:
118
diff
changeset
|
117 |
118 | 118 #endif |