changeset 869:bcc81531a672

set_game_task add to SceneGraphRoot.
author tkaito
date Sun, 27 Jun 2010 23:01:44 +0900
parents 58b4fb8ad77c
children 79b2d56aa27a
files Renderer/Engine/SceneGraph.cc Renderer/Engine/SceneGraph.h Renderer/Engine/SceneGraphRoot.cc Renderer/Engine/SceneGraphRoot.h Renderer/Engine/viewer.h example/Bulk/Makefile example/Bulk/Makefile.def example/Bulk/Makefile.macosx example/Bulk/ppe/Twice.cc example/HelloWorld/Makefile example/Simple/Makefile example/basic/Makefile example/get_segment/Makefile example/word_count/Makefile example/word_count3/Makefile
diffstat 15 files changed, 42 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraph.cc	Tue Jun 22 16:10:28 2010 +0900
+++ b/Renderer/Engine/SceneGraph.cc	Sun Jun 27 23:01:44 2010 +0900
@@ -650,6 +650,7 @@
     this->create_sg = new_create_sg;
 }
 
+
 void
 SceneGraph::add_next(SceneGraphPtr next)
 {
--- a/Renderer/Engine/SceneGraph.h	Tue Jun 22 16:10:28 2010 +0900
+++ b/Renderer/Engine/SceneGraph.h	Sun Jun 27 23:01:44 2010 +0900
@@ -93,6 +93,7 @@
     void set_move_collision(move_func new_move, collision_func new_collision);
     void set_move_collision(move_func new_move, collision_func new_collision, void *sgroot);
     void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg);
+    void set_game_task(void *sgroot_, int id, void *property, int size, PostFunction post_func);
     void remove(void);
     SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree);
     SceneGraphPtr realRemoveFromList(SceneGraphPtr list);
--- a/Renderer/Engine/SceneGraphRoot.cc	Tue Jun 22 16:10:28 2010 +0900
+++ b/Renderer/Engine/SceneGraphRoot.cc	Sun Jun 27 23:01:44 2010 +0900
@@ -697,4 +697,18 @@
 
 }
 
+
+void
+SceneGraphRoot::set_game_task(int id, void *property, int size, PostFunction post_func)
+{ 
+  HTask *task = sgroot->tmanager->create_task(id);
+  task->set_cpu(SPE_ANY);
+  task->add_inData(property, size*16);
+  task->add_outData(property, size*16);
+  task->add_param((memaddr)1);
+  task->set_post(post_func, (void*)property, 0);
+  task->spawn();
+}
+
+
 /* end */
--- a/Renderer/Engine/SceneGraphRoot.h	Tue Jun 22 16:10:28 2010 +0900
+++ b/Renderer/Engine/SceneGraphRoot.h	Sun Jun 27 23:01:44 2010 +0900
@@ -105,6 +105,7 @@
     void OffLightSwitch(int id);
     void OnLightSysSwitch();
     void OffLightSysSwitch();
+    void set_game_task(int id, void *property, int size, PostFunction post_func);
 
     /* Other System API */
     void allExecute(int screen_w, int screen_h);
--- a/Renderer/Engine/viewer.h	Tue Jun 22 16:10:28 2010 +0900
+++ b/Renderer/Engine/viewer.h	Sun Jun 27 23:01:44 2010 +0900
@@ -60,7 +60,7 @@
     HTaskPtr initLoop();
 
     void clean_pixels() {}
-      
+
     void run_init(TaskManager *manager, Application *app);
     void run_loop(HTaskPtr task_next);
     void run_draw(HTaskPtr task_next);
@@ -89,6 +89,11 @@
     // void setSceneData(SceneGraph *g);
     void mainLoop();
 
+    void set_game_task(int id, void *property, int size, PostFunction post_func)
+    {
+      sgroot->set_game_task(id, property, size, post_func);
+    }
+
     void createFromXMLmemory(SceneGraph * node, char *data, int len)
     {
 	sgroot->createFromXMLmemory(manager, node, data, len);
--- a/example/Bulk/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/Bulk/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"
--- a/example/Bulk/Makefile.def	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/Bulk/Makefile.def	Sun Jun 27 23:01:44 2010 +0900
@@ -13,5 +13,9 @@
 
 ABIBIT = 32
 
-INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
-LIBS = -L${CERIUM}/TaskManager
+#INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
+#LIBS = -L${CERIUM}/TaskManager
+
+INCLUDE = -I. -I.. -I${CERIUM}/include/TaskManager -I$(CERIUM)/Renderer/Engine -I$(CERIUM)/include/Cerium
+LIBS = -L${CERIUM}/TaskManager -L$(CERIUM)/Renderer/Engine
+TOOL = $(CERIUM)/bin
--- a/example/Bulk/Makefile.macosx	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/Bulk/Makefile.macosx	Sun Jun 27 23:01:44 2010 +0900
@@ -11,7 +11,11 @@
 TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
 TASK_OBJS = $(TASK_SRCS:.cc=.o)
 
-LIBS += -lFifoManager `sdl-config --libs`
+#LIBS += -lFifoManager `sdl-config --libs`
+CFLAGS += `sdl-config --cflags` `xml2-config --cflags`
+LIBS += -lCerium -lFifoManager
+LIBS += `sdl-config --libs` `xml2-config --libs` -lSDL_image -Wl,-framework,OpenGL 
+
 CC += -m$(ABIBIT)
 
 .SUFFIXES: .cc .o
--- a/example/Bulk/ppe/Twice.cc	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/Bulk/ppe/Twice.cc	Sun Jun 27 23:01:44 2010 +0900
@@ -14,7 +14,7 @@
     int *i_data;
     int *o_data;
     long length;
-    int count = (int)s->get_param(0);
+    long count = (long)s->get_param(0);
 
     for(int j = 0; j<count; j++) {
 	i_data = (int*)s->get_input(rbuf, j);
--- a/example/HelloWorld/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/HelloWorld/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"
--- a/example/Simple/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/Simple/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"
--- a/example/basic/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/basic/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"
--- a/example/get_segment/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/get_segment/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"
--- a/example/word_count/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/word_count/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"
--- a/example/word_count3/Makefile	Tue Jun 22 16:10:28 2010 +0900
+++ b/example/word_count3/Makefile	Sun Jun 27 23:01:44 2010 +0900
@@ -6,7 +6,7 @@
 
 fifo64: FORCE
 	@echo "Make for Mac OS X 64bit mode"
-	@$(MAKE) -f Makefile.fifo ABIBIT=64
+	@$(MAKE) -f Makefile.macosx ABIBIT=64
 
 linux: FORCE
 	@echo "Make for Linux"