X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gen.c;h=df5b342e40fb11965c963a0ce4009db6a4da31bb;hb=fbc68c65e01838feb77f47b30994b45fcc39ebaf;hp=0b0c3442e3105773cf81f127405cb9bed86e6dd3;hpb=22f62f001f21d1b91fefd9fc495c122d9ddf205a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gen.c b/world_gen.c index 0b0c344..df5b342 100644 --- a/world_gen.c +++ b/world_gen.c @@ -85,13 +85,12 @@ static void world_gen_add_blob( world_instance *world, scene_vert *ref = &world->scene_geo.arrvertices[ hit->tri[0] ]; - for( u32 i=0; ico, pvert->co ); - scene_vert_pack_norm( pvert, transform[1] ); + scene_vert_pack_norm( pvert, transform[1], 0.0f ); v2_copy( ref->uv, pvert->uv ); } @@ -287,6 +286,17 @@ static void world_gen_generate_meshes( world_instance *world ){ } } + /* unpack region models */ + for( u32 i=0; ient_region ); i++ ){ + ent_region *region = mdl_arritm( &world->ent_region, i ); + + for( u32 j=0; jsubmesh_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; ient_gate ); i++ ){ ent_gate *gate = mdl_arritm( &world->ent_gate, i ); @@ -300,6 +310,17 @@ static void world_gen_generate_meshes( world_instance *world ){ } } + /* unpack prop models */ + for( u32 i=0; ient_prop ); i++ ){ + ent_prop *prop = mdl_arritm( &world->ent_prop, i ); + + for( u32 j=0; jsubmesh_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 ); } @@ -652,7 +673,6 @@ static void async_world_postprocess( void *payload, u32 _size ){ } glBindFramebuffer( GL_FRAMEBUFFER, 0 ); - world->status = k_world_status_loaded; } /* Loads textures from the pack file */