Mercurial > hg > Game > Cerium
changeset 988:da1cec21f0c9 draft akira
fix for double buffer
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 02 Oct 2010 03:48:39 +0900 |
parents | 6c3dffa8996f |
children | 1ff34456944d |
files | Renderer/Engine/Makefile.def Renderer/Engine/Makefile.macosx Renderer/Engine/fb.h Renderer/Engine/spe/DataAllocate.cc Renderer/Engine/task/DataAllocate.cc Renderer/Engine/viewer.cc Renderer/Engine/viewerPS3.cc Renderer/Engine/viewerSDL.cc TaskManager/Makefile.def |
diffstat | 9 files changed, 20 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/Makefile.def Sat Oct 02 03:48:39 2010 +0900 @@ -5,7 +5,7 @@ ABIBIT = 32 ABI = -m$(ABIBIT) CC = g++ -OPT = -g -O9 #-DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1 +OPT = -g # -O9 #-DSPE_CREATE_POLYGON_CHECK -DSPE_CREATE_POLYGON=1 CFLAGS = -g -Wall $(ABI) $(OPT) # -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I.
--- a/Renderer/Engine/Makefile.macosx Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/Makefile.macosx Sat Oct 02 03:48:39 2010 +0900 @@ -13,7 +13,7 @@ LIBS += -lFifoManager -CFLAGS += `sdl-config --cflags` `xml2-config --cflags` +CFLAGS += `sdl-config --cflags` `xml2-config --cflags` -Drestrict=__restrict__ LIBS += `sdl-config --libs` `xml2-config --libs` -lSDL_image -Wl,-framework,OpenGL .SUFFIXES: .cc .o
--- a/Renderer/Engine/fb.h Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/fb.h Sat Oct 02 03:48:39 2010 +0900 @@ -1,6 +1,7 @@ #ifndef FB_H #define FB_H +#include "types.h" #if defined(__linux__) #include <unistd.h> @@ -12,7 +13,6 @@ #include <sys/ioctl.h> #include <stdlib.h> #include <iostream> -#include "types.h" using namespace std;
--- a/Renderer/Engine/spe/DataAllocate.cc Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/spe/DataAllocate.cc Sat Oct 02 03:48:39 2010 +0900 @@ -10,7 +10,7 @@ run(SchedTask *s, void *rbuf, void *wbuf) { - int count = (int)s->get_input(rbuf, 0); + int count = (int)s->get_param(0); for(int i=0;i<count;i++) { void *idata = s->get_input(rbuf, i); long size = (long)s->get_param(i*2+1);
--- a/Renderer/Engine/task/DataAllocate.cc Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/task/DataAllocate.cc Sat Oct 02 03:48:39 2010 +0900 @@ -10,7 +10,7 @@ run(SchedTask *s, void *rbuf, void *wbuf) { - int count = (int)s->get_input(rbuf, 0); + int count = (int)s->get_param(0); for(int i=0;i<count;i++) { void *idata = s->get_input(rbuf, i); long size = (long)s->get_param(i*2+1);
--- a/Renderer/Engine/viewer.cc Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/viewer.cc Sat Oct 02 03:48:39 2010 +0900 @@ -115,12 +115,12 @@ for(int i = 0; i < spe_num; i++) { HTaskPtr data_load = manager->create_task(DataAllocate); data_load->set_param(0,(memaddr)3); // num of allocate block - data_load->set_param(0,(memaddr)(sizeof(float)*4*light_num)); // 1st allocate size - data_load->set_param(1,(memaddr)Light); // 1st id - data_load->set_param(0,(memaddr)(light_num * sizeof(int))); // 2nd size - data_load->set_param(1,(memaddr)LightSwitch); // 2nd id - data_load->set_param(0,(memaddr)16); // 3rd size - data_load->set_param(1,(memaddr)LightSysSwitch); // 3rd id + data_load->set_param(1,(memaddr)(sizeof(float)*4*light_num)); // 1st allocate size + data_load->set_param(2,(memaddr)Light); // 1st id + data_load->set_param(3,(memaddr)(light_num * sizeof(int))); // 2nd size + data_load->set_param(4,(memaddr)LightSwitch); // 2nd id + data_load->set_param(5,(memaddr)16); // 3rd size + data_load->set_param(6,(memaddr)LightSysSwitch); // 3rd id data_load->set_cpu((CPU_TYPE)((int)SPE_0 + i)); data_load->spawn(); } @@ -176,11 +176,11 @@ r[i].spackList_ptr = (SpanPack**)manager->allocate(sizeof(SpanPack*)*r[i].spackList_length_align); - for (int j = 0; i < r[i].spackList_length; i++) { + for (int j = 0; j < r[i].spackList_length; j++) { r[i].spackList_ptr[j] = &r[i].spackList[j]; } - for (int j = 1; j <= r[i].spackList_length; i++) { + for (int j = 1; j <= r[i].spackList_length; j++) { r[i].spackList[j-1].init(j*split_screen_h); } }
--- a/Renderer/Engine/viewerPS3.cc Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/viewerPS3.cc Sat Oct 02 03:48:39 2010 +0900 @@ -33,7 +33,8 @@ } #else /* !defined(__linux__) */ -ScreenInfo get_fbdev_addr(void) { +ScreenInfo +ViewerPS3::get_fbdev_addr(void) { ScreenInfo tmp = {0,0,0,0}; return tmp; } @@ -83,7 +84,9 @@ // cp_fb_wait_vsync( &fb ); // Send the frame just drawn to the CRT by the next vblank +#ifdef __linux__ cp_fb_flip( &fb, frame_ndx ); +#endif frame_ndx = frame_ndx ^ 0x01; return (uint32_t*)fb.draw_addr[ frame_ndx ]; @@ -93,8 +96,10 @@ void ViewerPS3::free_device() { +#ifdef __linux__ cp_vt_close(&vt); cp_fb_close(&fb); +#endif } /* end */
--- a/Renderer/Engine/viewerSDL.cc Sat Oct 02 03:19:33 2010 +0900 +++ b/Renderer/Engine/viewerSDL.cc Sat Oct 02 03:48:39 2010 +0900 @@ -47,9 +47,7 @@ ViewerSDL::clean_pixels() { //bzero(pixels, sizeof(int)*width*height); -#if !UGA SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,0,0)); -#endif } void
--- a/TaskManager/Makefile.def Sat Oct 02 03:19:33 2010 +0900 +++ b/TaskManager/Makefile.def Sat Oct 02 03:48:39 2010 +0900 @@ -29,9 +29,8 @@ ABIBIT = 32 -OPT = -g -O9 +OPT = -g -O -DEARLY_TOUCH # OPT = -g -DTASK_LIST_MAIL -O9 -# -DEARLY_TOUCH CC = g++ CFLAGS = -Wall `sdl-config --cflags` -m$(ABIBIT) $(OPT)