annotate stage_init.cc @ 11:8c7a2e7cb9e0

test
author tkaito
date Sat, 17 Jul 2010 14:12:53 +0900
parents 27d3291a7c82
children aecc2199251e
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 }
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
18
8
tkaito
parents: 7
diff changeset
19 ObjProperty back_property;
tkaito
parents: 7
diff changeset
20
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
21 void
11
tkaito
parents: 10
diff changeset
22 create_title_back(Viewer *sgroot_, int w, int h)
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
23 {
11
tkaito
parents: 10
diff changeset
24 Viewer *sgroot = sgroot_;
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
25 SceneGraphPtr back;
9
dea6d34c8e91 not move.
tkaito
parents: 8
diff changeset
26 back_property.flag = 0;
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
27
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
28 back = sgroot->createSceneGraph();
10
tkaito
parents: 9
diff changeset
29 sgroot->setSceneData(back);
9
dea6d34c8e91 not move.
tkaito
parents: 8
diff changeset
30
10
tkaito
parents: 9
diff changeset
31 SceneGraphPtr title = (SceneGraphPtr)charactor[0].root;
11
tkaito
parents: 10
diff changeset
32 ObjProperty titlep;
tkaito
parents: 10
diff changeset
33 titlep.x = w/2;
tkaito
parents: 10
diff changeset
34 titlep.y = h/2;
tkaito
parents: 10
diff changeset
35 titlep.root = (void*)title;
tkaito
parents: 10
diff changeset
36 titlep.parent = (void*)back;
10
tkaito
parents: 9
diff changeset
37 int size = sizeof(ObjProperty)*16;
11
tkaito
parents: 10
diff changeset
38 sgroot->set_move_task(title, TITLE_MOVE, (void*)&titlep, size, create_title);
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
39 }
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
40
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
41
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
42 void
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
43 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor)
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
44 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
45 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
46
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
47 SceneGraphPtr stage = sgroot->createSceneGraph();
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
48 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
49
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
50 //mydandy->set_move_collision(dandy_move, dandy_coll);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
51 //stage->set_move_collision(stage_move, stage_coll);
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
52
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
53 mydandy->xyz[0] = w/2;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
54 mydandy->xyz[1] = h*0.9;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
55 mydandy->xyz[2] = 0.0f;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
56
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
57 stage->addChild(mydandy);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
58 sgroot->setSceneData(stage);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
59 }
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
60