6 typedef struct ent_spawn ent_spawn
;
7 typedef struct ent_light ent_light
;
8 typedef struct ent_gate ent_gate
;
9 typedef struct ent_route_node ent_route_node
;
10 typedef struct ent_path_index ent_path_index
;
11 typedef struct ent_checkpoint ent_checkpoint
;
12 typedef struct ent_route ent_route
;
13 typedef struct ent_water ent_water
;
14 typedef struct ent_audio_clip ent_audio_clip
;
15 typedef struct volume_particles volume_particles
;
16 typedef struct volume_trigger volume_trigger
;
17 typedef struct ent_volume ent_volume
;
18 typedef struct ent_audio ent_audio
;
19 typedef struct ent_marker ent_marker
;
20 typedef struct ent_traffic ent_traffic
;
21 typedef struct ent_font ent_font
;
22 typedef struct ent_font_variant ent_font_variant
;
23 typedef struct ent_glyph ent_glyph
;
24 typedef struct ent_skateshop ent_skateshop
;
25 typedef struct ent_camera ent_camera
;
26 typedef struct ent_swspreview ent_swspreview
;
27 typedef struct ent_worldinfo ent_worldinfo
;
28 typedef struct ent_ccmd ent_ccmd
;
29 typedef struct ent_objective ent_objective
;
30 typedef struct ent_challenge ent_challenge
;
31 typedef struct ent_relay ent_relay
;
32 typedef struct ent_cubemap ent_cubemap
;
45 k_ent_font_variant
= 10,
49 k_ent_swspreview
= 14,
59 static u32
mdl_entity_id_type( u32 entity_id
){
60 return (entity_id
& 0xffff0000) >> 16;
63 static u32
mdl_entity_id_id( u32 entity_id
){
64 return entity_id
& 0x0000ffff;
67 static u32
mdl_entity_id( u32 type
, u32 index
){
68 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
72 k_ent_function_trigger
,
73 k_ent_function_particle_spawn
77 mdl_transform transform
;
82 k_light_type_point
= 0,
87 mdl_transform transform
;
102 k_gate_type_unlinked
= 0,
103 k_gate_type_teleport
= 1,
104 k_gate_type_nonlocal_unlinked
= 2,
105 k_gate_type_nonlocel
= 3
111 k_ent_gate_linked
= 0x1, /* this is a working portal */
112 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
113 NOTE: if set, it adds the flip flag. */
114 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
115 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
116 k_ent_gate_locked
= 0x10,/* has to be unlocked to be useful */
130 m4x3f to_world
, transport
;
141 u16 routes
[4]; /* routes that pass through this gate */
145 u32 submesh_start
, submesh_count
;
148 struct ent_route_node
{
150 u8 ref_count
, ref_total
;
153 struct ent_path_index
{
157 struct ent_checkpoint
{
165 mdl_transform transform
;
166 u32 official_track_id
;
171 u16 checkpoints_start
,
177 u16 active_checkpoint
,
181 m4x3f board_transform
;
185 u32 id_camera
; /* v103+ */
189 mdl_transform transform
;
191 u32 reserved0
, reserved1
;
194 struct ent_audio_clip
{
203 struct volume_particles
{
207 struct volume_trigger
{
211 enum ent_volume_flag
{
212 k_ent_volume_flag_particles
= 0x1,
213 k_ent_volume_flag_disabled
= 0x2
217 mdl_transform transform
;
218 m4x3f to_world
, to_local
;
223 volume_trigger trigger
;
224 volume_particles particles
;
229 mdl_transform transform
;
233 float volume
, crossfade
;
241 mdl_transform transform
;
246 k_skateshop_type_boardshop
,
247 k_skateshop_type_charshop
,
248 k_skateshop_type_worldshop
,
251 struct ent_skateshop
{
252 mdl_transform transform
;
277 struct ent_swspreview
{
278 u32 id_camera
, id_display
, id_display1
;
282 mdl_transform transform
;
289 u32 index
; /* into the path */
293 mdl_transform transform
;
297 enum ent_menuitem_type
{
298 k_ent_menuitem_type_visual
= 0,
299 k_ent_menuitem_type_event_button
= 1,
300 k_ent_menuitem_type_page_button
= 2,
301 k_ent_menuitem_type_toggle
= 3,
302 k_ent_menuitem_type_slider
= 4,
303 k_ent_menuitem_type_page
= 5,
304 k_ent_menuitem_type_binding
= 6,
305 k_ent_menuitem_type_visual_nocol
= 7,
306 k_ent_menuitem_type_disabled
= 90
309 enum ent_menuitem_stack_behaviour
{
310 k_ent_menuitem_stack_append
= 0,
311 k_ent_menuitem_stack_replace
= 1
314 typedef struct ent_menuitem ent_menuitem
;
317 id_links
[4]; /* ent_menuitem */
318 f32 factive
, fvisible
;
320 mdl_transform transform
;
321 u32 submesh_start
, submesh_count
;
323 union{ u64 _u64
; /* force storage for 64bit pointers */
336 u32 id_min
, /* ent_marker */
338 id_handle
, /* ent_menuitem */
350 u32 id_check
, /* ent_menuitem */
352 v3f offset
; /* relative to parent */
358 id_entrypoint
, /* ent_menuitem */
359 id_viewpoint
; /* ent_camera */
371 struct ent_worldinfo
{
372 u32 pstr_name
, pstr_author
, pstr_desc
;
376 static ent_marker
*ent_find_marker( mdl_context
*mdl
,
377 mdl_array_ptr
*arr
, const char *alias
)
379 for( u32 i
=0; i
<mdl_arrcount(arr
); i
++ ){
380 ent_marker
*marker
= mdl_arritm( arr
, i
);
382 if( !strcmp( mdl_pstr( mdl
, marker
->pstr_alias
), alias
) ){
390 enum channel_behaviour
{
391 k_channel_behaviour_unlimited
= 0,
392 k_channel_behaviour_discard_if_full
= 1,
393 k_channel_behaviour_crossfade_if_full
= 2
396 enum probability_curve
{
397 k_probability_curve_constant
= 0,
398 k_probability_curve_wildlife_day
= 1,
399 k_probability_curve_wildlife_night
= 2
411 struct ent_font_variant
{
426 enum ent_objective_filter
{
427 k_ent_objective_filter_none
= 0x00000000,
428 k_ent_objective_filter_trick_shuvit
= 0x00000001,
429 k_ent_objective_filter_trick_kickflip
= 0x00000002,
430 k_ent_objective_filter_trick_treflip
= 0x00000004,
431 k_ent_objective_filter_trick_any
=
432 k_ent_objective_filter_trick_shuvit
|
433 k_ent_objective_filter_trick_treflip
|
434 k_ent_objective_filter_trick_kickflip
,
435 k_ent_objective_filter_flip_back
= 0x00000008,
436 k_ent_objective_filter_flip_front
= 0x00000010,
437 k_ent_objective_filter_flip_any
=
438 k_ent_objective_filter_flip_back
|
439 k_ent_objective_filter_flip_front
,
440 k_ent_objective_filter_grind_truck_any
= 0x00000020,
441 k_ent_objective_filter_grind_board_any
= 0x00000040,
442 k_ent_objective_filter_grind_any
=
443 k_ent_objective_filter_grind_truck_any
|
444 k_ent_objective_filter_grind_board_any
,
445 k_ent_objective_filter_footplant
= 0x00000080,
446 k_ent_objective_filter_passthrough
= 0x00000100
449 enum ent_objective_flag
{
450 k_ent_objective_hidden
= 0x1,
451 k_ent_objective_passed
= 0x2
454 struct ent_objective
{
455 mdl_transform transform
;
466 enum ent_challenge_flag
{
467 k_ent_challenge_timelimit
= 0x1
470 struct ent_challenge
{
471 mdl_transform transform
;
489 u32 resolution
, live
, texture_id
,
490 framebuffer_id
, renderbuffer_id
, placeholder
[2];
493 typedef struct ent_call ent_call
;
500 static void entity_call( world_instance
*world
, ent_call
*call
);
502 #endif /* ENTITY_H */