.......
[carveJwlIkooP6JGAAIwe30JlM.git] / world.h
diff --git a/world.h b/world.h
index 3c20e81e1a87483aa20f3f0565102457073e862a..f970b0a3204f68152656d8fa366db6f9817aad44 100644 (file)
--- 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; i<mworld->material_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);