Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraph.h @ 1211:7763f03a94e1 draft before-dma-manager
const char fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 22 Jul 2011 08:46:29 +0900 |
parents | 0ee23180d301 |
children | 636dfdc30176 |
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); |
1169 | 23 SceneGraph(TaskManager *manager, SceneGraphPtr orig); |
1211 | 24 SceneGraph(TaskManager *manager, const char* string_name, int pixels, Uint32 len , const char* obj_name); |
1210 | 25 |
283 | 26 ~SceneGraph(void); |
27 | |
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
|
28 // 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
|
29 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
|
30 |
283 | 31 // Node がもつ状態変数(というべきか否か |
32 // xyz,angle ぐらいあればおk? | |
33 float stack_xyz[3]; | |
34 float stack_angle[3]; | |
539 | 35 int id; |
593
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
36 // Objectのシーケンス番号(Linda) |
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
37 // とりあえず動かしたいので追加 |
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
|
38 int seq, seq_rd, resend_flag; |
860 | 39 |
1033
a9581a9df440
add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
942
diff
changeset
|
40 // task 生成用の情報 |
539 | 41 int property_size; |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
42 void *propertyptr; |
882 | 43 int move_id; |
44 int coll_id; | |
766 | 45 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
|
46 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
|
47 |
283 | 48 |
49 // xml ファイルから生成した時のオブジェクトリスト | |
50 SceneGraphPtr next; | |
51 SceneGraphPtr prev; | |
52 SceneGraphPtr last; | |
53 | |
54 // Tree Structure | |
55 SceneGraphPtr parent; | |
56 SceneGraphPtr brother; | |
57 SceneGraphPtr children; | |
58 SceneGraphPtr lastChild; | |
59 | |
60 // Tree から削除されていたら 1 をセット。default = 0 | |
61 int flag_remove; | |
62 | |
63 // SceneGraph ID (SGList.h) | |
64 int sgid; | |
65 | |
66 // この SceneGraph は描画するものかどうか (0:しない 1:する | |
67 int flag_drawable; | |
68 | |
69 // anime frame num | |
70 int frame; | |
71 | |
539 | 72 // Group ID |
73 int gid; | |
74 | |
283 | 75 // 関数ポインタ |
76 move_func move; | |
77 collision_func collision; | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
724
diff
changeset
|
78 create_sg_func create_sg; |
1205
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1169
diff
changeset
|
79 |
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1169
diff
changeset
|
80 // フォントデータ |
1211 | 81 void create_font_data(TaskManager *manager,const char *font, int pixels,Uint32 color, const char *filename); |
82 void get_font_image(TaskManager *manager,const char *font, int pixels,Uint32 color, const char *name); | |
1205
b8adf4e95e96
add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
1169
diff
changeset
|
83 void createFont(TaskManager *manager); |
1211 | 84 void conv(const char *str, int length, u_int32_t *out); |
85 SDL_Surface* load_font_image(const char *font, int pixels,Uint32 color, const char *string_name); | |
1208 | 86 |
283 | 87 // desutroctor で呼ばれる |
88 void (SceneGraph::*finalize)(void); | |
89 | |
90 void init(void); | |
91 void finalize_original(void); | |
92 void finalize_copy(void); | |
93 void move_execute(int screen_w, int screen_h); | |
94 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
|
95 void create_sg_execute(); |
283 | 96 void all_execute(int screen_w, int screen_h); |
97 | |
98 void add_next(SceneGraphPtr next); | |
99 SceneGraphPtr addChild(SceneGraphPtr child); | |
100 SceneGraphPtr addBrother(SceneGraphPtr bro); | |
1136 | 101 SceneGraphPtr clone(TaskManager *manager); |
1169 | 102 SceneGraphPtr clone(TaskManager *manager, void *buf); |
283 | 103 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
|
104 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
|
105 void set_move_collision(collision_func new_collision); |
283 | 106 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
|
107 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
|
108 void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg); |
283 | 109 void remove(void); |
110 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree); | |
111 SceneGraphPtr realRemoveFromList(SceneGraphPtr list); | |
112 int isRemoved(void); | |
113 | |
114 static SceneGraphPtr createSceneGraph(int id); | |
115 | |
116 void translate(float x, float y, float z); | |
117 void translateX(float x); | |
118 void translateY(float y); | |
119 void translateZ(float z); | |
120 | |
121 | |
122 void tree_check(void); | |
123 void print_member(void); | |
539 | 124 void get_data(TaskManager *manager, xmlNodePtr cur); |
283 | 125 void delete_data(void); |
539 | 126 |
1211 | 127 SDL_Surface* load_decode_image(const char *filename, const char *image_name, xmlNodePtr cur); |
539 | 128 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id); |
129 void get_image(TaskManager *manager, xmlNodePtr cur); | |
283 | 130 }; |
131 | |
132 #endif | |
133 | |
539 | 134 // 帯域変数を使うのは禁止なので削除すること |
283 | 135 // オリジナル (Linked List) |
136 extern SceneGraphPtr scene_graph; | |
137 | |
138 // 描画用 (同じオブジェクトが複数ある) Tree | |
139 extern SceneGraphPtr scene_graph_view; |