283
|
1 #ifndef INCLUDED_SCENE_GRAPH_ROOT
|
|
2 #define INCLUDED_SCENE_GRAPH_ROOT
|
|
3
|
|
4 #ifndef INCLUDED_SCENE_GRAPH
|
|
5 # include "SceneGraph.h"
|
|
6 #endif
|
|
7
|
|
8 #ifndef INCLUDED_SCENE_GRAPH_ARRAY
|
|
9 # include "SceneGraphArray.h"
|
|
10 #endif
|
|
11
|
|
12 #ifndef INCLUDED_CAMERA
|
|
13 # include "Camera.h"
|
|
14 #endif
|
|
15
|
|
16 #ifndef INCLUDED_SCENE_GRAPH_ITERATOR
|
|
17 # include "SceneGraphIterator.h"
|
|
18 #endif
|
|
19
|
|
20 class SceneGraphRoot {
|
|
21 public:
|
|
22 /* Constructor, Destructor */
|
|
23 SceneGraphRoot(float w, float h);
|
|
24 ~SceneGraphRoot(void);
|
|
25
|
|
26 /* Variables */
|
|
27 // xml から読み込んだ、オリジナルの SceneGraph
|
|
28 SceneGraphPtr *sg_src;
|
|
29
|
|
30 // move, collision 用の SceneGraph (tree)
|
|
31 SceneGraphPtr sg_exec_tree;
|
|
32
|
|
33 // 描画用の SceneGraph List (tree)
|
|
34 SceneGraphPtr sg_draw_tree;
|
|
35
|
|
36 // sg_exec_tree に対応する list
|
|
37 SceneGraphPtr sg_available_list;
|
|
38
|
|
39 // sg_draw_tree に対応する list
|
|
40 // draw_tree は描画後削除される
|
|
41 SceneGraphPtr sg_remove_list;
|
|
42
|
|
43 SceneGraphArrayPtr sg_array1;
|
|
44 SceneGraphArrayPtr sg_array2;
|
|
45 SceneGraphArrayPtr sg_curArray;
|
|
46
|
|
47 // コントローラーオブジェクト (Keyboard, Joystick, ..)
|
|
48 Pad *controller;
|
|
49
|
|
50 // カメラオブジェクト
|
|
51 Camera *camera;
|
|
52
|
|
53 // SceneGraphIterator
|
|
54 SceneGraphIteratorPtr iterator;
|
|
55
|
|
56 /**
|
|
57 * Functions
|
|
58 */
|
|
59 /* User API */
|
|
60 void createFromXMLfile(const char *);
|
|
61 SceneGraphPtr createSceneGraph(int id);
|
|
62 SceneGraphPtr createSceneGraph(void);
|
|
63 void setSceneData(SceneGraphPtr sg);
|
|
64 Pad *getController(void);
|
|
65 SceneGraphIteratorPtr getIterator(void);
|
|
66 SceneGraphIteratorPtr getIterator(SceneGraphPtr list);
|
|
67 CameraPtr getCamera(void);
|
|
68
|
|
69 /* Other System API */
|
|
70 void allExecute(int screen_w, int screen_h);
|
|
71 void checkRemove(void);
|
|
72 SceneGraphPtr getExecuteSceneGraph(void);
|
|
73 SceneGraphPtr getDrawSceneGraph(void);
|
|
74 void updateControllerState(void);
|
|
75
|
|
76 /* System API */
|
|
77 void registSceneGraph(SceneGraphPtr sg);
|
|
78 void addNext(SceneGraphPtr sg);
|
|
79 void allRemove(SceneGraphPtr list);
|
|
80 };
|
|
81
|
|
82 typedef SceneGraphRoot *SceneGraphRootPtr;
|
|
83
|
|
84 #endif
|
|
85
|
|
86 extern SceneGraphRootPtr sgroot;
|