Mercurial > hg > Members > kono > Cerium
comparison TaskManager/Test/test_render/viewer.cpp @ 133:435e0d24db39
DrawSpan のテクスチャ座標を求める部分で、width と height が逆に使われてた。
add new xml file
author | gongo@charles.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 27 Nov 2008 15:08:10 +0900 |
parents | 8a33f4859ed8 |
children | 6cf991f28c6c |
comparison
equal
deleted
inserted
replaced
132:e7c80537b6aa | 133:435e0d24db39 |
---|---|
222 task_create_sp->add_inData(&spackList[index_start], sizeof(SpanPack)); | 222 task_create_sp->add_inData(&spackList[index_start], sizeof(SpanPack)); |
223 | 223 |
224 task_create_sp->add_param(index_start); | 224 task_create_sp->add_param(index_start); |
225 | 225 |
226 /** | 226 /** |
227 * ex. screen_height が 480, spenum が 6 の場合、 | 227 * ex. screen_height が 480, spenum が 6 の場合、各SPEのy担当範囲 |
228 * [ 1.. 80] [ 81..160] [161..240] | 228 * [ 1.. 80] [ 81..160] [161..240] |
229 * [241..320] [321..400] [401..480] | 229 * [241..320] [321..400] [401..480] |
230 * | 230 * |
231 * ex. screen_height が 1080, spenum が 5 の場合、 | 231 * ex. screen_height が 1080, spenum が 5 の場合、 |
232 * [ 1..216] [217..432] [433..648] | 232 * [ 1..216] [217..432] [433..648] |
245 task_update_sgp->spawn(); | 245 task_update_sgp->spawn(); |
246 task_create_pp->spawn(); | 246 task_create_pp->spawn(); |
247 task_next->spawn(); | 247 task_next->spawn(); |
248 } | 248 } |
249 | 249 |
250 static int st_rgb = 0xffffff; | |
251 static int st_diff = 0x111111; | |
252 | |
253 void | 250 void |
254 Viewer::run_draw(void) | 251 Viewer::run_draw(void) |
255 { | 252 { |
256 HTaskPtr task_next; | 253 HTaskPtr task_next; |
257 HTaskPtr task_draw; | 254 HTaskPtr task_draw; |
258 | 255 |
259 task_next = manager->create_task(TASK_DUMMY); | 256 task_next = manager->create_task(TASK_DUMMY); |
260 task_next->set_post(post2runLoop, NULL); | 257 task_next->set_post(post2runLoop, NULL); |
261 | 258 |
262 ppack->clear(); | 259 ppack->clear(); |
263 | |
264 if (frames % 20 == 0) { | |
265 st_rgb += st_diff; | |
266 } | |
267 if (st_rgb >= 0xeeeeee || st_rgb <= 0) { | |
268 st_diff = -st_diff; | |
269 } | |
270 | 260 |
271 unsigned int diff = 0; | 261 unsigned int diff = 0; |
272 for (int i = 0; i < spackList_length; i++) { | 262 for (int i = 0; i < spackList_length; i++) { |
273 SpanPack *spack = &spackList[i]; | 263 SpanPack *spack = &spackList[i]; |
274 int startx = 1; | 264 int startx = 1; |
284 // Draw SpanPack | 274 // Draw SpanPack |
285 task_draw = manager->create_task(TASK_DRAW_SPAN); | 275 task_draw = manager->create_task(TASK_DRAW_SPAN); |
286 task_draw->add_inData(spack, sizeof(SpanPack)); | 276 task_draw->add_inData(spack, sizeof(SpanPack)); |
287 } else { | 277 } else { |
288 // Draw Background (現在は塗りつぶし) | 278 // Draw Background (現在は塗りつぶし) |
289 //break; | |
290 task_draw = manager->create_task(TASK_DRAW_BACK); | 279 task_draw = manager->create_task(TASK_DRAW_BACK); |
291 task_draw->add_param(0); | 280 task_draw->add_param(0xffffff); |
292 //task_draw->add_param(st_rgb); | |
293 } | 281 } |
294 | 282 |
295 for (int k = 0; k < rangey; k++) { | 283 for (int k = 0; k < rangey; k++) { |
296 task_draw->add_outData( | 284 task_draw->add_outData( |
297 &pixels[(startx-1)+this->width*(k+start_y-1)], | 285 &pixels[(startx-1)+this->width*(k+start_y-1)], |