1 | ///////////////////////////////////////////////////////////////////////////////
|
---|
2 | //
|
---|
3 | // ## ######
|
---|
4 | // ###### ###
|
---|
5 | // ## ############### Shark 3D Engine (www.shark3d.com)
|
---|
6 | // ########## # # #
|
---|
7 | // ######## Copyright (c) 1996-2007 Spinor GmbH.
|
---|
8 | // ######### # # # All rights reserved.
|
---|
9 | // ## ##########
|
---|
10 | // ##
|
---|
11 | //
|
---|
12 | ///////////////////////////////////////////////////////////////////////////////
|
---|
13 |
|
---|
14 | // Definition of the input and output.
|
---|
15 |
|
---|
16 | // The client root actor is a capsule, defining an own local namespace.
|
---|
17 | actor_ident "kit_base.capsule"
|
---|
18 | actor_param
|
---|
19 | {
|
---|
20 | // Delegate the action calls to all children:
|
---|
21 | active 1
|
---|
22 | // Scope name. Used in error messages.
|
---|
23 | scope "io"
|
---|
24 | // Name of the capsule actor within its own namespace.
|
---|
25 | // Actors within the capsule can access the capsule
|
---|
26 | // actor itself by this name.
|
---|
27 | local_name "capsule"
|
---|
28 | // Delegate commands from outside to the correct dispatcher.
|
---|
29 | deleg_target "dispatch_export"
|
---|
30 | // The capsule actor contains a group of actors:
|
---|
31 | child_ident "kit_base.group"
|
---|
32 | child_param
|
---|
33 | {
|
---|
34 | // Delegate action calls to the children.
|
---|
35 | active 1
|
---|
36 | child_array
|
---|
37 | {
|
---|
38 | // Dispatcher for commands from outside the client capsule.
|
---|
39 | ident "kit_base.dispatch"
|
---|
40 | param
|
---|
41 | {
|
---|
42 | name "dispatch_export"
|
---|
43 | entry_array
|
---|
44 | {
|
---|
45 | cmds "set_sndmgr_level"
|
---|
46 | "set_state_world" "set_state_sky"
|
---|
47 | targets "snd"
|
---|
48 | }
|
---|
49 | {
|
---|
50 | // Assign a 3D state image.
|
---|
51 | cmds "set_camera_transf"
|
---|
52 | targets "extratransf"
|
---|
53 | newcmd "set_transf"
|
---|
54 | }
|
---|
55 | {
|
---|
56 | // Commands for gfx:
|
---|
57 | cmds "set_gfxmgr_level"
|
---|
58 | "set_state_world" "set_state_sky"
|
---|
59 | "set_sim_world"
|
---|
60 | "set_noise_world"
|
---|
61 | "set_sensorstate_world"
|
---|
62 | "set_cursor_x" "set_cursor_y"
|
---|
63 | "move_cursor_x" "move_cursor_y"
|
---|
64 | "toggle_showgfxbound"
|
---|
65 | "toggle_showgfxmesh" "toggle_showgfxwire"
|
---|
66 | "toggle_showgfxocclmesh" "toggle_showgfxocclwire"
|
---|
67 | "toggle_showphysbound" "toggle_showphysgeo"
|
---|
68 | "toggle_showphyscontact"
|
---|
69 | "toggle_shownoise"
|
---|
70 | "toggle_showsensorgeo"
|
---|
71 | "toggle_showsensorbound"
|
---|
72 | "store_screenshot"
|
---|
73 | "reset_msg"
|
---|
74 | "toggle_frmtime" "toggle_stat" "reset_stat"
|
---|
75 | "toggle_fullscreen"
|
---|
76 | "set_playerbody"
|
---|
77 | targets "gfx"
|
---|
78 | }
|
---|
79 | {
|
---|
80 | cmds "toggle_catch_mouse"
|
---|
81 | targets "toggle_catch_mouse"
|
---|
82 | newcmd "perform"
|
---|
83 | }
|
---|
84 |
|
---|
85 | // Update output:
|
---|
86 | {
|
---|
87 | // Render the gfxports:
|
---|
88 | cmds "perform_output"
|
---|
89 | targets "gfx"
|
---|
90 | newcmd "paint"
|
---|
91 | }
|
---|
92 | {
|
---|
93 | // Update snd:
|
---|
94 | cmds "perform_output"
|
---|
95 | targets "snd"
|
---|
96 | newcmd "update"
|
---|
97 | }
|
---|
98 | {
|
---|
99 | // Update snd:
|
---|
100 | cmds "suspend_output"
|
---|
101 | targets "snd"
|
---|
102 | newcmd "suspend"
|
---|
103 | }
|
---|
104 |
|
---|
105 | // Update input:
|
---|
106 | {
|
---|
107 | cmds "perform_input"
|
---|
108 | targets "input"
|
---|
109 | newcmd "update"
|
---|
110 | }
|
---|
111 | }
|
---|
112 | }
|
---|
113 | {
|
---|
114 | // Dispatcher for commands from outside the client capsule.
|
---|
115 | ident "kit_base.dispatch"
|
---|
116 | param
|
---|
117 | {
|
---|
118 | name "dispatch"
|
---|
119 | entry_array
|
---|
120 | {
|
---|
121 | // Assign a 3D state image.
|
---|
122 | cmds "set_camera_efftransf"
|
---|
123 | targets "gfx" "snd"
|
---|
124 | }
|
---|
125 | {
|
---|
126 | cmds "input_dev_found"
|
---|
127 | targets "inputcfg"
|
---|
128 | newcmd "configure_dev"
|
---|
129 | }
|
---|
130 | {
|
---|
131 | cmds "input_dev_lost"
|
---|
132 | targets
|
---|
133 | }
|
---|
134 | }
|
---|
135 | }
|
---|
136 | {
|
---|
137 | ident "kit_engbase.extratransf"
|
---|
138 | param
|
---|
139 | {
|
---|
140 | name "extratransf"
|
---|
141 | transf_target "dispatch"
|
---|
142 | transf_cmd "set_camera_efftransf"
|
---|
143 | extcfg_actor "^^cfg"
|
---|
144 | extcfg_entry_extratransf "client.extratransf"
|
---|
145 | }
|
---|
146 | }
|
---|
147 | {
|
---|
148 | // Create the context object.
|
---|
149 | // The context is the glue managing input and output.
|
---|
150 | // Other IO-actors like input or gfx refer this context actor:
|
---|
151 | ident "kit_io.ctx"
|
---|
152 | param
|
---|
153 | {
|
---|
154 | name "ctx"
|
---|
155 | active 1
|
---|
156 | src_actor "^^root"
|
---|
157 | src_cmd "get_ctx"
|
---|
158 | extcfg_actor "^^cfg"
|
---|
159 | extcfg_entry_param "context"
|
---|
160 | given_array
|
---|
161 | {
|
---|
162 | item "^^env"
|
---|
163 | given_ident "env"
|
---|
164 | }
|
---|
165 | }
|
---|
166 | }
|
---|
167 | {
|
---|
168 | // Include the graphics output definitions.
|
---|
169 | ident "kit_base.extern"
|
---|
170 | param
|
---|
171 | {
|
---|
172 | // Delegate action calls to the child:
|
---|
173 | deleg_name "gfx"
|
---|
174 | res "client/actor/gfx.s3d_actor_run"
|
---|
175 | watch_target "^io_extern"
|
---|
176 | watch_cmd "load_current"
|
---|
177 | active 1
|
---|
178 | }
|
---|
179 | }
|
---|
180 | {
|
---|
181 | ident "kit_base.extern"
|
---|
182 | param
|
---|
183 | {
|
---|
184 | // Delegate action calls to the child:
|
---|
185 | deleg_name "snd"
|
---|
186 | res "client/actor/snd.s3d_actor_run"
|
---|
187 | watch_target "^io_extern"
|
---|
188 | watch_cmd "load_current"
|
---|
189 | active 1
|
---|
190 | }
|
---|
191 | }
|
---|
192 | {
|
---|
193 | // Input actor.
|
---|
194 | ident "kit_io.input"
|
---|
195 | param
|
---|
196 | {
|
---|
197 | name "input"
|
---|
198 | ctx "ctx"
|
---|
199 | extcfg_actor "^^cfg"
|
---|
200 | extcfg_entry "input.mgr"
|
---|
201 | found_target "dispatch"
|
---|
202 | found_cmd "input_dev_found"
|
---|
203 | lost_target "dispatch"
|
---|
204 | lost_cmd "input_dev_lost"
|
---|
205 | char_target "^dispatch_input"
|
---|
206 | char_cmd "handle_char"
|
---|
207 | given_array
|
---|
208 | {
|
---|
209 | item "^^env"
|
---|
210 | given_ident "env"
|
---|
211 | }
|
---|
212 | {
|
---|
213 | item "ctx"
|
---|
214 | given_ident "ctx"
|
---|
215 | }
|
---|
216 | }
|
---|
217 | }
|
---|
218 | {
|
---|
219 | // Simple default input configuration.
|
---|
220 | // This actor sends input configuration commands
|
---|
221 | // to the input actor.
|
---|
222 | ident "kit_io.inputcfg"
|
---|
223 | param
|
---|
224 | {
|
---|
225 | name "inputcfg"
|
---|
226 | input "input" // The input actor to cfgurate.
|
---|
227 | target "^dispatch_input" // Target of input commands.
|
---|
228 | extcfg_actor "^^cfg"
|
---|
229 | extcfg_entry_mapping "input.mapping"
|
---|
230 | }
|
---|
231 | }
|
---|
232 | {
|
---|
233 | ident "kit_base.paramstr"
|
---|
234 | param
|
---|
235 | {
|
---|
236 | name "toggle_catch_mouse"
|
---|
237 | target "input"
|
---|
238 | cmd "userfunc_all"
|
---|
239 | param "toggle_catch_mouse"
|
---|
240 | }
|
---|
241 | }
|
---|
242 | }
|
---|
243 | }
|
---|