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
;
51 k_ent_font_variant
= 10,
55 k_ent_swspreview
= 14,
70 static inline u32
mdl_entity_id_type( u32 entity_id
)
72 return (entity_id
& 0x0fff0000) >> 16;
75 static inline u32
mdl_entity_id_id( u32 entity_id
)
77 return entity_id
& 0x0000ffff;
80 static inline u32
mdl_entity_id( u32 type
, u32 index
)
82 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
87 k_ent_function_trigger
,
88 k_ent_function_particle_spawn
,
89 k_ent_function_trigger_leave
93 mdl_transform transform
;
98 k_light_type_point
= 0,
103 mdl_transform transform
;
118 k_gate_type_unlinked
= 0,
119 k_gate_type_teleport
= 1,
120 k_gate_type_nonlocal_unlinked
= 2,
121 k_gate_type_nonlocel
= 3
127 k_ent_gate_linked
= 0x1, /* this is a working portal */
128 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
129 NOTE: if set, it adds the flip flag. */
130 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
131 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
132 k_ent_gate_locked
= 0x10,/* has to be unlocked to be useful */
134 k_ent_gate_clean_pass
= 0x20,/* player didn't rewind while getting here */
148 m4x3f to_world
, transport
;
159 u16 routes
[4]; /* routes that pass through this gate */
163 u32 submesh_start
, submesh_count
;
166 struct ent_route_node
{
168 u8 ref_count
, ref_total
;
171 struct ent_path_index
{
175 struct ent_checkpoint
{
184 enum ent_route_flag
{
185 k_ent_route_flag_achieve_silver
= 0x1,
186 k_ent_route_flag_achieve_gold
= 0x2,
188 k_ent_route_flag_out_of_zone
= 0x10,
189 k_ent_region_flag_hasname
= 0x20
194 mdl_transform transform
;
195 u32 official_track_id
; /* TODO: remove this */
200 u16 checkpoints_start
,
206 u16 active_checkpoint
,
210 m4x3f board_transform
;
214 u32 id_camera
; /* v103+ */
216 /* v104+, but always accessible */
219 f32 ui_stopper
, ui_residual
;
221 ui_px ui_first_block_width
, ui_residual_block_w
;
225 mdl_transform transform
;
227 u32 reserved0
, reserved1
;
230 struct ent_audio_clip
{
239 struct volume_particles
{
243 struct volume_trigger
{
244 u32 event
, event_leave
;
247 enum ent_volume_flag
{
248 k_ent_volume_flag_particles
= 0x1,
249 k_ent_volume_flag_disabled
= 0x2
253 mdl_transform transform
;
254 m4x3f to_world
, to_local
;
259 volume_trigger trigger
;
260 volume_particles particles
;
265 mdl_transform transform
;
269 float volume
, crossfade
;
277 mdl_transform transform
;
282 k_skateshop_type_boardshop
= 0,
283 k_skateshop_type_charshop
= 1,
284 k_skateshop_type_worldshop
= 2,
285 k_skateshop_type_DELETED
= 3,
286 k_skateshop_type_server
= 4
289 struct ent_skateshop
{
290 mdl_transform transform
;
320 struct ent_swspreview
{
321 u32 id_camera
, id_display
, id_display1
;
325 mdl_transform transform
;
332 u32 index
; /* into the path */
336 mdl_transform transform
;
340 enum ent_menuitem_type
{
341 k_ent_menuitem_type_visual
= 0,
342 k_ent_menuitem_type_event_button
= 1,
343 k_ent_menuitem_type_page_button
= 2,
344 k_ent_menuitem_type_toggle
= 3,
345 k_ent_menuitem_type_slider
= 4,
346 k_ent_menuitem_type_page
= 5,
347 k_ent_menuitem_type_binding
= 6,
348 k_ent_menuitem_type_visual_nocol
= 7,
349 k_ent_menuitem_type_disabled
= 90
352 enum ent_menuitem_stack_behaviour
{
353 k_ent_menuitem_stack_append
= 0,
354 k_ent_menuitem_stack_replace
= 1
357 typedef struct ent_menuitem ent_menuitem
;
360 id_links
[4]; /* ent_menuitem */
361 f32 factive
, fvisible
;
363 mdl_transform transform
;
364 u32 submesh_start
, submesh_count
;
366 union{ u64 _u64
; /* force storage for 64bit pointers */
379 u32 id_min
, /* ent_marker */
381 id_handle
, /* ent_menuitem */
393 u32 id_check
, /* ent_menuitem */
395 v3f offset
; /* relative to parent */
401 id_entrypoint
, /* ent_menuitem */
402 id_viewpoint
; /* ent_camera */
414 struct ent_worldinfo
{
415 u32 pstr_name
, pstr_author
, pstr_desc
;
421 ent_marker
*ent_find_marker( mdl_context
*mdl
, mdl_array_ptr
*arr
,
424 enum channel_behaviour
{
425 k_channel_behaviour_unlimited
= 0,
426 k_channel_behaviour_discard_if_full
= 1,
427 k_channel_behaviour_crossfade_if_full
= 2
430 enum probability_curve
{
431 k_probability_curve_constant
= 0,
432 k_probability_curve_wildlife_day
= 1,
433 k_probability_curve_wildlife_night
= 2
445 struct ent_font_variant
{
460 enum ent_objective_filter
{
461 k_ent_objective_filter_none
= 0x00000000,
462 k_ent_objective_filter_trick_shuvit
= 0x00000001,
463 k_ent_objective_filter_trick_kickflip
= 0x00000002,
464 k_ent_objective_filter_trick_treflip
= 0x00000004,
465 k_ent_objective_filter_trick_any
=
466 k_ent_objective_filter_trick_shuvit
|
467 k_ent_objective_filter_trick_treflip
|
468 k_ent_objective_filter_trick_kickflip
,
469 k_ent_objective_filter_flip_back
= 0x00000008,
470 k_ent_objective_filter_flip_front
= 0x00000010,
471 k_ent_objective_filter_flip_any
=
472 k_ent_objective_filter_flip_back
|
473 k_ent_objective_filter_flip_front
,
474 k_ent_objective_filter_grind_truck_any
= 0x00000020,
475 k_ent_objective_filter_grind_board_any
= 0x00000040,
476 k_ent_objective_filter_grind_any
=
477 k_ent_objective_filter_grind_truck_any
|
478 k_ent_objective_filter_grind_board_any
,
479 k_ent_objective_filter_footplant
= 0x00000080,
480 k_ent_objective_filter_passthrough
= 0x00000100
483 enum ent_objective_flag
{
484 k_ent_objective_hidden
= 0x1,
485 k_ent_objective_passed
= 0x2
488 struct ent_objective
{
489 mdl_transform transform
;
500 enum ent_challenge_flag
{
501 k_ent_challenge_timelimit
= 0x1
504 struct ent_challenge
{
505 mdl_transform transform
;
519 u32 targets_events
[4];
524 u32 resolution
, live
, texture_id
,
525 framebuffer_id
, renderbuffer_id
, placeholder
[2];
528 typedef struct ent_call ent_call
;
534 struct ent_miniworld
{
535 mdl_transform transform
;
542 mdl_transform transform
;
543 u32 submesh_start
, submesh_count
, flags
, pstr_alias
;
547 mdl_transform transform
;
548 u32 submesh_start
, submesh_count
, pstr_title
, flags
, zone_volume
,
555 mdl_transform transform
;
561 void entity_call( world_instance
*world
, ent_call
*call
);