Mercurial > hg > Members > kono > Cerium
changeset 155:77dac07efd79
TextureInfoList がずれてたのを修正
author | gongo@gendarme.local |
---|---|
date | Thu, 04 Dec 2008 13:58:41 +0900 |
parents | f4673e790675 |
children | cd5ad7adc5e1 |
files | TaskManager/Test/test_render/Makefile TaskManager/Test/test_render/Makefile.def TaskManager/Test/test_render/spe/CreateSpan.cpp TaskManager/Test/test_render/spe/DrawSpan.cpp TaskManager/Test/test_render/task/CreateSpan.cpp TaskManager/Test/test_render/task/DrawSpan.cpp TaskManager/Test/test_render/viewer.cpp |
diffstat | 7 files changed, 52 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Makefile Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/Makefile Thu Dec 04 13:58:41 2008 +0900 @@ -12,10 +12,12 @@ @echo "Make for Linux" @$(MAKE) -f Makefile.linux +macosx-depend: FORCE + @$(MAKE) -f Makefile.macosx depend + FORCE: clean: @$(MAKE) -f Makefile.macosx clean @$(MAKE) -f Makefile.ps3 clean @$(MAKE) -f Makefile.linux clean -
--- a/TaskManager/Test/test_render/Makefile.def Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/Makefile.def Thu Dec 04 13:58:41 2008 +0900 @@ -11,7 +11,7 @@ #CERIUM = ../../.. CC = g++ -CFLAGS = -O9 -g -Wall# -DDEBUG +CFLAGS = -O0 -g -Wall# -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I. -LIBS = -L$(CERIUM)/TaskManager +LIBS = -L$(CERIUM)/TaskManager \ No newline at end of file
--- a/TaskManager/Test/test_render/spe/CreateSpan.cpp Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/spe/CreateSpan.cpp Thu Dec 04 13:58:41 2008 +0900 @@ -181,7 +181,7 @@ } smanager->dma_wait(TILE_STORE); - tilelist->next = 0; // ? + tilelist->next = NULL; smanager->dma_store(tilelist, (uint32)tilelist_addr, sizeof(TileInfoList), TILE_STORE); free(send_tilelist); @@ -268,7 +268,7 @@ if (charge_y_top <= y && y <= charge_y_end) { // 1..8 を index0, 9..16 を index1 にするために y を -1 int index = (y-1) / split_screen_h; - + //if (index != 0) continue; /** * 違う SpanPack を扱う場合、 * 現在の SpanPack をメインメモリに送り、
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp Thu Dec 04 13:58:41 2008 +0900 @@ -258,7 +258,7 @@ tex_ypos = (int)((span->tex_height-1) * tey1); tex_zpos = (int)z; -#if 0 +#if 1 if (tex_xpos != tilist->tileinfo[0].tix && tex_xpos != tilist->tileinfo[0].tix) { fprintf(stderr, "1: (%3d, %3d), (%3d, %3d)\n", @@ -280,18 +280,18 @@ } else { int js = (x < rangex_start) ? rangex_start - x : 0; int je = (x + x_len > rangex_end) ? rangex_end - x : x_len; - + if (js > je) continue; int cur_x = 0; int max_x = je; - int len; + int len = 0; /** * Span ɽʤϰ([js..je]) TileInfoList * äƤΤǡФ */ - while (cur_x + MAX_TILE_LIST < js) { + while (cur_x + MAX_TILE_LIST <= js) { smanager->dma_load(next_tilist, (uint32)tilist->next, sizeof(TileInfoList), TILE_INFO_LOAD); smanager->dma_wait(TILE_INFO_LOAD); @@ -306,17 +306,29 @@ cur_x = js; while (cur_x <= max_x) { - if (cur_x + MAX_TILE_LIST - 1 < max_x) { + /** + * TileInfoList 30 ĤǶڤƤΤ + * cur_x TileInfoList 椫ϤޤäƤ + * MAX_TILE_LIST ˼ޤͤ + * (ex.) + * cur_x (=js) 0 Ϥޤä硢 + * cur_x = 0, len = 29 + * cur_x (=js) 15 Ϥޤä硢 + * cur_x = 15, len = 14 ˤʤ + */ + int cur_x_diff = MAX_TILE_LIST - (cur_x % MAX_TILE_LIST); + + if (cur_x + cur_x_diff - 1 < max_x) { smanager->dma_load(next_tilist, (uint32)tilist->next, sizeof(TileInfoList), TILE_INFO_LOAD); - len = MAX_TILE_LIST - 1; + len = cur_x_diff - 1; } else { len = max_x - cur_x; } float tex_x, tex_y, tex_z; - + for (int j = cur_x; j <= cur_x + len; j++) { localx = getLocalX(x-1+j); tex_z = z*(x_len-1-j)/(x_len-1) + zpos*j/(x_len-1); @@ -328,7 +340,6 @@ tex_xpos = (int)((span->tex_width-1) * tex_x); tex_ypos = (int)((span->tex_height-1) * tex_y); -#if 0 if (tex_xpos != tilist->tileinfo[j%MAX_TILE_LIST].tix && tex_xpos != tilist->tileinfo[j%MAX_TILE_LIST].tix) { fprintf(stderr, "size = %d\n", tilist->size); @@ -339,7 +350,6 @@ tilist->tileinfo[j%MAX_TILE_LIST].tix, tilist->tileinfo[j%MAX_TILE_LIST].tiy); } -#endif tex_xpos = tilist->tileinfo[j%MAX_TILE_LIST].tix; tex_ypos = tilist->tileinfo[j%MAX_TILE_LIST].tiy; @@ -359,7 +369,7 @@ tilist = next_tilist; next_tilist = tmp; - cur_x += MAX_TILE_LIST; + cur_x += cur_x_diff; } } }
--- a/TaskManager/Test/test_render/task/CreateSpan.cpp Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/task/CreateSpan.cpp Thu Dec 04 13:58:41 2008 +0900 @@ -181,7 +181,7 @@ } smanager->dma_wait(TILE_STORE); - tilelist->next = 0; // ? + tilelist->next = NULL; smanager->dma_store(tilelist, (uint32)tilelist_addr, sizeof(TileInfoList), TILE_STORE); free(send_tilelist); @@ -268,7 +268,7 @@ if (charge_y_top <= y && y <= charge_y_end) { // 1..8 を index0, 9..16 を index1 にするために y を -1 int index = (y-1) / split_screen_h; - + //if (index != 0) continue; /** * 違う SpanPack を扱う場合、 * 現在の SpanPack をメインメモリに送り、
--- a/TaskManager/Test/test_render/task/DrawSpan.cpp Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/task/DrawSpan.cpp Thu Dec 04 13:58:41 2008 +0900 @@ -258,7 +258,7 @@ tex_ypos = (int)((span->tex_height-1) * tey1); tex_zpos = (int)z; -#if 0 +#if 1 if (tex_xpos != tilist->tileinfo[0].tix && tex_xpos != tilist->tileinfo[0].tix) { fprintf(stderr, "1: (%3d, %3d), (%3d, %3d)\n", @@ -280,18 +280,18 @@ } else { int js = (x < rangex_start) ? rangex_start - x : 0; int je = (x + x_len > rangex_end) ? rangex_end - x : x_len; - + if (js > je) continue; int cur_x = 0; int max_x = je; - int len; + int len = 0; /** * Span ɽʤϰ([js..je]) TileInfoList * äƤΤǡФ */ - while (cur_x + MAX_TILE_LIST < js) { + while (cur_x + MAX_TILE_LIST <= js) { smanager->dma_load(next_tilist, (uint32)tilist->next, sizeof(TileInfoList), TILE_INFO_LOAD); smanager->dma_wait(TILE_INFO_LOAD); @@ -306,17 +306,29 @@ cur_x = js; while (cur_x <= max_x) { - if (cur_x + MAX_TILE_LIST - 1 < max_x) { + /** + * TileInfoList 30 ĤǶڤƤΤ + * cur_x TileInfoList 椫ϤޤäƤ + * MAX_TILE_LIST ˼ޤͤ + * (ex.) + * cur_x (=js) 0 Ϥޤä硢 + * cur_x = 0, len = 29 + * cur_x (=js) 15 Ϥޤä硢 + * cur_x = 15, len = 14 ˤʤ + */ + int cur_x_diff = MAX_TILE_LIST - (cur_x % MAX_TILE_LIST); + + if (cur_x + cur_x_diff - 1 < max_x) { smanager->dma_load(next_tilist, (uint32)tilist->next, sizeof(TileInfoList), TILE_INFO_LOAD); - len = MAX_TILE_LIST - 1; + len = cur_x_diff - 1; } else { len = max_x - cur_x; } float tex_x, tex_y, tex_z; - + for (int j = cur_x; j <= cur_x + len; j++) { localx = getLocalX(x-1+j); tex_z = z*(x_len-1-j)/(x_len-1) + zpos*j/(x_len-1); @@ -328,7 +340,6 @@ tex_xpos = (int)((span->tex_width-1) * tex_x); tex_ypos = (int)((span->tex_height-1) * tex_y); -#if 0 if (tex_xpos != tilist->tileinfo[j%MAX_TILE_LIST].tix && tex_xpos != tilist->tileinfo[j%MAX_TILE_LIST].tix) { fprintf(stderr, "size = %d\n", tilist->size); @@ -339,7 +350,6 @@ tilist->tileinfo[j%MAX_TILE_LIST].tix, tilist->tileinfo[j%MAX_TILE_LIST].tiy); } -#endif tex_xpos = tilist->tileinfo[j%MAX_TILE_LIST].tix; tex_ypos = tilist->tileinfo[j%MAX_TILE_LIST].tiy; @@ -359,7 +369,7 @@ tilist = next_tilist; next_tilist = tmp; - cur_x += MAX_TILE_LIST; + cur_x += cur_x_diff; } } }
--- a/TaskManager/Test/test_render/viewer.cpp Wed Dec 03 20:14:23 2008 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Thu Dec 04 13:58:41 2008 +0900 @@ -339,10 +339,12 @@ int endx = split_screen_w; int start_y = spack->info.y_top - split_screen_h + 1; - //int end_y = spack->info.y_top; + int end_y = spack->info.y_top; int rangey = (start_y + split_screen_h - 1 > this->height) ? this->height - start_y + 1 : split_screen_h; + //if (end_y != 128) continue; + while (startx < this->width) { if (spack->info.size > 0) { // Draw SpanPack