fix some problems with world loader
[carveJwlIkooP6JGAAIwe30JlM.git] / world_gen.c
index 7d3cc81dc30be79cdfd4c68df8d13e2b5d1e9e05..4e01de338cfbd70e5e9b4c4319535702825be504 100644 (file)
@@ -287,6 +287,17 @@ static void world_gen_generate_meshes( world_instance *world ){
       }
    }
 
+   /* unpack region models */
+   for( u32 i=0; i<mdl_arrcount( &world->ent_region ); i++ ){
+      ent_region *region = mdl_arritm( &world->ent_region, i );
+
+      for( u32 j=0; j<region->submesh_count; j ++ ){
+         mdl_submesh *sm = mdl_arritm( &world->meta.submeshs, 
+                                       region->submesh_start+j );
+         world_unpack_submesh_dynamic( world, &world->scene_no_collide, sm );
+      }
+   }
+
    /* unpack gate models */
    for( u32 i=0; i<mdl_arrcount( &world->ent_gate ); i++ ){
       ent_gate *gate = mdl_arritm( &world->ent_gate, i );
@@ -300,6 +311,17 @@ static void world_gen_generate_meshes( world_instance *world ){
       }
    }
 
+   /* unpack prop models */
+   for( u32 i=0; i<mdl_arrcount( &world->ent_prop ); i++ ){
+      ent_prop *prop = mdl_arritm( &world->ent_prop, i );
+
+      for( u32 j=0; j<prop->submesh_count; j ++ ){
+         mdl_submesh *sm = mdl_arritm( &world->meta.submeshs, 
+                                       prop->submesh_start+j );
+         world_unpack_submesh_dynamic( world, &world->scene_no_collide, sm );
+      }
+   }
+
    vg_async_dispatch( call, async_scene_upload );
 }