Mercurial > hg > Game > Cerium
annotate 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 |
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 "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; | |
283 | 20 |
21 class SceneGraphRoot { | |
22 public: | |
23 /* Constructor, Destructor */ | |
24 SceneGraphRoot(float w, float h); | |
558 | 25 ~SceneGraphRoot(); |
283 | 26 |
27 /* Variables */ | |
562 | 28 TaskManager *tmanager; |
29 | |
30 // sgid と name を持った SgStruct のリスト | |
31 SceneGraphList *sglist; | |
32 | |
283 | 33 // xml から読み込んだ、オリジナルの SceneGraph |
562 | 34 SceneGraphPtr *sg_src; |
541
1a31b8820a4d
Cerium Rendering Library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
539
diff
changeset
|
35 int sg_src_length; |
283 | 36 |
37 // move, collision 用の SceneGraph (tree) | |
38 SceneGraphPtr sg_exec_tree; | |
39 | |
40 // 描画用の SceneGraph List (tree) | |
41 SceneGraphPtr sg_draw_tree; | |
42 | |
43 // sg_exec_tree に対応する list | |
44 SceneGraphPtr sg_available_list; | |
45 | |
46 // sg_draw_tree に対応する list | |
47 // draw_tree は描画後削除される | |
48 SceneGraphPtr sg_remove_list; | |
49 | |
50 SceneGraphArrayPtr sg_array1; | |
51 SceneGraphArrayPtr sg_array2; | |
52 SceneGraphArrayPtr sg_curArray; | |
53 | |
54 // コントローラーオブジェクト (Keyboard, Joystick, ..) | |
55 Pad *controller; | |
56 | |
57 // カメラオブジェクト | |
58 Camera *camera; | |
59 | |
60 // SceneGraphIterator | |
61 SceneGraphIteratorPtr iterator; | |
62 | |
63 /** | |
64 * Functions | |
65 */ | |
66 /* User API */ | |
539 | 67 void createFromXMLfile(TaskManager *manager, const char *); |
562 | 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); | |
283 | 71 SceneGraphPtr createSceneGraph(int id); |
558 | 72 SceneGraphPtr createSceneGraph(); |
562 | 73 SceneGraphPtr createSceneGraph(const char *name); |
74 int getSgid(const char *name); | |
75 | |
283 | 76 void setSceneData(SceneGraphPtr sg); |
558 | 77 Pad *getController(); |
78 SceneGraphIteratorPtr getIterator(); | |
283 | 79 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); |
558 | 80 CameraPtr getCamera(); |
283 | 81 |
82 /* Other System API */ | |
83 void allExecute(int screen_w, int screen_h); | |
558 | 84 void checkRemove(); |
85 SceneGraphPtr getExecuteSceneGraph(); | |
86 SceneGraphPtr getDrawSceneGraph(); | |
87 void updateControllerState(); | |
283 | 88 |
539 | 89 void speExecute(int screen_w, int screen_h); |
562 | 90 void speExecute(int screen_w, int screen_h, Application *app); |
539 | 91 |
283 | 92 /* System API */ |
93 void registSceneGraph(SceneGraphPtr sg); | |
562 | 94 void registSceneGraphList(SceneGraphPtr sg); |
95 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp); | |
283 | 96 void addNext(SceneGraphPtr sg); |
97 void allRemove(SceneGraphPtr list); | |
98 }; | |
99 | |
100 typedef SceneGraphRoot *SceneGraphRootPtr; | |
101 | |
102 | |
539 | 103 // 大域変数は無くすこと |
562 | 104 extern SceneGraphRoot *sgroot; |
105 | |
106 #endif | |
558 | 107 |
108 /* end */ |