changeset 198:57921c8d21c5

rename snake_bg to panel
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Mon, 26 Jan 2009 10:38:29 +0900
parents 3c77b74d04ac
children eb20274baa7c
files TaskManager/Test/test_render/SceneGraphRoot.h TaskManager/Test/test_render/panel.cpp TaskManager/Test/test_render/snake_bg.cpp TaskManager/Test/test_render/task/CreateSpan.cpp TaskManager/Test/test_render/universe.cpp TaskManager/Test/test_render/viewer.cpp
diffstat 6 files changed, 45 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Test/test_render/SceneGraphRoot.h	Mon Jan 26 10:14:21 2009 +0900
+++ b/TaskManager/Test/test_render/SceneGraphRoot.h	Mon Jan 26 10:38:29 2009 +0900
@@ -50,3 +50,5 @@
 typedef SceneGraphRoot *SceneGraphRootPtr;
 
 #endif
+
+extern SceneGraphRootPtr sgroot;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/Test/test_render/panel.cpp	Mon Jan 26 10:38:29 2009 +0900
@@ -0,0 +1,37 @@
+#include "SceneGraphRoot.h"
+#include "SGList.h"
+
+static void panel_move(SceneGraphPtr node, int screen_w, int screen_h);
+static void panel_collision(SceneGraphPtr node, int screen_w, int screen_h,
+			    SceneGraphPtr tree);
+
+static void
+panel_move(SceneGraphPtr node, int screen_w, int screen_h)
+{
+}
+
+static void
+panel_collision(SceneGraphPtr node, int screen_w, int screen_h,
+	       SceneGraphPtr tree)
+{
+}
+
+void
+panel_init(int bg)
+{
+    SceneGraphPtr panel;
+
+    if (bg == 2) {
+	sgroot->createFromXMLfile("xml_file/panel_512.xml");
+	panel = sgroot->createSceneGraph(PANEL_512);
+    } else if (bg == 3) {
+	sgroot->createFromXMLfile("xml_file/panel_1024.xml");
+	panel = sgroot->createSceneGraph(PANEL_1024);
+    } else {
+	sgroot->createFromXMLfile("xml_file/panel_2048.xml");
+	panel = sgroot->createSceneGraph(PANEL_2048);
+    }
+
+    panel->set_move_collision(panel_move, panel_collision);
+    sgroot->setSceneData(panel);
+}
--- a/TaskManager/Test/test_render/snake_bg.cpp	Mon Jan 26 10:14:21 2009 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#include "SceneGraph.h"
-#include "xml_file/snake576x384.h"
-#include "xml_file/snake800x600.h"
-#include "xml_file/1920x1080.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(int bg)
-{
-    if (bg == 2) {
-	SceneGraph::createFromXMLfile("xml_file/snake576x384.xml");
-    } else if (bg == 3) {
-	SceneGraph::createFromXMLfile("xml_file/snake800x600.xml");
-    } else {
-	SceneGraph::createFromXMLfile("xml_file/1920x1080.xml");
-    }
-
-    Plane->set_move_collision(snake_move, snake_collision);
-}
--- a/TaskManager/Test/test_render/task/CreateSpan.cpp	Mon Jan 26 10:14:21 2009 +0900
+++ b/TaskManager/Test/test_render/task/CreateSpan.cpp	Mon Jan 26 10:38:29 2009 +0900
@@ -384,8 +384,6 @@
 			     (int)(span->tex_width*tex_x_len),
 			     (int)(span->tex_height*tex_y_len), tex_scale_max);
 
-	scale = (8 > tex_scale_max) ? tex_scale_max : 8;
-	
 	uint32 *tapestry = getTapestry(tex_width, tex_height, scale, tex_addr);
 
 	span->tex_addr   = tapestry;
--- a/TaskManager/Test/test_render/universe.cpp	Mon Jan 26 10:14:21 2009 +0900
+++ b/TaskManager/Test/test_render/universe.cpp	Mon Jan 26 10:38:29 2009 +0900
@@ -2,7 +2,6 @@
 #include "SceneGraphRoot.h"
 #include "SGList.h"
 
-SceneGraphRootPtr sgroot;
 int moonrem = 0;
 
 static void
@@ -56,13 +55,11 @@
 }
 
 void
-universe_init(SceneGraphRootPtr _sgroot)
+universe_init(void)
 {
     SceneGraphPtr earth;
     SceneGraphPtr moon;
 
-    sgroot = _sgroot;
-
     sgroot->createFromXMLfile("xml_file/universe.xml");
 
     // SGList.h にある SceneGraph ID から SceneGraph を生成する
--- a/TaskManager/Test/test_render/viewer.cpp	Mon Jan 26 10:14:21 2009 +0900
+++ b/TaskManager/Test/test_render/viewer.cpp	Mon Jan 26 10:38:29 2009 +0900
@@ -19,7 +19,7 @@
 int this_time;
 int frames;
 
-static SceneGraphRootPtr sgroot;
+SceneGraphRootPtr sgroot;
 
 /* Data Pack sent to Other CPUs (ex. SPE) */
 SceneGraphPack *sgpack;
@@ -107,8 +107,8 @@
 
 extern void node_init(void);
 extern void create_cube_split(int);
-extern void create_snake_bg(int);
-extern void universe_init(SceneGraphRootPtr);
+extern void panel_init(int);
+extern void universe_init();
 
 void
 Viewer::run_init(const char *xml, int sg_number)
@@ -131,10 +131,10 @@
     case 2:
     case 3:
     case 4:
-	create_snake_bg(sg_number);
+	panel_init(sg_number);
 	break;
     case 5:
-	universe_init(sgroot);
+	universe_init();
 	break;
     case 6:
 	node_init();