annotate stage_init.cc @ 30:14f2ef87f9f2 default tip

remove unnecessary files
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 10 Dec 2010 11:29:41 +0900
parents 34fde39c0a31
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
1 #include "dandy.h"
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
2
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
3 HTaskPtr
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
4 pad_alloc(Viewer *sgroot)
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
5 {
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
6 HTaskPtr task = sgroot->manager->create_task(PAD_ALLOCATE);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
7 void *pad = (void*)sgroot->getController();
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
8 int size = sizeof(Pad);
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
9
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
10 task->set_param(0, PAD_INPUT);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
11 task->set_param(1, size);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
12 task->add_inData(pad, size);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
13 task->set_cpu(SPE_ANY);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
14 task->spawn();
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
15
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
16 return task;
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
17 }
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
18
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
19 HTaskPtr
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
20 pad_update(SceneGraphRoot *sgroot)
21
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
21 {
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
22 HTaskPtr task = sgroot->tmanager->create_task(PAD_UPDATE);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
23 void *pad = (void*)sgroot->getController();
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
24 int size = sizeof(Pad);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
25
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
26 task->set_param(0, PAD_INPUT);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
27 task->set_param(1, size);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
28 task->add_inData(pad, size);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
29 task->set_cpu(SPE_ANY);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
30 task->spawn();
21
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
31
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
32 return task;
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
33 }
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
34
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
35 HTaskPtr
27
34fde39c0a31 commit test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 26 24
diff changeset
36 pad_free(SceneGraphRoot *sgroot)
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
37 {
27
34fde39c0a31 commit test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 26 24
diff changeset
38 HTaskPtr task = sgroot->tmanager->create_task(PAD_FREE);
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
39
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
40 task->set_param(0, PAD_INPUT);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
41 task->set_cpu(SPE_ANY);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
42 task->spawn();
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
43
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
44 return task;
21
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
45 }
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
46
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
47 void
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
48 title_move(SceneGraphPtr node, void *sgroot_, int w, int h)
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
49 {
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
50 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
5
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
51
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
52 HTaskPtr update = pad_update(sgroot);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
53 HTaskPtr title_task = sgroot->tmanager->create_task(TITLE_MOVE);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
54 int size = sizeof(ObjProperty);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
55 title_task->set_param(0, PAD_INPUT);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
56 title_task->add_inData((void *)&charactor[0], size);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
57 title_task->add_outData((void *)&charactor[0], size);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
58 title_task->set_cpu(SPE_ANY);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
59 title_task->wait_for(update);
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
60 title_task->spawn();
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
61 }
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
62
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
63 void
11
tkaito
parents: 10
diff changeset
64 create_title_back(Viewer *sgroot_, int w, int h)
19
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
65 {
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
66 Viewer *sgroot = sgroot_;
23
3fb8a6a34e24 debug and keep up with task_array
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
67 SceneGraphPtr root = sgroot->createSceneGraph();
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
68
21
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
69 SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
27
34fde39c0a31 commit test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 26 24
diff changeset
70 title->set_move_collision(title_move);
19
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
71 charactor[0].x = w/2;
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
72 charactor[0].y = h/2;
24
a131729d6e4d not working.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
73 charactor[0].vx = 1.0;
a131729d6e4d not working.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
74 charactor[0].vy = 1.0;
19
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
75 charactor[0].flag = 0;
23
3fb8a6a34e24 debug and keep up with task_array
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
76 charactor[0].parent = (void*)root;
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
77
19
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
78 title->xyz[0] = charactor[0].x;
632ce41a842a testing game task with pad's input
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
79 title->xyz[1] = charactor[0].y;
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
80 title->set_move_collision(title_move);
21
fd9deaa67de9 debug done.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
81
26
6bea374ee604 global alloc test.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
82 pad_alloc(sgroot);
23
3fb8a6a34e24 debug and keep up with task_array
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
83 root->addChild(title);
3fb8a6a34e24 debug and keep up with task_array
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 21
diff changeset
84 sgroot->setSceneData(root);
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
85 }