X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.c;h=096de9a99a624717425a5383061430b3d1f273e2;hb=e913a28dff24a331d0ecf3f0600d23a46ce0f307;hp=04db5a008a123f8314a8447272c88c8007ebaaf7;hpb=9723ed75d4da703c91603d251816ce476a1e9098;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index 04db5a0..096de9a 100644 --- a/world_render.c +++ b/world_render.c @@ -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; ksubmesh_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 );