annotate stage_init.cc @ 9:dea6d34c8e91

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