annotate stage_init.cc @ 3:7b4c2cfeba45

task not move 2%
author tkaito
date Thu, 17 Jun 2010 06:31:01 +0900
parents 6e1afe1016dc
children ccc811ee5f55
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
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
3 void stage_move(SceneGraphPtr node, void *sgroot_, int w, int h);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
4 void stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
5
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
6 void
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
7 createSceneGraphFromProperty(SchedTask *s, void *charactor_, void *b)
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
8 {
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
9 ObjPropertyPtr charactor1 = (ObjPropertyPtr)charactor;
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
10 printf("charactor.x = %f\n", charactor1[0].x);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
11 }
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
12
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
13
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
14 void
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
15 create_title(void *sgroot_, int w, int h)
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
16 {
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
17 TaskManager *manager;
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
18 Viewer *sgroot = (Viewer *)sgroot_;
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
19 SceneGraphPtr back1; //title;
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
20
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
21 back1 = sgroot->createSceneGraph();
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
22 //back->set_move_collision(back_move, back_coll);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
23 sgroot->setSceneData(back1);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
24
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
25 /* createPropertyFromSceneGraph */
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
26 charactor[0].x = back1->xyz[0];
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
27 charactor[0].y = back1->xyz[1];
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
28 charactor[0].vx = back1->stack_xyz[0];
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
29 charactor[0].vy = back1->stack_xyz[1];
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
30 charactor[0].frame = back1->frame;
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
31
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
32 /* set_game_task */
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
33 HTask *back;
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
34 back = manager->create_task(TITLE_MOVE);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
35 back->set_cpu(SPE_ANY);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
36 back->add_inData((char*)charactor, sizeof(ObjProperty));
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
37 back->add_outData(charactor, sizeof(ObjProperty));
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
38 back->add_param((memaddr)1);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
39 back->set_post(createSceneGraphFromProperty, (void*)charactor, 0);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
40 //back->set_post(test, (void*)charactor, 0);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
41 back->spawn();
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
42 }
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
43
3
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
44 //createSceneGraphFromProperty(ObjProperty charactor);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
45
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
46
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
47 //title = sgroot->createSceneGraph("title001");
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
48 //title->xyz[0] = w/2;
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
49 //title->xyz[1] = h/2;
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
50 //back->addChild(title);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
51
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
52
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
53 //title->set_move_collision(title_move, title_coll);
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
54
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
55
7b4c2cfeba45 task not move 2%
tkaito
parents: 2
diff changeset
56
2
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
57
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
58 void
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
59 create_stage(void *sgroot_, int w, int h)
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
60 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
61 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
62
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
63 SceneGraphPtr stage = sgroot->createSceneGraph();
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
64 SceneGraphPtr mydandy = sgroot->createSceneGraph("mydandy");
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
65
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
66 mydandy->set_move_collision(dandy_move, dandy_coll);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
67 stage->set_move_collision(stage_move, stage_coll);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
68
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
69 mydandy->xyz[0] = w/2;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
70 mydandy->xyz[1] = h*0.9;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
71 mydandy->xyz[2] = 0.0f;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
72
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
73 stage->addChild(mydandy);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
74 sgroot->setSceneData(stage);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
75 }
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
76
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
77 void
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
78 stage_move(SceneGraphPtr node, void *sgroot_, int w, int h)
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
79 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
80
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
81 //stage_plan(node, sgroot_, w, h);
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
82 node->frame += 1;
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
83
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
84 }
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
85
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
86 void
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
87 stage_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree)
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
88 {
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
89 }
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
90
6e1afe1016dc Task is not yet.
tkaito
parents:
diff changeset
91