changeset 143:9588726193e1 draft

add xml
author gongo@charles.cr.ie.u-ryukyu.ac.jp
date Sat, 29 Nov 2008 03:36:11 +0900
parents dc68420f705f
children 594093237a15
files TaskManager/Test/test_render/Makefile.def TaskManager/Test/test_render/cube_action.cpp TaskManager/Test/test_render/node.cpp TaskManager/Test/test_render/snake_bg.cpp TaskManager/Test/test_render/viewer.cpp
diffstat 5 files changed, 47 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Makefile.def	Sat Nov 29 02:39:43 2008 +0900
+++ b/TaskManager/Test/test_render/Makefile.def	Sat Nov 29 03:36:11 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  = -O0 -g -Wall# -DDEBUG
+CFLAGS  = -O9 -g -Wall# -DDEBUG
 
 INCLUDE = -I$(CERIUM)/include/TaskManager -I.
 LIBS = -L$(CERIUM)/TaskManager
--- a/TaskManager/Test/test_render/cube_action.cpp	Sat Nov 29 02:39:43 2008 +0900
+++ b/TaskManager/Test/test_render/cube_action.cpp	Sat Nov 29 03:36:11 2008 +0900
@@ -1,5 +1,6 @@
 #include "SceneGraph.h"
-#include "xml_file/cube_split.h"
+//#include "xml_file/cube_split.h"
+#include "xml_file/cube.h"
 
 static void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h);
 static void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h);
@@ -16,9 +17,9 @@
     node->xyz[1] -= node->stack_xyz[0] * node->stack_xyz[1];
     node->xyz[2] -= node->stack_xyz[0] * node->stack_xyz[2];
 
-    node->angle[0] += 0.2;
-    node->angle[1] += 0.2 * node->stack_xyz[1];
-    node->angle[2] += 0.2 * node->stack_xyz[2];
+    node->angle[0] += 2.0f;
+    node->angle[1] += 2.0f * node->stack_xyz[1];
+    node->angle[2] += 2.0f * node->stack_xyz[2];
     
     if (node->frame > 10 && scene_graph->controller->circle.push) {
 	cube_split(node);
@@ -32,9 +33,9 @@
     node->xyz[1] -= node->stack_xyz[0] * node->stack_xyz[1];
     node->xyz[2] -= node->stack_xyz[0] * node->stack_xyz[2];
 
-    node->angle[0] += 0.2;
-    node->angle[1] += 0.2 * node->stack_xyz[1];
-    node->angle[2] += 0.2 * node->stack_xyz[2];
+    node->angle[0] += 2.0f;
+    node->angle[1] += 2.0f * node->stack_xyz[1];
+    node->angle[2] += 2.0f * node->stack_xyz[2];
 
     if (node->frame > 10 && scene_graph->controller->circle.push) {
 	cube_split(node);
@@ -54,12 +55,12 @@
     p->xyz[1] = root->xyz[1];
     p->xyz[2] = root->xyz[2];
 
-    p->stack_xyz[0] = 0.2;
+    p->stack_xyz[0] = 2.0f;
     p->stack_xyz[1] = random()%3-1;
     p->stack_xyz[2] = random()%3-1;
 
     root->xyz[0] -= 2;
-    root->stack_xyz[0] = 0.2;
+    root->stack_xyz[0] = 2.0f;
     root->stack_xyz[1] = random()%3-1;
     root->stack_xyz[2] = random()%3-1;
 }
@@ -92,7 +93,9 @@
 void
 create_cube_split(void)
 {
-    SceneGraph::createFromXMLfile("xml_file/cube_split.xml");
-    Plane->set_move_collision(plane_idle, cube_collision);
-    CUBE->set_move_collision(cube_move_idle, cube_collision);
+    //SceneGraph::createFromXMLfile("xml_file/cube_split.xml");
+    //Plane->set_move_collision(plane_idle, cube_collision);
+    //CUBE->set_move_collision(cube_move_idle, cube_collision);
+    SceneGraph::createFromXMLfile("xml_file/cube.xml");
+    Cube->set_move_collision(cube_move_idle, cube_collision);
 }
--- a/TaskManager/Test/test_render/node.cpp	Sat Nov 29 02:39:43 2008 +0900
+++ b/TaskManager/Test/test_render/node.cpp	Sat Nov 29 03:36:11 2008 +0900
@@ -2,7 +2,6 @@
 #include "SceneGraph.h"
 #include "xml_file/cube.h"
 
-
 static void
 cube_collision(SceneGraphPtr node, int screen_w, int screen_h,
 	       SceneGraphPtr tree)
@@ -64,9 +63,8 @@
 void
 node_init(void)
 {
-#if 1
-    scene_graph->set_move_collision(Cube, cube_move, cube_collision);
+    SceneGraph::createFromXMLfile("xml_file/cube.xml");
+    Cube->set_move_collision(cube_move, cube_collision);
     Cube->stack_xyz[0] = 2.0f;
     Cube->stack_xyz[1] = 2.0f;
-#endif
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Test/test_render/snake_bg.cpp	Sat Nov 29 03:36:11 2008 +0900
@@ -0,0 +1,24 @@
+#include "SceneGraph.h"
+#include "xml_file/snake576x384.h"
+
+static void snake_move(SceneGraphPtr node, int screen_w, int screen_h);
+static void snake_collision(SceneGraphPtr node, int screen_w, int screen_h,
+			    SceneGraphPtr tree);
+
+static void
+snake_move(SceneGraphPtr node, int screen_w, int screen_h)
+{
+}
+
+static void
+snake_collision(SceneGraphPtr node, int screen_w, int screen_h,
+	       SceneGraphPtr tree)
+{
+}
+
+void
+create_snake_bg(void)
+{
+    SceneGraph::createFromXMLfile("xml_file/snake576x384.xml");
+    Plane->set_move_collision(snake_move, snake_collision);
+}
--- a/TaskManager/Test/test_render/viewer.cpp	Sat Nov 29 02:39:43 2008 +0900
+++ b/TaskManager/Test/test_render/viewer.cpp	Sat Nov 29 03:36:11 2008 +0900
@@ -104,8 +104,8 @@
 }
 
 extern void node_init(void);
-
 extern void create_cube_split(void);
+extern void create_snake_bg(void);
 
 void
 Viewer::run_init(char *xml)
@@ -126,7 +126,8 @@
     //SceneGraph::createFromXMLfile(xml);
     //polygon->viewer  = this;
 
-    create_cube_split();
+    //create_cube_split();
+    create_snake_bg();
     //node_init();
 
     scene_graph->controller = create_controller();