Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/SceneGraph.h @ 983:ff74988bbb2a
minor fix
author | root@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Fri, 01 Oct 2010 00:37:06 +0900 |
parents | b2f7d2ad3804 |
children | 431936c0cc96 |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_SCENE_GRAPH |
2 #define INCLUDED_SCENE_GRAPH | |
3 | |
507 | 4 #include "polygon.h" |
5 #include "Pad.h" | |
6 #include "TaskManager.h" | |
930 | 7 #include "texture.h" |
283 | 8 class SceneGraph; |
9 | |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
10 //typedef void (*move_func)(SceneGraph* node, int screen_w, int screen_h); |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
11 typedef void (*move_func)(SceneGraph* node, void *sgroot, int screen_w, int screen_h); |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
12 //typedef void (*collision_func)(SceneGraph* node, int screen_w, int screen_h, |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
13 // SceneGraph* tree); |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
14 typedef void (*collision_func)(SceneGraph* node, void *sgroot, int screen_w, int screen_h, |
507 | 15 SceneGraph* tree); |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
16 typedef void (*create_sg_func)(void *sgroot, void *property, void *update_property); |
283 | 17 typedef SceneGraph* SceneGraphPtr; |
18 | |
19 class SceneGraph : public Polygon { | |
20 public: | |
21 SceneGraph(void); | |
507 | 22 SceneGraph(TaskManager *manager, xmlNodePtr surface); |
283 | 23 SceneGraph(SceneGraphPtr orig); |
24 ~SceneGraph(void); | |
25 | |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
26 // add |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
27 void *sgroot; |
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
28 |
283 | 29 // Node がもつ状態変数(というべきか否か |
30 // xyz,angle ぐらいあればおk? | |
31 float stack_xyz[3]; | |
32 float stack_angle[3]; | |
507 | 33 int id; |
593
6f741ab60749
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
507
diff
changeset
|
34 // Objectのシーケンス番号(Linda) |
6f741ab60749
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
507
diff
changeset
|
35 // とりあえず動かしたいので追加 |
847
8c78d15ea999
replace rd() to wait_rd(). and if reply of wait_rd() is NULL, client request one more rd(). for wait_rd() cannot get last changed tuple.
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
843
diff
changeset
|
36 int seq, seq_rd, resend_flag; |
860 | 37 |
507 | 38 int property_size; |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
39 void *propertyptr; |
882 | 40 int move_id; |
41 int coll_id; | |
42 PostFunction post_func; | |
767 | 43 memaddr property; |
769
2a00c1f470b7
add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
767
diff
changeset
|
44 memaddr update_property; |
2a00c1f470b7
add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
767
diff
changeset
|
45 |
283 | 46 |
47 // xml ファイルから生成した時のオブジェクトリスト | |
48 SceneGraphPtr next; | |
49 SceneGraphPtr prev; | |
50 SceneGraphPtr last; | |
51 | |
52 // Tree Structure | |
53 SceneGraphPtr parent; | |
54 SceneGraphPtr brother; | |
55 SceneGraphPtr children; | |
56 SceneGraphPtr lastChild; | |
57 | |
58 // Tree から削除されていたら 1 をセット。default = 0 | |
59 int flag_remove; | |
60 | |
61 // SceneGraph ID (SGList.h) | |
62 int sgid; | |
63 | |
64 // この SceneGraph は描画するものかどうか (0:しない 1:する | |
65 int flag_drawable; | |
66 | |
67 // anime frame num | |
68 int frame; | |
69 | |
507 | 70 // Group ID |
71 int gid; | |
72 | |
283 | 73 // 関数ポインタ |
74 move_func move; | |
75 collision_func collision; | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
76 create_sg_func create_sg; |
283 | 77 |
78 // desutroctor で呼ばれる | |
79 void (SceneGraph::*finalize)(void); | |
80 | |
81 void init(void); | |
82 void finalize_original(void); | |
83 void finalize_copy(void); | |
84 void move_execute(int screen_w, int screen_h); | |
85 void collision_check(int screen_w, int screen_h, SceneGraphPtr tree); | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
86 void create_sg_execute(); |
283 | 87 void all_execute(int screen_w, int screen_h); |
88 | |
89 void add_next(SceneGraphPtr next); | |
90 SceneGraphPtr addChild(SceneGraphPtr child); | |
91 SceneGraphPtr addBrother(SceneGraphPtr bro); | |
92 SceneGraphPtr clone(void); | |
93 SceneGraphPtr clone(void *buf); | |
94 SceneGraphPtr searchSceneGraph(const char *name); | |
95 void set_move_collision(move_func new_move, collision_func new_collision); | |
656
d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
593
diff
changeset
|
96 void set_move_collision(move_func new_move, collision_func new_collision, void *sgroot); |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
97 void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg); |
283 | 98 void remove(void); |
99 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree); | |
100 SceneGraphPtr realRemoveFromList(SceneGraphPtr list); | |
101 int isRemoved(void); | |
102 | |
103 static SceneGraphPtr createSceneGraph(int id); | |
104 | |
105 void translate(float x, float y, float z); | |
106 void translateX(float x); | |
107 void translateY(float y); | |
108 void translateZ(float z); | |
109 | |
110 | |
111 void tree_check(void); | |
112 void print_member(void); | |
507 | 113 void get_data(TaskManager *manager, xmlNodePtr cur); |
283 | 114 void delete_data(void); |
507 | 115 |
116 SDL_Surface* load_decode_image(char *image_name, xmlNodePtr cur); | |
117 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id); | |
118 void get_image(TaskManager *manager, xmlNodePtr cur); | |
283 | 119 }; |
120 | |
121 #endif | |
122 | |
507 | 123 // 帯域変数を使うのは禁止なので削除すること |
283 | 124 // オリジナル (Linked List) |
125 extern SceneGraphPtr scene_graph; | |
126 | |
127 // 描画用 (同じオブジェクトが複数ある) Tree | |
128 extern SceneGraphPtr scene_graph_view; |