source: GTP/trunk/App/Demos/Geom/Shark3D/clod_head_demo_win32/src/res/client/actor/io.s3d_actor @ 2236

Revision 2236, 8.3 KB checked in by gumbau, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 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.
17actor_ident "kit_base.capsule"
18actor_param
19{
20    active 1
21    // Scope name. Used in error messages.
22    scope "io"
23    // Name of the capsule actor within its own namespace.
24    // Actors within the capsule can access the capsule
25    // actor itself by this name.
26    local_name "capsule"
27    // Delegate commands from outside to the correct dispatcher.
28    deleg_target "dispatch_export"
29    // The capsule actor contains a group of actors:
30    child_ident "kit_base.group"
31    child_param
32    {
33        active 1
34        child_array
35        {
36            // Dispatcher for commands from outside the client capsule.
37            ident "kit_base.dispatch"
38            param
39            {
40                name "dispatch_export"
41                entry_array
42                {
43                    cmds "set_sndmgr_level"
44                        "set_state_world" "set_state_sky"
45                    targets "snd"
46                }
47                {
48                    // Assign a 3D state image.
49                    cmds "set_camera_transf"
50                    targets "extratransf"
51                    newcmd "set_transf"
52                }
53                {
54                    // Commands for gfx:
55                    cmds "set_gfxmgr_level"
56                        "set_state_world" "set_state_sky"
57                        "set_sim_world"
58                        "set_noise_world"
59                        "set_sensorstate_world"
60                        "set_cursor_x" "set_cursor_y"
61                        "move_cursor_x" "move_cursor_y"
62                        "toggle_showgfxbound"
63                        "toggle_showgfxmesh" "toggle_showgfxwire"
64                        "toggle_showgfxocclmesh" "toggle_showgfxocclwire"
65                        "toggle_showphysbound" "toggle_showphysgeo"
66                        "toggle_showphyscontact"
67                        "toggle_simple"
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" //"flush_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 "flush_output"
101                    targets "snd"
102                    newcmd "flush"
103                }*/
104                {
105                    // Update snd:
106                    cmds "suspend_output"
107                    targets "snd"
108                    newcmd "suspend"
109                }
110
111                // Update output full:
112                /*
113                {
114                    cmds "complete_output"
115                    targets "gfx"
116                    newcmd "complete"
117                }
118                {
119                    cmds "complete_output"
120                    targets "^^root"
121                    newcmd "ignore_frmtime"
122                }
123                */
124
125                // Update input:
126                {
127                    cmds "perform_input"
128                    targets "input"
129                    newcmd "update"
130                }
131            }
132        }
133        {
134            // Dispatcher for commands from outside the client capsule.
135            ident "kit_base.dispatch"
136            param
137            {
138                name "dispatch"
139                entry_array
140                {
141                    // Assign a 3D state image.
142                    cmds "set_camera_efftransf"
143                    targets "gfx" "snd"
144                }
145                {
146                    cmds "input_dev_found"
147                    targets "inputcfg"
148                    newcmd "configure_dev"
149                }
150                {
151                    cmds "input_dev_lost"
152                    targets
153                }
154            }
155        }
156        {
157            ident "kit_engbase.extratransf"
158            param
159            {
160                name "extratransf"
161                transf_target "dispatch"
162                transf_cmd "set_camera_efftransf"
163                extcfg_actor "^^cfg"
164                extcfg_entry_extratransf "client.extratransf"
165            }
166        }
167        {
168            // Create the context object.
169            // The context is the glue managing input and output.
170            // Other IO-actors like input or gfx refer this context actor:
171            ident "kit_io.ctx"
172            param
173            {
174                active 1
175                name "ctx"
176                src_actor "^^root"
177                src_cmd "get_ctx"
178                extcfg_actor "^^cfg"
179                extcfg_entry_param "context"
180                given_array
181                {
182                    item "^^env"
183                    given_ident "env"
184                }
185            }
186        }
187        {
188            // Include the graphics output definitions.
189            ident "kit_base.extern"
190            param
191            {
192                active 1
193                deleg_name "gfx"
194                res "client/actor/gfx.s3d_actor_run"
195                watch_target "^io_extern"
196                watch_cmd "load_current"
197            }
198        }
199        {
200            ident "kit_base.extern"
201            param
202            {
203                active 1
204                deleg_name "snd"
205                res "client/actor/snd.s3d_actor_run"
206                watch_target "^io_extern"
207                watch_cmd "load_current"
208            }
209        }
210        {
211            // Input actor.
212            ident "kit_io.input"
213            param
214            {
215                name "input"
216                ctx "ctx"
217                extcfg_actor "^^cfg"
218                extcfg_entry "input.mgr"
219                found_target "dispatch"
220                found_cmd "input_dev_found"
221                lost_target "dispatch"
222                lost_cmd "input_dev_lost"
223                char_target "^dispatch_input"
224                char_cmd "handle_char"
225                given_array
226                {
227                    item "^^env"
228                    given_ident "env"
229                }
230                {
231                    item "ctx"
232                    given_ident "ctx"
233                }
234            }
235        }
236        {
237            // Simple default input configuration.
238            // This actor sends input configuration commands
239            // to the input actor.
240            ident "kit_io.inputcfg"
241            param
242            {
243                name "inputcfg"
244                input "input"               // The input actor to cfgurate.
245                target "^dispatch_input"    // Target of input commands.
246                extcfg_actor "^^cfg"
247                extcfg_entry_mapping "input.mapping"
248            }
249        }
250        {
251            ident "kit_base.paramstr"
252            param
253            {
254                name "toggle_catch_mouse"
255                target "input"
256                cmd "userfunc_all"
257                param "toggle_catch_mouse"
258            }
259        }
260    }
261}
Note: See TracBrowser for help on using the repository browser.