- struct classtype_instance *inst = mdl_get_entdata( mworld, pnode );
- pnode->sub_uid = 0;
-
- int cached = 0;
- for( int i=0; i<world.instance_cache_count; i++ )
- {
- struct instance_cache *cache = &world.instance_cache[i];
- if( inst->pstr_file == cache->pstr_file )
- {
- cached = 1;
- pnode->sub_uid = i+1;
- break;
- }
- }
+ vg_warn( "Failed to cache %s\n", filename );
+ }
+#endif
+ }
+}
+
+VG_STATIC void world_pct_audio( mdl_node *pnode )
+{
+ struct world_audio_thing *thing = &world.audio_things[
+ world.audio_things_count ];
+
+ memset( thing, 0, sizeof(struct world_audio_thing) );
+ struct classtype_audio *aud = mdl_get_entdata( world.meta, pnode );
+
+ v3_copy( pnode->co, thing->pos );
+
+ if( aud->flags & AUDIO_FLAG_SPACIAL_3D )
+ thing->volume = aud->volume * pnode->s[0];
+ else
+ thing->volume = aud->volume;
+
+ thing->flags = aud->flags;
+ thing->temp_embedded_clip.path = mdl_pstr( world.meta, aud->pstr_file );
+ audio_clip_load( &thing->temp_embedded_clip );
+ thing->player.name = mdl_pstr( world.meta, pnode->pstr_name );
+ thing->player.enqued = 0;
+
+ pnode->sub_uid = world.audio_things_count;
+ world.audio_things_count ++;
+}
+
+VG_STATIC void world_entities_process(void)
+{
+ struct entity_instruction
+ {
+ enum classtype ct;
+ void (*process)( mdl_node *pnode );
+ }
+ entity_instructions[] =
+ {
+ { k_classtype_spawn, world_pct_spawn },
+ { k_classtype_water, world_pct_water },
+ { k_classtype_instance, world_pct_instance },
+ { k_classtype_audio, world_pct_audio },
+ };