ent_audio_clip,
ent_audio,
ent_volume,
- ent_traffic;
+ ent_traffic,
+ ent_skateshop,
+ ent_marker,
+ ent_camera,
+ ent_swspreview;
ent_gate *rendering_gate;
VG_MEMORY_SYSTEM );
}
-typedef struct ent_call ent_call;
-struct ent_call{
- ent_index ent;
- u32 function;
- void *data;
-};
-
-VG_STATIC void entity_call( world_instance *world, ent_call *call );
-
VG_STATIC void ent_volume_call( world_instance *world, ent_call *call )
{
- ent_volume *volume = mdl_arritm( &world->ent_volume, call->ent.index );
- if( !volume->target.type ) return;
+ u32 index = mdl_entity_id_id( call->id );
+ ent_volume *volume = mdl_arritm( &world->ent_volume, index );
+ if( !volume->target ) return;
if( call->function == k_ent_function_trigger ){
- call->ent = volume->target;
+ call->id = volume->target;
if( volume->type == k_volume_subtype_particle ){
float *co = alloca( sizeof(float)*3 );
call->data = co;
entity_call( world, call );
}
- else
+ else{
entity_call( world, call );
+ }
}
}
VG_STATIC void ent_audio_call( world_instance *world, ent_call *call )
{
- ent_audio *audio = mdl_arritm( &world->ent_audio, call->ent.index );
+ u32 index = mdl_entity_id_id( call->id );
+ ent_audio *audio = mdl_arritm( &world->ent_audio, index );
v3f sound_co;
}
}
-VG_STATIC void entity_call( world_instance *world, ent_call *call )
-{
- if( call->ent.type == k_ent_volume ){
- ent_volume_call( world, call );
- } else if( call->ent.type == k_ent_audio ){
- ent_audio_call( world, call );
- }
-}
-
VG_STATIC void world_update( world_instance *world, v3f pos )
{
world_global.sky_time += world_global.sky_rate * vg.time_delta;
if( !world_global.in_volume ){
ent_call basecall;
- basecall.ent.index = idx;
- basecall.ent.type = k_ent_volume;
basecall.function = k_ent_function_trigger;
+ basecall.id = mdl_entity_id( k_ent_volume, idx );
basecall.data = NULL;
entity_call( world, &basecall );
for( int j=0; j<random_ticks; j++ ){
ent_call basecall;
- basecall.ent.index = idx;
- basecall.ent.type = k_ent_volume;
- basecall.function = k_ent_function_trigger;
+ basecall.id = mdl_entity_id( k_ent_volume, idx );
basecall.data = NULL;
entity_call( world, &basecall );