changeset 422:976ca6f00d65

comment
author game@henri.cr.ie.u-ryukyu.ac.jp
date Thu, 24 Sep 2009 12:35:32 +0900
parents 90d677a9c00b
children afb717c43a3c
files TaskManager/Test/test_render/KeyStat.h TaskManager/Test/test_render/SceneGraphRoot.cc TaskManager/Test/test_render/task/Switch.cc TaskManager/Test/test_render/viewer.cc TaskManager/Test/test_render/viewer.h
diffstat 5 files changed, 20 insertions(+), 99 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Test/test_render/KeyStat.h	Wed Sep 23 21:29:30 2009 +0900
+++ b/TaskManager/Test/test_render/KeyStat.h	Thu Sep 24 12:35:32 2009 +0900
@@ -7,12 +7,16 @@
     PUSH,
 };
 
+// 可変長の構造体にする。
+// int で1つ送り bit field でやると
 typedef struct key_stat {
+    int length;
     int right;
     int left;
     int up;
     int down;
     int circle;
+    unsigned char data[0];
 };
 
 #endif
--- a/TaskManager/Test/test_render/SceneGraphRoot.cc	Wed Sep 23 21:29:30 2009 +0900
+++ b/TaskManager/Test/test_render/SceneGraphRoot.cc	Thu Sep 24 12:35:32 2009 +0900
@@ -196,39 +196,11 @@
     }
 
     /*removeのflagをもとにtreeを形成*/
-    while (t) {
-	SceneGraphPtr c = NULL;
-	if (!t->isRemoved()) {
-	    c = t->clone();	    
-	    addNext(c);
-	    cur_parent->addChild(c);
-	    c->frame = t->frame;
-            /*親の回転、座標から、子の回転、座標を算出*/
-            get_matrix(c->matrix, c->angle, c->xyz, cur_parent->matrix);
-        } 
-
-	if (t->children != NULL && c != NULL) {
-	    cur_parent = c;
-	    t = t->children;
-	} else if (t->brother != NULL) {
-	    t = t->brother;
-	} else {
-	    while (t) {
-		if (t->brother != NULL) {
-		    t = t->brother;
-		    break;
-		} else {
-		    if (t->parent == NULL) {
-			t = NULL;
-			break;
-		    } else {
-                        cur_parent = cur_parent->parent;
-                        t = t->parent;
-			
-		    }
-		}
-	    }	    
-	}
+    /* spe から送り返されてきた property の配列を見て生成する for()*/
+    for (Property *t = property[0]; is_end(t); t++){
+	SceneGraphPtr s = application->scenegraph_factory(t); // SceneGraphNode を作る
+	t->scenegraph = s; // property list には SceneGraphへのポインタが入っている
+	application->scenegraph_connector(property[0], s); // add する
     }
 
       
--- a/TaskManager/Test/test_render/task/Switch.cc	Wed Sep 23 21:29:30 2009 +0900
+++ b/TaskManager/Test/test_render/task/Switch.cc	Thu Sep 24 12:35:32 2009 +0900
@@ -9,6 +9,7 @@
 int
 Switch::run(void *rbuf, void *wbuf)
 {
+// 配列にする
     SceneGraphRootPtr tmp = sgroot;
     sgroot = sgroot_2;
     sgroot_2 = tmp;
--- a/TaskManager/Test/test_render/viewer.cc	Wed Sep 23 21:29:30 2009 +0900
+++ b/TaskManager/Test/test_render/viewer.cc	Thu Sep 24 12:35:32 2009 +0900
@@ -117,7 +117,7 @@
     sgroot = new SceneGraphRoot(this->width, this->height);
     sgroot_2 = new SceneGraphRoot(this->width, this->height);
     //sgroot->createFromXMLFile(xml);
-
+    // ここの switch は application->init(this, manager, sg_no); になるべき
     switch (sg_number) {
     case 0:
     case 1:
@@ -243,8 +243,8 @@
     this->keyPtr = key;
 
     // post2runLoop は旧バージョン用なので post2speRunLoop の様なものを別につくるべき
-    task_next->set_post(post2speRunLoop, (void*)this); // set_post(function(this->run_loop()), NULL)
-    task_next->spawn();
+    //task_next->set_post(post2speRunLoop, (void*)this); // set_post(function(this->run_loop()), NULL)
+    //task_next->spawn();
     // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ
 
     /* test */
@@ -314,12 +314,14 @@
     update_key->add_inData(viewer->keyPtr, sizeof(key_stat));
     update_key->spawn();
 
-    HTaskPtr move_task = viewer->manager->create_task(TASK_MOVE);    
+    /* TASK_MOVE は外から引数で取ってくるべき */
+    HTaskPtr move_task = viewer->manager->create_task(viewer->move_taskid);    
     //move_task->add_param(sgroot);
 
     HTaskPtr draw_task = viewer->manager->create_task(TASK_DRAW);
 
     HTaskPtr switch_task = viewer->manager->create_task(TASK_SWITCH);
+
     switch_task->wait_for(move_task);
     switch_task->wait_for(draw_task);
     move_task->spawn();
@@ -338,36 +340,6 @@
     viewer->run_move(task_next);
 }
 
-/*
-void
-Viewer::spe_run_loop()
-{
-
-    bool quit_flg;
-    quit_flg = quit_check();
-    if (quit_flg == true) {
-        this_time = get_ticks();
-        run_finish();
-        return;
-    }
-
-    clean_pixels();
-
-    for (int i = 1; i <= spackList_length; i++) {
-        spackList[i-1].reinit(i*split_screen_h);
-    }
-        
-    //run_move(task_next);
-    sgroot->updateControllerState();
-    sgroot->speExecute(width, height);
-    //sgroot->checkRemove();
-
-    // ここから下は Rendering という関数にする
-    rendering(task_next);
-
-}
-
-*/
 void
 Viewer::mainLoop()
 {
@@ -375,40 +347,8 @@
 
     task_next->set_post(&post2runLoop, (void *)this); // set_post(function(this->run_loop()), NULL)
     task_next->spawn();
-    // TASK_INIT_TEXTURE が全て終わったら DUMMY_TASK が Viewer::run_loop() を呼ぶ
 }
 
-
-/*
-static void
-post2exchange_sgroot(void *viewer_)
-{
-    Viewer *viewer = (Viewer*)viewer_;
-    HTaskPtr task_next = viewer->manager->create_task(TASK_DUMMY);
-    viewer->exchange_sgroot(task_next);
-}
-
-void
-Viewer::exchange_sgroot(TaskManager *manager)
-{
-
-    SceneGraphRootPtr tmp = sgroot;
-    sgroot = sgroot_2;
-    sgroot_2 = tmp;
-    
-}
-*/
-
-/*
-void
-Viewer::spe_run_move(HTaskPtr task_next)
-{
-    HTaskPtr move_task = manager->create_task(MOVE_TASK);
-    move_task->add_param(sgroot);
-    task_next->wait_for(move_task);
-}
-*/
-
 static void
 post2runMove(void *viewer_)
 {
@@ -600,3 +540,5 @@
     delete sgroot_2;
     quit();
 }
+
+/* end */
--- a/TaskManager/Test/test_render/viewer.h	Wed Sep 23 21:29:30 2009 +0900
+++ b/TaskManager/Test/test_render/viewer.h	Thu Sep 24 12:35:32 2009 +0900
@@ -14,6 +14,8 @@
 
     virtual ~Viewer(void) {}
 
+    //Application *application;
+
     TaskManager *manager;
     key_stat *keyPtr;