Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraph.h @ 1143:786e800abfb4 draft
minor fix
author | Yutaka_Kinjyo |
---|---|
date | Sat, 19 Feb 2011 01:59:14 +0900 |
parents | f326494ffdc7 |
children | 38111db531e0 |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_SCENE_GRAPH |
2 #define INCLUDED_SCENE_GRAPH | |
3 | |
539 | 4 #include "polygon.h" |
5 #include "Pad.h" | |
6 #include "TaskManager.h" | |
930 | 7 #include "texture.h" |
283 | 8 class SceneGraph; |
9 | |
653
7a311860a76e
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); |
7a311860a76e
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); |
7a311860a76e
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, |
7a311860a76e
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); |
7a311860a76e
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, |
539 | 15 SceneGraph* tree); |
759
45f7ab7101ea
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: | |
1143 | 21 SceneGraph(TaskManager *manager); |
539 | 22 SceneGraph(TaskManager *manager, xmlNodePtr surface); |
283 | 23 SceneGraph(SceneGraphPtr orig); |
24 ~SceneGraph(void); | |
25 | |
653
7a311860a76e
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 |
7a311860a76e
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; |
7a311860a76e
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]; | |
539 | 33 int id; |
593
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
34 // Objectのシーケンス番号(Linda) |
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
35 // とりあえず動かしたいので追加 |
847
4482720bbba7
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 |
1033
a9581a9df440
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
942
diff
changeset
|
38 // task 生成用の情報 |
539 | 39 int property_size; |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
40 void *propertyptr; |
882 | 41 int move_id; |
42 int coll_id; | |
766 | 43 memaddr property; |
768
06302c1dc87d
add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
766
diff
changeset
|
44 memaddr update_property; |
06302c1dc87d
add add spe/chain_move Test/property_chain, not workd
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
766
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 | |
539 | 70 // Group ID |
71 int gid; | |
72 | |
283 | 73 // 関数ポインタ |
74 move_func move; | |
75 collision_func collision; | |
759
45f7ab7101ea
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); | |
759
45f7ab7101ea
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); | |
1136 | 92 SceneGraphPtr clone(TaskManager *manager); |
283 | 93 SceneGraphPtr clone(void *buf); |
94 SceneGraphPtr searchSceneGraph(const char *name); | |
1033
a9581a9df440
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
942
diff
changeset
|
95 void set_move_collision(move_func new_move); |
a9581a9df440
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
942
diff
changeset
|
96 void set_move_collision(collision_func new_collision); |
283 | 97 void set_move_collision(move_func new_move, collision_func new_collision); |
653
7a311860a76e
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
|
98 void set_move_collision(move_func new_move, collision_func new_collision, void *sgroot); |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
99 void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg); |
283 | 100 void remove(void); |
101 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree); | |
102 SceneGraphPtr realRemoveFromList(SceneGraphPtr list); | |
103 int isRemoved(void); | |
104 | |
105 static SceneGraphPtr createSceneGraph(int id); | |
106 | |
107 void translate(float x, float y, float z); | |
108 void translateX(float x); | |
109 void translateY(float y); | |
110 void translateZ(float z); | |
111 | |
112 | |
113 void tree_check(void); | |
114 void print_member(void); | |
539 | 115 void get_data(TaskManager *manager, xmlNodePtr cur); |
283 | 116 void delete_data(void); |
539 | 117 |
118 SDL_Surface* load_decode_image(char *image_name, xmlNodePtr cur); | |
119 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id); | |
120 void get_image(TaskManager *manager, xmlNodePtr cur); | |
283 | 121 }; |
122 | |
123 #endif | |
124 | |
539 | 125 // 帯域変数を使うのは禁止なので削除すること |
283 | 126 // オリジナル (Linked List) |
127 extern SceneGraphPtr scene_graph; | |
128 | |
129 // 描画用 (同じオブジェクトが複数ある) Tree | |
130 extern SceneGraphPtr scene_graph_view; |