3 #include "vg/vg_audio.h"
4 #include "vg/vg_imgui.h"
7 typedef struct ent_spawn ent_spawn
;
8 typedef struct ent_light ent_light
;
9 typedef struct ent_gate ent_gate
;
10 typedef struct ent_route_node ent_route_node
;
11 typedef struct ent_path_index ent_path_index
;
12 typedef struct ent_checkpoint ent_checkpoint
;
13 typedef struct ent_route ent_route
;
14 typedef struct ent_water ent_water
;
15 typedef struct ent_audio_clip ent_audio_clip
;
16 typedef struct volume_particles volume_particles
;
17 typedef struct volume_trigger volume_trigger
;
18 typedef struct ent_volume ent_volume
;
19 typedef struct ent_audio ent_audio
;
20 typedef struct ent_marker ent_marker
;
21 typedef struct ent_traffic ent_traffic
;
22 typedef struct ent_font ent_font
;
23 typedef struct ent_font_variant ent_font_variant
;
24 typedef struct ent_glyph ent_glyph
;
25 typedef struct ent_skateshop ent_skateshop
;
26 typedef struct ent_camera ent_camera
;
27 typedef struct ent_swspreview ent_swspreview
;
28 typedef struct ent_worldinfo ent_worldinfo
;
29 typedef struct ent_ccmd ent_ccmd
;
30 typedef struct ent_objective ent_objective
;
31 typedef struct ent_challenge ent_challenge
;
32 typedef struct ent_relay ent_relay
;
33 typedef struct ent_cubemap ent_cubemap
;
34 typedef struct ent_miniworld ent_miniworld
;
35 typedef struct ent_prop ent_prop
;
36 typedef struct ent_region ent_region
;
37 typedef struct ent_list ent_list
;
38 typedef struct ent_glider ent_glider
;
39 typedef struct ent_npc ent_npc
;
52 k_ent_font_variant
= 10,
56 k_ent_swspreview
= 14,
72 static inline u32
mdl_entity_id_type( u32 entity_id
)
74 return (entity_id
& 0x0fff0000) >> 16;
77 static inline u32
mdl_entity_id_id( u32 entity_id
)
79 return entity_id
& 0x0000ffff;
82 static inline u32
mdl_entity_id( u32 type
, u32 index
)
84 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
89 k_ent_function_trigger
,
90 k_ent_function_particle_spawn
,
91 k_ent_function_trigger_leave
95 mdl_transform transform
;
100 k_light_type_point
= 0,
101 k_light_type_spot
= 1
105 mdl_transform transform
;
120 k_gate_type_unlinked
= 0,
121 k_gate_type_teleport
= 1,
122 k_gate_type_nonlocal_unlinked
= 2,
123 k_gate_type_nonlocel
= 3
129 k_ent_gate_linked
= 0x1, /* this is a working portal */
130 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
131 NOTE: if set, it adds the flip flag. */
132 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
133 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
134 k_ent_gate_locked
= 0x10,/* has to be unlocked to be useful */
136 k_ent_gate_clean_pass
= 0x20,/* player didn't rewind while getting here */
150 m4x3f to_world
, transport
;
161 u16 routes
[4]; /* routes that pass through this gate */
165 u32 submesh_start
, submesh_count
;
168 struct ent_route_node
{
170 u8 ref_count
, ref_total
;
173 struct ent_path_index
{
177 struct ent_checkpoint
{
186 enum ent_route_flag
{
187 k_ent_route_flag_achieve_silver
= 0x1,
188 k_ent_route_flag_achieve_gold
= 0x2,
190 k_ent_route_flag_out_of_zone
= 0x10,
191 k_ent_region_flag_hasname
= 0x20
196 mdl_transform transform
;
197 u32 official_track_id
; /* TODO: remove this */
202 u16 checkpoints_start
,
208 u16 active_checkpoint
,
212 m4x3f board_transform
;
216 u32 id_camera
; /* v103+ */
218 /* v104+, but always accessible */
221 f32 ui_stopper
, ui_residual
;
223 ui_px ui_first_block_width
, ui_residual_block_w
;
227 mdl_transform transform
;
229 u32 reserved0
, reserved1
;
232 struct ent_audio_clip
{
241 struct volume_particles
{
245 struct volume_trigger
{
246 i32 event
, event_leave
;
249 enum ent_volume_flag
{
250 k_ent_volume_flag_particles
= 0x1,
251 k_ent_volume_flag_disabled
= 0x2
255 mdl_transform transform
;
256 m4x3f to_world
, to_local
;
261 volume_trigger trigger
;
262 volume_particles particles
;
267 mdl_transform transform
;
271 float volume
, crossfade
;
279 mdl_transform transform
;
284 k_skateshop_type_boardshop
= 0,
285 k_skateshop_type_charshop
= 1,
286 k_skateshop_type_worldshop
= 2,
287 k_skateshop_type_DELETED
= 3,
288 k_skateshop_type_server
= 4
291 struct ent_skateshop
{
292 mdl_transform transform
;
322 struct ent_swspreview
{
323 u32 id_camera
, id_display
, id_display1
;
327 mdl_transform transform
;
334 u32 index
; /* into the path */
338 mdl_transform transform
;
342 enum ent_menuitem_type
{
343 k_ent_menuitem_type_visual
= 0,
344 k_ent_menuitem_type_event_button
= 1,
345 k_ent_menuitem_type_page_button
= 2,
346 k_ent_menuitem_type_toggle
= 3,
347 k_ent_menuitem_type_slider
= 4,
348 k_ent_menuitem_type_page
= 5,
349 k_ent_menuitem_type_binding
= 6,
350 k_ent_menuitem_type_visual_nocol
= 7,
351 k_ent_menuitem_type_disabled
= 90
354 enum ent_menuitem_stack_behaviour
{
355 k_ent_menuitem_stack_append
= 0,
356 k_ent_menuitem_stack_replace
= 1
359 typedef struct ent_menuitem ent_menuitem
;
362 id_links
[4]; /* ent_menuitem */
363 f32 factive
, fvisible
;
365 mdl_transform transform
;
366 u32 submesh_start
, submesh_count
;
368 union{ u64 _u64
; /* force storage for 64bit pointers */
381 u32 id_min
, /* ent_marker */
383 id_handle
, /* ent_menuitem */
395 u32 id_check
, /* ent_menuitem */
397 v3f offset
; /* relative to parent */
403 id_entrypoint
, /* ent_menuitem */
404 id_viewpoint
; /* ent_camera */
416 struct ent_worldinfo
{
417 u32 pstr_name
, pstr_author
, pstr_desc
;
423 ent_marker
*ent_find_marker( mdl_context
*mdl
, mdl_array_ptr
*arr
,
426 enum channel_behaviour
{
427 k_channel_behaviour_unlimited
= 0,
428 k_channel_behaviour_discard_if_full
= 1,
429 k_channel_behaviour_crossfade_if_full
= 2
432 enum probability_curve
{
433 k_probability_curve_constant
= 0,
434 k_probability_curve_wildlife_day
= 1,
435 k_probability_curve_wildlife_night
= 2
447 struct ent_font_variant
{
462 enum ent_objective_filter
{
463 k_ent_objective_filter_none
= 0x00000000,
464 k_ent_objective_filter_trick_shuvit
= 0x00000001,
465 k_ent_objective_filter_trick_kickflip
= 0x00000002,
466 k_ent_objective_filter_trick_treflip
= 0x00000004,
467 k_ent_objective_filter_trick_any
=
468 k_ent_objective_filter_trick_shuvit
|
469 k_ent_objective_filter_trick_treflip
|
470 k_ent_objective_filter_trick_kickflip
,
471 k_ent_objective_filter_flip_back
= 0x00000008,
472 k_ent_objective_filter_flip_front
= 0x00000010,
473 k_ent_objective_filter_flip_any
=
474 k_ent_objective_filter_flip_back
|
475 k_ent_objective_filter_flip_front
,
476 k_ent_objective_filter_grind_truck_any
= 0x00000020,
477 k_ent_objective_filter_grind_board_any
= 0x00000040,
478 k_ent_objective_filter_grind_any
=
479 k_ent_objective_filter_grind_truck_any
|
480 k_ent_objective_filter_grind_board_any
,
481 k_ent_objective_filter_footplant
= 0x00000080,
482 k_ent_objective_filter_passthrough
= 0x00000100
485 enum ent_objective_flag
{
486 k_ent_objective_hidden
= 0x1,
487 k_ent_objective_passed
= 0x2
490 struct ent_objective
{
491 mdl_transform transform
;
502 enum ent_challenge_flag
{
503 k_ent_challenge_timelimit
= 0x1
506 struct ent_challenge
{
507 mdl_transform transform
;
521 i32 targets_events
[4];
526 u32 resolution
, live
, texture_id
,
527 framebuffer_id
, renderbuffer_id
, placeholder
[2];
530 typedef struct ent_call ent_call
;
537 struct ent_miniworld
{
538 mdl_transform transform
;
545 mdl_transform transform
;
546 u32 submesh_start
, submesh_count
, flags
, pstr_alias
;
550 mdl_transform transform
;
551 u32 submesh_start
, submesh_count
, pstr_title
, flags
, zone_volume
,
558 mdl_transform transform
;
565 mdl_transform transform
;
566 u32 id
, context
, camera
;
570 void entity_call( world_instance
*world
, ent_call
*call
);