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
;
41 typedef struct ent_call ent_call
;
48 typedef enum entity_call_result entity_call_result
;
49 enum entity_call_result
51 k_entity_call_result_OK
,
52 k_entity_call_result_unhandled
,
53 k_entity_call_result_invalid
56 typedef enum entity_call_result
57 (*fn_entity_call_handler
)( world_instance
*, ent_call
*);
71 k_ent_font_variant
= 10,
75 k_ent_swspreview
= 14,
91 static inline u32
mdl_entity_id_type( u32 entity_id
)
93 return (entity_id
& 0x0fff0000) >> 16;
96 static inline u32
mdl_entity_id_id( u32 entity_id
)
98 return entity_id
& 0x0000ffff;
101 static inline u32
mdl_entity_id( u32 type
, u32 index
)
103 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
108 k_ent_function_trigger
,
109 k_ent_function_particle_spawn
,
110 k_ent_function_trigger_leave
114 mdl_transform transform
;
119 k_light_type_point
= 0,
120 k_light_type_spot
= 1
124 mdl_transform transform
;
139 k_gate_type_unlinked
= 0,
140 k_gate_type_teleport
= 1,
141 k_gate_type_nonlocal_unlinked
= 2,
142 k_gate_type_nonlocel
= 3
148 k_ent_gate_linked
= 0x1, /* this is a working portal */
149 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
150 NOTE: if set, it adds the flip flag. */
151 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
152 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
153 k_ent_gate_locked
= 0x10,/* has to be unlocked to be useful */
155 k_ent_gate_clean_pass
= 0x20,/* player didn't rewind while getting here */
169 m4x3f to_world
, transport
;
180 u16 routes
[4]; /* routes that pass through this gate */
184 u32 submesh_start
, submesh_count
;
187 struct ent_route_node
{
189 u8 ref_count
, ref_total
;
192 struct ent_path_index
{
196 struct ent_checkpoint
{
205 enum ent_route_flag
{
206 k_ent_route_flag_achieve_silver
= 0x1,
207 k_ent_route_flag_achieve_gold
= 0x2,
209 k_ent_route_flag_out_of_zone
= 0x10,
210 k_ent_region_flag_hasname
= 0x20
215 mdl_transform transform
;
216 u32 official_track_id
; /* TODO: remove this */
221 u16 checkpoints_start
,
227 u16 active_checkpoint
,
231 m4x3f board_transform
;
235 u32 id_camera
; /* v103+ */
237 /* v104+, but always accessible */
240 f32 ui_stopper
, ui_residual
;
242 ui_px ui_first_block_width
, ui_residual_block_w
;
246 mdl_transform transform
;
248 u32 reserved0
, reserved1
;
251 struct ent_audio_clip
{
260 struct volume_particles
{
264 struct volume_trigger
{
265 i32 event
, event_leave
;
268 enum ent_volume_flag
{
269 k_ent_volume_flag_particles
= 0x1,
270 k_ent_volume_flag_disabled
= 0x2
274 mdl_transform transform
;
275 m4x3f to_world
, to_local
;
280 volume_trigger trigger
;
281 volume_particles particles
;
286 mdl_transform transform
;
290 float volume
, crossfade
;
298 mdl_transform transform
;
303 k_skateshop_type_boardshop
= 0,
304 k_skateshop_type_charshop
= 1,
305 k_skateshop_type_worldshop
= 2,
306 k_skateshop_type_DELETED
= 3,
307 k_skateshop_type_server
= 4
310 struct ent_skateshop
{
311 mdl_transform transform
;
341 struct ent_swspreview
{
342 u32 id_camera
, id_display
, id_display1
;
346 mdl_transform transform
;
353 u32 index
; /* into the path */
357 mdl_transform transform
;
361 enum ent_menuitem_type
{
362 k_ent_menuitem_type_visual
= 0,
363 k_ent_menuitem_type_event_button
= 1,
364 k_ent_menuitem_type_page_button
= 2,
365 k_ent_menuitem_type_toggle
= 3,
366 k_ent_menuitem_type_slider
= 4,
367 k_ent_menuitem_type_page
= 5,
368 k_ent_menuitem_type_binding
= 6,
369 k_ent_menuitem_type_visual_nocol
= 7,
370 k_ent_menuitem_type_disabled
= 90
373 enum ent_menuitem_stack_behaviour
{
374 k_ent_menuitem_stack_append
= 0,
375 k_ent_menuitem_stack_replace
= 1
378 typedef struct ent_menuitem ent_menuitem
;
381 id_links
[4]; /* ent_menuitem */
382 f32 factive
, fvisible
;
384 mdl_transform transform
;
385 u32 submesh_start
, submesh_count
;
387 union{ u64 _u64
; /* force storage for 64bit pointers */
400 u32 id_min
, /* ent_marker */
402 id_handle
, /* ent_menuitem */
414 u32 id_check
, /* ent_menuitem */
416 v3f offset
; /* relative to parent */
422 id_entrypoint
, /* ent_menuitem */
423 id_viewpoint
; /* ent_camera */
435 struct ent_worldinfo
{
436 u32 pstr_name
, pstr_author
, pstr_desc
;
442 ent_marker
*ent_find_marker( mdl_context
*mdl
, mdl_array_ptr
*arr
,
445 enum channel_behaviour
{
446 k_channel_behaviour_unlimited
= 0,
447 k_channel_behaviour_discard_if_full
= 1,
448 k_channel_behaviour_crossfade_if_full
= 2
451 enum probability_curve
{
452 k_probability_curve_constant
= 0,
453 k_probability_curve_wildlife_day
= 1,
454 k_probability_curve_wildlife_night
= 2
466 struct ent_font_variant
{
481 enum ent_objective_filter
{
482 k_ent_objective_filter_none
= 0x00000000,
483 k_ent_objective_filter_trick_shuvit
= 0x00000001,
484 k_ent_objective_filter_trick_kickflip
= 0x00000002,
485 k_ent_objective_filter_trick_treflip
= 0x00000004,
486 k_ent_objective_filter_trick_any
=
487 k_ent_objective_filter_trick_shuvit
|
488 k_ent_objective_filter_trick_treflip
|
489 k_ent_objective_filter_trick_kickflip
,
490 k_ent_objective_filter_flip_back
= 0x00000008,
491 k_ent_objective_filter_flip_front
= 0x00000010,
492 k_ent_objective_filter_flip_any
=
493 k_ent_objective_filter_flip_back
|
494 k_ent_objective_filter_flip_front
,
495 k_ent_objective_filter_grind_truck_any
= 0x00000020,
496 k_ent_objective_filter_grind_board_any
= 0x00000040,
497 k_ent_objective_filter_grind_any
=
498 k_ent_objective_filter_grind_truck_any
|
499 k_ent_objective_filter_grind_board_any
,
500 k_ent_objective_filter_footplant
= 0x00000080,
501 k_ent_objective_filter_passthrough
= 0x00000100
504 enum ent_objective_flag
{
505 k_ent_objective_hidden
= 0x1,
506 k_ent_objective_passed
= 0x2
509 struct ent_objective
{
510 mdl_transform transform
;
521 enum ent_challenge_flag
{
522 k_ent_challenge_timelimit
= 0x1
525 struct ent_challenge
{
526 mdl_transform transform
;
540 i32 targets_events
[4];
545 u32 resolution
, live
, texture_id
,
546 framebuffer_id
, renderbuffer_id
, placeholder
[2];
549 struct ent_miniworld
{
550 mdl_transform transform
;
557 mdl_transform transform
;
558 u32 submesh_start
, submesh_count
, flags
, pstr_alias
;
562 mdl_transform transform
;
563 u32 submesh_start
, submesh_count
, pstr_title
, flags
, zone_volume
,
570 mdl_transform transform
;
577 mdl_transform transform
;
578 u32 id
, context
, camera
;
582 void entity_call( world_instance
*world
, ent_call
*call
);