# HG changeset patch # User root@henri.cr.ie.u-ryukyu.ac.jp # Date 1285863945 -32400 # Node ID df5185513c2d8525488e349b7fb34176e10730c0 # Parent ff74988bbb2ab52ce8ece2ea8689fe060555fb3f minor fix diff -r ff74988bbb2a -r df5185513c2d Renderer/Engine/Makefile.cell --- a/Renderer/Engine/Makefile.cell Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/Makefile.cell Fri Oct 01 01:25:45 2010 +0900 @@ -13,7 +13,7 @@ LIBS += -lCellManager -lspe2 -lpthread -CFLAGS += -Drestrict=__restrict__ `sdl-config --cflags` `xml2-config --cflags` +CFLAGS += -D__CERIUM_CELL__ -Drestrict=__restrict__ `sdl-config --cflags` `xml2-config --cflags` LIBS += `sdl-config --libs` -lSDL_image -lGL `xml2-config --libs` .SUFFIXES: .cc .o diff -r ff74988bbb2a -r df5185513c2d Renderer/Engine/viewer.cc --- a/Renderer/Engine/viewer.cc Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/viewer.cc Fri Oct 01 01:25:45 2010 +0900 @@ -98,10 +98,6 @@ { this->manager = manager; - start_time = get_ticks(); - this_time = 0; - frames = 0; - if (spe_num == 0) spe_num = 1; sgroot = new SceneGraphRoot(this->width, this->height); @@ -160,6 +156,10 @@ data_load->spawn(); } + start_time = get_ticks(); + this_time = 0; + frames = 0; + MainLoop *mainloop = app->init(this, this->width, this->height); mainloop->mainLoop(); } @@ -947,10 +947,10 @@ data_update_wait->spawn(); if (profile) { if (frames % 50 == 49) { + manager->show_profile(); this_time = get_ticks(); - manager->show_profile(); if (this_time != start_time) { - printf("\n%f FPS\n", (((float)frames)/(this_time-start_time))*1000.0); + printf("\n%f FPS\n", ((((float)frames)*1000.0)/(this_time-start_time))); start_time = this_time; frames = 0; } } diff -r ff74988bbb2a -r df5185513c2d Renderer/Engine/viewerFB.cc --- a/Renderer/Engine/viewerFB.cc Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/viewerFB.cc Fri Oct 01 01:25:45 2010 +0900 @@ -1,6 +1,10 @@ #include "viewerFB.h" #include "fb.h" #include +#if 0 +#include +#endif + #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK @@ -65,6 +69,14 @@ } send_current_information("The framebuffer device was mapped !"); +#if 0 + // Take control of frame buffer from kernel + ioctl(fd_framebuffer, PS3FB_IOCTL_ON, 0); + int field_ndx = 0; + ioctl(fd_framebuffer , PS3FB_IOCTL_FSEL, &field_ndx ); +#endif + + printf("fb: 0x%x \n", (unsigned int)fbptr); info.xres = xres; info.yres = yres; diff -r ff74988bbb2a -r df5185513c2d Renderer/Engine/viewerPS3.cc --- a/Renderer/Engine/viewerPS3.cc Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/viewerPS3.cc Fri Oct 01 01:25:45 2010 +0900 @@ -52,6 +52,7 @@ } screen_info = get_fbdev_addr(); + uint32_t *pixels = screen_info.fbptr[frame_ndx]; if (pixels == 0) { diff -r ff74988bbb2a -r df5185513c2d Renderer/Engine/viewerSDL.cc --- a/Renderer/Engine/viewerSDL.cc Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/viewerSDL.cc Fri Oct 01 01:25:45 2010 +0900 @@ -3,6 +3,8 @@ #include "TaskManager.h" #include "viewer_types.h" +#define UGA 1 + extern void post2runLoop(void *); #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK @@ -21,7 +23,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(); @@ -45,14 +47,28 @@ ViewerSDL::clean_pixels() { //bzero(pixels, sizeof(int)*width*height); +#if !UGA SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,0,0)); +#endif } void ViewerSDL::clear_screen() { +#if !UGA SDL_BlitSurface(bitmap, NULL, screen, NULL); SDL_UpdateRect(screen, 0, 0, 0, 0); +#endif +} + +uint32_t * +ViewerSDL::flip_screen(uint32_t *old) +{ +#if UGA + SDL_BlitSurface(bitmap,NULL,screen,NULL); + SDL_UpdateRect(screen,0,0,0,0); +#endif + return old; } void diff -r ff74988bbb2a -r df5185513c2d Renderer/Engine/viewerSDL.h --- a/Renderer/Engine/viewerSDL.h Fri Oct 01 00:37:06 2010 +0900 +++ b/Renderer/Engine/viewerSDL.h Fri Oct 01 01:25:45 2010 +0900 @@ -17,6 +17,8 @@ void clean_pixels(); void clear_screen(); void free_device(); + uint32_t* flip_screen(uint32_t *); + }; #endif