Mercurial > hg > Game > Cerium
changeset 170:5a4f2497c22d draft
fix ViewerSDL
author | gongo@localhost.localdomain |
---|---|
date | Thu, 11 Dec 2008 11:18:44 +0900 |
parents | 831e534608f4 |
children | 17f2138b9d52 973be8571888 |
files | 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/DrawSpan.cpp TaskManager/Test/test_render/viewer.cpp TaskManager/Test/test_render/viewerSDL.cpp |
diffstat | 6 files changed, 12 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Makefile.def Thu Dec 11 10:41:01 2008 +0900 +++ b/TaskManager/Test/test_render/Makefile.def Thu Dec 11 11:18:44 2008 +0900 @@ -3,10 +3,10 @@ # include/library path # ex: macosx #CERIUM = /Users/gongo/Source/Concurrency/Game_project/Cerium -CERIUM = /Users/gongo/Source/hg/Cerium +#CERIUM = /Users/gongo/Source/hg/Cerium # ex: linux/ps3 -#CERIUM = /home/gongo/Cerium +CERIUM = /home/gongo/Cerium #CERIUM = ../../..
--- a/TaskManager/Test/test_render/spe/CreateSpan.cpp Thu Dec 11 10:41:01 2008 +0900 +++ b/TaskManager/Test/test_render/spe/CreateSpan.cpp Thu Dec 11 11:18:44 2008 +0900 @@ -123,6 +123,7 @@ return blockX + (twidth/TEXTURE_SPLIT_PIXEL)*blockY; } +#if 0 static int getScale(SpanPtr span) { @@ -141,6 +142,7 @@ return scale; } +#endif /** * x軸に水平な辺を持つ三角形ポリゴンから、
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp Thu Dec 11 10:41:01 2008 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp Thu Dec 11 11:18:44 2008 +0900 @@ -161,7 +161,7 @@ for (int i = 0; i < rangey; i++) { linebuf[i] = (int*)smanager->get_output(i); - linebuf_init(linebuf[i], rangex, 0xffffff); + linebuf_init(linebuf[i], rangex, 0xffffffff); } do {
--- a/TaskManager/Test/test_render/task/DrawSpan.cpp Thu Dec 11 10:41:01 2008 +0900 +++ b/TaskManager/Test/test_render/task/DrawSpan.cpp Thu Dec 11 11:18:44 2008 +0900 @@ -161,7 +161,7 @@ for (int i = 0; i < rangey; i++) { linebuf[i] = (int*)smanager->get_output(i); - linebuf_init(linebuf[i], rangex, 0xffffff); + linebuf_init(linebuf[i], rangex, 0xffffffff); } do {
--- a/TaskManager/Test/test_render/viewer.cpp Thu Dec 11 10:41:01 2008 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Thu Dec 11 11:18:44 2008 +0900 @@ -104,7 +104,6 @@ extern void create_cube_split(int); extern void create_snake_bg(int); extern void universe_init(void); -extern void picture_init(void); void Viewer::run_init(char *xml, int sg_number) @@ -141,9 +140,6 @@ case 6: node_init(); break; - case 7: - picture_init(); - break; default: node_init(); break; @@ -325,7 +321,7 @@ } else { // Draw Background (現在は塗りつぶし) task_draw = manager->create_task(TASK_DRAW_BACK); - task_draw->add_param(0xffffff); + task_draw->add_param(0xffffffff); } for (int k = 0; k < rangey; k++) {
--- a/TaskManager/Test/test_render/viewerSDL.cpp Thu Dec 11 10:41:01 2008 +0900 +++ b/TaskManager/Test/test_render/viewerSDL.cpp Thu Dec 11 11:18:44 2008 +0900 @@ -17,22 +17,21 @@ exit(1); } - screen = SDL_SetVideoMode(width, height, bpp, SDL_HWSURFACE); + screen = SDL_SetVideoMode(width, height, bpp, SDL_SWSURFACE); if (screen == NULL) { fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); SDL_Quit(); exit(1); } - pixels = (Uint32*)screen->pixels; - - p = (Uint32*)manager->malloc(sizeof(int)*width*height); - pixels = p; + p = (Uint32*)manager->malloc(screen->pitch*height); bitmap = SDL_CreateRGBSurfaceFrom((void *)p, screen->w, screen->h, screen->format->BitsPerPixel, screen->pitch, redMask, greenMask, blueMask, alphaMask); + + pixels = p; } void @@ -44,10 +43,8 @@ void ViewerSDL::run_loop(void) { -//#if !defined(__LINUX__) SDL_BlitSurface(bitmap, NULL, screen, NULL); SDL_UpdateRect(screen, 0, 0, 0, 0); -//#endif Viewer::run_loop(); } @@ -55,6 +52,7 @@ void ViewerSDL::run_finish(void) { + free(bitmap->pixels); SDL_FreeSurface(bitmap); Viewer::run_finish();