annotate stage_init.cc @ 10:27d3291a7c82

fix
author tkaito
date Tue, 13 Jul 2010 18:09:25 +0900
parents dea6d34c8e91
children 8c7a2e7cb9e0
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
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
3
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
4 void
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
5 create_title(SchedTask *s, void *charactor_, void *b)
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
6 {
5
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
7 ObjPropertyPtr charactor = (ObjPropertyPtr)charactor_;
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
8 SceneGraphPtr back1, title;
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
9 back1 = (SceneGraphPtr)charactor[0].parent;
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
10 title = (SceneGraphPtr)charactor[0].root;
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
11
5
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
12 title->xyz[0] = charactor[0].x;
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
13 title->xyz[1] = charactor[0].y;
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
14
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
15 back1->addChild(title);
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
16
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
17 }
10
tkaito
parents: 9
diff changeset
18 /*
tkaito
parents: 9
diff changeset
19 void
tkaito
parents: 9
diff changeset
20 title_move(SceneGraphPtr node, void *sgroot_, int w, int h)
tkaito
parents: 9
diff changeset
21 {
tkaito
parents: 9
diff changeset
22 sgroot->set_move_task(obj, TITLE_MOVE, (void*)property, size, create_title);
tkaito
parents: 9
diff changeset
23 }
tkaito
parents: 9
diff changeset
24
tkaito
parents: 9
diff changeset
25 void
tkaito
parents: 9
diff changeset
26 title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree)
tkaito
parents: 9
diff changeset
27 {
tkaito
parents: 9
diff changeset
28 }
tkaito
parents: 9
diff changeset
29 */
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
30
8
tkaito
parents: 7
diff changeset
31 ObjProperty back_property;
tkaito
parents: 7
diff changeset
32
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
33 void
10
tkaito
parents: 9
diff changeset
34 create_title_back(void *sgroot_, int w, int h)
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
35 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
36 Viewer *sgroot = (Viewer *)sgroot_;
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
37 SceneGraphPtr back;
9
dea6d34c8e91 not move.
tkaito
parents: 8
diff changeset
38 back_property.flag = 0;
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
39
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
40 back = sgroot->createSceneGraph();
10
tkaito
parents: 9
diff changeset
41 //back->set_move_collision(back_move, back_coll);
tkaito
parents: 9
diff changeset
42 sgroot->setSceneData(back);
9
dea6d34c8e91 not move.
tkaito
parents: 8
diff changeset
43
10
tkaito
parents: 9
diff changeset
44 SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
tkaito
parents: 9
diff changeset
45 ObjPropertyPtr titlep;
tkaito
parents: 9
diff changeset
46 titlep->x = w/2;
tkaito
parents: 9
diff changeset
47 titlep->y = h/2;
tkaito
parents: 9
diff changeset
48 titlep->root = (void*)title;
tkaito
parents: 9
diff changeset
49 titlep->parent = (void*)back;
tkaito
parents: 9
diff changeset
50 int size = sizeof(ObjProperty)*16;
tkaito
parents: 9
diff changeset
51 //sgroot->set_move_property(title, title_move, (void*)property, size);
tkaito
parents: 9
diff changeset
52 sgroot->set_move_task(title, TITLE_MOVE, (void*)titlep, size, create_title);
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
53 }
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
54
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
55
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
56 void
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
57 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor)
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
58 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
59 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
60
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
61 SceneGraphPtr stage = sgroot->createSceneGraph();
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
62 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
63
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
64 //mydandy->set_move_collision(dandy_move, dandy_coll);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
65 //stage->set_move_collision(stage_move, stage_coll);
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
66
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
67 mydandy->xyz[0] = w/2;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
68 mydandy->xyz[1] = h*0.9;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
69 mydandy->xyz[2] = 0.0f;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
70
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
71 stage->addChild(mydandy);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
72 sgroot->setSceneData(stage);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
73 }
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
74