-#if 0
-VG_STATIC void world_ents_allocate( world_instance *world )
-{
- vg_info( "Allocating entities\n" );
-
- /* --count entites to allocate buffers for them.--
- * --maybe in the future we just store these numbers in the model file...--
- *
- * ... 16.03.23: I HOPE YOUR FUCKING HAPPY
- * ... 22.03.23: incomprehensible pain
- *
- * -- use this in world_routes too --
- *
- */
-
- struct countable
- {
- enum classtype ct, ct1;
- void **to_allocate;
- u32 item_size;
- int count;
- }
- entity_counts[] =
- {
- {
- k_classtype_spawn,
- k_classtype_none,
- (void*)&world->spawns,
- sizeof(struct respawn_point)
- },
- {
- k_classtype_audio,
- k_classtype_none,
- (void*)&world->audio_things,
- sizeof(struct world_audio_thing)
- },
- {
- k_classtype_world_light,
- k_classtype_none,
- (void*)&world->lights,
- sizeof(struct world_light)
- },
- {
- k_classtype_nonlocal_gate,
- k_classtype_none,
- (void*)&world->nonlocal_gates,
- sizeof(struct nonlocal_gate)
- },
- };
-
- for( int i=0; i<vg_list_size(entity_counts); i++ )
- entity_counts[i].count = 0;
-
- for( int i=0; i<world->meta->info.node_count; i++ )
- {
- mdl_node *pnode = mdl_node_from_id( world->meta, i );
-
- for( int j=0; j<vg_list_size(entity_counts); j ++ )
- {
- if( (pnode->classtype == entity_counts[j].ct) ||
- (pnode->classtype == entity_counts[j].ct1) )
- {
- pnode->sub_uid = entity_counts[j].count;
- entity_counts[j].count ++;
- break;
- }
- }
- }
-
- for( int i=0; i<vg_list_size(entity_counts); i++ )
- {
- struct countable *counter = &entity_counts[i];
-
- u32 bufsize = counter->item_size*counter->count;
- *counter->to_allocate = vg_linear_alloc( world_global.generic_heap,
- bufsize );
- memset( *counter->to_allocate, 0, bufsize );
- }
-
- world->volume_bh = bh_create( world_global.generic_heap,
- &bh_system_volumes,
- world,
- world->volume_count,
- 1 );
-}
-#endif