annotate stage_init.cc @ 8:7c60ef3fca5b

test
author tkaito
date Wed, 07 Jul 2010 03:11:52 +0900
parents c015109a6041
children dea6d34c8e91
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
8
tkaito
parents: 7
diff changeset
30 ObjProperty back_property;
tkaito
parents: 7
diff changeset
31
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
32 void
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
33 create_back(void *sgroot_, int w, int h)
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
34 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
35 Viewer *sgroot = (Viewer *)sgroot_;
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
36 SceneGraphPtr back;
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
37
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
38 back = sgroot->createSceneGraph();
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
39 back->set_move_collision(back_move, back_coll);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
40 sgroot->setSceneData(back);
8
tkaito
parents: 7
diff changeset
41 back_property.flag = 0;
5
bcbcee3c6729 title done.
tkaito
parents: 4
diff changeset
42
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
43 charactor[0].x = w/2;
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
44 charactor[0].y = h/2;
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
45 charactor[0].parent = (void*)back;
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
46
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 5
diff changeset
47 int size = sizeof(ObjPropertyPtr)*16;
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
48
6
661ec1e92042 set_game_task move to API(SceneGrapRoot).
tkaito
parents: 5
diff changeset
49 /* set_game_task(int id, ObjProperty property, int size, PostFunction post_func) */
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
50 sgroot->set_game_task(TITLE_MOVE, charactor, size, create_title);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
51
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
52 }
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
53
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
54
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
55 void
4
ccc811ee5f55 property add.
tkaito
parents: 3
diff changeset
56 create_stage(void *sgroot_, int w, int h, ObjPropertyPtr charactor)
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
57 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
58 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
59
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
60 SceneGraphPtr stage = sgroot->createSceneGraph();
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
61 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
62
7
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
63 //mydandy->set_move_collision(dandy_move, dandy_coll);
c015109a6041 schedule add. 10% done.
tkaito
parents: 6
diff changeset
64 //stage->set_move_collision(stage_move, stage_coll);
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
65
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
66 mydandy->xyz[0] = w/2;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
67 mydandy->xyz[1] = h*0.9;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
68 mydandy->xyz[2] = 0.0f;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
69
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
70 stage->addChild(mydandy);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
71 sgroot->setSceneData(stage);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
72 }
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
73