Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraph.h @ 801:eb6add789a24 draft
global id
author | yutaka@localhost.localdomain |
---|---|
date | Wed, 19 May 2010 14:59:41 +0900 |
parents | 06302c1dc87d |
children | 8d702fc5d77a |
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" | |
283 | 7 class SceneGraph; |
8 | |
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
|
9 //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
|
10 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
|
11 //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
|
12 // 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
|
13 typedef void (*collision_func)(SceneGraph* node, void *sgroot, int screen_w, int screen_h, |
539 | 14 SceneGraph* tree); |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
747
diff
changeset
|
15 typedef void (*create_sg_func)(void *sgroot, void *property, void *update_property); |
283 | 16 typedef SceneGraph* SceneGraphPtr; |
17 | |
18 class SceneGraph : public Polygon { | |
19 public: | |
20 SceneGraph(void); | |
539 | 21 SceneGraph(TaskManager *manager, xmlNodePtr surface); |
283 | 22 SceneGraph(SceneGraphPtr orig); |
23 ~SceneGraph(void); | |
24 | |
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
|
25 // 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
|
26 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
|
27 |
283 | 28 // Node がもつ状態変数(というべきか否か |
29 // xyz,angle ぐらいあればおk? | |
30 float stack_xyz[3]; | |
31 float stack_angle[3]; | |
539 | 32 int id; |
593
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
33 // Objectのシーケンス番号(Linda) |
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
34 // とりあえず動かしたいので追加 |
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
35 int seq; |
75c78f8fba24
sending and moving of multi xml work (linda)
kazz@kazzone.st.ie.u-ryukyu.ac.jp
parents:
539
diff
changeset
|
36 |
539 | 37 int property_size; |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
747
diff
changeset
|
38 void *propertyptr; |
766 | 39 //void *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
|
40 //void *update_property; |
766 | 41 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
|
42 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
|
43 |
283 | 44 |
45 // xml ファイルから生成した時のオブジェクトリスト | |
46 SceneGraphPtr next; | |
47 SceneGraphPtr prev; | |
48 SceneGraphPtr last; | |
49 | |
50 // Tree Structure | |
51 SceneGraphPtr parent; | |
52 SceneGraphPtr brother; | |
53 SceneGraphPtr children; | |
54 SceneGraphPtr lastChild; | |
55 | |
56 // Tree から削除されていたら 1 をセット。default = 0 | |
57 int flag_remove; | |
58 | |
59 // SceneGraph ID (SGList.h) | |
60 int sgid; | |
61 | |
62 // この SceneGraph は描画するものかどうか (0:しない 1:する | |
63 int flag_drawable; | |
64 | |
65 // anime frame num | |
66 int frame; | |
67 | |
539 | 68 // Group ID |
69 int gid; | |
70 | |
283 | 71 // 関数ポインタ |
72 move_func move; | |
73 collision_func collision; | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
747
diff
changeset
|
74 create_sg_func create_sg; |
283 | 75 |
76 // desutroctor で呼ばれる | |
77 void (SceneGraph::*finalize)(void); | |
78 | |
79 void init(void); | |
80 void finalize_original(void); | |
81 void finalize_copy(void); | |
82 void move_execute(int screen_w, int screen_h); | |
83 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:
747
diff
changeset
|
84 void create_sg_execute(); |
283 | 85 void all_execute(int screen_w, int screen_h); |
86 | |
87 void add_next(SceneGraphPtr next); | |
88 SceneGraphPtr addChild(SceneGraphPtr child); | |
89 SceneGraphPtr addBrother(SceneGraphPtr bro); | |
90 SceneGraphPtr clone(void); | |
91 SceneGraphPtr clone(void *buf); | |
92 SceneGraphPtr searchSceneGraph(const char *name); | |
93 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
|
94 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:
747
diff
changeset
|
95 void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg); |
283 | 96 void remove(void); |
97 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree); | |
98 SceneGraphPtr realRemoveFromList(SceneGraphPtr list); | |
99 int isRemoved(void); | |
100 | |
101 static SceneGraphPtr createSceneGraph(int id); | |
102 | |
103 void translate(float x, float y, float z); | |
104 void translateX(float x); | |
105 void translateY(float y); | |
106 void translateZ(float z); | |
107 | |
108 | |
109 void tree_check(void); | |
110 void print_member(void); | |
539 | 111 void get_data(TaskManager *manager, xmlNodePtr cur); |
283 | 112 void delete_data(void); |
539 | 113 |
114 SDL_Surface* load_decode_image(char *image_name, xmlNodePtr cur); | |
115 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id); | |
116 void get_image(TaskManager *manager, xmlNodePtr cur); | |
283 | 117 }; |
118 | |
119 #endif | |
120 | |
539 | 121 // 帯域変数を使うのは禁止なので削除すること |
283 | 122 // オリジナル (Linked List) |
123 extern SceneGraphPtr scene_graph; | |
124 | |
125 // 描画用 (同じオブジェクトが複数ある) Tree | |
126 extern SceneGraphPtr scene_graph_view; |