+enum ent_menuitem_type{
+ k_ent_menuitem_type_visual = 0,
+ k_ent_menuitem_type_event_button = 1,
+ k_ent_menuitem_type_page_button = 2,
+ k_ent_menuitem_type_toggle = 3,
+ k_ent_menuitem_type_slider = 4,
+ k_ent_menuitem_type_page = 5,
+ k_ent_menuitem_type_binding = 6,
+ k_ent_menuitem_type_visual_nocol = 7,
+ k_ent_menuitem_type_disabled = 90
+};
+
+enum ent_menuitem_stack_behaviour{
+ k_ent_menuitem_stack_append = 0,
+ k_ent_menuitem_stack_replace = 1
+};
+
+typedef struct ent_menuitem ent_menuitem;
+struct ent_menuitem{
+ u32 type, groups,
+ id_links[4]; /* ent_menuitem */
+ f32 factive, fvisible;
+
+ mdl_transform transform;
+ u32 submesh_start, submesh_count;
+
+ union{ u64 _u64; /* force storage for 64bit pointers */
+ i32 *pi32;
+ f32 *pf32;
+ void *pvoid;
+ };
+
+ union{
+ struct{
+ u32 pstr_name;
+ }
+ visual;
+
+ struct{
+ u32 id_min, /* ent_marker */
+ id_max, /* . */
+ id_handle, /* ent_menuitem */
+ pstr_data;
+ }
+ slider;
+
+ struct{
+ u32 pstr,
+ stack_behaviour;
+ }
+ button;
+
+ struct{
+ u32 id_check, /* ent_menuitem */
+ pstr_data;
+ v3f offset; /* relative to parent */
+ }
+ checkmark;
+
+ struct{
+ u32 pstr_name,
+ id_entrypoint, /* ent_menuitem */
+ id_viewpoint; /* ent_camera */
+ }
+ page;
+
+ struct{
+ u32 pstr_bind,
+ font_variant;
+ }
+ binding;
+ };
+};
+
+struct ent_worldinfo{
+ u32 pstr_name, pstr_author, pstr_desc;
+ f32 timezone;
+};
+
+static ent_marker *ent_find_marker( mdl_context *mdl,
+ mdl_array_ptr *arr, const char *alias )
+{
+ for( u32 i=0; i<mdl_arrcount(arr); i++ ){
+ ent_marker *marker = mdl_arritm( arr, i );
+
+ if( !strcmp( mdl_pstr( mdl, marker->pstr_alias ), alias ) ){
+ return marker;
+ }
+ }
+
+ return NULL;
+}
+
+enum channel_behaviour{
+ k_channel_behaviour_unlimited = 0,
+ k_channel_behaviour_discard_if_full = 1,
+ k_channel_behaviour_crossfade_if_full = 2
+};
+
+enum probability_curve{
+ k_probability_curve_constant = 0,
+ k_probability_curve_wildlife_day = 1,
+ k_probability_curve_wildlife_night = 2
+};
+
+struct ent_font{
+ u32 alias,
+ variant_start,
+ variant_count,
+ glyph_start,
+ glyph_count,
+ glyph_utf32_base;
+};
+
+struct ent_font_variant{
+ u32 name,
+ material_id;
+};
+
+struct ent_glyph{
+ v2f size;
+ u32 indice_start,
+ indice_count;
+};
+
+struct ent_ccmd{
+ u32 pstr_command;
+};
+
+enum ent_objective_filter{
+ k_ent_objective_filter_none = 0x00000000,
+ k_ent_objective_filter_trick_shuvit = 0x00000001,
+ k_ent_objective_filter_trick_kickflip = 0x00000002,
+ k_ent_objective_filter_trick_treflip = 0x00000004,
+ k_ent_objective_filter_trick_any =
+ k_ent_objective_filter_trick_shuvit|
+ k_ent_objective_filter_trick_treflip|
+ k_ent_objective_filter_trick_kickflip,
+ k_ent_objective_filter_flip_back = 0x00000008,
+ k_ent_objective_filter_flip_front = 0x00000010,
+ k_ent_objective_filter_flip_any =
+ k_ent_objective_filter_flip_back|
+ k_ent_objective_filter_flip_front,
+ k_ent_objective_filter_grind_truck_any = 0x00000020,
+ k_ent_objective_filter_grind_board_any = 0x00000040,
+ k_ent_objective_filter_grind_any =
+ k_ent_objective_filter_grind_truck_any|
+ k_ent_objective_filter_grind_board_any,
+ k_ent_objective_filter_footplant = 0x00000080,
+ k_ent_objective_filter_passthrough = 0x00000100
+};
+
+enum ent_objective_flag {
+ k_ent_objective_hidden = 0x1,
+ k_ent_objective_passed = 0x2
+};
+
+struct ent_objective{
+ mdl_transform transform;
+ u32 submesh_start,
+ submesh_count,
+ flags,
+ id_next,
+ filter,filter2,
+ id_win,
+ win_event;
+ f32 time_limit;
+};
+
+enum ent_challenge_flag {
+ k_ent_challenge_timelimit = 0x1
+};
+
+struct ent_challenge{
+ mdl_transform transform;
+ u32 pstr_alias,
+ flags,
+ target,
+ target_event,
+ reset,
+ reset_event,
+ first,
+ camera,
+ status;
+};
+
+struct ent_relay {
+ u32 targets[4][2];
+};
+
+struct ent_cubemap {
+ v3f co;
+ u32 resolution, live, texture_id,
+ framebuffer_id, renderbuffer_id, placeholder[2];
+};
+
+typedef struct ent_call ent_call;
+struct ent_call{
+ u32 id, function;
+ void *data;
+};
+
+#include "world.h"
+static void entity_call( world_instance *world, ent_call *call );
+