annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
388
3d1e86396d16 MemHash (OS X version)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 382
diff changeset
1 #include <iostream>
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 #include <math.h>
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
3 #include "SceneGraphRoot.h"
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
4 #include "SceneGraph.h"
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 #include "SGList.h"
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
6 #include "TaskManager.h"
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
7 #include "Func.h"
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
8
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
9 #define FALSE 0
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
10 #define TRUE !FALSE
382
1c3f84a6f5d0 chain.cpp update
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 378
diff changeset
11 #define CHAIN_LEN 50
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
12
382
1c3f84a6f5d0 chain.cpp update
kazz@kazzone.cr.ie.u-ryukyu.ac.jp
parents: 378
diff changeset
13 static double chain_width = 10;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
14
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
15 typedef struct {
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
16 double x, y, next_x, next_y;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
17 double vx, vy, next_vx, next_vy;
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
18 double angle[3];
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
19 int can_move;
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
20 SceneGraphPtr parent;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
21 int id;
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
22 int parent_id;
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
23 } PropertyPtr*;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
24
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
25 /* SceneGraph の property */
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
26 PropertyPtr properties[2];
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
27 PropertyPtr property;
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
28
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
29
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
30
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
31 //void createSceneGraphFromProperty(CHAIN_VARS* p) ;
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
32 void createSceneGraphFromProperty(void* p) ;
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
33
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
34 void
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
35 Chain::init_chain_vars(CHAIN_VARS *cv) {
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
36 cv->x = 0, cv->y = 0, cv->next_x = 0, cv->next_y = 0;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
37 cv->vx = 0, cv->vy = 0, cv->next_vx = 0, cv->next_vy = 0;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
38 cv->can_move = TRUE;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
39 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
40
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
41 void
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
42 set_vector(CHAIN_VARS *p, SceneGraphPtr sg) {
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
43 sg->xyz[0] = p->next_x;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
44 sg->xyz[1] = p->next_y;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
45 sg->xyz[2] = 0.0f;
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
46 sg->angle[0] = p->angle[0];
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
47 sg->angle[1] = p->angle[1];
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
48 sg->angle[2] = p->angle[2];
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
49 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
50
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
51 /*
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
52 static void
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
53 chain_move_ope(SceneGraphPtr node, int screen_w, int screen_h)
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
54 {
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
55 Pad *pad = sgroot->getController();
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
56
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
57 if (pad->circle.isHold()) {
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
58 property[CHAIN_LEN-1].can_move = FALSE;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
59 if (pad->left.isHold()) {
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
60 property[CHAIN_LEN-1].x += -5.0;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
61 } else if (pad->right.isHold()) {
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
62 property[CHAIN_LEN-1].x += 5.0;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
63 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
64
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
65 if (pad->up.isHold()) {
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
66 property[CHAIN_LEN-1].y += -5.0;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
67 } else if (pad->down.isHold()) {
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
68 property[CHAIN_LEN-1].y += 5.0;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
69 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
70 } else {
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
71 property[CHAIN_LEN-1].can_move = TRUE;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
72 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
73 }
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
74 */
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
75
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
76 void
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
77 Chain::chain_move(TaskManager *manager, SceneGraphPtr sg, int w, int h)
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
78 {
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
79 int id = sg->id;
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
80 //PropertyPtr p = (PropertyPtr)sg->propertyptr;
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
81 HTaskPtr chain_cal;
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
82 PropertyPtr output;
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
83
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
84 // SceneGraph の切り替えもここでやる
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
85 if (property == properties[0]) {
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
86 property = properties[1];
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
87 output = properties[0];
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
88 }else{
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
89 property = properties[0];
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
90 output = properties[1];
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
91 }
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
92 chain_cal = manager->create_task(CHAINCAL_TASK);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
93 chain_cal->add_inData(property, sizeof(CHAIN_VARS)*CHAIN_LEN);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
94 chain_cal->add_param(id);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
95 chain_cal->add_outData(output, sizeof(CHAIN_VARS)*CHAIN_LEN);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
96 chain_cal->set_post(createSceneGraphFromProperty, (void*)id);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
97 chain_cal->spawn();
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
98
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
99 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
100
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
101 void
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
102 Chain::chain_collision(SceneGraphPtr sg, int w, int h, SceneGraphPtr osg)
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
103 {
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
104 }
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
105
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
106 void
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
107 createSceneGraphFromProperty(void* p)
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
108 {
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
109 PropertyPtr chain_p = (PropertyPtr)p;
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
110 SceneGraphPtr chain_copy = sgroot->createSceneGraph(CHAIN);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
111 chain_copy->propertyptr = (void*)chain_p;
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
112 chain_copy->property_size = sizeof(CHAIN_VARS);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
113 set_vector(chain_p, chain_copy);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
114 chain_p->parent->addChild(chain_copy);
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
115 }
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
116
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
117 void
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
118 Chain::chain_init(TaskManager *manager, int w, int h)
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
119 {
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
120 SceneGraphPtr root_chain, chain;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
121 CHAIN_VARS rcv;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
122
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
123 HTaskPtr chain_init;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
124
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
125
397
ce86b0186a4a delete manager (in kernel/ppe/TaskManager.h)
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 396
diff changeset
126 sgroot->createFromXMLfile(manager, "xml_file/chain.xml");
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
127
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
128 /* SPE に送る property の配列の領域確保 */
431
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
129 properties[0] = (PropertyPtr)manager->allocate(sizeof(CHAIN_VARS)*CHAIN_LEN);
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
130 properties[1] = (PropertyPtr)manager->allocate(sizeof(CHAIN_VARS)*CHAIN_LEN);
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
131 property = properties[0];
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
132
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
133 root_chain = sgroot->createSceneGraph(CHAIN);
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
134 // set_move_collision()ではだめ
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
135 root_chain->set_move_collision(chain_move_ope, chain_collision);
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
136 init_chain_vars(&rcv);
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
137 rcv.next_x = w / 2;
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
138 rcv.next_y = 0.0;
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
139 rcv.angle[0] = 0;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
140 rcv.angle[1] = 0;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
141 rcv.angle[2] = 0;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
142
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
143 set_vector(&rcv, root_chain);
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
144
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
145 for(int i = 0; i < CHAIN_LEN; i++) {
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
146 chain = sgroot->createSceneGraph(CHAIN);
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
147 property[i].id = i;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
148 init_chain_vars(&property[i]);
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
149 property[i].x = 0;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
150 property[i].y = chain_width * i;
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
151 set_vector(&property[i], chain);
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
152 property->angle[1] = -90 * (i % 2);
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
153 //chain->set_move_collision(chain_move, chain_collision);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
154 chain->propertyptr = &property[i];
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
155 chain->property_size = sizeof(CHAIN_VARS);
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
156 root_chain->addChild(chain);
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
157 property[i].parent = root_chain;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
158 }
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
159 property[0].can_move = FALSE;
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
160
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
161 // property を SPU の共有領域へコピーする
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
162 chain_init = manager->create_task(CHAININIT_TASK);
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
163 chain_init->add_inData(property, sizeof(CHAIN_VARS)*CHAIN_LEN);
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
164 chain_init->add_param(CHAIN_LEN);
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
165 chain_init->set_cpu(SPE_0);
396
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
166 chain_init->set_post(createSceneGraphFromProperty, (void*)property);
0b623693e6ec don't move. separate allExecute from run_loop
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 395
diff changeset
167 chain_init->spawn();
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
168
375
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
169 sgroot->setSceneData(root_chain);
2ae25549dd6a chain.cpp added
kazz@kazzone.ie.u-ryukyu.ac.jp
parents:
diff changeset
170 }
395
208ba3551474 chain on SPE
game@localhost.localdomain
parents: 388
diff changeset
171