Mercurial > hg > Game > Cerium
changeset 217:bfdd037aee21 draft
fix
author | gongo@localhost.localdomain |
---|---|
date | Wed, 04 Feb 2009 22:50:42 +0900 |
parents | e9a52d68db42 |
children | c4083e25b9bc |
files | TaskManager/Test/test_render/SceneGraph.cpp TaskManager/Test/test_render/main.cpp TaskManager/Test/test_render/viewer.cpp TaskManager/Test/test_render/viewerSDL.cpp example/many_task/Makefile.def example/many_task/main.cc |
diffstat | 6 files changed, 32 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/SceneGraph.cpp Wed Feb 04 22:44:16 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.cpp Wed Feb 04 22:50:42 2009 +0900 @@ -72,7 +72,7 @@ int diff = TEXTURE_SPLIT_PIXEL; int p_diff = 1; - tex_dest = (uint32*)manager->malloc(sizeof(int)*all_pixel_num); + tex_dest = (uint32*)manager->allocate(sizeof(int)*all_pixel_num); while (scale_cnt) { for (int y = 0; y < tex_h; y += diff) {
--- a/TaskManager/Test/test_render/main.cpp Wed Feb 04 22:44:16 2009 +0900 +++ b/TaskManager/Test/test_render/main.cpp Wed Feb 04 22:50:42 2009 +0900 @@ -5,7 +5,8 @@ #include "Func.h" /* prototype */ -int init(int argc, char *argv[]); +static int init(int argc, char *argv[]); +static void TMend(void); extern void task_initialize(); @@ -78,11 +79,13 @@ screen->video_init(); screen->run_init(xml, sg_number); + manager->set_TMend(TMend); + return 0; } int -cerium_main(int argc, char *argv[]) +TMmain(int argc, char *argv[]) { task_initialize(); @@ -90,3 +93,9 @@ //return 0; } + +void +TMend(void) +{ + printf("test_nogl end\n"); +}
--- a/TaskManager/Test/test_render/viewer.cpp Wed Feb 04 22:44:16 2009 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Wed Feb 04 22:50:42 2009 +0900 @@ -166,12 +166,12 @@ sgroot->controller = create_controller(); - sgpack = (SceneGraphPack*)manager->malloc(sizeof(SceneGraphPack)); + sgpack = (SceneGraphPack*)manager->allocate(sizeof(SceneGraphPack)); sgpack->init(); - ppack = (PolygonPack*)manager->malloc(sizeof(PolygonPack)); + ppack = (PolygonPack*)manager->allocate(sizeof(PolygonPack)); spackList_length = (this->height + split_screen_h - 1) / split_screen_h; - spackList = (SpanPack*)manager->malloc(sizeof(SpanPack)*spackList_length); + spackList = (SpanPack*)manager->allocate(sizeof(SpanPack)*spackList_length); /** * SPU に送る address list は 16 バイト倍数でないといけない。 @@ -186,7 +186,7 @@ /* 各 SPU が持つ、SpanPack の address list */ spackList_ptr = - (SpanPack**)manager->malloc(sizeof(SpanPack*)*spackList_length_align); + (SpanPack**)manager->allocate(sizeof(SpanPack*)*spackList_length_align); for (int i = 0; i < spackList_length; i++) { spackList_ptr[i] = &spackList[i];
--- a/TaskManager/Test/test_render/viewerSDL.cpp Wed Feb 04 22:44:16 2009 +0900 +++ b/TaskManager/Test/test_render/viewerSDL.cpp Wed Feb 04 22:50:42 2009 +0900 @@ -24,7 +24,7 @@ exit(1); } - p = (Uint32*)manager->malloc(screen->pitch*height); + p = (Uint32*)manager->allocate(screen->pitch*height); bitmap = SDL_CreateRGBSurfaceFrom((void *)p, screen->w, screen->h, screen->format->BitsPerPixel,
--- a/example/many_task/Makefile.def Wed Feb 04 22:44:16 2009 +0900 +++ b/example/many_task/Makefile.def Wed Feb 04 22:50:42 2009 +0900 @@ -2,7 +2,7 @@ # include/library path # ex: macosx -CERIUM = /Users/gongo/Source/Concurrency/Game_project/Cerium +#CERIUM = /Users/gongo/Source/Concurrency/Game_project/Cerium # ex: linux/ps3 -#CERIUM = /home/gongo/Game_project/Cerium \ No newline at end of file +CERIUM = /home/gongo/Cerium \ No newline at end of file
--- a/example/many_task/main.cc Wed Feb 04 22:44:16 2009 +0900 +++ b/example/many_task/main.cc Wed Feb 04 22:50:42 2009 +0900 @@ -11,18 +11,20 @@ double getTime(); -char *help_str = "Usage: ./sort [-cpu spe_num] [-length data_length]\n \ - -cpu Number of SPE used (default 1) \n \ - -length Sorted number of data (default 1200)"; +const char *help_str = "Usage: ./sort [option]\n \ +options\n\ + -cpu Number of SPE used (default 1)\n\ + -l, --length Sorted number of data (default 1200)\n\ + -h, --help Print this message"; int init(int argc, char **argv) { for (int i = 1; argv[i]; ++i) { - if (strcmp(argv[i], "-length") == 0) { + if (strcmp(argv[i], "--length") == 0 || strcmp(argv[i], "-l") == 0) { data_size = atoi(argv[++i]); } - if (strcmp(argv[i], "--help") == 0) { + if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { printf("%s\n", help_str); return -1; } @@ -32,7 +34,7 @@ } int -main(int argc, char *argv[]) +cerium_main(int argc, char *argv[]) { // 計測用 double st_time, ed_time; @@ -45,19 +47,18 @@ task_init(); runLoop = manager->create_task(TASK_MAIN); - printf("main spenum: %d\n",spenum); - runLoop->add_param(spenum); + runLoop->add_param(6); runLoop->add_param(data_size); runLoop->spawn(); // Start st_time = getTime(); - manager->run(); - ed_time = getTime(); + //manager->run(); + //ed_time = getTime(); - printf("Time: %0.6f\n",ed_time-st_time); + //printf("Time: %0.6f\n",ed_time-st_time); - delete manager; + //delete manager; FINISH: return 0;