large reduction, redoing things
[carveJwlIkooP6JGAAIwe30JlM.git] / world_gen.h
index cbf47287f9d1de2881a4a60de7b0287119281e74..fdbe9e58ee54aa6ddda195cb26a2aed06028de42 100644 (file)
@@ -170,27 +170,6 @@ VG_STATIC void world_ents_allocate( world_instance *world )
          (void*)&world->audio_things, 
          sizeof(struct world_audio_thing) 
       },
-      {
-         k_classtype_trigger,
-         k_classtype_particle_box,
-         (void*)&world->triggers,
-         sizeof(struct trigger_zone)
-      },
-
-#if 0
-      {
-         k_classtype_logic_relay,
-         (void*)&world->logic_relays,
-         sizeof(struct logic_relay)
-      },
-#endif
-
-      {
-         k_classtype_logic_achievement,
-         k_classtype_none,
-         (void*)&world->logic_achievements,
-         sizeof(struct logic_achievement)
-      },
       {
          k_classtype_world_light,
          k_classtype_none,
@@ -203,12 +182,6 @@ VG_STATIC void world_ents_allocate( world_instance *world )
          (void*)&world->nonlocal_gates,
          sizeof(struct nonlocal_gate)
       },
-      {
-         k_classtype_soundscape,
-         k_classtype_none,
-         (void*)&world->soundscapes,
-         sizeof(struct soundscape)
-      }
    };
 
    for( int i=0; i<vg_list_size(entity_counts); i++ )
@@ -240,7 +213,11 @@ VG_STATIC void world_ents_allocate( world_instance *world )
       memset( *counter->to_allocate, 0, bufsize );
    }
 
-   logic_bricks_world_gen_allocate( world );
+   world->volume_bh = bh_create( world_global.generic_heap,
+                                  &bh_system_volumes,
+                                  world,
+                                  world->volume_count,
+                                  1 );
 }
 
 VG_STATIC void world_pct_spawn( world_instance *world, mdl_node *pnode )
@@ -288,46 +265,6 @@ VG_STATIC void world_pct_audio( world_instance *world, mdl_node *pnode )
    world->audio_things_count ++;
 }
 
-#if 0
-VG_STATIC void world_pct_relay( world_instance *world, mdl_node *pnode )
-{
-   struct logic_relay *relay = &world->logic_relays[ world->relay_count ];
-   struct classtype_logic_relay *inf = mdl_get_entdata( world->meta, pnode );
-
-   relay->target_count = 0;
-
-   for( int i=0; i<vg_list_size(relay->targets); i++ )
-   {
-      if( inf->targets[i] )
-      {
-         struct relay_target *target = &relay->targets[relay->target_count ++];
-         mdl_node *other = mdl_node_from_id( world->meta, inf->targets[i] );
-         
-         target->classtype = other->classtype;
-         target->sub_id = other->sub_uid;
-      }
-   }
-
-   v3_copy( pnode->co, relay->pos );
-   world->relay_count ++;
-}
-#endif
-
-
-VG_STATIC void world_pct_achievement( world_instance *world, mdl_node *pnode )
-{
-   struct logic_achievement *ach = 
-      &world->logic_achievements[ world->achievement_count ];
-   struct classtype_logic_achievement *inf = 
-      mdl_get_entdata( world->meta, pnode );
-
-   v3_copy( pnode->co, ach->pos );
-   ach->achievement_id = mdl_pstr( world->meta, inf->pstr_name );
-   ach->achieved = 0;
-
-   world->achievement_count ++;
-}
-
 VG_STATIC void world_pct_world_light( world_instance *world, mdl_node *pnode )
 {
    struct world_light *light = &world->lights[ world->light_count ++ ];
@@ -366,10 +303,6 @@ VG_STATIC void world_entities_process( world_instance *world )
       { k_classtype_spawn,    world_pct_spawn },
       { k_classtype_water,    world_pct_water },
       { k_classtype_audio,    world_pct_audio },
-#if 0
-      { k_classtype_logic_relay, world_pct_relay },
-#endif
-      { k_classtype_logic_achievement, world_pct_achievement },
       { k_classtype_world_light, world_pct_world_light },
       { k_classtype_nonlocal_gate, world_pct_nonlocal_gate }
    };
@@ -390,7 +323,6 @@ VG_STATIC void world_entities_process( world_instance *world )
       }
    }
 }
-
 VG_STATIC void world_link_nonlocal_gates( int index_a, int index_b )
 {
    vg_info( "Linking non-local gates\n" );
@@ -1029,7 +961,7 @@ VG_STATIC void world_clean( world_instance *world )
    world->scene_lines = NULL;
 
    world->geo_bh = NULL;
-   world->trigger_bh = NULL;
+   world->volume_bh = NULL;
    world->audio_bh = NULL;
 
    world->spawns = NULL;
@@ -1038,20 +970,12 @@ VG_STATIC void world_clean( world_instance *world )
    world->audio_things = NULL;
    world->audio_things_count = 0;
 
-   world->triggers = NULL;
-   world->trigger_count = 0;
+   world->volumes = NULL;
+   world->volume_count = 0;
 
    world->lights = NULL;
    world->light_count = 0;
 
-#if 0
-   world->logic_relays = NULL;
-   world->relay_count = 0;
-#endif
-
-   world->logic_achievements = NULL;
-   world->achievement_count = 0;
-
    world->nodes = NULL;
    world->node_count = 0;
 
@@ -1067,9 +991,6 @@ VG_STATIC void world_clean( world_instance *world )
    world->soundscapes = NULL;
    world->soundscape_count = 0;
 
-   world->logic_bricks = NULL;
-   world->logic_brick_count = 0;
-
    world->nonlocal_gates = NULL;
    world->nonlocalgate_count = 0;