comparison Renderer/Engine/SceneGraphRoot.h @ 562:d65f21b18165 draft

name search
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 22 Oct 2009 22:22:31 +0900
parents 00428ba0ba03
children 5193d51294a2
comparison
equal deleted inserted replaced
561:5d9728befc2d 562:d65f21b18165
3 3
4 #include "SceneGraph.h" 4 #include "SceneGraph.h"
5 #include "SceneGraphArray.h" 5 #include "SceneGraphArray.h"
6 #include "Camera.h" 6 #include "Camera.h"
7 #include "SceneGraphIterator.h" 7 #include "SceneGraphIterator.h"
8 // #include "Application.h"
9 #include "SceneGraphList.h"
10 #include "SgStruct.h"
11 // #include "TaskManager.h"
12 #include <sys/types.h>
13
14 typedef struct {
15 caddr_t file_mmap;
16 off_t size;
17 } st_mmap_t;
18
19 class Application;
8 20
9 class SceneGraphRoot { 21 class SceneGraphRoot {
10 public: 22 public:
11 /* Constructor, Destructor */ 23 /* Constructor, Destructor */
12 SceneGraphRoot(float w, float h); 24 SceneGraphRoot(float w, float h);
13 ~SceneGraphRoot(); 25 ~SceneGraphRoot();
14 26
15 /* Variables */ 27 /* Variables */
28 TaskManager *tmanager;
29
30 // sgid と name を持った SgStruct のリスト
31 SceneGraphList *sglist;
32
16 // xml から読み込んだ、オリジナルの SceneGraph 33 // xml から読み込んだ、オリジナルの SceneGraph
17 SceneGraphPtr sg_src; 34 SceneGraphPtr *sg_src;
18 int sg_src_length; 35 int sg_src_length;
19 36
20 // move, collision 用の SceneGraph (tree) 37 // move, collision 用の SceneGraph (tree)
21 SceneGraphPtr sg_exec_tree; 38 SceneGraphPtr sg_exec_tree;
22 39
46 /** 63 /**
47 * Functions 64 * Functions
48 */ 65 */
49 /* User API */ 66 /* User API */
50 void createFromXMLfile(TaskManager *manager, const char *); 67 void createFromXMLfile(TaskManager *manager, const char *);
68 //void createFromXMLmemory(TaskManager *manager, const char *xml);
69 //void createFromXMLmemory(TaskManager *manager, st_mmap_t mmap_t);
70 void createFromXMLmemory(TaskManager *manager, char *data, int len);
51 SceneGraphPtr createSceneGraph(int id); 71 SceneGraphPtr createSceneGraph(int id);
52 SceneGraphPtr createSceneGraph(); 72 SceneGraphPtr createSceneGraph();
73 SceneGraphPtr createSceneGraph(const char *name);
74 int getSgid(const char *name);
75
53 void setSceneData(SceneGraphPtr sg); 76 void setSceneData(SceneGraphPtr sg);
54 Pad *getController(); 77 Pad *getController();
55 SceneGraphIteratorPtr getIterator(); 78 SceneGraphIteratorPtr getIterator();
56 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); 79 SceneGraphIteratorPtr getIterator(SceneGraphPtr list);
57 CameraPtr getCamera(); 80 CameraPtr getCamera();
62 SceneGraphPtr getExecuteSceneGraph(); 85 SceneGraphPtr getExecuteSceneGraph();
63 SceneGraphPtr getDrawSceneGraph(); 86 SceneGraphPtr getDrawSceneGraph();
64 void updateControllerState(); 87 void updateControllerState();
65 88
66 void speExecute(int screen_w, int screen_h); 89 void speExecute(int screen_w, int screen_h);
90 void speExecute(int screen_w, int screen_h, Application *app);
67 91
68 /* System API */ 92 /* System API */
69 void registSceneGraph(SceneGraphPtr sg); 93 void registSceneGraph(SceneGraphPtr sg);
94 void registSceneGraphList(SceneGraphPtr sg);
95 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp);
70 void addNext(SceneGraphPtr sg); 96 void addNext(SceneGraphPtr sg);
71 void allRemove(SceneGraphPtr list); 97 void allRemove(SceneGraphPtr list);
72 }; 98 };
73 99
74 typedef SceneGraphRoot *SceneGraphRootPtr; 100 typedef SceneGraphRoot *SceneGraphRootPtr;
75 101
102
103 // 大域変数は無くすこと
104 extern SceneGraphRoot *sgroot;
105
76 #endif 106 #endif
77 107
78 // 大域変数は無くすこと
79 // move に Controller を渡せば必要ないはず...
80 extern SceneGraphRootPtr sgroot;
81
82 /* end */ 108 /* end */