Mercurial > hg > Game > Cerium
changeset 735:32160f3c0367 draft
fix Engin/Application.h, not work on ps3
author | hiroki@localhost.localdomain |
---|---|
date | Fri, 25 Dec 2009 20:20:40 +0900 |
parents | 92035a11633d |
children | 1b225972ae88 |
files | Renderer/Engine/Application.h Renderer/Engine/Makefile.def Renderer/Engine/spe/ChainInit.cc Renderer/Engine/spe/Makefile Renderer/Engine/viewer.cc Renderer/Engine/viewer.h Renderer/Test/viewer.cc Renderer/Test/viewer.h |
diffstat | 8 files changed, 20 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Application.h Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Engine/Application.h Fri Dec 25 20:20:40 2009 +0900 @@ -18,7 +18,6 @@ virtual ~Application(); virtual MainLoopPtr init(Viewer *viewer, int w, int h) = 0; - virtual MainLoopPtr init_only_sg(SgChange *sgchange, int w, int h) = 0; }; #endif
--- a/Renderer/Engine/Makefile.def Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Engine/Makefile.def Fri Dec 25 20:20:40 2009 +0900 @@ -5,7 +5,7 @@ ABIBIT = 32 ABI = -m$(ABIBIT) CC = g++ -OPT = -g +OPT = -g -O2 CFLAGS = -g -Wall $(ABI) $(OPT) # -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I.
--- a/Renderer/Engine/spe/ChainInit.cc Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Engine/spe/ChainInit.cc Fri Dec 25 20:20:40 2009 +0900 @@ -21,12 +21,13 @@ static int run(SchedTask *s,void *rbuf, void *wbuf) { + /* CHAIN_VARS* idata = (CHAIN_VARS*)s->get_input(rbuf, 0); uint32 chain_len = (unsigned long)s->get_param(0); // property は spe 上で allocate している(global) CHAIN_VARS *property = (CHAIN_VARS*)s->global_alloc(DATA_ID, sizeof(CHAIN_VARS)*chain_len); memcpy(property, idata, sizeof(CHAIN_VARS)*chain_len); - + */ return 0; }
--- a/Renderer/Engine/spe/Makefile Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Engine/spe/Makefile Fri Dec 25 20:20:40 2009 +0900 @@ -10,7 +10,7 @@ OBJS = $(SRCS:.cc=.o) CC = spu-g++ -CFLAGS = -Wall -g -fno-exceptions -fno-rtti #-DDEBUG +CFLAGS = -Wall -fno-exceptions -fno-rtti $(OPT)#-DDEBUG INCLUDE = -I$(TOP)/include/TaskManager -I. -I.. LIBS = -L$(TOP)/TaskManager -lspemanager
--- a/Renderer/Engine/viewer.cc Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Engine/viewer.cc Fri Dec 25 20:20:40 2009 +0900 @@ -102,13 +102,20 @@ int size = sizeof(float)*4; + light_xyz = (float *)manager->allocate(size); light_xyz[0] = 0.0f; light_xyz[1] = 0.0f; light_xyz[2] = 0.0f; light_xyz[3] = 0.0f; HTaskPtr data_load; - for(int i = 0; i < spe_num; i++) { + data_load = manager->create_task(DataLoad); + data_load->set_param(0,(memaddr)size); + data_load->set_param(1,(memaddr)Light); + data_load->set_cpu((CPU_TYPE)((int)SPE_0)); + data_load->spawn(); + + for(int i = 1; i < spe_num; i++) { data_load = manager->create_task(DataLoad); data_load->set_param(0,(memaddr)size); data_load->set_param(1,(memaddr)Light);
--- a/Renderer/Engine/viewer.h Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Engine/viewer.h Fri Dec 25 20:20:40 2009 +0900 @@ -9,6 +9,7 @@ #include "MainLoop.h" #include "Application.h" #include "SceneGraphRoot.h" +#include "base.h" class SceneGraphRoot; @@ -21,6 +22,7 @@ Viewer(int bpp, int width, int height, int spenum); virtual ~Viewer() {} + BASE_NEW_DELETE(Viewer); Application *app; @@ -29,16 +31,18 @@ HTaskPtr draw_dummy; /* screen info */ - int width; - int height; int bpp; + int rgb_size[3]; int spe_num; + int width; + int height; - int rgb_size[3]; - float light_xyz[4]; + //float light_xyz[4] __attribute__((aligned(16))); + float *light_xyz; float *light_xyz_stock; + Uint32 video_flags; Uint32 *pixels;
--- a/Renderer/Test/viewer.cc Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Test/viewer.cc Fri Dec 25 20:20:40 2009 +0900 @@ -141,12 +141,6 @@ return sgroot; } -MainLoopPtr -viewer::init_only_sg(SgChange *sgroot, int screen_w, int screen_h) -{ - return sgroot; -} - extern Application * application() { return new viewer();
--- a/Renderer/Test/viewer.h Sat Dec 19 16:37:49 2009 +0900 +++ b/Renderer/Test/viewer.h Fri Dec 25 20:20:40 2009 +0900 @@ -7,5 +7,4 @@ class viewer : public Application { MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h); - MainLoopPtr init_only_sg(SgChange *viewer, int screen_w, int screen_h); };