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
;
33 typedef struct ent_miniworld ent_miniworld
;
34 typedef struct ent_prop ent_prop
;
35 typedef struct ent_region ent_region
;
48 k_ent_font_variant
= 10,
52 k_ent_swspreview
= 14,
66 static u32
mdl_entity_id_type( u32 entity_id
){
67 return (entity_id
& 0x0fff0000) >> 16;
70 static u32
mdl_entity_id_id( u32 entity_id
){
71 return entity_id
& 0x0000ffff;
74 static u32
mdl_entity_id( u32 type
, u32 index
){
75 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
79 k_ent_function_trigger
,
80 k_ent_function_particle_spawn
,
81 k_ent_function_trigger_leave
85 mdl_transform transform
;
90 k_light_type_point
= 0,
95 mdl_transform transform
;
110 k_gate_type_unlinked
= 0,
111 k_gate_type_teleport
= 1,
112 k_gate_type_nonlocal_unlinked
= 2,
113 k_gate_type_nonlocel
= 3
119 k_ent_gate_linked
= 0x1, /* this is a working portal */
120 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
121 NOTE: if set, it adds the flip flag. */
122 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
123 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
124 k_ent_gate_locked
= 0x10,/* has to be unlocked to be useful */
126 k_ent_gate_clean_pass
= 0x20,/* player didn't rewind while getting here */
140 m4x3f to_world
, transport
;
151 u16 routes
[4]; /* routes that pass through this gate */
155 u32 submesh_start
, submesh_count
;
158 struct ent_route_node
{
160 u8 ref_count
, ref_total
;
163 struct ent_path_index
{
167 struct ent_checkpoint
{
176 enum ent_route_flag
{
177 k_ent_route_flag_achieve_silver
= 0x1,
178 k_ent_route_flag_achieve_gold
= 0x2,
180 k_ent_route_flag_out_of_zone
= 0x10
185 mdl_transform transform
;
186 u32 official_track_id
; /* TODO: remove this */
191 u16 checkpoints_start
,
197 u16 active_checkpoint
,
201 m4x3f board_transform
;
205 u32 id_camera
; /* v103+ */
207 /* v104+, but always accessible */
210 f32 ui_stopper
, ui_residual
;
212 ui_px ui_first_block_width
, ui_residual_block_w
;
216 mdl_transform transform
;
218 u32 reserved0
, reserved1
;
221 struct ent_audio_clip
{
230 struct volume_particles
{
234 struct volume_trigger
{
235 u32 event
, event_leave
;
238 enum ent_volume_flag
{
239 k_ent_volume_flag_particles
= 0x1,
240 k_ent_volume_flag_disabled
= 0x2
244 mdl_transform transform
;
245 m4x3f to_world
, to_local
;
250 volume_trigger trigger
;
251 volume_particles particles
;
256 mdl_transform transform
;
260 float volume
, crossfade
;
268 mdl_transform transform
;
273 k_skateshop_type_boardshop
= 0,
274 k_skateshop_type_charshop
= 1,
275 k_skateshop_type_worldshop
= 2,
276 k_skateshop_type_DELETED
= 3,
277 k_skateshop_type_server
= 4
280 struct ent_skateshop
{
281 mdl_transform transform
;
311 struct ent_swspreview
{
312 u32 id_camera
, id_display
, id_display1
;
316 mdl_transform transform
;
323 u32 index
; /* into the path */
327 mdl_transform transform
;
331 enum ent_menuitem_type
{
332 k_ent_menuitem_type_visual
= 0,
333 k_ent_menuitem_type_event_button
= 1,
334 k_ent_menuitem_type_page_button
= 2,
335 k_ent_menuitem_type_toggle
= 3,
336 k_ent_menuitem_type_slider
= 4,
337 k_ent_menuitem_type_page
= 5,
338 k_ent_menuitem_type_binding
= 6,
339 k_ent_menuitem_type_visual_nocol
= 7,
340 k_ent_menuitem_type_disabled
= 90
343 enum ent_menuitem_stack_behaviour
{
344 k_ent_menuitem_stack_append
= 0,
345 k_ent_menuitem_stack_replace
= 1
348 typedef struct ent_menuitem ent_menuitem
;
351 id_links
[4]; /* ent_menuitem */
352 f32 factive
, fvisible
;
354 mdl_transform transform
;
355 u32 submesh_start
, submesh_count
;
357 union{ u64 _u64
; /* force storage for 64bit pointers */
370 u32 id_min
, /* ent_marker */
372 id_handle
, /* ent_menuitem */
384 u32 id_check
, /* ent_menuitem */
386 v3f offset
; /* relative to parent */
392 id_entrypoint
, /* ent_menuitem */
393 id_viewpoint
; /* ent_camera */
405 struct ent_worldinfo
{
406 u32 pstr_name
, pstr_author
, pstr_desc
;
411 static ent_marker
*ent_find_marker( mdl_context
*mdl
,
412 mdl_array_ptr
*arr
, const char *alias
)
414 for( u32 i
=0; i
<mdl_arrcount(arr
); i
++ ){
415 ent_marker
*marker
= mdl_arritm( arr
, i
);
417 if( !strcmp( mdl_pstr( mdl
, marker
->pstr_alias
), alias
) ){
425 enum channel_behaviour
{
426 k_channel_behaviour_unlimited
= 0,
427 k_channel_behaviour_discard_if_full
= 1,
428 k_channel_behaviour_crossfade_if_full
= 2
431 enum probability_curve
{
432 k_probability_curve_constant
= 0,
433 k_probability_curve_wildlife_day
= 1,
434 k_probability_curve_wildlife_night
= 2
446 struct ent_font_variant
{
461 enum ent_objective_filter
{
462 k_ent_objective_filter_none
= 0x00000000,
463 k_ent_objective_filter_trick_shuvit
= 0x00000001,
464 k_ent_objective_filter_trick_kickflip
= 0x00000002,
465 k_ent_objective_filter_trick_treflip
= 0x00000004,
466 k_ent_objective_filter_trick_any
=
467 k_ent_objective_filter_trick_shuvit
|
468 k_ent_objective_filter_trick_treflip
|
469 k_ent_objective_filter_trick_kickflip
,
470 k_ent_objective_filter_flip_back
= 0x00000008,
471 k_ent_objective_filter_flip_front
= 0x00000010,
472 k_ent_objective_filter_flip_any
=
473 k_ent_objective_filter_flip_back
|
474 k_ent_objective_filter_flip_front
,
475 k_ent_objective_filter_grind_truck_any
= 0x00000020,
476 k_ent_objective_filter_grind_board_any
= 0x00000040,
477 k_ent_objective_filter_grind_any
=
478 k_ent_objective_filter_grind_truck_any
|
479 k_ent_objective_filter_grind_board_any
,
480 k_ent_objective_filter_footplant
= 0x00000080,
481 k_ent_objective_filter_passthrough
= 0x00000100
484 enum ent_objective_flag
{
485 k_ent_objective_hidden
= 0x1,
486 k_ent_objective_passed
= 0x2
489 struct ent_objective
{
490 mdl_transform transform
;
501 enum ent_challenge_flag
{
502 k_ent_challenge_timelimit
= 0x1
505 struct ent_challenge
{
506 mdl_transform transform
;
520 u32 targets_events
[4];
525 u32 resolution
, live
, texture_id
,
526 framebuffer_id
, renderbuffer_id
, placeholder
[2];
529 typedef struct ent_call ent_call
;
535 struct ent_miniworld
{
536 mdl_transform transform
;
543 mdl_transform transform
;
544 u32 submesh_start
, submesh_count
, flags
;
548 mdl_transform transform
;
549 u32 submesh_start
, submesh_count
, pstr_title
, flags
, zone_volume
;
553 static void entity_call( world_instance
*world
, ent_call
*call
);
555 #endif /* ENTITY_H */