X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world.h;h=f970b0a3204f68152656d8fa366db6f9817aad44;hb=46643f969b12c2144a5f15ac5509610f18b467e4;hp=3c20e81e1a87483aa20f3f0565102457073e862a;hpb=3ee65e6e24bfc39db7c7dd8c1f4cec3d5c42d0f8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world.h b/world.h index 3c20e81..f970b0a 100644 --- a/world.h +++ b/world.h @@ -65,7 +65,7 @@ static struct gworld /* TODO Maybe make this less hardcoded */ mdl_submesh sm_geo_std_oob, sm_geo_std, sm_geo_vb, sm_foliage_main, sm_foliage_alphatest, - sm_graffiti; + sm_graffiti, sm_subworld; glmesh skybox, skydome; mdl_submesh dome_upper, dome_lower; @@ -355,7 +355,8 @@ static void world_load(void) mat_surf_oob = 0, mat_vertex_blend = 0, mat_alphatest = 0, - mat_graffiti = 0; + mat_graffiti = 0, + mat_subworld = 0; for( int i=1; imaterial_count; i++ ) { @@ -372,6 +373,8 @@ static void world_load(void) mat_alphatest = i; else if( !strcmp( "graffitibox", mat_name )) mat_graffiti = i; + else if( !strcmp( "subworld", mat_name )) + mat_subworld = i; } m4x3f midentity; @@ -387,6 +390,10 @@ static void world_load(void) add_all_if_material( midentity, &world.geo, mworld, mat_surf ); scene_copy_slice( &world.geo, &world.sm_geo_std ); + if( mat_subworld ) + add_all_if_material( midentity, &world.geo, mworld, mat_subworld ); + scene_copy_slice( &world.geo, &world.sm_subworld ); + if( mat_vertex_blend ) add_all_if_material( midentity, &world.geo, mworld, mat_vertex_blend ); scene_copy_slice( &world.geo, &world.sm_geo_vb ); @@ -630,6 +637,7 @@ static void render_terrain( m4x4f projection, v3f camera ) scene_bind( &world.geo ); mdl_draw_submesh( &world.sm_geo_std_oob ); mdl_draw_submesh( &world.sm_geo_std ); + mdl_draw_submesh( &world.sm_subworld ); /* TODO: Dont draw in reflection */ glDisable(GL_CULL_FACE);