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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCLUDED_SCENE_GRAPH
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCLUDED_SCENE_GRAPH
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include "polygon.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
5 #include "Pad.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
6 #include "TaskManager.h"
930
b58861019a28 GL drawing speed up
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 882
diff changeset
7 #include "texture.h"
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
8 class SceneGraph;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17 typedef SceneGraph* SceneGraphPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 class SceneGraph : public Polygon {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20 public:
1143
786e800abfb4 minor fix
Yutaka_Kinjyo
parents: 1136
diff changeset
21 SceneGraph(TaskManager *manager);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
22 SceneGraph(TaskManager *manager, xmlNodePtr surface);
1169
b93ff55ba015 free TaskArray rbuf
Yutaka_Kinjyo
parents: 1166
diff changeset
23 SceneGraph(TaskManager *manager, SceneGraphPtr orig);
1211
7763f03a94e1 const char fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1210
diff changeset
24 SceneGraph(TaskManager *manager, const char* string_name, int pixels, Uint32 len , const char* obj_name);
1210
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1208 1205
diff changeset
25
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 ~SceneGraph(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 // Node がもつ状態変数(というべきか否か
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 // xyz,angle ぐらいあればおk?
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 float stack_xyz[3];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34 float stack_angle[3];
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
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
63a08f3a468a Still on the way
yutaka@localhost.localdomain
parents: 847
diff changeset
39
1033
a9581a9df440 add application main method and task.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents: 942
diff changeset
40 // task 生成用の情報
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
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
1cb89ec2e796 SceneGraphRoot::set_move_task add.
tkaito
parents: 869
diff changeset
43 int move_id;
1cb89ec2e796 SceneGraphRoot::set_move_task add.
tkaito
parents: 869
diff changeset
44 int coll_id;
766
3541fe06be2b add spe/univers_move
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 759
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
48
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
49 // xml ファイルから生成した時のオブジェクトリスト
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
50 SceneGraphPtr next;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
51 SceneGraphPtr prev;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
52 SceneGraphPtr last;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
53
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
54 // Tree Structure
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
55 SceneGraphPtr parent;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
56 SceneGraphPtr brother;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
57 SceneGraphPtr children;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
58 SceneGraphPtr lastChild;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
59
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
60 // Tree から削除されていたら 1 をセット。default = 0
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
61 int flag_remove;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
62
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
63 // SceneGraph ID (SGList.h)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
64 int sgid;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
65
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
66 // この SceneGraph は描画するものかどうか (0:しない 1:する
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
67 int flag_drawable;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
68
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
69 // anime frame num
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
70 int frame;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
71
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
72 // Group ID
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
73 int gid;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
74
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
75 // 関数ポインタ
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
76 move_func move;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
7763f03a94e1 const char fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1210
diff changeset
81 void create_font_data(TaskManager *manager,const char *font, int pixels,Uint32 color, const char *filename);
7763f03a94e1 const char fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1210
diff changeset
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
7763f03a94e1 const char fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1210
diff changeset
84 void conv(const char *str, int length, u_int32_t *out);
7763f03a94e1 const char fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1210
diff changeset
85 SDL_Surface* load_font_image(const char *font, int pixels,Uint32 color, const char *string_name);
1208
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents: 1169
diff changeset
86
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
87 // desutroctor で呼ばれる
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
88 void (SceneGraph::*finalize)(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
89
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
90 void init(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
91 void finalize_original(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
92 void finalize_copy(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
93 void move_execute(int screen_w, int screen_h);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
96 void all_execute(int screen_w, int screen_h);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
97
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
98 void add_next(SceneGraphPtr next);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
99 SceneGraphPtr addChild(SceneGraphPtr child);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
100 SceneGraphPtr addBrother(SceneGraphPtr bro);
1136
f326494ffdc7 not work ieshoot. not check Cell
Yutaka_Kinjyo
parents: 1129
diff changeset
101 SceneGraphPtr clone(TaskManager *manager);
1169
b93ff55ba015 free TaskArray rbuf
Yutaka_Kinjyo
parents: 1166
diff changeset
102 SceneGraphPtr clone(TaskManager *manager, void *buf);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
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
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
109 void remove(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
110 SceneGraphPtr realRemoveFromTree(SceneGraphPtr tree);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
111 SceneGraphPtr realRemoveFromList(SceneGraphPtr list);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
112 int isRemoved(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
113
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
114 static SceneGraphPtr createSceneGraph(int id);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
115
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
116 void translate(float x, float y, float z);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
117 void translateX(float x);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
118 void translateY(float y);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
119 void translateZ(float z);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
120
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
121
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
122 void tree_check(void);
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
123 void print_member(void);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
124 void get_data(TaskManager *manager, xmlNodePtr cur);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
125 void delete_data(void);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
126
1211
7763f03a94e1 const char fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 1210
diff changeset
127 SDL_Surface* load_decode_image(const char *filename, const char *image_name, xmlNodePtr cur);
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
128 int makeTapestries(TaskManager *manager, SDL_Surface *texture_image, int id);
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
129 void get_image(TaskManager *manager, xmlNodePtr cur);
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
130 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
131
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
132 #endif
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
133
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
134 // 帯域変数を使うのは禁止なので削除すること
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
135 // オリジナル (Linked List)
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
136 extern SceneGraphPtr scene_graph;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
137
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
138 // 描画用 (同じオブジェクトが複数ある) Tree
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
139 extern SceneGraphPtr scene_graph_view;