annotate stage_init.cc @ 7:c015109a6041

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