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