Mercurial > hg > Members > kono > Cerium
changeset 169:cd1c289f952d
fix
author | gongo@gendarme.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 11 Dec 2008 10:41:01 +0900 |
parents | cf2aa37d2fe7 |
children | d1f2ce3bdb2f |
files | TaskManager/Test/test_render/Makefile.def TaskManager/Test/test_render/spe/CreateSpan.cpp TaskManager/Test/test_render/viewer.cpp TaskManager/Test/test_render/viewerSDL.cpp |
diffstat | 4 files changed, 37 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Makefile.def Thu Dec 11 10:38:28 2008 +0900 +++ b/TaskManager/Test/test_render/Makefile.def Thu Dec 11 10:41:01 2008 +0900 @@ -3,15 +3,15 @@ # 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 = ../../.. CC = g++ -CFLAGS = -O9 -g -Wall# -DDEBUG +CFLAGS = -O0 -g -Wall# -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I. LIBS = -L$(CERIUM)/TaskManager \ No newline at end of file
--- a/TaskManager/Test/test_render/spe/CreateSpan.cpp Thu Dec 11 10:38:28 2008 +0900 +++ b/TaskManager/Test/test_render/spe/CreateSpan.cpp Thu Dec 11 10:41:01 2008 +0900 @@ -123,6 +123,25 @@ return blockX + (twidth/TEXTURE_SPLIT_PIXEL)*blockY; } +static int +getScale(SpanPtr span) +{ + int tex_width = span->texture_width; + int tex_height = span->texture_height; + int width = span->length_x; + int scale = 1; + + if (tex_width > width) { + int t_scale = tex_width/width; + + while (t_scale >>= 1) { + scale <<= 1; + } + } + + return scale; +} + /** * x軸に水平な辺を持つ三角形ポリゴンから、 * Span を抜き出す @@ -278,6 +297,9 @@ tmp_tey2 =( (i/(div_y)) * vMid->tex_y) + ( ((div_y - i)/(div_y)) * vMin->tex_y); + + + if (tmp_xpos > tmp_end) { x = (int)tmp_end; /**
--- a/TaskManager/Test/test_render/viewer.cpp Thu Dec 11 10:38:28 2008 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Thu Dec 11 10:41:01 2008 +0900 @@ -104,6 +104,7 @@ 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) @@ -140,6 +141,9 @@ case 6: node_init(); break; + case 7: + picture_init(); + break; default: node_init(); break;
--- a/TaskManager/Test/test_render/viewerSDL.cpp Thu Dec 11 10:38:28 2008 +0900 +++ b/TaskManager/Test/test_render/viewerSDL.cpp Thu Dec 11 10:41:01 2008 +0900 @@ -17,7 +17,7 @@ exit(1); } - screen = SDL_SetVideoMode(width, height, bpp, SDL_SWSURFACE); + screen = SDL_SetVideoMode(width, height, bpp, SDL_HWSURFACE); if (screen == NULL) { fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); SDL_Quit(); @@ -28,9 +28,11 @@ p = (Uint32*)manager->malloc(sizeof(int)*width*height); pixels = p; - bitmap = SDL_CreateRGBSurfaceFrom((void *)p, width, height, 32, - width*4, redMask, greenMask, - blueMask, alphaMask); + bitmap = SDL_CreateRGBSurfaceFrom((void *)p, + screen->w, screen->h, + screen->format->BitsPerPixel, + screen->pitch, + redMask, greenMask, blueMask, alphaMask); } void @@ -42,10 +44,10 @@ void ViewerSDL::run_loop(void) { -#if !defined(__LINUX__) +//#if !defined(__LINUX__) SDL_BlitSurface(bitmap, NULL, screen, NULL); SDL_UpdateRect(screen, 0, 0, 0, 0); -#endif +//#endif Viewer::run_loop(); }