Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraph.h @ 766:3541fe06be2b draft
add spe/univers_move
author | hiroki@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Sat, 13 Feb 2010 17:33:38 +0900 |
parents | 45f7ab7101ea |
children | 06302c1dc87d |
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; |
40 memaddr property; | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
747
diff
changeset
|
41 void *update_property; |
283 | 42 |
43 // xml ファイルから生成した時のオブジェクトリスト | |
44 SceneGraphPtr next; | |
45 SceneGraphPtr prev; | |
46 SceneGraphPtr last; | |
47 | |
48 // Tree Structure | |
49 SceneGraphPtr parent; | |
50 SceneGraphPtr brother; | |
51 SceneGraphPtr children; | |
52 SceneGraphPtr lastChild; | |
53 | |
54 // Tree から削除されていたら 1 をセット。default = 0 | |
55 int flag_remove; | |
56 | |
57 // SceneGraph ID (SGList.h) | |
58 int sgid; | |
59 | |
60 // この SceneGraph は描画するものかどうか (0:しない 1:する | |
61 int flag_drawable; | |
62 | |
63 // anime frame num | |
64 int frame; | |
65 | |
539 | 66 // Group ID |
67 int gid; | |
68 | |
283 | 69 // 関数ポインタ |
70 move_func move; | |
71 collision_func collision; | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
747
diff
changeset
|
72 create_sg_func create_sg; |
283 | 73 |
74 // desutroctor で呼ばれる | |
75 void (SceneGraph::*finalize)(void); | |
76 | |
77 void init(void); | |
78 void finalize_original(void); | |
79 void finalize_copy(void); | |
80 void move_execute(int screen_w, int screen_h); | |
81 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
|
82 void create_sg_execute(); |
283 | 83 void all_execute(int screen_w, int screen_h); |
84 | |
85 void add_next(SceneGraphPtr next); | |
86 SceneGraphPtr addChild(SceneGraphPtr child); | |
87 SceneGraphPtr addBrother(SceneGraphPtr bro); | |
88 SceneGraphPtr clone(void); | |
89 SceneGraphPtr clone(void *buf); | |
90 SceneGraphPtr searchSceneGraph(const char *name); | |
91 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
|
92 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
|
93 void set_move_collision(move_func new_move, collision_func new_collision, create_sg_func new_create_sg); |
283 | 94 void remove(void); |
95 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree); | |
96 SceneGraphPtr realRemoveFromList(SceneGraphPtr list); | |
97 int isRemoved(void); | |
98 | |
99 static SceneGraphPtr createSceneGraph(int id); | |
100 | |
101 void translate(float x, float y, float z); | |
102 void translateX(float x); | |
103 void translateY(float y); | |
104 void translateZ(float z); | |
105 | |
106 | |
107 void tree_check(void); | |
108 void print_member(void); | |
539 | 109 void get_data(TaskManager *manager, xmlNodePtr cur); |
283 | 110 void delete_data(void); |
539 | 111 |
112 SDL_Surface* load_decode_image(char *image_name, xmlNodePtr cur); | |
113 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id); | |
114 void get_image(TaskManager *manager, xmlNodePtr cur); | |
283 | 115 }; |
116 | |
117 #endif | |
118 | |
539 | 119 // 帯域変数を使うのは禁止なので削除すること |
283 | 120 // オリジナル (Linked List) |
121 extern SceneGraphPtr scene_graph; | |
122 | |
123 // 描画用 (同じオブジェクトが複数ある) Tree | |
124 extern SceneGraphPtr scene_graph_view; |