diff TaskManager/Test/test_render/Application/chain.cc @ 431:b40a9b901d71 draft

fix
author game@henri.cr.ie.u-ryukyu.ac.jp
date Thu, 24 Sep 2009 20:43:14 +0900
parents 2c592936bbdf
children 7705fa2025da
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Application/chain.cc	Thu Sep 24 17:45:35 2009 +0900
+++ b/TaskManager/Test/test_render/Application/chain.cc	Thu Sep 24 20:43:14 2009 +0900
@@ -19,19 +19,20 @@
     int can_move;
     SceneGraphPtr parent;
     int id;
-    //int parent;
-} CHAIN_VARS;
+    int parent_id;
+} PropertyPtr*;
 
 /* SceneGraph の property */
-CHAIN_VARS* properties[2];
-CHAIN_VARS* property;
+PropertyPtr properties[2];
+PropertyPtr property;
+
 
 
 //void createSceneGraphFromProperty(CHAIN_VARS* p) ;
 void createSceneGraphFromProperty(void* p) ;
 
 void
-init_chain_vars(CHAIN_VARS *cv) {
+Chain::init_chain_vars(CHAIN_VARS *cv) {
     cv->x = 0, cv->y = 0, cv->next_x = 0, cv->next_y = 0;
     cv->vx = 0, cv->vy = 0, cv->next_vx = 0, cv->next_vy = 0;
     cv->can_move = TRUE;
@@ -47,7 +48,7 @@
     sg->angle[2] = p->angle[2];
 }
 
-
+/*
 static void
 chain_move_ope(SceneGraphPtr node, int screen_w, int screen_h)
 {
@@ -70,14 +71,15 @@
         property[CHAIN_LEN-1].can_move = TRUE;
     }
 }
+*/
 
 void
-chain_move(TaskManager *manager, SceneGraphPtr sg, int w, int h)
+Chain::chain_move(TaskManager *manager, SceneGraphPtr sg, int w, int h)
 {
     int id = sg->id;
-    //CHAIN_VARS* p = (CHAIN_VARS*)sg->propertyptr;
+    //PropertyPtr p = (PropertyPtr)sg->propertyptr;
     HTaskPtr chain_cal;
-    CHAIN_VARS* output;
+    PropertyPtr output;
 
     // SceneGraph の切り替えもここでやる
     if (property == properties[0]) {
@@ -97,15 +99,14 @@
 }
 
 void
-chain_collision(SceneGraphPtr sg, int w, int h, SceneGraphPtr osg)
+Chain::chain_collision(SceneGraphPtr sg, int w, int h, SceneGraphPtr osg)
 {
-
 }
 
 void 
 createSceneGraphFromProperty(void* p) 
 {
-    CHAIN_VARS* chain_p = (CHAIN_VARS*)p;
+    PropertyPtr chain_p = (PropertyPtr)p;
     SceneGraphPtr chain_copy = sgroot->createSceneGraph(CHAIN);
     chain_copy->propertyptr = (void*)chain_p;
     chain_copy->property_size = sizeof(CHAIN_VARS);
@@ -114,7 +115,7 @@
 }
 
 void
-chain_init(TaskManager *manager, int w, int h)
+Chain::chain_init(TaskManager *manager, int w, int h)
 {
     SceneGraphPtr root_chain, chain;
     CHAIN_VARS rcv;
@@ -125,8 +126,8 @@
     sgroot->createFromXMLfile(manager, "xml_file/chain.xml");
 
     /* SPE に送る property の配列の領域確保 */
-    properties[0] = (CHAIN_VARS*)manager->allocate(sizeof(CHAIN_VARS)*CHAIN_LEN);
-    properties[1] = (CHAIN_VARS*)manager->allocate(sizeof(CHAIN_VARS)*CHAIN_LEN);
+    properties[0] = (PropertyPtr)manager->allocate(sizeof(CHAIN_VARS)*CHAIN_LEN);
+    properties[1] = (PropertyPtr)manager->allocate(sizeof(CHAIN_VARS)*CHAIN_LEN);
     property = properties[0];
 
     root_chain = sgroot->createSceneGraph(CHAIN);