cell shade character
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.c
index 04db5a008a123f8314a8447272c88c8007ebaaf7..096de9a99a624717425a5383061430b3d1f273e2 100644 (file)
@@ -164,12 +164,6 @@ void world_render_props( world_instance *world, u32 material_id,
                          struct world_pass *pass ){
    if( !mdl_arrcount( &world->ent_prop ) ) return;
 
-   /* HACK: use the first material for every prop entity */
-   ent_prop *first = mdl_arritm( &world->ent_prop, 0 );
-   if( !first->submesh_count ) return;
-
-   mdl_submesh *sm = mdl_arritm( &world->meta.submeshs, first->submesh_start );
-   if( sm->material_id != material_id ) return;
 
    struct world_surface *mat = &world->surfaces[ material_id ];
    pass->fn_bind_textures( world, mat );
@@ -179,7 +173,10 @@ void world_render_props( world_instance *world, u32 material_id,
       if( prop->flags & 0x1 ) continue;
       
       for( u32 k=0; k<prop->submesh_count; k++ ){
-         sm = mdl_arritm( &world->meta.submeshs, prop->submesh_start+k );
+         mdl_submesh *sm = 
+            mdl_arritm( &world->meta.submeshs, prop->submesh_start+k );
+
+         if( sm->material_id != material_id ) continue;
 
          m4x3f mmdl;
          mdl_transform_m4x3( &prop->transform, mmdl );