Mercurial > hg > Game > Cerium
changeset 914:6286b3baf744 draft
0 is filled on the spe side.
author | yutaka@localhost.localdomain |
---|---|
date | Thu, 22 Jul 2010 00:23:37 +0900 |
parents | 564096e53d8a |
children | aa9728394194 |
files | Renderer/Engine/main.cc Renderer/Engine/spe/DrawSpan.cc Renderer/Engine/task/DrawSpan.cc Renderer/Engine/viewer.cc Renderer/Engine/viewer.h |
diffstat | 5 files changed, 28 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/main.cc Tue Jul 20 17:31:05 2010 +0900 +++ b/Renderer/Engine/main.cc Thu Jul 22 00:23:37 2010 +0900 @@ -31,6 +31,8 @@ int spenum = 1; video_type vtype = VTYPE_SDL; + int mem_flag = 0; + for(int i = 1; argv[i]; ++i) { if (strcmp(argv[i], "-bpp") == 0) { @@ -53,6 +55,9 @@ } i++; } + if (strcmp(argv[i], "-mem") == 0) { + mem_flag = 1; + } } Viewer *screen; @@ -67,6 +72,7 @@ screen = new Viewer(manager, dev, bpp, width, height, spenum); } + screen->mem_flag = mem_flag; screen->run_init(manager, application()); return 0;
--- a/Renderer/Engine/spe/DrawSpan.cc Tue Jul 20 17:31:05 2010 +0900 +++ b/Renderer/Engine/spe/DrawSpan.cc Thu Jul 22 00:23:37 2010 +0900 @@ -503,7 +503,12 @@ int rangex = rangex_end - rangex_start + 1; int rangey = (long)smanager->get_param(4); - linebuf_init(smanager, rangex, rangey, 0); + for(int h = 0; h < rangey; h++) { + int *buf = (int*)smanager->get_output(h); + for (int i = 0; i < rangex; i++) { + buf[i] = 0; + } + } return 0;
--- a/Renderer/Engine/task/DrawSpan.cc Tue Jul 20 17:31:05 2010 +0900 +++ b/Renderer/Engine/task/DrawSpan.cc Thu Jul 22 00:23:37 2010 +0900 @@ -484,7 +484,12 @@ int rangex = rangex_end - rangex_start + 1; int rangey = (long)smanager->get_param(4); - linebuf_init(smanager, rangex, rangey, 0); + for(int h = 0; h < rangey; h++) { + int *buf = (int*)smanager->get_output(h); + for (int i = 0; i < rangex; i++) { + buf[i] = 0; + } + } return 0;
--- a/Renderer/Engine/viewer.cc Tue Jul 20 17:31:05 2010 +0900 +++ b/Renderer/Engine/viewer.cc Thu Jul 22 00:23:37 2010 +0900 @@ -754,6 +754,7 @@ } ppack->clear(); + for (int i = 0; i < spackList_length; i++) { SpanPack *spack = &spackList[i]; int startx = 1; @@ -766,7 +767,8 @@ #if 1 - if(spack->info.size > 0) { + // mem_flag は spe 側で黒い部分を 0 で埋めるフラグ + if(spack->info.size > 0 || mem_flag == 1) { int array_task_num = (this->width + split_screen_w - 1) / split_screen_w; HTaskPtr task_draw_array = manager->create_task_array(DrawSpan, array_task_num, 6, 1, rangey); @@ -807,12 +809,15 @@ task_draw_array->wait_for(data_update_wait); task_draw_array->spawn(); - } else { + + } else { + memset(&pixels[(startx-1)+this->width*(starty-1)], 0, (this->width)*sizeof(int)*rangey); - } + } + #else