Mercurial > hg > Game > Cerium
annotate Renderer/Engine/SceneGraphRoot.h @ 792:b480fc04206f draft
add light switch
author | yutaka@localhost.localdomain |
---|---|
date | Sun, 02 May 2010 04:17:34 +0900 |
parents | c0a8af52fa43 |
children | 66497087393d |
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 |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
17 class SceneGraphRoot; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
18 typedef void (*regist_func)(SceneGraphRoot *sgroot); |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
19 |
283 | 20 class SceneGraphRoot { |
21 public: | |
22 /* Constructor, Destructor */ | |
23 SceneGraphRoot(float w, float h); | |
558 | 24 ~SceneGraphRoot(); |
283 | 25 |
26 /* Variables */ | |
562 | 27 TaskManager *tmanager; |
28 | |
283 | 29 // xml から読み込んだ、オリジナルの SceneGraph |
575
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
30 // Static Singleton |
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
31 // SceneGraphPtr *sg_src; |
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
32 // int sg_src_length; |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
33 SceneGraphPtr list; |
283 | 34 |
35 // move, collision 用の SceneGraph (tree) | |
36 SceneGraphPtr sg_exec_tree; | |
37 | |
38 // 描画用の SceneGraph List (tree) | |
39 SceneGraphPtr sg_draw_tree; | |
40 | |
41 // sg_exec_tree に対応する list | |
42 SceneGraphPtr sg_available_list; | |
43 | |
44 // sg_draw_tree に対応する list | |
45 // draw_tree は描画後削除される | |
46 SceneGraphPtr sg_remove_list; | |
47 | |
48 SceneGraphArrayPtr sg_array1; | |
49 SceneGraphArrayPtr sg_array2; | |
50 SceneGraphArrayPtr sg_curArray; | |
51 | |
52 // コントローラーオブジェクト (Keyboard, Joystick, ..) | |
53 Pad *controller; | |
54 | |
55 // カメラオブジェクト | |
56 Camera *camera; | |
57 | |
597 | 58 // 光源のオブジェクト |
761 | 59 SceneGraphPtr light[4]; |
792 | 60 int light_switch[4]; |
61 int light_sysswitch; | |
677
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
653
diff
changeset
|
62 // 光源の疑似 xml file |
761 | 63 // 光源は4つで決め打ち。 |
64 // 4 * lightnum (4) = 16; | |
65 float light_vector[16]; | |
597 | 66 |
792 | 67 |
68 | |
283 | 69 // SceneGraphIterator |
70 SceneGraphIteratorPtr iterator; | |
71 | |
677
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
653
diff
changeset
|
72 // fd of Linda taple space |
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
653
diff
changeset
|
73 int tid; |
591 | 74 |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
75 // move task test flag |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
76 int move_finish_flag; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
77 |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
78 // 関数ポインタ |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
79 regist_func regist; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
80 // application で実行する task |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
81 HTaskPtr move_exec_task; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
82 |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
83 // とりあえず |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
84 int screen_w; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
85 int screen_h; |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
86 |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
87 |
283 | 88 /** |
89 * Functions | |
90 */ | |
91 /* User API */ | |
539 | 92 void createFromXMLfile(TaskManager *manager, const char *); |
580
ec9dd24c2dc8
add all object in file in dynamic_create
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
575
diff
changeset
|
93 void createFromXMLmemory(TaskManager *manager, SceneGraph * node, char *data, int len); |
283 | 94 SceneGraphPtr createSceneGraph(int id); |
558 | 95 SceneGraphPtr createSceneGraph(); |
562 | 96 SceneGraphPtr createSceneGraph(const char *name); |
97 int getSgid(const char *name); | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
98 void appTaskRegist(regist_func new_regist); |
562 | 99 |
283 | 100 void setSceneData(SceneGraphPtr sg); |
558 | 101 Pad *getController(); |
102 SceneGraphIteratorPtr getIterator(); | |
283 | 103 SceneGraphIteratorPtr getIterator(SceneGraphPtr list); |
558 | 104 CameraPtr getCamera(); |
761 | 105 SceneGraphPtr getLight(int id); |
677
24054155368c
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
653
diff
changeset
|
106 float* getLightVector(); |
792 | 107 int* getLightSwitch(); |
108 int getLightSysSwitch(); | |
283 | 109 |
110 /* Other System API */ | |
111 void allExecute(int screen_w, int screen_h); | |
758 | 112 void oneExecute(int screen_w, int screen_h); |
558 | 113 void checkRemove(); |
114 SceneGraphPtr getExecuteSceneGraph(); | |
115 SceneGraphPtr getDrawSceneGraph(); | |
116 void updateControllerState(); | |
759
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
117 void regist_execute(); |
45f7ab7101ea
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
758
diff
changeset
|
118 void move_finish(); |
283 | 119 |
539 | 120 void speExecute(int screen_w, int screen_h); |
562 | 121 void speExecute(int screen_w, int screen_h, Application *app); |
539 | 122 |
283 | 123 /* System API */ |
124 void registSceneGraph(SceneGraphPtr sg); | |
562 | 125 void registSceneGraphList(SceneGraphPtr sg); |
126 void addSceneGraphList(TaskManager *manager, SceneGraphPtr tmp); | |
283 | 127 void addNext(SceneGraphPtr sg); |
128 void allRemove(SceneGraphPtr list); | |
565 | 129 |
575
341f1f881a9b
Linda API worked. (slightly unreliable)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
565
diff
changeset
|
130 int getLast() ; |
565 | 131 |
283 | 132 }; |
133 | |
134 typedef SceneGraphRoot *SceneGraphRootPtr; | |
135 | |
136 | |
539 | 137 // 大域変数は無くすこと |
653
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
597
diff
changeset
|
138 //extern SceneGraphRoot *sgroot; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
597
diff
changeset
|
139 //extern SceneGraphRoot *sgroot_A; |
7a311860a76e
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
597
diff
changeset
|
140 //extern SceneGraphRoot *sgroot_B; |
562 | 141 |
142 #endif | |
558 | 143 |
144 /* end */ |