Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraphRoot.h @ 575:341f1f881a9b draft
Linda API worked. (slightly unreliable)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Oct 2009 15:53:24 +0900 |
parents | 5193d51294a2 |
children | ec9dd24c2dc8 |
rev | line source |
---|---|
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" | |
562 | 8 #include <sys/types.h> |
9 | |
10 typedef struct { | |
11 caddr_t file_mmap; | |
12 off_t size; | |
13 } st_mmap_t; | |
14 | |
15 class Application; | |
283 | 16 |
17 class SceneGraphRoot { | |
18 public: | |
19 /* Constructor, Destructor */ | |
20 SceneGraphRoot(float w, float h); | |
558 | 21 ~SceneGraphRoot(); |
283 | 22 |
23 /* Variables */ | |
562 | 24 TaskManager *tmanager; |
25 | |
283 | 26 // xml から読み込んだ、オリジナルの SceneGraph |
575
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
27 // Static Singleton |
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
28 // SceneGraphPtr *sg_src; |
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
29 // int sg_src_length; |
283 | 30 |
31 // move, collision 用の SceneGraph (tree) | |
32 SceneGraphPtr sg_exec_tree; | |
33 | |
34 // 描画用の SceneGraph List (tree) | |
35 SceneGraphPtr sg_draw_tree; | |
36 | |
37 // sg_exec_tree に対応する list | |
38 SceneGraphPtr sg_available_list; | |
39 | |
40 // sg_draw_tree に対応する list | |
41 // draw_tree は描画後削除される | |
42 SceneGraphPtr sg_remove_list; | |
43 | |
44 SceneGraphArrayPtr sg_array1; | |
45 SceneGraphArrayPtr sg_array2; | |
46 SceneGraphArrayPtr sg_curArray; | |
47 | |
48 // コントローラーオブジェクト (Keyboard, Joystick, ..) | |
49 Pad *controller; | |
50 | |
51 // カメラオブジェクト | |
52 Camera *camera; | |
53 | |
54 // SceneGraphIterator | |
55 SceneGraphIteratorPtr iterator; | |
56 | |
57 /** | |
58 * Functions | |
59 */ | |
60 /* User API */ | |
539 | 61 void createFromXMLfile(TaskManager *manager, const char *); |
562 | 62 //void createFromXMLmemory(TaskManager *manager, const char *xml); |
63 //void createFromXMLmemory(TaskManager *manager, st_mmap_t mmap_t); | |
64 void createFromXMLmemory(TaskManager *manager, char *data, int len); | |
283 | 65 SceneGraphPtr createSceneGraph(int id); |
558 | 66 SceneGraphPtr createSceneGraph(); |
562 | 67 SceneGraphPtr createSceneGraph(const char *name); |
68 int getSgid(const char *name); | |
69 | |
283 | 70 void setSceneData(SceneGraphPtr sg); |
558 | 71 Pad *getController(); |
72 SceneGraphIteratorPtr getIterator(); | |
283 | 73 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); |
558 | 74 CameraPtr getCamera(); |
283 | 75 |
76 /* Other System API */ | |
77 void allExecute(int screen_w, int screen_h); | |
558 | 78 void checkRemove(); |
79 SceneGraphPtr getExecuteSceneGraph(); | |
80 SceneGraphPtr getDrawSceneGraph(); | |
81 void updateControllerState(); | |
283 | 82 |
539 | 83 void speExecute(int screen_w, int screen_h); |
562 | 84 void speExecute(int screen_w, int screen_h, Application *app); |
539 | 85 |
283 | 86 /* System API */ |
87 void registSceneGraph(SceneGraphPtr sg); | |
562 | 88 void registSceneGraphList(SceneGraphPtr sg); |
89 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp); | |
283 | 90 void addNext(SceneGraphPtr sg); |
91 void allRemove(SceneGraphPtr list); | |
565 | 92 |
575
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
93 int getLast() ; |
565 | 94 |
283 | 95 }; |
96 | |
97 typedef SceneGraphRoot *SceneGraphRootPtr; | |
98 | |
99 | |
539 | 100 // 大域変数は無くすこと |
562 | 101 extern SceneGraphRoot *sgroot; |
102 | |
103 #endif | |
558 | 104 |
105 /* end */ |