Mercurial > hg > Game > Cerium
comparison TaskManager/Test/test_render/spe/DrawSpan.cpp @ 168:f533a4104d41 draft
Delete DrawSpan::get_pixel().
author | gongo@localhost.localdomain |
---|---|
date | Thu, 11 Dec 2008 10:38:28 +0900 |
parents | 508beb59e0eb |
children | 5a4f2497c22d |
comparison
equal
deleted
inserted
replaced
167:508beb59e0eb | 168:f533a4104d41 |
---|---|
95 } | 95 } |
96 | 96 |
97 return zRow; | 97 return zRow; |
98 } | 98 } |
99 | 99 |
100 | |
101 char* | |
102 DrawSpan::get_pixel(int tx, int ty, uint32 *texture_image) | |
103 { | |
104 return (char*)(texture_image+((TEXTURE_SPLIT_PIXEL)*ty+tx)); | |
105 } | |
106 | |
107 Uint32 | 100 Uint32 |
108 DrawSpan::get_rgb(int tx, int ty, uint32 *addr) | 101 DrawSpan::get_rgb(int tx, int ty, uint32 *addr) |
109 { | 102 { |
110 Uint8 red, green, blue, alpha; | 103 Uint8 red, green, blue, alpha; |
111 TilePtr tile; | 104 TilePtr tile; |
112 | 105 |
113 /** | |
114 * get,put はオブジェクト(Hashとか?)を作ってアクセスするかな | |
115 */ | |
116 tile = hash->get(addr); | 106 tile = hash->get(addr); |
117 if (tile == NULL) { | 107 if (tile == NULL) { |
118 if (tileList->size >= MAX_TILE) { | 108 if (tileList->size >= MAX_TILE) { |
119 tileList->init(); | 109 tileList->init(); |
120 hash->clear(); | 110 hash->clear(); |
141 tileList->size++; | 131 tileList->size++; |
142 | 132 |
143 smanager->dma_wait(TEX_LOAD); | 133 smanager->dma_wait(TEX_LOAD); |
144 } | 134 } |
145 | 135 |
146 char *p = get_pixel(tx, ty, tile->pixel); | 136 return tile->pixel[(TEXTURE_SPLIT_PIXEL)*ty+tx]; |
147 | |
148 alpha = 255; | |
149 red = (Uint8) p[0]; | |
150 green = (Uint8) p[1]; | |
151 blue = (Uint8) p[2]; | |
152 | |
153 return (red & 0xff) * 0x10000 + (green & 0xff) * 0x100 | |
154 + (blue & 0xff) + (alpha << 24); | |
155 } | 137 } |
156 | 138 |
157 | 139 |
158 | 140 |
159 int | 141 int |
275 span->tex_width, span->tex_addr); | 257 span->tex_width, span->tex_addr); |
276 tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL; | 258 tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL; |
277 tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL; | 259 tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL; |
278 | 260 |
279 rgb = get_rgb(tex_localx, tex_localy, tex_addr); | 261 rgb = get_rgb(tex_localx, tex_localy, tex_addr); |
280 | 262 |
281 zRow[localx + (rangex*localy)] = tex_z; | 263 zRow[localx + (rangex*localy)] = tex_z; |
282 linebuf[localy][localx] = rgb; | 264 linebuf[localy][localx] = rgb; |
283 } | 265 } |
284 } | 266 } |
285 } | 267 } |